Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-uwp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-uwp
Commits
5a197d5c
Commit
5a197d5c
authored
Oct 25, 2016
by
Nicolas Jager
Browse files
Options
Downloads
Patches
Plain Diff
smartpanel : delete ring account from the panel
Change-Id: Ie40094e31cfb975ea7f518f068b6c38eb5504e6b Tuleap: #1246
parent
d8e49595
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
AccountListItem.h
+3
-2
3 additions, 2 deletions
AccountListItem.h
AccountListItemsViewModel.cpp
+11
-0
11 additions, 0 deletions
AccountListItemsViewModel.cpp
AccountListItemsViewModel.h
+1
-0
1 addition, 0 deletions
AccountListItemsViewModel.h
SmartPanel.xaml.cpp
+12
-10
12 additions, 10 deletions
SmartPanel.xaml.cpp
with
27 additions
and
12 deletions
AccountListItem.h
+
3
−
2
View file @
5a197d5c
...
@@ -37,6 +37,7 @@ public:
...
@@ -37,6 +37,7 @@ public:
property
bool
_isSelected
{
property
bool
_isSelected
{
void
set
(
bool
value
)
{
void
set
(
bool
value
)
{
isSelected_
=
value
;
isSelected_
=
value
;
if
(
!
_disconnected
)
NotifyPropertyChanged
(
"_isSelected"
);
NotifyPropertyChanged
(
"_isSelected"
);
}
}
bool
get
()
{
bool
get
()
{
...
@@ -44,13 +45,13 @@ public:
...
@@ -44,13 +45,13 @@ public:
}
}
}
}
property
bool
_editionMode
;
property
bool
_editionMode
;
property
bool
_disconnected
;
protected
:
protected
:
void
NotifyPropertyChanged
(
String
^
propertyName
);
void
NotifyPropertyChanged
(
String
^
propertyName
);
private
:
private
:
bool
isSelected_
;
bool
isSelected_
;
};
};
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
AccountListItemsViewModel.cpp
+
11
−
0
View file @
5a197d5c
...
@@ -60,3 +60,14 @@ RingClientUWP::ViewModel::AccountListItemsViewModel::findItem(String^ accountId)
...
@@ -60,3 +60,14 @@ RingClientUWP::ViewModel::AccountListItemsViewModel::findItem(String^ accountId)
return
nullptr
;
return
nullptr
;
}
}
void
RingClientUWP
::
ViewModel
::
AccountListItemsViewModel
::
removeItem
(
AccountListItem
^
item
)
{
unsigned
int
index
;
itemsList_
->
IndexOf
(
item
,
&
index
);
item
->
_disconnected
=
true
;
// avoid disconected exception.
itemsList_
->
RemoveAt
(
index
);
}
This diff is collapsed.
Click to expand it.
AccountListItemsViewModel.h
+
1
−
0
View file @
5a197d5c
...
@@ -43,6 +43,7 @@ internal:
...
@@ -43,6 +43,7 @@ internal:
/* functions */
/* functions */
AccountListItem
^
findItem
(
String
^
accountId
);
AccountListItem
^
findItem
(
String
^
accountId
);
void
removeItem
(
AccountListItem
^
item
);
/* properties */
/* properties */
property
Vector
<
AccountListItem
^>^
itemsList
property
Vector
<
AccountListItem
^>^
itemsList
...
...
This diff is collapsed.
Click to expand it.
SmartPanel.xaml.cpp
+
12
−
10
View file @
5a197d5c
...
@@ -727,6 +727,8 @@ void RingClientUWP::Views::SmartPanel::_editAccountMenuButton__Click(Platform::O
...
@@ -727,6 +727,8 @@ void RingClientUWP::Views::SmartPanel::_editAccountMenuButton__Click(Platform::O
auto
account
=
AccountListItemsViewModel
::
instance
->
_selectedItem
->
_account
;
auto
account
=
AccountListItemsViewModel
::
instance
->
_selectedItem
->
_account
;
_aliasTextBoxEditionMenu_
->
Text
=
account
->
name_
;
_aliasTextBoxEditionMenu_
->
Text
=
account
->
name_
;
_accountEditionMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_accountEditionMenuGrid_
->
Visibility
=
Windows
::
UI
::
Xaml
::
Visibility
::
Visible
;
_deleteAccountBtnEditionMenu_
->
IsChecked
=
false
;
_deleteAccountBtnEditionMenu_
->
IsEnabled
=
(
AccountListItemsViewModel
::
instance
->
itemsList
->
Size
>
1
)
?
true
:
false
;
}
}
...
@@ -739,19 +741,19 @@ void RingClientUWP::Views::SmartPanel::_acceptAccountModification__Click(Platfor
...
@@ -739,19 +741,19 @@ void RingClientUWP::Views::SmartPanel::_acceptAccountModification__Click(Platfor
// mettre ca en visibility du bouton delete
// mettre ca en visibility du bouton delete
auto
accountsListSize
=
dynamic_cast
<
Vector
<
AccountListItem
^>^>
(
_accountsList_
->
ItemsSource
)
->
Size
;
auto
accountsListSize
=
dynamic_cast
<
Vector
<
AccountListItem
^>^>
(
_accountsList_
->
ItemsSource
)
->
Size
;
/* if the delete button is toggled, just delete the account */
if
(
_deleteAccountBtnEditionMenu_
->
IsChecked
&&
accountsListSize
>
1
)
{
if
(
_deleteAccountBtnEditionMenu_
->
IsChecked
&&
accountsListSize
>
1
)
{
RingD
::
instance
->
deleteAccount
(
accountId
);
AccountListItem
^
item
;
for
each
(
item
in
AccountListItemsViewModel
::
instance
->
itemsList
)
if
(
item
->
_account
->
accountID_
==
accountId
)
break
;
/* rebuild a new list of accounts without the one to delete */
if
(
item
)
auto
newAccountList
=
ref
new
Vector
<
AccountListItem
^>
();
AccountListItemsViewModel
::
instance
->
removeItem
(
item
);
for
each
(
AccountListItem
^
item
in
AccountListItemsViewModel
::
instance
->
itemsList
)
{
if
(
item
->
_account
->
accountID_
!=
accountId
)
newAccountList
->
Append
(
item
);
}
_accountsList_
->
ItemsSource
=
newA
ccount
List
;
RingD
::
instance
->
deleteAccount
(
a
ccount
Id
)
;
}
else
{
}
else
{
/* otherwise edit the account */
account
->
name_
=
_aliasTextBoxEditionMenu_
->
Text
;
account
->
name_
=
_aliasTextBoxEditionMenu_
->
Text
;
account
->
_upnpState
=
_upnpState_
->
IsOn
;
account
->
_upnpState
=
_upnpState_
->
IsOn
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment