Skip to content
Snippets Groups Projects
Commit 797fa1ae authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Andreas Traczyk
Browse files

accounts: adds an account ID property to the Account class

- adds account id property to the Account class
- adds reference to account ID in AccountsViewModel
- adds loading of account ID in RingD::reloadAccountList

Change-Id: I757443fb08e3f48f1e39f2b21785384d6f41d8b6
Tuleap: #976
parent 93abfeaf
No related branches found
No related tags found
No related merge requests found
...@@ -29,11 +29,13 @@ using namespace RingClientUWP; ...@@ -29,11 +29,13 @@ using namespace RingClientUWP;
Account::Account(String^ name, Account::Account(String^ name,
String^ ringID, String^ ringID,
String^ accountType) String^ accountType,
String^ accountID)
{ {
name_ = name; name_ = name;
ringID_ = ringID; ringID_ = ringID;
accountType_ = accountType; accountType_ = accountType;
accountID_ = accountID;
} }
void void
......
...@@ -27,13 +27,14 @@ namespace RingClientUWP ...@@ -27,13 +27,14 @@ namespace RingClientUWP
public ref class Account sealed : public INotifyPropertyChanged public ref class Account sealed : public INotifyPropertyChanged
{ {
public: public:
Account(String^ name, String^ ringID, String^ accountType); Account(String^ name, String^ ringID, String^ accountType, String^ accountID);
virtual event PropertyChangedEventHandler^ PropertyChanged; virtual event PropertyChangedEventHandler^ PropertyChanged;
property String^ name_; property String^ name_;
property String^ ringID_; property String^ ringID_;
property String^ accountType_; property String^ accountType_;
property String^ accountID_;
protected: protected:
void NotifyPropertyChanged(String^ propertyName); void NotifyPropertyChanged(String^ propertyName);
......
...@@ -29,12 +29,13 @@ AccountsViewModel::AccountsViewModel() ...@@ -29,12 +29,13 @@ AccountsViewModel::AccountsViewModel()
} }
void void
AccountsViewModel::add(std::string& name, std::string& ringID, std::string& accountType) AccountsViewModel::add(std::string& name, std::string& ringID, std::string& accountType, std::string& accountID)
{ {
accountsList_->Append(ref new Account( accountsList_->Append(ref new Account(
Utils::toPlatformString(name), Utils::toPlatformString(name),
Utils::toPlatformString(ringID), Utils::toPlatformString(ringID),
Utils::toPlatformString(accountType) Utils::toPlatformString(accountType),
Utils::toPlatformString(accountID)
)); ));
} }
......
...@@ -42,7 +42,7 @@ internal: ...@@ -42,7 +42,7 @@ internal:
} }
/* functions */ /* functions */
void add(std::string& name, std::string& ringID, std::string& accountType); void add(std::string& name, std::string& ringID, std::string& accountType, std::string& accountID);
void clearAccountList(); void clearAccountList();
/* properties */ /* properties */
......
...@@ -56,7 +56,8 @@ RingClientUWP::RingD::reloadAccountList() ...@@ -56,7 +56,8 @@ RingClientUWP::RingD::reloadAccountList()
RingClientUWP::ViewModel::AccountsViewModel::instance->add( RingClientUWP::ViewModel::AccountsViewModel::instance->add(
accountDetails.find(ring::Conf::CONFIG_ACCOUNT_ALIAS)->second, //name accountDetails.find(ring::Conf::CONFIG_ACCOUNT_ALIAS)->second, //name
ringID, //ringid ringID, //ringid
accountDetails.find(ring::Conf::CONFIG_ACCOUNT_TYPE)->second); //type accountDetails.find(ring::Conf::CONFIG_ACCOUNT_TYPE)->second, //type
*rit);
} }
// load user preferences // load user preferences
Configuration::UserPreferences::instance->load(); Configuration::UserPreferences::instance->load();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment