summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/AccountListDialog.cpp
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-11-22 12:47:39 -0600
committerAndrew <forkk@forkk.net>2013-11-22 12:47:39 -0600
commit75e7932607bdd84d2867765eb6f07dcec95ee193 (patch)
tree9ee711dac0a07f6797eedf3ee61d277bb3b63c2c /gui/dialogs/AccountListDialog.cpp
parent23bc195b3c8558cb997789ca8772342612716993 (diff)
downloadMultiMC-75e7932607bdd84d2867765eb6f07dcec95ee193.tar
MultiMC-75e7932607bdd84d2867765eb6f07dcec95ee193.tar.gz
MultiMC-75e7932607bdd84d2867765eb6f07dcec95ee193.tar.lz
MultiMC-75e7932607bdd84d2867765eb6f07dcec95ee193.tar.xz
MultiMC-75e7932607bdd84d2867765eb6f07dcec95ee193.zip
Properly implement launching and downloading
Also added a system to select an active account to log in with.
Diffstat (limited to 'gui/dialogs/AccountListDialog.cpp')
-rw-r--r--gui/dialogs/AccountListDialog.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gui/dialogs/AccountListDialog.cpp b/gui/dialogs/AccountListDialog.cpp
index 838bef7f..c685c164 100644
--- a/gui/dialogs/AccountListDialog.cpp
+++ b/gui/dialogs/AccountListDialog.cpp
@@ -34,6 +34,7 @@ AccountListDialog::AccountListDialog(QWidget *parent) :
ui->setupUi(this);
m_accounts = MMC->accounts();
+ // TODO: Make the "Active?" column show checkboxes or radio buttons.
ui->listView->setModel(m_accounts.get());
}
@@ -63,6 +64,17 @@ void AccountListDialog::on_editAccountBtn_clicked()
// TODO
}
+void AccountListDialog::on_setActiveBtn_clicked()
+{
+ QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
+ if (selection.size() > 0)
+ {
+ QModelIndex selected = selection.first();
+ MojangAccountPtr account = selected.data(MojangAccountList::PointerRole).value<MojangAccountPtr>();
+ m_accounts->setActiveAccount(account->username());
+ }
+}
+
void AccountListDialog::on_closeBtnBox_rejected()
{
close();