Skip to content
Snippets Groups Projects
Commit 746f376e authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

refactoring: implements per account contacts, trust requests & more

- seperates contacts by account
- implements the trust request API
- introduces localization strings and transifex update mechanism
- adds lodepng to remove windows photobooth png metadata
- changes icons
- adds default colored initial avatars
- changes logo images
- complete overhaul on the ui/ux

Change-Id: I43914ff63a48bb43a6997721773df5029a1650b5
parent 46910037
No related branches found
No related tags found
No related merge requests found
Showing
with 536 additions and 184 deletions
[main]
host = https://www.transifex.com
[ring.resourcesuwpclientresw]
file_filter = localization/<lang>/Resources.resw
source_file = localization/en-US/Resources.resw
source_lang = en
type = RESX
lang_map = cs_CZ: cs-CZ, da_DK: da-DK, de_DE: de-DE, fa_IR: fa-IR, fr_CA: fr-CA, fr_FR: fr-FR, hi_IN: hi-IN, it_IT: it-IT, nl_NL: nl-NL, pt_BR: pt-BR, ru_RU: ru-RU, sk_SK: sk-SK, sq_AL: sq-AL, zh_CN: zh-CN, zh_TW: zh-TW
...@@ -33,22 +33,19 @@ ...@@ -33,22 +33,19 @@
Margin="24"> Margin="24">
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<Button x:Name="_aboutBasicButton_" <Button x:Uid="_aboutBasicButton_"
Content="About"
Margin="0,0,6,0" Margin="0,0,6,0"
BorderThickness="0" BorderThickness="0"
FontSize="12" FontSize="12"
Click="_aboutBasicButton__Click" Click="_aboutBasicButton__Click"
/> />
<Button x:Name="_aboutCreditsButton_" <Button x:Uid="_aboutCreditsButton_"
Content="Credits"
Margin="0,0,6,0" Margin="0,0,6,0"
BorderThickness="0" BorderThickness="0"
FontSize="12" FontSize="12"
Click="_aboutCreditsButton__Click" Click="_aboutCreditsButton__Click"
/> />
<Button x:Name="_aboutCloseButton_" <Button x:Uid="_aboutCloseButton_"
Content="Close"
Margin="0,0,6,0" Margin="0,0,6,0"
BorderThickness="0" BorderThickness="0"
FontSize="12" FontSize="12"
...@@ -56,11 +53,9 @@ ...@@ -56,11 +53,9 @@
/> />
</StackPanel> </StackPanel>
<Image x:Name="_welcomeImage_" <Image x:Name="_welcomeImage_"
Source="Assets\Wide310x150Logo.scale-200.png" Source="Assets\Wide310x150Logo.scale-200.png"
Width="310" Width="310"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Margin="0 10 0 30"
Height="150"/> Height="150"/>
<Grid x:Name="_aboutNavGrid_"> <Grid x:Name="_aboutNavGrid_">
<Grid.RowDefinitions> <Grid.RowDefinitions>
...@@ -72,24 +67,24 @@ ...@@ -72,24 +67,24 @@
VerticalScrollBarVisibility="Hidden"> VerticalScrollBarVisibility="Hidden">
<StackPanel MaxWidth="500" <StackPanel MaxWidth="500"
Width="310"> Width="310">
<TextBlock Text="Ring version: 2017/2/13" <TextBlock x:Name="_aboutVersionString_"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
Margin="0,0,0,24" Margin="0,0,0,24"
FontSize="12" FontSize="12"
FontWeight="Bold" FontWeight="Bold"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
<TextBlock Text="Release: Beta 2 - Gaston Miron" <TextBlock x:Uid="_aboutReleaseTitle_"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
FontSize="12" FontSize="12"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
<TextBlock Text="The Microsoft Windows Runtime client for Ring." <TextBlock x:Uid="_aboutReleasePlatform_"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
FontSize="12" FontSize="12"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
<TextBlock Text="Ring is a secured and distributed communication software." <TextBlock x:Uid="_aboutReleaseDescription_"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
FontSize="12" FontSize="12"
...@@ -104,26 +99,25 @@ ...@@ -104,26 +99,25 @@
TextAlignment="Justify" TextAlignment="Justify"
FontSize="10" FontSize="10"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
<TextBlock Text="This program comes with absolutely no warranty" <TextBlock x:Uid="_aboutDisclaimer_"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
FontSize="10" FontSize="10"
HorizontalAlignment="Center"/> HorizontalAlignment="Center"/>
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<TextBlock Text="See the " <TextBlock x:Uid="_aboutGPL_0_"
Margin="0,0,4,0" Margin="0,0,4,0"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
FontSize="10"/> FontSize="10"/>
<HyperlinkButton Content="GNU General Public License, version 3 or later" <HyperlinkButton x:Uid="_aboutGPL_1_"
FontSize="10" FontSize="10">
NavigateUri="https://www.gnu.org/licenses/gpl-3.0.en.html">
<HyperlinkButton.RenderTransform> <HyperlinkButton.RenderTransform>
<TranslateTransform Y="-6"/> <TranslateTransform Y="-6"/>
</HyperlinkButton.RenderTransform> </HyperlinkButton.RenderTransform>
</HyperlinkButton> </HyperlinkButton>
<TextBlock Text=" for details." <TextBlock x:Uid="_aboutGPL_2_"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Justify" TextAlignment="Justify"
FontSize="10"/> FontSize="10"/>
...@@ -139,7 +133,7 @@ ...@@ -139,7 +133,7 @@
BorderBrush="Black" BorderBrush="Black"
BorderThickness="1"> BorderThickness="1">
<StackPanel> <StackPanel>
<TextBlock Text="Created by:" <TextBlock x:Uid="_c_created_by_"
Margin="0,0,0,0" Margin="0,0,0,0"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Center" TextAlignment="Center"
...@@ -151,7 +145,6 @@ ...@@ -151,7 +145,6 @@
TextAlignment="Center" TextAlignment="Center"
FontSize="12" FontSize="12"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<LineBreak/> Created by:
<LineBreak/> Adrien Béraud <LineBreak/> Adrien Béraud
<LineBreak/> Alexandr Sergheev <LineBreak/> Alexandr Sergheev
<LineBreak/> Alexandre Lision <LineBreak/> Alexandre Lision
...@@ -166,7 +159,9 @@ ...@@ -166,7 +159,9 @@
<LineBreak/> Emmanuel Lepage-Vallée <LineBreak/> Emmanuel Lepage-Vallée
<LineBreak/> Frédéric Guimont <LineBreak/> Frédéric Guimont
<LineBreak/> Guillaume Roguez <LineBreak/> Guillaume Roguez
<LineBreak/> Hadrien De Sousa
<LineBreak/> Julien Grossholtz <LineBreak/> Julien Grossholtz
<LineBreak/> Kateryna Kostiuk
<LineBreak/> Loïc Siret <LineBreak/> Loïc Siret
<LineBreak/> Nicolas Jäger <LineBreak/> Nicolas Jäger
<LineBreak/> Nicolas Reynaud <LineBreak/> Nicolas Reynaud
...@@ -175,13 +170,16 @@ ...@@ -175,13 +170,16 @@
<LineBreak/> Patrick Keroulas <LineBreak/> Patrick Keroulas
<LineBreak/> Philippe Gorley <LineBreak/> Philippe Gorley
<LineBreak/> Romain Bertozzi <LineBreak/> Romain Bertozzi
<LineBreak/> Sébastien Blin
<LineBreak/> Seva Ivanov <LineBreak/> Seva Ivanov
<LineBreak/> Silbino Gonçalves Matado
<LineBreak/> Simon Désaulniers <LineBreak/> Simon Désaulniers
<LineBreak/> Stepan Salenikovich <LineBreak/> Stepan Salenikovich
<LineBreak/> Simon Zeni <LineBreak/> Simon Zeni
<LineBreak/> Thibault Wittemberg <LineBreak/> Thibault Wittemberg
<LineBreak/>
</TextBlock> </TextBlock>
<TextBlock Text="Artwork by:" <TextBlock x:Uid="_c_artwork_by_"
Margin="0,0,0,0" Margin="0,0,0,0"
TextWrapping="Wrap" TextWrapping="Wrap"
TextAlignment="Center" TextAlignment="Center"
......
/************************************************************************** /**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux * * Copyright (C) 2016 by Savoir-faire Linux *
* Author: Jger Nicolas <nicolas.jager@savoirfairelinux.com> *
* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> * * Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
...@@ -27,9 +26,64 @@ using namespace Windows::UI::ViewManagement; ...@@ -27,9 +26,64 @@ using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Core; using namespace Windows::UI::Core;
using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Controls;
#define BUILD_YEAR_CH0 (__DATE__[ 7])
#define BUILD_YEAR_CH1 (__DATE__[ 8])
#define BUILD_YEAR_CH2 (__DATE__[ 9])
#define BUILD_YEAR_CH3 (__DATE__[10])
#define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n')
#define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F')
#define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r')
#define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p')
#define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y')
#define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n')
#define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l')
#define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u')
#define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S')
#define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O')
#define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N')
#define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D')
#define BUILD_MONTH_CH0 \
((BUILD_MONTH_IS_OCT || BUILD_MONTH_IS_NOV || BUILD_MONTH_IS_DEC) ? '1' : '0')
#define BUILD_MONTH_CH1 \
( \
(BUILD_MONTH_IS_JAN) ? '1' : \
(BUILD_MONTH_IS_FEB) ? '2' : \
(BUILD_MONTH_IS_MAR) ? '3' : \
(BUILD_MONTH_IS_APR) ? '4' : \
(BUILD_MONTH_IS_MAY) ? '5' : \
(BUILD_MONTH_IS_JUN) ? '6' : \
(BUILD_MONTH_IS_JUL) ? '7' : \
(BUILD_MONTH_IS_AUG) ? '8' : \
(BUILD_MONTH_IS_SEP) ? '9' : \
(BUILD_MONTH_IS_OCT) ? '0' : \
(BUILD_MONTH_IS_NOV) ? '1' : \
(BUILD_MONTH_IS_DEC) ? '2' : \
/* error default */ '?' \
)
#define BUILD_DAY_CH0 ((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')
#define BUILD_DAY_CH1 (__DATE__[ 5])
AboutPage::AboutPage() AboutPage::AboutPage()
{ {
InitializeComponent(); InitializeComponent();
const char completeVersion[] =
{
BUILD_YEAR_CH0, BUILD_YEAR_CH1, BUILD_YEAR_CH2, BUILD_YEAR_CH3,
'/',
BUILD_MONTH_CH0, BUILD_MONTH_CH1,
'/',
BUILD_DAY_CH0, BUILD_DAY_CH1,
'\0'
};
auto buildDate = std::string(reinterpret_cast<const char*>(completeVersion));
PackageVersion version = Package::Current->Id->Version;
auto buildVersion = version.Major.ToString() + "." + version.Minor.ToString() + "." + version.Build.ToString();
_aboutVersionString_->Text = "Ring version: " + Utils::toPlatformString(buildDate) + " build: " + buildVersion;
}; };
void RingClientUWP::Views::AboutPage::_aboutBasicButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) void RingClientUWP::Views::AboutPage::_aboutBasicButton__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
......
...@@ -32,7 +32,13 @@ Account::Account(String^ name, ...@@ -32,7 +32,13 @@ Account::Account(String^ name,
String^ accountType, String^ accountType,
String^ accountID, String^ accountID,
String^ deviceId, String^ deviceId,
String^ deviceName,
bool active,
bool upnpState, bool upnpState,
bool autoAnswer,
bool dhtPublicInCalls,
bool turnEnabled,
String^ turnAddress,
String^ sipHostname, String^ sipHostname,
String^ sipUsername, String^ sipUsername,
String^ sipPassword) String^ sipPassword)
...@@ -42,11 +48,19 @@ Account::Account(String^ name, ...@@ -42,11 +48,19 @@ Account::Account(String^ name,
accountType_ = accountType; accountType_ = accountType;
accountID_ = accountID; accountID_ = accountID;
_deviceId = deviceId; _deviceId = deviceId;
_deviceName = deviceName;
_active = active;
_upnpState = upnpState; _upnpState = upnpState;
_autoAnswer = autoAnswer;
_dhtPublicInCalls = dhtPublicInCalls;
_turnEnabled = turnEnabled;
_turnAddress = turnAddress;
_sipHostname = sipHostname; _sipHostname = sipHostname;
_sipUsername = sipUsername; _sipUsername = sipUsername;
_sipPassword = sipPassword; _sipPassword = sipPassword;
_unreadMessages = 0; _unreadMessages = 0;
_registrationState = RegistrationState::UNKNOWN;
_username = "";
} }
void void
...@@ -60,3 +74,9 @@ Account::NotifyPropertyChanged(String^ propertyName) ...@@ -60,3 +74,9 @@ Account::NotifyPropertyChanged(String^ propertyName)
PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName)); PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
})); }));
} }
void
Account::raiseNotifyPropertyChanged(String^ propertyName)
{
NotifyPropertyChanged(propertyName);
}
...@@ -30,9 +30,23 @@ ref class Contact; ...@@ -30,9 +30,23 @@ ref class Contact;
public ref class Account sealed : public INotifyPropertyChanged public ref class Account sealed : public INotifyPropertyChanged
{ {
public: public:
Account(String^ name, String^ ringID, String^ accountType, String^ accountID, String^ deviceId, bool upnpState Account(String^ name,
, String^ sipHostname, String^ sipUsername, String^ sipPassword); String^ ringID,
String^ accountType,
String^ accountID,
String^ deviceId,
String^ deviceName,
bool active,
bool upnpState,
bool autoAnswer,
bool dhtPublicInCalls,
bool turnEnabled,
String^ turnAddress,
String^ sipHostname,
String^ sipUsername,
String^ sipPassword);
void raiseNotifyPropertyChanged(String^ propertyName);
virtual event PropertyChangedEventHandler^ PropertyChanged; virtual event PropertyChangedEventHandler^ PropertyChanged;
property String^ name_ property String^ name_
...@@ -43,8 +57,51 @@ public: ...@@ -43,8 +57,51 @@ public:
void set(String^ value) { void set(String^ value) {
alias_ = value; alias_ = value;
NotifyPropertyChanged("name_"); NotifyPropertyChanged("name_");
NotifyPropertyChanged("_bestName");
} }
} }
property String^ _username
{
String^ get() {
return username_;
}
void set(String^ value) {
username_ = value;
NotifyPropertyChanged("_username");
NotifyPropertyChanged("_bestName");
}
}
property String^ _bestName {
String^ get() {
String^ bestName;
if (alias_)
bestName = alias_;
return bestName;
}
}
property String^ _bestName2 {
String^ get() {
String^ bestName;
if (accountType_ == "RING" && username_)
bestName += username_;
return bestName;
}
}
property String^ _bestName3 {
String^ get() {
String^ bestName;
if (alias_)
bestName += alias_;
if (accountType_ == "RING" && username_)
bestName += " (" + username_ + ")";
return bestName;
}
}
property String^ ringID_ { property String^ ringID_ {
String^ get() { String^ get() {
return ringID__; return ringID__;
...@@ -57,15 +114,16 @@ public: ...@@ -57,15 +114,16 @@ public:
property String^ accountType_; // refacto : create a enum accountType property String^ accountType_; // refacto : create a enum accountType
property String^ accountID_; property String^ accountID_;
property String^ _deviceId; property String^ _deviceId;
property IVector<String^>^ _devicesIdList { property String^ _deviceName;
IVector<String^>^ get() {
return devicesIdList_; property RegistrationState _registrationState;
}
void set(IVector<String^>^ value) { property bool _active;
devicesIdList_ = value;
}
};
property bool _upnpState; property bool _upnpState;
property bool _autoAnswer;
property bool _dhtPublicInCalls;
property bool _turnEnabled;
property String^ _turnAddress;
property String^ _sipHostname; property String^ _sipHostname;
property String^ _sipUsername property String^ _sipUsername
{ {
...@@ -75,17 +133,35 @@ public: ...@@ -75,17 +133,35 @@ public:
void set(String^ value) { void set(String^ value) {
sipUsername_ = value; sipUsername_ = value;
NotifyPropertyChanged("_sipUsername"); NotifyPropertyChanged("_sipUsername");
NotifyPropertyChanged("_bestName");
} }
} }
property unsigned _unreadMessages property unsigned _unreadMessages {
{
unsigned get() { unsigned get() {
return unreadMessages_; return unreadMessages_;
} }
void set(unsigned value) { void set(unsigned value) {
unreadMessages_ = value; unreadMessages_ = value;
NotifyPropertyChanged("_unreadMessages"); NotifyPropertyChanged("_unreadMessages");
NotifyPropertyChanged("_allUnread");
}
}
property unsigned _unreadContactRequests {
unsigned get() {
return unreadContactRequests_;
}
void set(unsigned value) {
unreadContactRequests_ = value;
NotifyPropertyChanged("_unreadContactRequests");
NotifyPropertyChanged("_allUnread");
}
}
property unsigned _allUnread {
unsigned get() {
return unreadContactRequests_ + unreadMessages_;
} }
} }
...@@ -104,13 +180,14 @@ protected: ...@@ -104,13 +180,14 @@ protected:
void NotifyPropertyChanged(String^ propertyName); void NotifyPropertyChanged(String^ propertyName);
private: private:
IVector<String^>^ devicesIdList_;
IVector<Contact^>^ contactsList_; IVector<Contact^>^ contactsList_;
String^ alias_; String^ alias_;
String^ username_;
String^ ringID__; String^ ringID__;
String^ sipUsername_; String^ sipUsername_;
unsigned unreadMessages_; unsigned unreadMessages_;
unsigned unreadContactRequests_;
}; };
} }
...@@ -33,7 +33,6 @@ AccountListItem::AccountListItem(Account^ a) ...@@ -33,7 +33,6 @@ AccountListItem::AccountListItem(Account^ a)
{ {
_account = a; _account = a;
_editionMode = false; _editionMode = false;
} }
void void
...@@ -44,6 +43,13 @@ AccountListItem::NotifyPropertyChanged(String^ propertyName) ...@@ -44,6 +43,13 @@ AccountListItem::NotifyPropertyChanged(String^ propertyName)
CoreDispatcherPriority::High, CoreDispatcherPriority::High,
ref new DispatchedHandler([this, propertyName]() ref new DispatchedHandler([this, propertyName]()
{ {
//MSG_("AccountListItem::NotifyPropertyChanged: " + propertyName);
PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName)); PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
})); }));
} }
void
AccountListItem::raiseNotifyPropertyChanged(String^ propertyName)
{
NotifyPropertyChanged(propertyName);
}
#pragma once
/************************************************************************** /**************************************************************************
* Copyright (C) 2016 by Savoir-faire Linux * * Copyright (C) 2016 by Savoir-faire Linux *
* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> * * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
...@@ -17,6 +16,9 @@ ...@@ -17,6 +16,9 @@
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/ **************************************************************************/
#pragma once
using namespace Platform; using namespace Platform;
using namespace Windows::Data::Json; using namespace Windows::Data::Json;
using namespace Windows::UI::Xaml; using namespace Windows::UI::Xaml;
...@@ -26,26 +28,32 @@ using namespace Windows::UI::Xaml::Data; ...@@ -26,26 +28,32 @@ using namespace Windows::UI::Xaml::Data;
namespace RingClientUWP namespace RingClientUWP
{ {
namespace Controls { namespace Controls
{
public ref class AccountListItem sealed : public INotifyPropertyChanged public ref class AccountListItem sealed : public INotifyPropertyChanged
{ {
public: public:
AccountListItem(Account^ a); AccountListItem(Account^ a);
void raiseNotifyPropertyChanged(String^ propertyName);
virtual event PropertyChangedEventHandler^ PropertyChanged; virtual event PropertyChangedEventHandler^ PropertyChanged;
property Account^ _account; property Account^ _account;
property bool _editionMode;
property bool _disconnected;
property bool _isSelected { property bool _isSelected {
bool get() {
return isSelected_;
}
void set(bool value) { void set(bool value) {
isSelected_ = value; isSelected_ = value;
if (!_disconnected) if (!_disconnected)
NotifyPropertyChanged("_isSelected"); NotifyPropertyChanged("_isSelected");
} }
bool get() {
return isSelected_;
}
} }
property bool _editionMode;
property bool _disconnected;
protected: protected:
void NotifyPropertyChanged(String^ propertyName); void NotifyPropertyChanged(String^ propertyName);
......
...@@ -42,7 +42,7 @@ AccountListItemsViewModel::AccountListItemsViewModel() ...@@ -42,7 +42,7 @@ AccountListItemsViewModel::AccountListItemsViewModel()
void RingClientUWP::ViewModel::AccountListItemsViewModel::OnaccountAdded(RingClientUWP::Account ^account) void RingClientUWP::ViewModel::AccountListItemsViewModel::OnaccountAdded(RingClientUWP::Account ^account)
{ {
auto item = ref new AccountListItem(account); auto item = ref new AccountListItem(account);
itemsList_->Append(item); itemsList_->InsertAt(0, item);
} }
...@@ -54,7 +54,8 @@ void RingClientUWP::ViewModel::AccountListItemsViewModel::OnclearAccountsList() ...@@ -54,7 +54,8 @@ void RingClientUWP::ViewModel::AccountListItemsViewModel::OnclearAccountsList()
void void
AccountListItemsViewModel::updateContactsViewModel() AccountListItemsViewModel::updateContactsViewModel()
{ {
SmartPanelItemsViewModel::instance->update(); SmartPanelItemsViewModel::instance->refreshFilteredItemsList();
SmartPanelItemsViewModel::instance->update(ViewModel::NotifyStrings::notifySmartPanelItem);
} }
AccountListItem^ AccountListItem^
...@@ -67,6 +68,17 @@ RingClientUWP::ViewModel::AccountListItemsViewModel::findItem(String^ accountId) ...@@ -67,6 +68,17 @@ RingClientUWP::ViewModel::AccountListItemsViewModel::findItem(String^ accountId)
return nullptr; return nullptr;
} }
int
AccountListItemsViewModel::getIndex(String^ accountId)
{
int i;
for (i = 0; i < itemsList_->Size; i++) {
if (itemsList_->GetAt(i)->_account->accountID_ == accountId)
break;
}
return i;
}
void RingClientUWP::ViewModel::AccountListItemsViewModel::removeItem(AccountListItem ^ item) void RingClientUWP::ViewModel::AccountListItemsViewModel::removeItem(AccountListItem ^ item)
{ {
unsigned int index; unsigned int index;
...@@ -96,3 +108,25 @@ AccountListItemsViewModel::unreadMessages() ...@@ -96,3 +108,25 @@ AccountListItemsViewModel::unreadMessages()
} }
return messageCount; return messageCount;
} }
int
AccountListItemsViewModel::unreadContactRequests()
{
int unreadContactRequestCount = 0;
for each (auto account in AccountsViewModel::instance->accountsList) {
account->_unreadContactRequests = AccountsViewModel::instance->unreadContactRequests(account->accountID_);
unreadContactRequestCount += account->_unreadContactRequests;
}
return unreadContactRequestCount;
}
void
AccountListItemsViewModel::update(const std::vector<std::string>& properties)
{
for each (AccountListItem^ item in itemsList) {
item->raiseNotifyPropertyChanged("");
for each (std::string prop in properties) {
item->_account->raiseNotifyPropertyChanged(Utils::toPlatformString(prop));
}
}
}
\ No newline at end of file
...@@ -34,6 +34,7 @@ public ref class AccountListItemsViewModel sealed ...@@ -34,6 +34,7 @@ public ref class AccountListItemsViewModel sealed
public: public:
String^ getSelectedAccountId(); String^ getSelectedAccountId();
int unreadMessages(); int unreadMessages();
int unreadContactRequests();
internal: internal:
/* singleton */ /* singleton */
...@@ -47,26 +48,25 @@ internal: ...@@ -47,26 +48,25 @@ internal:
} }
/* functions */ /* functions */
void update(const std::vector<std::string>& properties);
AccountListItem^ findItem(String^ accountId); AccountListItem^ findItem(String^ accountId);
int getIndex(String^ accountId);
void removeItem(AccountListItem^ item); void removeItem(AccountListItem^ item);
/* properties */ /* properties */
property Vector<AccountListItem^>^ itemsList property Vector<AccountListItem^>^ itemsList
{ {
Vector<AccountListItem^>^ get() Vector<AccountListItem^>^ get() {
{
return itemsList_; return itemsList_;
} }
} }
property AccountListItem^ _selectedItem property AccountListItem^ _selectedItem
{ {
AccountListItem^ get() AccountListItem^ get() {
{
return currentItem_; return currentItem_;
} }
void set(AccountListItem^ value) void set(AccountListItem^ value) {
{
if (currentItem_) if (currentItem_)
currentItem_->_isSelected = false; currentItem_->_isSelected = false;
currentItem_ = value; currentItem_ = value;
......
...@@ -37,61 +37,89 @@ AccountsViewModel::AccountsViewModel() ...@@ -37,61 +37,89 @@ AccountsViewModel::AccountsViewModel()
} }
void void
AccountsViewModel::raiseContactAdded(String^ accountId, Contact ^ name) AccountsViewModel::raiseContactAdded(String^ accountId, Contact ^ contact)
{ {
contactAdded(accountId, name); contactAdded(accountId, contact);
} }
void void
AccountsViewModel::raiseContactDeleted(String^ accountId, Contact ^ name) AccountsViewModel::raiseContactDeleted(String^ accountId, Contact ^ contact)
{ {
contactDeleted(accountId, name); contactDeleted(accountId, contact);
} }
void void
AccountsViewModel::raiseContactDataModified(String^ accountId, Contact ^ name) AccountsViewModel::raiseContactDataModified(String^ accountId, Contact ^ contact)
{ {
contactDataModified(accountId, name); contactDataModified(accountId, contact);
} }
void void
AccountsViewModel::addRingAccount(std::string& alias, std::string& ringID, std::string& accountID, std::string& deviceId, bool upnpState) AccountsViewModel::raiseUnreadContactRequest()
{ {
auto account = ref new Account( newUnreadContactRequest();
Utils::toPlatformString(alias), }
void
AccountsViewModel::addRingAccount( std::string& alias,
std::string& ringID,
std::string& accountID,
std::string& deviceId,
std::string& deviceName,
bool active,
bool upnpState,
bool autoAnswer,
bool dhtPublicInCalls,
bool turnEnabled,
std::string& turnAddress)
{
auto account = ref new Account( Utils::toPlatformString(alias),
Utils::toPlatformString(ringID), Utils::toPlatformString(ringID),
"RING", "RING",
Utils::toPlatformString(accountID), Utils::toPlatformString(accountID),
Utils::toPlatformString(deviceId), Utils::toPlatformString(deviceId),
Utils::toPlatformString(deviceName),
active,
upnpState, upnpState,
"" /* sip hostame not used woth ring account */, autoAnswer,
dhtPublicInCalls,
turnEnabled,
Utils::toPlatformString(turnAddress),
"" /* sip hostame not used with ring account */,
"" /* sip username not used with ring account */, "" /* sip username not used with ring account */,
"" /* sip password not used with ring */ ); "" /* sip password not used with ring */ );
RingD::instance->lookUpAddress(accountID, Utils::toPlatformString(ringID));
accountsList_->Append(account); accountsList_->InsertAt(0, account);
contactListModels_->Insert(account->accountID_, ref new ContactListModel(account->accountID_)); contactListModels_->Insert(account->accountID_, ref new ContactListModel(account->accountID_));
updateScrollView();
accountAdded(account); accountAdded(account);
} }
void void
AccountsViewModel::addSipAccount(std::string& alias, std::string& accountID, std::string& sipHostname, std::string& sipUsername, std::string& sipPassword) AccountsViewModel::addSipAccount( std::string& alias,
std::string& accountID,
bool active,
std::string& sipHostname,
std::string& sipUsername,
std::string& sipPassword)
{ {
auto account = ref new Account( auto account = ref new Account( Utils::toPlatformString(alias),
Utils::toPlatformString(alias),
"" /* ring Id not used with sip */ , "" /* ring Id not used with sip */ ,
"SIP", "SIP",
Utils::toPlatformString(accountID), Utils::toPlatformString(accountID),
"" /* device id not used with sip */, "" /* device id not used with sip */,
"" /* device name not used with sip */,
active,
false /* upnpn not used with sip */, false /* upnpn not used with sip */,
false,
true,
false,
"",
Utils::toPlatformString(sipHostname), Utils::toPlatformString(sipHostname),
Utils::toPlatformString(sipUsername), Utils::toPlatformString(sipUsername),
Utils::toPlatformString(sipPassword) Utils::toPlatformString(sipPassword));
);
accountsList_->Append(account); accountsList_->InsertAt(0, account);
contactListModels_->Insert(account->accountID_, ref new ContactListModel(account->accountID_)); contactListModels_->Insert(account->accountID_, ref new ContactListModel(account->accountID_));
updateScrollView();
accountAdded(account); accountAdded(account);
} }
...@@ -111,30 +139,77 @@ Account ^ RingClientUWP::ViewModel::AccountsViewModel::findItem(String ^ account ...@@ -111,30 +139,77 @@ Account ^ RingClientUWP::ViewModel::AccountsViewModel::findItem(String ^ account
return nullptr; return nullptr;
} }
Account^
AccountsViewModel::findAccountByRingID(String ^ ringId)
{
for each (Account^ item in accountsList_)
if (item->ringID_ == ringId)
return item;
return nullptr;
}
ContactListModel^ ContactListModel^
AccountsViewModel::getContactListModel(std::string& accountId) AccountsViewModel::getContactListModel(std::string& accountId)
{ {
try { if (contactListModels_->Size)
return contactListModels_->Lookup(Utils::toPlatformString(accountId)); return contactListModels_->Lookup(Utils::toPlatformString(accountId));
}
catch (Platform::OutOfBoundsException^ e) {
EXC_(e);
return nullptr; return nullptr;
} }
}
int int
AccountsViewModel::unreadMessages(String ^ accountId) AccountsViewModel::unreadMessages(String ^ accountId)
{ {
int messageCount = 0; int messageCount = 0;
auto acceptIncognitoMessages = findItem(accountId)->_dhtPublicInCalls;
if (auto contactListModel = getContactListModel(Utils::toString(accountId))) { if (auto contactListModel = getContactListModel(Utils::toString(accountId))) {
for each (auto contact in contactListModel->_contactsList) { for each (auto contact in contactListModel->_contactsList) {
if (acceptIncognitoMessages || contact->_trustStatus == TrustStatus::TRUSTED)
messageCount += contact->_unreadMessages; messageCount += contact->_unreadMessages;
} }
} }
return messageCount; return messageCount;
} }
int
AccountsViewModel::unreadContactRequests(String ^ accountId)
{
int contactRequestCount = 0;
if (auto contactListModel = getContactListModel(Utils::toString(accountId))) {
for each (auto contact in contactListModel->_contactsList) {
if (contact->_trustStatus == TrustStatus::INCOMING_CONTACT_REQUEST) {
contactRequestCount += contact->_unreadContactRequest ? 1 : 0;
}
}
}
return contactRequestCount;
}
int
AccountsViewModel::bannedContacts(String^ accountId)
{
int bannedContacts = 0;
if (auto contactListModel = getContactListModel(Utils::toString(accountId))) {
for each (auto contact in contactListModel->_contactsList) {
if (contact->_trustStatus == TrustStatus::BLOCKED) {
bannedContacts++;
}
}
}
return bannedContacts;
}
int
AccountsViewModel::activeAccounts()
{
int totalActiveAccounts = 0;
for (auto account : accountsList_) {
if (account->_active)
totalActiveAccounts++;
}
return totalActiveAccounts;
}
void void
AccountsViewModel::OnincomingAccountMessage(String ^ accountId, String ^ fromRingId, String ^ payload) AccountsViewModel::OnincomingAccountMessage(String ^ accountId, String ^ fromRingId, String ^ payload)
{ {
...@@ -142,31 +217,37 @@ AccountsViewModel::OnincomingAccountMessage(String ^ accountId, String ^ fromRin ...@@ -142,31 +217,37 @@ AccountsViewModel::OnincomingAccountMessage(String ^ accountId, String ^ fromRin
auto contact = contactListModel->findContactByRingId(fromRingId); auto contact = contactListModel->findContactByRingId(fromRingId);
if (contact == nullptr) bool itemSelected = false;
contact = contactListModel->addNewContact(fromRingId, fromRingId); if (auto selectedItem = SmartPanelItemsViewModel::instance->_selectedItem)
itemSelected = (selectedItem->_contact == contact);
auto item = SmartPanelItemsViewModel::instance->_selectedItem; auto isInBackground = RingD::instance->isInBackground;
if (contact == nullptr) { if (contact == nullptr) {
ERR_("contact not handled!"); contact = contactListModel->addNewContact(fromRingId, fromRingId, TrustStatus::UNKNOWN, true);
return; RingD::instance->lookUpAddress(Utils::toString(accountId), fromRingId);
if (!itemSelected || isInBackground || RingD::instance->isInvisible) {
RingD::instance->unpoppedToasts.insert(std::make_pair(contact->ringID_,
[isInBackground, fromRingId, payload](String^ username) {
RingD::instance->ShowIMToast(isInBackground, fromRingId, payload, username);
}));
}
}
else {
contact->_isIncognitoContact = true;
if (!itemSelected || isInBackground || RingD::instance->isInvisible) {
RingD::instance->ShowIMToast(isInBackground, fromRingId, payload);
}
} }
RingD::instance->lookUpAddress(fromRingId); auto messageId = Utils::toPlatformString(Utils::genID(0LL, 9999999999999999999LL));
contact->_conversation->addMessage(MSG_FROM_CONTACT, payload, std::time(nullptr), false, messageId);
contact->_conversation->addMessage(""/* date not yet used*/, MSG_FROM_CONTACT, payload);
/* save contacts conversation to disk */ /* save contacts conversation to disk */
contact->saveConversationToFile(); contact->saveConversationToFile();
auto item = SmartPanelItemsViewModel::instance->_selectedItem;
auto selectedContact = (item) ? item->_contact : nullptr; auto selectedContact = (item) ? item->_contact : nullptr;
newUnreadMessage(contact);
if (contact->ringID_ == fromRingId && contact != selectedContact) {
contact->_unreadMessages++;
newUnreadMessage();
/* saveContactsToFile used to save the notification */
contactListModel->saveContactsToFile();
}
} }
void void
...@@ -181,18 +262,14 @@ AccountsViewModel::OnincomingMessage(String ^callId, String ^payload) ...@@ -181,18 +262,14 @@ AccountsViewModel::OnincomingMessage(String ^callId, String ^payload)
if (contact) { if (contact) {
auto item = SmartPanelItemsViewModel::instance->_selectedItem; auto item = SmartPanelItemsViewModel::instance->_selectedItem;
contact->_conversation->addMessage(""/* date not yet used*/, MSG_FROM_CONTACT, payload); auto messageId = Utils::toPlatformString(Utils::genID(0LL, 9999999999999999999LL));
contact->_conversation->addMessage(MSG_FROM_CONTACT, payload, std::time(nullptr), false, messageId);
/* save contacts conversation to disk */ /* save contacts conversation to disk */
contact->saveConversationToFile(); contact->saveConversationToFile();
auto selectedContact = (item) ? item->_contact : nullptr; auto selectedContact = (item) ? item->_contact : nullptr;
if (contact != selectedContact) { newUnreadMessage(contact);
contact->_unreadMessages++;
newUnreadMessage();
/* saveContactsToFile used to save the notification */
contactListModel->saveContactsToFile();
}
} }
} }
\ No newline at end of file
...@@ -34,7 +34,8 @@ delegate void ClearAccountsList(); ...@@ -34,7 +34,8 @@ delegate void ClearAccountsList();
delegate void ContactAdded(String^, Contact^); delegate void ContactAdded(String^, Contact^);
delegate void ContactDeleted(String^, Contact^); delegate void ContactDeleted(String^, Contact^);
delegate void ContactDataModified(String^, Contact^); delegate void ContactDataModified(String^, Contact^);
delegate void NewUnreadMessage(); delegate void NewUnreadMessage(Contact^);
delegate void NewUnreadContactRequest();
namespace ViewModel namespace ViewModel
{ {
...@@ -42,9 +43,10 @@ namespace ViewModel ...@@ -42,9 +43,10 @@ namespace ViewModel
public ref class AccountsViewModel sealed public ref class AccountsViewModel sealed
{ {
public: public:
void raiseContactAdded(String^ accountId, Contact^ name); void raiseContactAdded(String^ accountId, Contact^ contact);
void raiseContactDeleted(String^ accountId, Contact^ name); void raiseContactDeleted(String^ accountId, Contact^ contact);
void raiseContactDataModified(String^ accountId, Contact^ name); void raiseContactDataModified(String^ accountId, Contact^ contact);
void raiseUnreadContactRequest();
internal: internal:
/* properties */ /* properties */
...@@ -55,21 +57,38 @@ internal: ...@@ -55,21 +57,38 @@ internal:
} }
} }
property Vector<Account^>^ accountsList property Vector<Account^>^ accountsList {
{ Vector<Account^>^ get() {
Vector<Account^>^ get()
{
return accountsList_; return accountsList_;
} }
} }
/* functions */ /* functions */
void addRingAccount(std::string& alias, std::string& ringID, std::string& accountID, std::string& deviceId, bool upnpState); void addRingAccount(std::string& alias,
void addSipAccount(std::string& alias, std::string& accountID, std::string& sipHostname, std::string& sipUsername, std::string& sipPassword); std::string& ringID,
std::string& accountID,
std::string& deviceId,
std::string& deviceName,
bool active,
bool upnpState,
bool autoAnswer,
bool dhtPublicInCalls,
bool turnEnabled,
std::string& turnAddress);
void addSipAccount( std::string& alias,
std::string& accountID,
bool active,
std::string& sipHostname,
std::string& sipUsername,
std::string& sipPassword);
void clearAccountList(); void clearAccountList();
Account^ findItem(String^ accountId); Account^ findItem(String^ accountId);
Account^ findAccountByRingID(String ^ ringId);
ContactListModel^ getContactListModel(std::string& accountId); ContactListModel^ getContactListModel(std::string& accountId);
int unreadMessages(String^ accountId); int unreadMessages(String^ accountId);
int unreadContactRequests(String^ accountId);
int bannedContacts(String^ accountId);
int activeAccounts();
/* events */ /* events */
event NewAccountSelected^ newAccountSelected; event NewAccountSelected^ newAccountSelected;
...@@ -81,6 +100,7 @@ internal: ...@@ -81,6 +100,7 @@ internal:
event ContactDeleted^ contactDeleted; event ContactDeleted^ contactDeleted;
event ContactDataModified^ contactDataModified; event ContactDataModified^ contactDataModified;
event NewUnreadMessage^ newUnreadMessage; event NewUnreadMessage^ newUnreadMessage;
event NewUnreadContactRequest^ newUnreadContactRequest;
private: private:
AccountsViewModel(); AccountsViewModel();
......
...@@ -19,14 +19,51 @@ ...@@ -19,14 +19,51 @@
x:Class="RingClientUWP.App" x:Class="RingClientUWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RingClientUWP"> xmlns:local="using:RingClientUWP"
xmlns:views="using:RingClientUWP.Views"
xmlns:uc="using:RingClientUWP.UserAndCustomControls">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<!-- converters -->
<views:BubbleBackground x:Key="_bubbleBackground_" />
<views:BubbleHorizontalAlignement x:Key="_bubbleHorizontalAlignement_" />
<views:boolToVisibility x:Key="_boolToVisibility_" />
<views:MessageDateTimeString x:Key="_MessageDateTimeString_" />
<views:MessageChainBreakToVisibility x:Key="_MessageChainBreakToVisibility_" />
<views:MessageChainBreakToHeight x:Key="_MessageChainBreakToHeight_" />
<views:CachedImageConverter x:Key="_CachedImageConverter_" />
<views:NameToInitialConverter x:Key="_NameToInitialConverter_" />
<views:NewMessageBubbleNotification x:Key="_NewMessageBubbleNotification_" />
<views:NewMessageNotificationToNumber x:Key="_NewMessageNotificationToNumber_" />
<views:IncomingVisibility x:Key="_IncomingVisibility_" />
<views:OutGoingVisibility x:Key="_OutGoingVisibility_" />
<views:HasAnActiveCall x:Key="_HasAnActiveCall_" />
<views:HasAvatarToVisibility x:Key="_HasAvatarToVisibility_" />
<views:AccountTypeToSourceImage x:Key="_AccountTypeToSourceImage_" />
<views:RingAccountTypeToVisibility x:Key="_RingAccountTypeToVisibility_" />
<views:AccountSelectedToVisibility x:Key="_AccountSelectedToVisibility_" />
<views:CollapseEmptyString x:Key="_CollapseEmptyString_" />
<views:ContactStatusNotification x:Key="_ContactStatusNotification_" />
<views:uintToVisibility x:Key="_uintToVisibility_" />
<views:OneToVisibility x:Key="_OneToVisibility_" />
<views:PresenceStatus x:Key="_PresenceStatus_" />
<views:MoreThanOneToVisibility x:Key="_MoreThanOneToVisibility_" />
<views:MoreThanZeroToVisibility x:Key="_MoreThanZeroToVisibility_" />
<views:UnreadAccountNotificationsString x:Key="_UnreadAccountNotificationsString_" />
<views:PartialTrustToVisibility x:Key="_PartialTrustToVisibility_" />
<views:TrustedToVisibility x:Key="_TrustedToVisibility_" />
<views:SelectedAccountToVisibility x:Key="_SelectedAccountToVisibility_" />
<views:CallStatusToSpinnerVisibility x:Key="_CallStatusToSpinnerVisibility_" />
<views:CallStatusForIncomingCallEllipse x:Key="_CallStatusForIncomingCallEllipse_" />
<views:AccountRegistrationStateToString x:Key="_AccountRegistrationStateToString_" />
<views:AccountRegistrationStateToForeground x:Key="_AccountRegistrationStateToForeground_" />
<views:ContactAccountTypeToVisibility x:Key="_ContactAccountTypeToVisibility_" />
<views:ContactConferenceableToVisibility x:Key="_ContactConferenceableToVisibility_" />
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles.xaml"/> <ResourceDictionary Source="ms-appx:///Styles.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>
...@@ -49,6 +49,7 @@ App::App() ...@@ -49,6 +49,7 @@ App::App()
void void
App::OnLaunched(LaunchActivatedEventArgs^ e) App::OnLaunched(LaunchActivatedEventArgs^ e)
{ {
if (e->PreviousExecutionState != ApplicationExecutionState::Running) {
rootFrame = dynamic_cast<Frame^>(Window::Current->Content); rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
if (rootFrame == nullptr) { if (rootFrame == nullptr) {
...@@ -64,10 +65,13 @@ App::OnLaunched(LaunchActivatedEventArgs^ e) ...@@ -64,10 +65,13 @@ App::OnLaunched(LaunchActivatedEventArgs^ e)
Window::Current->Content = rootFrame; Window::Current->Content = rootFrame;
} }
ApplicationView::GetForCurrentView()->SetPreferredMinSize(Size(500, 500)); ApplicationView::GetForCurrentView()->SetPreferredMinSize(Size(400, 500));
Windows::UI::ViewManagement::ApplicationView::PreferredLaunchViewSize = Size(800, 700); Windows::UI::ViewManagement::ApplicationView::PreferredLaunchViewSize = Size(740, 500);
auto configFile = Utils::toString(ApplicationData::Current->LocalFolder->Path + "\\.config\\dring.yml");
if (Utils::fileExists(configFile)) {
Windows::UI::ViewManagement::ApplicationView::PreferredLaunchWindowingMode Windows::UI::ViewManagement::ApplicationView::PreferredLaunchWindowingMode
= Windows::UI::ViewManagement::ApplicationViewWindowingMode::PreferredLaunchViewSize; = Windows::UI::ViewManagement::ApplicationViewWindowingMode::PreferredLaunchViewSize;
}
Window::Current->Activate(); Window::Current->Activate();
...@@ -80,6 +84,7 @@ App::OnLaunched(LaunchActivatedEventArgs^ e) ...@@ -80,6 +84,7 @@ App::OnLaunched(LaunchActivatedEventArgs^ e)
ApplicationView::GetForCurrentView()->TitleBar->ForegroundColor = Colors::White; ApplicationView::GetForCurrentView()->TitleBar->ForegroundColor = Colors::White;
ApplicationView::GetForCurrentView()->TitleBar->ButtonForegroundColor = Colors::White; ApplicationView::GetForCurrentView()->TitleBar->ButtonForegroundColor = Colors::White;
} }
}
void App::OnsummonWizard() void App::OnsummonWizard()
{ {
...@@ -103,7 +108,14 @@ void App::OnActivated(IActivatedEventArgs^ e) ...@@ -103,7 +108,14 @@ void App::OnActivated(IActivatedEventArgs^ e)
if (e->Kind == ActivationKind::ToastNotification) { if (e->Kind == ActivationKind::ToastNotification) {
auto toastArgs = safe_cast<ToastNotificationActivatedEventArgs^>(e); auto toastArgs = safe_cast<ToastNotificationActivatedEventArgs^>(e);
std::string args = Utils::toString(toastArgs->Argument); std::string args = Utils::toString(toastArgs->Argument);
if (!args.empty()) /*if (toastArgs->UserInput->HasKey("message"))
RingD::instance->acceptIncommingCall(Utils::toPlatformString(args)); MSG_(dynamic_cast<String^>(toastArgs->UserInput->Lookup("message")));*/
if (!args.empty()) {
auto callId = args.substr(2);
if (args[0] == 'a')
RingD::instance->acceptIncommingCall(Utils::toPlatformString(callId));
else if (args[0] == 'r')
RingD::instance->refuseIncommingCall(Utils::toPlatformString(callId));
}
} }
} }
\ No newline at end of file
Assets/AccountTypeRING.png

1.14 KiB | W: | H:

Assets/AccountTypeRING.png

2.08 KiB | W: | H:

Assets/AccountTypeRING.png
Assets/AccountTypeRING.png
Assets/AccountTypeRING.png
Assets/AccountTypeRING.png
  • 2-up
  • Swipe
  • Onion skin
Assets/AccountTypeSIP.png

679 B | W: | H:

Assets/AccountTypeSIP.png

701 B | W: | H:

Assets/AccountTypeSIP.png
Assets/AccountTypeSIP.png
Assets/AccountTypeSIP.png
Assets/AccountTypeSIP.png
  • 2-up
  • Swipe
  • Onion skin
Assets/SplashScreen.scale-200.png

36.5 KiB | W: | H:

Assets/SplashScreen.scale-200.png

37.8 KiB | W: | H:

Assets/SplashScreen.scale-200.png
Assets/SplashScreen.scale-200.png
Assets/SplashScreen.scale-200.png
Assets/SplashScreen.scale-200.png
  • 2-up
  • Swipe
  • Onion skin
Assets/TESTS/contactAvatar.png

4.56 KiB | W: | H:

Assets/TESTS/contactAvatar.png

1.69 KiB | W: | H:

Assets/TESTS/contactAvatar.png
Assets/TESTS/contactAvatar.png
Assets/TESTS/contactAvatar.png
Assets/TESTS/contactAvatar.png
  • 2-up
  • Swipe
  • Onion skin
Assets/TESTS/logo-ring.scale-100.png

36.3 KiB | W: | H:

Assets/TESTS/logo-ring.scale-100.png

42.7 KiB | W: | H:

Assets/TESTS/logo-ring.scale-100.png
Assets/TESTS/logo-ring.scale-100.png
Assets/TESTS/logo-ring.scale-100.png
Assets/TESTS/logo-ring.scale-100.png
  • 2-up
  • Swipe
  • Onion skin
Assets/TESTS/logo-ring.scale-125.png

46.7 KiB | W: | H:

Assets/TESTS/logo-ring.scale-125.png

54.9 KiB | W: | H:

Assets/TESTS/logo-ring.scale-125.png
Assets/TESTS/logo-ring.scale-125.png
Assets/TESTS/logo-ring.scale-125.png
Assets/TESTS/logo-ring.scale-125.png
  • 2-up
  • Swipe
  • Onion skin
Assets/TESTS/logo-ring.scale-150.png

57 KiB | W: | H:

Assets/TESTS/logo-ring.scale-150.png

66.8 KiB | W: | H:

Assets/TESTS/logo-ring.scale-150.png
Assets/TESTS/logo-ring.scale-150.png
Assets/TESTS/logo-ring.scale-150.png
Assets/TESTS/logo-ring.scale-150.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment