Commit 797fa1ae authored by atraczyk's avatar atraczyk Committed by Andreas Traczyk

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
......@@ -29,11 +29,13 @@ using namespace RingClientUWP;
Account::Account(String^ name,
String^ ringID,
String^ accountType)
String^ accountType,
String^ accountID)
{
name_ = name;
ringID_ = ringID;
accountType_ = accountType;
accountID_ = accountID;
}
void
......
......@@ -27,13 +27,14 @@ namespace RingClientUWP
public ref class Account sealed : public INotifyPropertyChanged
{
public:
Account(String^ name, String^ ringID, String^ accountType);
Account(String^ name, String^ ringID, String^ accountType, String^ accountID);
virtual event PropertyChangedEventHandler^ PropertyChanged;
property String^ name_;
property String^ ringID_;
property String^ accountType_;
property String^ accountID_;
protected:
void NotifyPropertyChanged(String^ propertyName);
......
......@@ -29,12 +29,13 @@ AccountsViewModel::AccountsViewModel()
}
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(
Utils::toPlatformString(name),
Utils::toPlatformString(ringID),
Utils::toPlatformString(accountType)
Utils::toPlatformString(accountType),
Utils::toPlatformString(accountID)
));
}
......
......@@ -42,7 +42,7 @@ internal:
}
/* 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();
/* properties */
......
......@@ -56,7 +56,8 @@ RingClientUWP::RingD::reloadAccountList()
RingClientUWP::ViewModel::AccountsViewModel::instance->add(
accountDetails.find(ring::Conf::CONFIG_ACCOUNT_ALIAS)->second, //name
ringID, //ringid
accountDetails.find(ring::Conf::CONFIG_ACCOUNT_TYPE)->second); //type
accountDetails.find(ring::Conf::CONFIG_ACCOUNT_TYPE)->second, //type
*rit);
}
// load user preferences
Configuration::UserPreferences::instance->load();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment