Commit b9cddd3b authored by Nicolas Jager's avatar Nicolas Jager
Browse files

smartpanel : updates menu buttons

- set the same style to all buttons.

Change-Id: Id70e6d0121521a45686b04ca6a86e75514b8089e
Tuleap: #790
parent 670e7f77
...@@ -113,6 +113,8 @@ ...@@ -113,6 +113,8 @@
<!-- hamburger button. --> <!-- hamburger button. -->
<Button x:Name="_toggleSmartBoxButton_" <Button x:Name="_toggleSmartBoxButton_"
Grid.Row="0" Grid.Row="0"
FontWeight="Bold"
FontSize="20"
Content="&#xE700;" Content="&#xE700;"
Click="_toggleSmartBoxButton__Click" Click="_toggleSmartBoxButton__Click"
HorizontalAlignment="Center" HorizontalAlignment="Center"
......
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
<Grid.RowDefinitions> <Grid.RowDefinitions>
<!-- where the selected account is shown. --> <!-- where the selected account is shown. -->
<RowDefinition x:Name="_selectedAccountRow_" <RowDefinition x:Name="_selectedAccountRow_"
Height="90"/> Height="60"/>
<!-- where the drop down menus are shown. --> <!-- where the drop down menus are shown. -->
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
...@@ -399,13 +399,13 @@ ...@@ -399,13 +399,13 @@
<Grid Grid.Row="0"> <Grid Grid.Row="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition x:Name="_selectedAccountAvatarColumn_" <ColumnDefinition x:Name="_selectedAccountAvatarColumn_"
Width="90"/> Width="60"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Ellipse <Ellipse
x:Name="_selectedAccountAvatarContainer_" x:Name="_selectedAccountAvatarContainer_"
Height="80" Height="50"
Width="80" Width="50"
Grid.Column="0" Grid.Column="0"
Stroke="White" Stroke="White"
StrokeThickness="3" StrokeThickness="3"
...@@ -422,8 +422,8 @@ ...@@ -422,8 +422,8 @@
<Ellipse <Ellipse
x:Name="_shaderPhotoboothIcon_" x:Name="_shaderPhotoboothIcon_"
Visibility="Collapsed" Visibility="Collapsed"
Height="80" Height="50"
Width="80" Width="50"
Grid.Column="0" Grid.Column="0"
IsHitTestVisible="False" IsHitTestVisible="False"
Fill="Black" Fill="Black"
...@@ -440,46 +440,52 @@ ...@@ -440,46 +440,52 @@
<StackPanel Grid.Column="1" <StackPanel Grid.Column="1"
VerticalAlignment="Bottom"> VerticalAlignment="Bottom">
<TextBlock x:Name="_selectedAccountName_" <TextBlock x:Name="_selectedAccountName_"
Text="[TEXT MISSING]" Text="the wizard will be sumoned..."
Margin="10,0,0,10" Margin="10"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis" TextTrimming="CharacterEllipsis"
Style="{StaticResource TextStyle2}"/> Style="{StaticResource TextStyle2}"/>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<!--Content="&#xE0A1;--> <!-- contacts list -->
<Button x:Name="_smartGridButton_" <ToggleButton x:Name="_contactsListMenuButton_"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Content="&#xe716;" Content="&#xe716;"
Click="_smartGridButton__Clicked" Click="_contactsListMenuButton__Click"
Style="{StaticResource smartGridButtonStyle}"/> Style="{StaticResource ToggleButtonStyle2}"/>
<!-- account menu -->
<ToggleButton x:Name="_accountsMenuButton_" <ToggleButton x:Name="_accountsMenuButton_"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Click="_accountsMenuButton__Click"
Content="&#xE168;" Content="&#xE168;"
Checked="_accountsMenuButton__Checked" Style="{StaticResource ToggleButtonStyle2}"/>
Unchecked="_accountsMenuButton__Unchecked"
Style="{StaticResource ToggleButtonStyle1}"/>
<!-- _shareMenuButton_ --> <!-- _shareMenuButton_ -->
<ToggleButton x:Name="_shareMenuButton_" <ToggleButton x:Name="_shareMenuButton_"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Checked="_shareMenuButton__Checked" Click="_shareMenuButton__Click"
Unchecked="_shareMenuButton__Unchecked" Style="{StaticResource ToggleButtonStyle2}">
Style="{StaticResource ToggleButtonStyle1}"> <StackPanel>
<Image Source="Assets/qrCodeIcon.png" <Image x:Name="_qrCodeIconWhite_"
Stretch="Uniform"/> Source="Assets/qrCodeIconWhite.png"
Visibility="Visible"
Stretch="None"/>
<Image x:Name="_qrCodeIconBlack_"
Visibility="Collapsed"
Source="Assets/qrCodeIconBlack.png"
Stretch="None"/>
</StackPanel>
</ToggleButton> </ToggleButton>
<!-- _devicesMenuButton_ --> <!-- _devicesMenuButton_ -->
<ToggleButton x:Name="_devicesMenuButton_" <ToggleButton x:Name="_devicesMenuButton_"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Click="_devicesMenuButton__Click"
Content="&#xE836;" Content="&#xE836;"
Checked="_devicesMenuButton__Checked" Style="{StaticResource ToggleButtonStyle2}"/>
Unchecked="_devicesMenuButton__Unchecked"
Style="{StaticResource ToggleButtonStyle1}"/>
<!-- _settingsMenuButton_ --> <!-- _settingsMenuButton_ -->
<ToggleButton x:Name="_settingsMenuButton_" <ToggleButton x:Name="_settingsMenuButton_"
Click="_settingsMenuButton__Click"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Content="&#xE115;" Content="&#xE115;"
Checked="_settingsMenu__Checked" Style="{StaticResource ToggleButtonStyle2}"/>
Unchecked="_settingsMenu__Unchecked"
Style="{StaticResource ToggleButtonStyle1}"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>
...@@ -487,9 +493,6 @@ ...@@ -487,9 +493,6 @@
<!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the <!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
same row. To summon them we use the visibility of their own grid, by linking it to a toggle button--> same row. To summon them we use the visibility of their own grid, by linking it to a toggle button-->
</Grid> </Grid>
<!-- smartList and settings. --> <!-- smartList and settings. -->
<Grid Grid.Row="1" <Grid Grid.Row="1"
...@@ -916,8 +919,7 @@ ...@@ -916,8 +919,7 @@
Grid.Row="0" Grid.Row="0"
Background="#3bc1d3"> Background="#3bc1d3">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal"
...@@ -936,7 +938,7 @@ ...@@ -936,7 +938,7 @@
<StackPanel x:Name="_step1Menu_" <StackPanel x:Name="_step1Menu_"
Background="#FFE4F1F9" Background="#FFE4F1F9"
Padding="10" Padding="10"
Grid.Row="1"> Grid.Row="0">
<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." <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" TextWrapping="Wrap"
TextAlignment="Justify"/> TextAlignment="Justify"/>
...@@ -948,7 +950,7 @@ ...@@ -948,7 +950,7 @@
<StackPanel x:Name="_step2Menu_" <StackPanel x:Name="_step2Menu_"
Background="#FFE4F1F9" Background="#FFE4F1F9"
Visibility="Collapsed" Visibility="Collapsed"
Grid.Row="1"> Grid.Row="0">
<TextBox x:Name="_PINTextBox_" <TextBox x:Name="_PINTextBox_"
Margin="10" Margin="10"
GotFocus="_PINTextBox__GotFocus" GotFocus="_PINTextBox__GotFocus"
...@@ -962,7 +964,7 @@ ...@@ -962,7 +964,7 @@
Text=""/> Text=""/>
</StackPanel> </StackPanel>
<!-- buttons next step and yes/no to add the account. --> <!-- buttons next step and yes/no to add the account. -->
<Grid Grid.Row="2"> <Grid Grid.Row="1">
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal"
Padding="10,0" Padding="10,0"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
...@@ -1120,6 +1122,7 @@ ...@@ -1120,6 +1122,7 @@
<PasswordBox x:Name="_passwordForPinGenerator_" <PasswordBox x:Name="_passwordForPinGenerator_"
Margin="10" Margin="10"
Grid.Row="1" Grid.Row="1"
KeyUp="_passwordForPinGenerator__KeyUp"
PlaceholderText="Enter your password"/> PlaceholderText="Enter your password"/>
</Grid> </Grid>
<!-- buttons yes/no to generate a PIN. --> <!-- buttons yes/no to generate a PIN. -->
...@@ -1209,7 +1212,6 @@ ...@@ -1209,7 +1212,6 @@
Foreground="Black" Foreground="Black"
Background="White" Background="White"
TextWrapping="Wrap" TextWrapping="Wrap"
KeyDown="_ringTxtBx__KeyDown"
KeyUp="_ringTxtBx__KeyUp" KeyUp="_ringTxtBx__KeyUp"
Text=""> Text="">
</TextBox> </TextBox>
......
...@@ -177,7 +177,7 @@ SmartPanel::SmartPanel() ...@@ -177,7 +177,7 @@ SmartPanel::SmartPanel()
RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Views::SmartPanel::OncallPlaced); RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Views::SmartPanel::OncallPlaced);
RingD::instance->incomingAccountMessage += ref new RingClientUWP::IncomingAccountMessage(this, &RingClientUWP::Views::SmartPanel::OnincomingAccountMessage); RingD::instance->incomingAccountMessage += ref new RingClientUWP::IncomingAccountMessage(this, &RingClientUWP::Views::SmartPanel::OnincomingAccountMessage);
menuOpen = MenuOpen::CONTACTS_LIST; selectMenu(MenuOpen::CONTACTS_LIST);
} }
void void
...@@ -220,152 +220,10 @@ RingClientUWP::Views::SmartPanel::updatePageContent() ...@@ -220,152 +220,10 @@ RingClientUWP::Views::SmartPanel::updatePageContent()
} }
// refacto : rm me
void RingClientUWP::Views::SmartPanel::unselectContact()
{
// _smartList_->SelectedItem = nullptr;
}
void RingClientUWP::Views::SmartPanel::_smartGridButton__Clicked(Object^ sender, RoutedEventArgs^ e)
{
_accountsMenuButton__Unchecked(nullptr,nullptr);
_accountsMenuButton_->IsChecked = false;
_shareMenuButton__Unchecked(nullptr,nullptr);
_shareMenuButton_->IsChecked = false;
_devicesMenuButton__Unchecked(nullptr,nullptr);
_devicesMenuButton_->IsChecked = false;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Checked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen = MenuOpen::ACCOUNTS_LIST;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_shareMenuButton_->IsChecked = false;
_devicesMenuButton_->IsChecked = false;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Unchecked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_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;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
void RingClientUWP::Views::SmartPanel::_settingsMenu__Checked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen - MenuOpen::SETTINGS;
_accountsMenuButton__Unchecked(nullptr,nullptr);
_accountsMenuButton_->IsChecked = false;
_shareMenuButton__Unchecked(nullptr,nullptr);
_shareMenuButton_->IsChecked = false;
_devicesMenuButton__Unchecked(nullptr,nullptr);
_devicesMenuButton_->IsChecked = false;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
auto vcm = Video::VideoManager::instance->captureManager();
if (vcm->deviceList->Size > 0) {
if (!vcm->isInitialized)
vcm->InitializeCameraAsync(true);
else
vcm->StartPreviewAsync(true);
}
summonPreviewPage();
}
void RingClientUWP::Views::SmartPanel::_settingsMenu__Unchecked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
auto vcm = Video::VideoManager::instance->captureManager();
if (vcm->deviceList->Size > 0) {
vcm->StopPreviewAsync()
.then([](task<void> stopPreviewTask)
{
try {
stopPreviewTask.get();
Video::VideoManager::instance->captureManager()->isSettingsPreviewing = false;
}
catch (Exception^ e) {
WriteException(e);
}
});
}
hidePreviewPage();
}
void RingClientUWP::Views::SmartPanel::setMode(RingClientUWP::Views::SmartPanel::Mode mode) void RingClientUWP::Views::SmartPanel::setMode(RingClientUWP::Views::SmartPanel::Mode mode)
{ {
if (mode == RingClientUWP::Views::SmartPanel::Mode::Normal) { _rowRingTxtBx_->Height = (mode == RingClientUWP::Views::SmartPanel::Mode::Normal)? 40 : 0;
_rowRingTxtBx_->Height = 40; selectMenu(MenuOpen::CONTACTS_LIST);
_selectedAccountAvatarContainer_->Height = 80;
_shaderPhotoboothIcon_->Height = 80;
_selectedAccountAvatarColumn_->Width = 90;
_selectedAccountRow_->Height = 90;
}
else {
_rowRingTxtBx_->Height = 0;
_selectedAccountAvatarContainer_->Height = 50;
_shaderPhotoboothIcon_->Height = 50;
_selectedAccountAvatarColumn_->Width = 60;
_selectedAccountRow_->Height = 60;
}
_selectedAccountAvatarContainer_->Width = _selectedAccountAvatarContainer_->Height;
_shaderPhotoboothIcon_->Width = _shaderPhotoboothIcon_->Height;
_settingsMenuButton_->IsChecked = false;
_accountsMenuButton_->IsChecked = false;
_shareMenuButton_->IsChecked = false;
_devicesMenuButton_->IsChecked = false;
}
void RingClientUWP::Views::SmartPanel::_shareMenuButton__Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::SHARE;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton_->IsChecked = false;
_devicesMenuButton_->IsChecked = false;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
generateQRcode();
}
void RingClientUWP::Views::SmartPanel::_shareMenuButton__Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
} }
void RingClientUWP::Views::SmartPanel::_addAccountBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) void RingClientUWP::Views::SmartPanel::_addAccountBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
...@@ -414,14 +272,14 @@ void RingClientUWP::Views::SmartPanel::_createAccountYes__Click(Platform::Object ...@@ -414,14 +272,14 @@ void RingClientUWP::Views::SmartPanel::_createAccountYes__Click(Platform::Object
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed; _accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed; _accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton__Checked(nullptr, nullptr);
selectMenu(MenuOpen::ACCOUNTS_LIST);
} }
void RingClientUWP::Views::SmartPanel::_createAccountNo__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) void RingClientUWP::Views::SmartPanel::_createAccountNo__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{ {
_accountsMenuButton_->IsChecked = false; selectMenu(MenuOpen::ACCOUNTS_LIST);
_accountsMenuButton__Unchecked(nullptr,nullptr);
} }
/* using the usual selection behaviour doesn't allow us to deselect by simple click. The selection is managed /* using the usual selection behaviour doesn't allow us to deselect by simple click. The selection is managed
...@@ -458,30 +316,6 @@ SmartPanel::_accountList__SelectionChanged(Platform::Object^ sender, Windows::UI ...@@ -458,30 +316,6 @@ SmartPanel::_accountList__SelectionChanged(Platform::Object^ sender, Windows::UI
updatePageContent(); updatePageContent();
} }
// (XXX) use only KeyUp
void RingClientUWP::Views::SmartPanel::_ringTxtBx__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{
/* add contact, test purpose but will be reused later in some way */
//if (e->Key == Windows::System::VirtualKey::Enter && !_ringTxtBx_->Text->IsEmpty()) {
// for (auto it : SmartPanelItemsViewModel::instance->itemsList) {
// if (it->_contact->name_ == _ringTxtBx_->Text) {
// _smartList_->SelectedItem = it;
// _ringTxtBx_->Text = "";
// return;
// }
// }
// /* if the string has 40 chars, we simply consider it as a ring id. It has to be improved */
// if (_ringTxtBx_->Text->Length() == 40) {
// ContactsViewModel::instance->addNewContact(_ringTxtBx_->Text, _ringTxtBx_->Text);
// _ringTxtBx_->Text = "";
// }
// RingD::instance->lookUpName(_ringTxtBx_->Text);
//}
}
void RingClientUWP::Views::SmartPanel::_ringTxtBx__Click(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) void RingClientUWP::Views::SmartPanel::_ringTxtBx__Click(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{ {
RingD::instance->lookUpName(_ringTxtBx_->Text); RingD::instance->lookUpName(_ringTxtBx_->Text);
...@@ -593,19 +427,6 @@ void RingClientUWP::Views::SmartPanel::Grid_PointerExited(Platform::Object^ send ...@@ -593,19 +427,6 @@ void RingClientUWP::Views::SmartPanel::Grid_PointerExited(Platform::Object^ send
} }
} }
// refacto : rm
void RingClientUWP::Views::SmartPanel::_contactItem__PointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
{
/*auto listBoxItem = dynamic_cast<ListBoxItem^>(sender);
auto smartPanelItem = dynamic_cast<SmartPanelItem^>(listBoxItem->DataContext);
if (_smartList_->SelectedItem != smartPanelItem)
_smartList_->SelectedItem = smartPanelItem;
else
_smartList_->SelectedItem = nullptr;
*/
}
void RingClientUWP::Views::SmartPanel::generateQRcode() void RingClientUWP::Views::SmartPanel::generateQRcode()
{ {
auto ringId = AccountListItemsViewModel::instance->_selectedItem->_account->ringID_; auto ringId = AccountListItemsViewModel::instance->_selectedItem->_account->ringID_;
...@@ -901,51 +722,6 @@ Object ^ RingClientUWP::Views::NewMessageBubleNotification::ConvertBack(Object ^ ...@@ -901,51 +722,6 @@ Object ^ RingClientUWP::Views::NewMessageBubleNotification::ConvertBack(Object ^
RingClientUWP::Views::NewMessageBubleNotification::NewMessageBubleNotification() RingClientUWP::Views::NewMessageBubleNotification::NewMessageBubleNotification()
{} {}
void RingClientUWP::Views::SmartPanel::_devicesMenuButton__Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_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...";
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
void RingClientUWP::Views::SmartPanel::_devicesMenuButton__Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::DEVICE;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_waitingDevicesList_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_devicesIdList_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
auto account = AccountListItemsViewModel::instance->_selectedItem->_account;
_deviceId_->Text = account->_deviceId;
if (_deviceId_->Text->IsEmpty()) {
_deviceId_->Text = "No device id found!";
ERR_("device Id not found for account " + Utils::toString(account->_deviceId));
}
RingD::instance->askToRefreshKnownDevices(account->accountID_);
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton_->IsChecked = false;
_shareMenuButton_->IsChecked = false;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
void RingClientUWP::Views::SmartPanel::_addDevice__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) void RingClientUWP::Views::SmartPanel::_addDevice__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{ {
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed; _devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
...@@ -965,17 +741,7 @@ void RingClientUWP::Views::SmartPanel::OndevicesListRefreshed(Platform::Collecti ...@@ -965,17 +741,7 @@ void RingClientUWP::Views::SmartPanel::OndevicesListRefreshed(Platform::Collecti
void RingClientUWP::Views::SmartPanel::_pinGeneratorYes__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) void RingClientUWP::Views::SmartPanel::_pinGeneratorYes__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{ {
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed; requestPin();
_waitingForPin_->Visibility = Windows::UI::Xaml::Visibility::Visible;
auto accountId = AccountListItemsViewModel::instance->_selectedItem->_account->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);
} }
...@@ -984,6 +750,8 @@ void RingClientUWP::Views::SmartPanel::_pinGeneratorNo__Click(Platform::Object^ ...@@ -984,6 +750,8 @@ void RingClientUWP::Views::SmartPanel::_pinGeneratorNo__Click(Platform::Object^
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed; _addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuButton_->IsChecked = false; _devicesMenuButton_->IsChecked = false;
_passwordForPinGenerator_->Password = ""; _passwordForPinGenerator_->Password = "";
selectMenu(MenuOpen::CONTACTS_LIST);
} }
...@@ -997,8 +765,7 @@ void RingClientUWP::Views::SmartPanel::OnexportOnRingEnded(Platform::String ^acc ...@@ -997,8 +765,7 @@ void RingClientUWP::Views::SmartPanel::OnexportOnRingEnded(Platform::String ^acc
void RingClientUWP::Views::SmartPanel::_closePin__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) void RingClientUWP::Views::SmartPanel::_closePin__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{ {
_waitingForPin_->Visibility = Windows::UI::Xaml::Visibility::Collapsed; selectMenu(MenuOpen::CONTACTS_LIST);
_devicesMenuButton_->IsChecked = false;
// refacto : do something better... // refacto : do something better...
_waitingAndResult_->Text = "Exporting account on the Ring..."; _waitingAndResult_->Text = "Exporting account on the Ring...";
...@@ -1007,9 +774,7 @@ void RingClientUWP::Views::SmartPanel::_closePin__Click(Platform::Object^ sender ...@@ -1007,9 +774,7 @@ void RingClientUWP::Views::SmartPanel::_closePin__Click(Platform::Object^ sender
void RingClientUWP::Views::SmartPanel::_shareMenuDone__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)