aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/controllerpasswords.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/controllerpasswords.cpp')
-rw-r--r--linden/indra/newview/controllerpasswords.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/linden/indra/newview/controllerpasswords.cpp b/linden/indra/newview/controllerpasswords.cpp
new file mode 100644
index 0000000..6e39d9a
--- /dev/null
+++ b/linden/indra/newview/controllerpasswords.cpp
@@ -0,0 +1,41 @@
1/*
2 * controllerpasswords.cpp
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "authentication_model.h"
10#include "prefpanelpasswords.h"
11#include "controllerpasswords.h"
12
13PasswordsController::PasswordsController(PasswordsPrefPanel *panel)
14: mPanel(panel)
15{
16 accounts_list = mPanel->getChild<LLScrollListCtrl>("accounts_list");
17 remove_btn = mPanel->getChild<LLButton>("remove_btn");
18 mModel = AuthenticationModel::getInstance();
19
20 // subscribe to the model
21 mModelConnection = mModel->subscribeToModelUpdates(boost::bind(&PasswordsController::update, this));
22 // request an initial update
23 mModel->requestUpdate();
24}
25
26PasswordsController::~PasswordsController()
27{
28 mModel->unsubscribe(mModelConnection);
29 mModel = NULL;
30}
31
32void PasswordsController::update()
33{
34 std::list<std::string> newAccountData;
35 mModel->getAllAccountNames(newAccountData);
36
37 if(mAccountData == newAccountData)
38 return;
39
40 accounts_list->deleteAllItems();
41}