Commit 82f8dda3 authored by atraczyk's avatar atraczyk Committed by Andreas Traczyk

Internal: populate account list from daemon

- Fills the account list after retrieving account list
  details form the daemon

Change-Id: I654fb554704049a942979de07a1b6b01ec513051
Tuleap: #962
parent ebec625c
......@@ -23,10 +23,20 @@ using namespace ViewModel;
AccountsViewModel::AccountsViewModel()
{
/* accountList_ should be filled with accounts saved on the disk */
accountsList_ = ref new Vector<Account^>();
}
accountsList_->Append(ref new Account("Moi","jfdhfshfhsk"));
accountsList_->Append(ref new Account("SuperMan", "jfdhfshfhsk"));
accountsList_->Append(ref new Account("Travail", "jfdhfshfhsk"));
void
AccountsViewModel::add(std::string& name, std::string& ringid)
{
accountsList_->Append(ref new Account(
Utils::toPlatformString(name),
Utils::toPlatformString(ringid)
));
}
void
AccountsViewModel::clearAccountList()
{
accountsList_->Clear();
}
\ No newline at end of file
......@@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
using namespace Platform::Collections;
namespace RingClientUWP
......@@ -36,6 +37,8 @@ internal:
}
/* functions */
void add(std::string& name, std::string& ringid);
void clearAccountList();
/* properties */
property Vector<Account^>^ accountsList
......
This diff is collapsed.
......@@ -338,6 +338,7 @@
Width="320"
TextWrapping="Wrap"
Style="{StaticResource TextBoxStyle1}"
KeyDown="_ringTxtBx__KeyDown"
Text=""/>
<ListBox x:Name="_smartList_"
Grid.Row="1"
......
This diff is collapsed.
......@@ -51,6 +51,7 @@ private:
void _createAccountNo__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void _avatarWebcamCaptureBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void _smartList__SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
void _ringTxtBx__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
};
}
}
\ No newline at end of file
......@@ -6,7 +6,8 @@ using namespace Windows::Storage;
namespace RingClientUWP
{
namespace Utils {
namespace Utils
{
task<bool>
fileExists(StorageFolder^ folder, String^ fileName)
......@@ -72,5 +73,6 @@ Platform::String^ toPlatformString(const std::string& str)
std::wstring wsstr = makeWString(str);
return ref new Platform::String(wsstr.c_str(), wsstr.length());
}
}
}
\ No newline at end of file
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