Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-client-uwp
Commits
38dd4429
Commit
38dd4429
authored
Oct 07, 2016
by
Nicolas Jager
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : multi device ui
Change-Id: Ib45aa0036febde4d117be67d426cfca5c1524117 Tulesp: #1220
parent
3f7f5533
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
5 deletions
+62
-5
RingD.cpp
RingD.cpp
+2
-1
SmartPanel.xaml
SmartPanel.xaml
+28
-0
SmartPanel.xaml.cpp
SmartPanel.xaml.cpp
+31
-4
SmartPanel.xaml.h
SmartPanel.xaml.h
+1
-0
No files found.
RingD.cpp
View file @
38dd4429
...
...
@@ -384,7 +384,7 @@ RingClientUWP::RingD::startDaemon()
DRing
::
exportable_callback
<
DRing
::
ConfigurationSignal
::
ExportOnRingEnded
>
([
&
](
const
std
::
string
&
accountId
,
int
status
,
const
std
::
string
&
pin
)
{
auto
accountId2
=
Utils
::
toPlatformString
(
accountId
);
auto
pin2
=
(
pin
.
empty
())
?
"Error
B
ad
P
assword"
:
"Your generated pin :"
+
Utils
::
toPlatformString
(
pin
);
auto
pin2
=
(
pin
.
empty
())
?
"Error
b
ad
p
assword"
:
"Your generated pin :
"
+
Utils
::
toPlatformString
(
pin
);
dispatcher
->
RunAsync
(
CoreDispatcherPriority
::
High
,
ref
new
DispatchedHandler
([
=
]()
{
exportOnRingEnded
(
accountId2
,
pin2
);
...
...
@@ -611,6 +611,7 @@ RingD::dequeueTasks()
ref
new
DispatchedHandler
([
=
]()
{
devicesListRefreshed
(
devicesList2
);
}));
break
;
}
case
Request
::
ExportOnRing
:
{
...
...
SmartPanel.xaml
View file @
38dd4429
...
...
@@ -546,14 +546,23 @@
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Device ID:"
Margin="10"
Grid.Row="0"
HorizontalAlignment="Center"/>
<TextBlock x:Name="_deviceId_"
Margin="10"
Text="[TEXT_MISSING]"
TextTrimming="CharacterEllipsis"
Grid.Row="1"
IsTextSelectionEnabled="True"
HorizontalAlignment="Center"/>
<TextBlock x:Name="_waitingDevicesList_"
Text="waiting for devices list..."
Grid.Row="2"
IsTextSelectionEnabled="True"
HorizontalAlignment="Center"/>
<ListBox x:Name="_devicesIdList_"
Visibility="Collapsed"
Grid.Row="2"/>
</Grid>
<Button x:Name="_addDevice_"
...
...
@@ -632,7 +641,26 @@
Grid.Row="0"
Margin="10,10,0,10"/>
</Grid>
<Grid Grid.Row="1">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center">
<Button x:Name="_closePin_"
Grid.Row="1"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Content=""
Click="_closePin__Click"
Style="{StaticResource ButtonStyle5}"/>
</StackPanel>
</Grid>
</Grid>
</Grid>
<!-- smartList and settings. -->
<Grid Grid.Row="1">
...
...
SmartPanel.xaml.cpp
View file @
38dd4429
...
...
@@ -147,9 +147,6 @@ RingClientUWP::Views::SmartPanel::updatePageContent()
_devicesMenuButton_
->
Visibility
=
(
account
->
accountType_
==
"RING"
)
?
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
:
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
RingD
::
instance
->
askToRefreshKnownDevices
(
name
);
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_accountsMenuButton__Checked
(
Object
^
sender
,
RoutedEventArgs
^
e
)
...
...
@@ -498,11 +495,22 @@ void RingClientUWP::Views::SmartPanel::_devicesMenuButton__Unchecked(Platform::O
{
_devicesMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_addingDeviceGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_waitingForPin_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_passwordForPinGenerator_
->
Password
=
""
;
// refacto : do something better...
_waitingAndResult_
->
Text
=
"Exporting account on the Ring..."
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_devicesMenuButton__Checked
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_waitingDevicesList_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_devicesIdList_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
auto
accountId
=
AccountsViewModel
::
instance
->
selectedAccount
->
accountID_
;
RingD
::
instance
->
askToRefreshKnownDevices
(
accountId
);
_shareMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_accountsMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_accountCreationMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
...
...
@@ -517,13 +525,16 @@ void RingClientUWP::Views::SmartPanel::_addDevice__Click(Platform::Object^ sende
{
_devicesMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_addingDeviceGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_closePin_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
OndevicesListRefreshed
(
Platform
::
Collections
::
Vector
<
Platform
::
String
^
,
std
::
equal_to
<
Platform
::
String
^>
,
true
>
^
devicesList
)
{
_waitingDevicesList_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
AccountsViewModel
::
instance
->
selectedAccount
->
_devicesIdList
=
devicesList
;
_devicesIdList_
->
ItemsSource
=
devicesList
;
_devicesIdList_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
}
...
...
@@ -534,6 +545,10 @@ void RingClientUWP::Views::SmartPanel::_pinGeneratorYes__Click(Platform::Object^
auto
accountId
=
AccountsViewModel
::
instance
->
selectedAccount
->
accountID_
;
auto
password
=
_passwordForPinGenerator_
->
Password
;
_passwordForPinGenerator_
->
Password
=
""
;
/* hide the button while we are waiting... */
_closePin_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
RingD
::
instance
->
askToExportOnRing
(
accountId
,
password
);
}
...
...
@@ -543,11 +558,23 @@ void RingClientUWP::Views::SmartPanel::_pinGeneratorNo__Click(Platform::Object^
{
_addingDeviceGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_devicesMenuButton_
->
IsChecked
=
false
;
_passwordForPinGenerator_
->
Password
=
""
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
OnexportOnRingEnded
(
Platform
::
String
^
accountId
,
Platform
::
String
^
pin
)
{
MSG_
(
"XXXX"
);
_waitingAndResult_
->
Text
=
pin
;
_closePin_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
}
void
RingClientUWP
::
Views
::
SmartPanel
::
_closePin__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
)
{
_waitingForPin_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Collapsed
;
_devicesMenuButton_
->
IsChecked
=
false
;
// refacto : do something better...
_waitingAndResult_
->
Text
=
"Exporting account on the Ring..."
;
}
SmartPanel.xaml.h
View file @
38dd4429
...
...
@@ -102,6 +102,7 @@ private:
void
_pinGeneratorYes__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
_pinGeneratorNo__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
void
OnexportOnRingEnded
(
Platform
::
String
^
accountId
,
Platform
::
String
^
pin
);
void
_closePin__Click
(
Platform
::
Object
^
sender
,
Windows
::
UI
::
Xaml
::
RoutedEventArgs
^
e
);
};
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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