Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-uwp
Commits
026a84b4
Commit
026a84b4
authored
Nov 28, 2016
by
Nicolas Jager
Browse files
Account : improvement for add existing account
Change-Id: Ibdeb9f48d881e42c67e011d8db4cdf524f7eb55a Tuleap: #790
parent
fac013fe
Changes
10
Hide whitespace changes
Inline
Side-by-side
MainPage.xaml.cpp
View file @
026a84b4
...
...
@@ -84,10 +84,9 @@ MainPage::MainPage()
visibilityChangedEventToken
=
Window
::
Current
->
VisibilityChanged
+=
ref
new
WindowVisibilityChangedEventHandler
(
this
,
&
MainPage
::
Application_VisibilityChanged
);
/*applicationSuspendingEventToken = Application::Current->Suspending +=
ref new SuspendingEventHandler(this, &MainPage::Application_Suspending);
applicationResumingEventToken = Application::Current->Resuming +=
ref new EventHandler<Object^>(this, &MainPage::Application_Resuming);*/
ref
new
EventHandler
<
Object
^>
(
this
,
&
MainPage
::
Application_Resuming
);
RingD
::
instance
->
registrationStateErrorGeneric
+=
ref
new
RingClientUWP
::
RegistrationStateErrorGeneric
(
this
,
&
RingClientUWP
::
MainPage
::
OnregistrationStateErrorGeneric
);
RingD
::
instance
->
registrationStateRegistered
+=
ref
new
RingClientUWP
::
RegistrationStateRegistered
(
this
,
&
RingClientUWP
::
MainPage
::
OnregistrationStateRegistered
);
}
void
...
...
@@ -437,3 +436,15 @@ void RingClientUWP::MainPage::OncloseMessageTextPage()
auto
smartPanel
=
dynamic_cast
<
SmartPanel
^>
(
_smartPanel_
->
Content
);
smartPanel
->
unselectContact
();
}
void
RingClientUWP
::
MainPage
::
OnregistrationStateErrorGeneric
(
const
std
::
string
&
accountId
)
{
showLoadingOverlay
(
false
,
false
);
}
void
RingClientUWP
::
MainPage
::
OnregistrationStateRegistered
()
{
showLoadingOverlay
(
false
,
false
);
}
MainPage.xaml.h
View file @
026a84b4
...
...
@@ -77,5 +77,7 @@ private:
void
OnpressHangUpCall
();
void
OnstateChange
(
Platform
::
String
^
callId
,
CallStatus
state
,
int
code
);
void
OncloseMessageTextPage
();
void
OnregistrationStateErrorGeneric
(
const
std
::
string
&
accountId
);
void
OnregistrationStateRegistered
();
};
}
RingD.cpp
View file @
026a84b4
...
...
@@ -88,7 +88,8 @@ RingClientUWP::RingD::reloadAccountList()
accountUpdated
(
account
);
}
else
{
RingClientUWP
::
ViewModel
::
AccountsViewModel
::
instance
->
addRingAccount
(
alias
,
ringID
,
accountId
,
deviceId
,
upnpState
);
if
(
!
ringID
.
empty
())
RingClientUWP
::
ViewModel
::
AccountsViewModel
::
instance
->
addRingAccount
(
alias
,
ringID
,
accountId
,
deviceId
,
upnpState
);
}
}
else
{
/* SIP */
...
...
@@ -503,11 +504,22 @@ RingD::registerCallbacks()
CoreApplication
::
MainView
->
CoreWindow
->
Dispatcher
->
RunAsync
(
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
{
reloadAccountList
();
if
(
editModeOn_
)
{
// enleves ce qui suit et utilises des evenements.
registrationStateRegistered
();
// mettre a jour le wizard
/*if (editModeOn_) {
auto frame = dynamic_cast<Frame^>(Window::Current->Content);
dynamic_cast<RingClientUWP::MainPage^>(frame->Content)->showLoadingOverlay(false, false);
editModeOn_ = false;
}
}*/
}));
}
else
if
(
state
==
DRing
::
Account
::
States
::
ERROR_GENERIC
)
{
CoreApplication
::
MainView
->
CoreWindow
->
Dispatcher
->
RunAsync
(
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
{
reloadAccountList
();
registrationStateErrorGeneric
(
account_id
);
// ajoute cet event dans le wizard
}));
}
}),
...
...
@@ -893,6 +905,12 @@ RingD::dequeueTasks()
deviceDetails
.
insert
(
std
::
make_pair
(
DRing
::
Account
::
ConfProperties
::
ARCHIVE_PIN
,
pin
));
deviceDetails
.
insert
(
std
::
make_pair
(
DRing
::
Account
::
ConfProperties
::
ARCHIVE_PASSWORD
,
password
));
DRing
::
addAccount
(
deviceDetails
);
CoreApplication
::
MainView
->
CoreWindow
->
Dispatcher
->
RunAsync
(
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
{
auto
frame
=
dynamic_cast
<
Frame
^>
(
Window
::
Current
->
Content
);
dynamic_cast
<
RingClientUWP
::
MainPage
^>
(
frame
->
Content
)
->
showLoadingOverlay
(
true
,
true
);
}));
}
break
;
case
Request
::
GetKnownDevices
:
...
...
RingD.h
View file @
026a84b4
...
...
@@ -40,6 +40,8 @@ delegate void AccountUpdated(Account^ account);
delegate
void
IncomingVideoMuted
(
String
^
callId
,
bool
state
);
delegate
void
RegisteredNameFound
(
LookupStatus
status
,
const
std
::
string
&
address
,
const
std
::
string
&
name
);
delegate
void
FinishCaptureDeviceEnumeration
();
delegate
void
RegistrationStateErrorGeneric
(
const
std
::
string
&
accountId
);
delegate
void
RegistrationStateRegistered
();
using
SharedCallback
=
std
::
shared_ptr
<
DRing
::
CallbackWrapperBase
>
;
using
namespace
std
::
placeholders
;
...
...
@@ -147,6 +149,8 @@ internal:
event
IncomingVideoMuted
^
incomingVideoMuted
;
event
RegisteredNameFound
^
registeredNameFound
;
event
FinishCaptureDeviceEnumeration
^
finishCaptureDeviceEnumeration
;
event
RegistrationStateErrorGeneric
^
registrationStateErrorGeneric
;
event
RegistrationStateRegistered
^
registrationStateRegistered
;
private:
/* sub classes */
...
...
SmartPanel.xaml
View file @
026a84b4
...
...
@@ -475,13 +475,23 @@
Background="#FFE4F1F9"
ItemTemplate="{StaticResource AccountListItemsTemplate}"/>
</ScrollViewer>
<Button x:Name="_addAccountBtn_"
Grid.Row="1"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Content=""
Click="_addAccountBtn__Click"
Style="{StaticResource ButtonStyle6}"/>
<StackPanel Orientation="Horizontal"
Grid.Row="1">
<!--Style="{StaticResource ButtonStyle6}"-->
<Button x:Name="_addAccountBtn_"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Content=""
Click="_addAccountBtn__Click"
Style="{StaticResource ButtonStyle5}"/>
<!--Style="{StaticResource ButtonStyle6}"-->
<Button x:Name="_linkThisDeviceBtn_"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Content=""
Click="_linkThisDeviceBtn__Click"
Style="{StaticResource ButtonStyle5}"/>
</StackPanel>
</Grid>
<!-- account creation menu. -->
<Grid x:Name="_accountCreationMenuGrid_"
...
...
@@ -695,6 +705,92 @@
</StackPanel>
</Grid>
</Grid>
<!-- add account menu. -->
<Grid x:Name="_accountAddMenuGrid_"
Visibility="Collapsed"
Grid.Row="2"
Background="LightBlue">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal"
Background="#FFE4F1F9"
Padding="10"
Grid.Row="0">
<Button x:Name="_step1button_"
Click="_step1button__Click"
Content="Step 1"/>
<TextBlock Text=">"/>
<Button x:Name="_step2button_"
Click="_step2button__Click"
Content="Step 2"/>
</StackPanel>
<!-- step 1. -->
<StackPanel x:Name="_step1Menu_"
Background="#FFE4F1F9"
Padding="10"
Grid.Row="1">
<TextBlock Text="To link this device to a Ring account, you'll first need to generate a PIN from Ring on a device hosting the account."
TextWrapping="Wrap"
TextAlignment="Justify"/>
<HyperlinkButton Content="Learn more"
Margin="0,0,0,10"
NavigateUri="http://ring.cx"/>
</StackPanel>
<!-- step 2. -->
<StackPanel x:Name="_step2Menu_"
Background="#FFE4F1F9"
Visibility="Collapsed"
Grid.Row="1">
<TextBox x:Name="_PINTextBox_"
Margin="10"
GotFocus="_PINTextBox__GotFocus"
PlaceholderText="Enter PIN"/>
<PasswordBox x:Name="_ArchivePassword_"
Margin="10"
PlaceholderText="Enter your password"/>
<TextBlock x:Name="_response_"
Foreground="Red"
HorizontalAlignment="Center"
Text=""/>
</StackPanel>
<!-- buttons next step and yes/no to add the account. -->
<Grid Grid.Row="2">
<StackPanel Orientation="Horizontal"
Padding="10,0"
HorizontalAlignment="Center">
<Button x:Name="_nextstep_"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Content=""
Click="_step2button__Click"
Style="{StaticResource ButtonStyle2}"/>
<Button x:Name="_addAccountYes_"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Visibility="Collapsed"
Content=""
Click="_addAccountYes__Click"
Style="{StaticResource ButtonStyle5}"/>
<Button x:Name="_addAccountNo_"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Visibility="Collapsed"
Content=""
Click="_addAccountNo__Click"
Style="{StaticResource ButtonStyle5}"/>
</StackPanel>
</Grid>
</Grid>
<!--<StackPanel Orientation="Horizontal"
Margin="0,20">
<TextBlock Style="{StaticResource TextSegoeStyle-20pt-black}"
Margin="0,0,10,0"
Text=""/>
<TextBlock Text="Alias"/>
</StackPanel>-->
<!-- account edition menu. -->
<Grid x:Name="_accountEditionGrid_"
Grid.Row="2"
...
...
@@ -740,7 +836,7 @@
Style="{StaticResource TextSegoeStyle-20pt-red}"
Text=""/>
</Grid>
<!--
upnp
sub menu. -->
<!--
edition
sub menu. -->
<StackPanel x:Name="_ringStackEdition_">
<!-- register account on blockachain -->
<StackPanel Orientation="Horizontal"
...
...
SmartPanel.xaml.cpp
View file @
026a84b4
...
...
@@ -69,8 +69,10 @@ SmartPanel::SmartPanel()
auto
accountsListSize
=
dynamic_cast
<
Vector
<
AccountListItem
^>^>
(
_accountsList_
->
ItemsSource
)
->
Size
;
if
(
accountsListSize
>
index
)
_accountsList_
->
SelectedIndex
=
index
;
else
_accountsList_
->
SelectedIndex
=
0
;
else
{
if
(
accountsListSize
>
0
)
_accountsList_
->
SelectedIndex
=
0
;
}
}
});
Configuration
::
UserPreferences
::
instance
->
loadProfileImage
+=
ref
new
LoadProfileImage
([
this
]()
{
...
...
@@ -147,6 +149,8 @@ SmartPanel::SmartPanel()
RingD
::
instance
->
finishCaptureDeviceEnumeration
+=
ref
new
RingClientUWP
::
FinishCaptureDeviceEnumeration
([
this
]()
{
populateVideoDeviceSettingsComboBox
();
});
RingD
::
instance
->
registrationStateErrorGeneric
+=
ref
new
RingClientUWP
::
RegistrationStateErrorGeneric
(
this
,
&
RingClientUWP
::
Views
::
SmartPanel
::
OnregistrationStateErrorGeneric
);
RingD
::
instance
->
registrationStateRegistered
+=
ref
new
RingClientUWP
::
RegistrationStateRegistered
(
this
,
&
RingClientUWP
::
Views
::
SmartPanel
::
OnregistrationStateRegistered
);
}
void
...
...
@@ -211,6 +215,7 @@ void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Unchecked(Object^ se
_accountsMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_accountCreationMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_accountEditionGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_accountAddMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_settingsMenu__Checked
(
Object
^
sender
,
RoutedEventArgs
^
e
)
...
...
@@ -733,6 +738,16 @@ void RingClientUWP::Views::SmartPanel::ringTxtBxPlaceHolderDelay(String^ placeHo
}),
delay
);
}
void
RingClientUWP
::
Views
::
SmartPanel
::
showLinkThisDeviceStep1
()
{
_step1Menu_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_step2Menu_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_nextstep_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_addAccountYes_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_addAccountNo_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
}
Object
^
RingClientUWP
::
Views
::
IncomingVisibility
::
Convert
(
Object
^
value
,
Windows
::
UI
::
Xaml
::
Interop
::
TypeName
targetType
,
Object
^
parameter
,
String
^
language
)
{
auto
state
=
static_cast
<
CallStatus
>
(
value
);
...
...
@@ -1211,41 +1226,60 @@ void RingClientUWP::Views::SmartPanel::_usernameTextBoxEdition__KeyUp(Platform::
void
RingClientUWP
::
Views
::
SmartPanel
::
OnregisteredNameFound
(
RingClientUWP
::
LookupStatus
status
,
const
std
::
string
&
address
,
const
std
::
string
&
name
)
{
if
(
_ringTxtBx_
->
Text
->
IsEmpty
())
// if true, we consider we did the lookup for a new account
switch
(
status
)
{
case
LookupStatus
::
SUCCESS
:
_usernameValidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
if
(
_ringTxtBx_
->
Text
->
IsEmpty
())
{
// if true, we consider we did the lookup for a new account
/* note : this code do both check for edit and creation menu. It doesn't affect the use and it's easier to
implement. */
auto
currentNameEdition
=
Utils
::
toString
(
_usernameTextBoxEdition_
->
Text
);
if
(
currentNameEdition
==
name
)
{
switch
(
status
)
{
case
LookupStatus
::
SUCCESS
:
_usernameValidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
break
;
case
LookupStatus
::
INVALID_NAME
:
_usernameValidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
break
;
case
LookupStatus
::
NOT_FOUND
:
_usernameValidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
break
;
case
LookupStatus
::
ERRORR
:
_usernameValidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
break
;
}
checkStateEditionMenu
();
return
;
}
//_registerOnBlockchainEdition_->IsEnabled = false
;
break
;
case
LookupStatus
::
INVALID_NAME
:
_usernameValidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
//_registerOnBlockchainEdition_->IsEnabled = false
;
break
;
case
LookupStatus
::
NOT_FOUND
:
_username
V
alid
Edition
_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_usernameInvalidEdition_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_username
Inv
alid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
//_registerOnBlockchainEdition_->IsEnabled = true
;
break
;
case
LookupStatus
::
ERRORR
:
_usernameValid
Edition
_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid
Edition
_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
//_registerOnBlockchainEdition_->IsEnabled = false
;
b
re
ak
;
auto
currentNameCreation
=
Utils
::
toString
(
_usernameTextBox_
->
Text
)
;
if
(
currentNameCreation
==
name
)
{
switch
(
status
)
{
case
LookupStatus
::
SUCCESS
:
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
break
;
case
LookupStatus
::
INVALID_NAME
:
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_username
Inv
alid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
break
;
case
LookupStatus
::
NOT_FOUND
:
_username
V
alid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
break
;
case
LookupStatus
::
ERRORR
:
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
break
;
}
checkStateAddAccountMenu
()
;
re
turn
;
}
else
// if false, we consider we are looking for a registered user
{
}
else
{
// if false, we consider we are looking for a registered user
switch
(
status
)
{
case
LookupStatus
::
SUCCESS
:
ContactsViewModel
::
instance
->
addNewContact
(
Utils
::
toPlatformString
(
name
),
Utils
::
toPlatformString
(
address
));
...
...
@@ -1274,10 +1308,7 @@ void RingClientUWP::Views::SmartPanel::OnregisteredNameFound(RingClientUWP::Look
}
_smartList_
->
SelectedItem
=
nullptr
;
}
checkStateAddAccountMenu
();
}
...
...
@@ -1340,6 +1371,8 @@ void RingClientUWP::Views::SmartPanel::_usernameTextBox__KeyUp(Platform::Object^
_usernameValid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_usernameInvalid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
}
...
...
@@ -1537,3 +1570,68 @@ void RingClientUWP::Views::SmartPanel::_ringTxtBx__KeyUp(Platform::Object^ sende
}
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_linkThisDeviceBtn__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_accountsMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_accountAddMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
showLinkThisDeviceStep1
();
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_step2button__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_step1Menu_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_step2Menu_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_nextstep_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_addAccountYes_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_addAccountNo_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_PINTextBox_
->
Text
=
""
;
_ArchivePassword_
->
Password
=
""
;
_response_
->
Text
=
""
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_step1button__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
showLinkThisDeviceStep1
();
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_addAccountNo__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_accountsMenuButton_
->
IsChecked
=
false
;
_accountsMenuButton__Unchecked
(
nullptr
,
nullptr
);
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_addAccountYes__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
this
->
Dispatcher
->
RunAsync
(
Windows
::
UI
::
Core
::
CoreDispatcherPriority
::
Normal
,
ref
new
Windows
::
UI
::
Core
::
DispatchedHandler
([
this
]()
{
RingD
::
instance
->
registerThisDevice
(
_PINTextBox_
->
Text
,
_ArchivePassword_
->
Password
);
_ArchivePassword_
->
Password
=
""
;
_PINTextBox_
->
Text
=
""
;
}));
}
void
RingClientUWP
::
Views
::
SmartPanel
::
OnregistrationStateErrorGeneric
(
const
std
::
string
&
accountId
)
{
_response_
->
Text
=
"Credentials error or PIN expired."
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_PINTextBox__GotFocus
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_response_
->
Text
=
""
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
OnregistrationStateRegistered
()
{
_addAccountNo__Click
(
nullptr
,
nullptr
);
}
SmartPanel.xaml.h
View file @
026a84b4
...
...
@@ -129,6 +129,7 @@ private:
void
checkStateAddAccountMenu
();
void
checkStateEditionMenu
();
void
ringTxtBxPlaceHolderDelay
(
String
^
placeHolderText
,
int
delayInMilliSeconds
);
void
showLinkThisDeviceStep1
();
/* members */
void
_devicesMenuButton__Unchecked
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
...
...
@@ -161,6 +162,14 @@ private:
void
_deleteAccountEdition__Toggled
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_RegisterStateEdition__Toggled
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_ringTxtBx__KeyUp
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
Input
::
KeyRoutedEventArgs
^
e
);
void
_linkThisDeviceBtn__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_step2button__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_step1button__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_addAccountNo__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_addAccountYes__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
OnregistrationStateErrorGeneric
(
const
std
::
string
&
accountId
);
void
_PINTextBox__GotFocus
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
OnregistrationStateRegistered
();
};
}
}
Wizard.xaml
View file @
026a84b4
...
...
@@ -217,7 +217,7 @@
Click="_step2button__Click"
Content="Step 2"/>
</StackPanel>
<!--
add account menu
. -->
<!--
step 1
. -->
<StackPanel x:Name="_step1Menu_"
Background="#FFE4F1F9"
Padding="10"
...
...
@@ -229,17 +229,22 @@
Margin="0,0,0,10"
NavigateUri="http://ring.cx"/>
</StackPanel>
<!--
add account menu
. -->
<!--
step 2
. -->
<StackPanel x:Name="_step2Menu_"
Background="#FFE4F1F9"
Visibility="Collapsed"
Grid.Row="1">
<TextBox x:Name="_PINTextBox_"
Margin="10"
GotFocus="_PINTextBox__GotFocus"
PlaceholderText="Enter PIN"/>
<PasswordBox x:Name="_ArchivePassword_"
Margin="10"
PlaceholderText="Enter your password"/>
<TextBlock x:Name="_response_"
Foreground="Red"
HorizontalAlignment="Center"
Text=""/>
</StackPanel>
<!-- buttons next step and yes/no to add the account. -->
<Grid Grid.Row="2">
...
...
Wizard.xaml.cpp
View file @
026a84b4
...
...
@@ -30,6 +30,7 @@ Wizard::Wizard()
InitializeComponent
();
/* connect to delegates */
RingD
::
instance
->
registeredNameFound
+=
ref
new
RingClientUWP
::
RegisteredNameFound
(
this
,
&
RingClientUWP
::
Views
::
Wizard
::
OnregisteredNameFound
);
RingD
::
instance
->
registrationStateErrorGeneric
+=
ref
new
RingClientUWP
::
RegistrationStateErrorGeneric
(
this
,
&
RingClientUWP
::
Views
::
Wizard
::
OnregistrationStateErrorGeneric
);
}
void
RingClientUWP
::
Views
::
Wizard
::
OnNavigatedTo
(
Windows
::
UI
::
Xaml
::
Navigation
::
NavigationEventArgs
^
e
)
...
...
@@ -295,3 +296,15 @@ void RingClientUWP::Views::Wizard::OnregisteredNameFound(LookupStatus status, co
checkState
();
}
void
RingClientUWP
::
Views
::
Wizard
::
OnregistrationStateErrorGeneric
(
const
std
::
string
&
accountId
)
{
_response_
->
Text
=
"Credentials error or PIN expired."
;
}
void
RingClientUWP
::
Views
::
Wizard
::
_PINTextBox__GotFocus
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_response_
->
Text
=
""
;
}
Wizard.xaml.h
View file @
026a84b4
...
...
@@ -38,6 +38,8 @@ private:
bool
isPublic
=
true
;
bool
isUsernameValid
;
// available
bool
isFullNameValid
;
void
OnregistrationStateErrorGeneric
(
const
std
::
string
&
accountId
);
void
_PINTextBox__GotFocus
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment