Properly implement launching and downloading
Also added a system to select an active account to log in with.
This commit is contained in:
@ -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();
|
||||
|
@ -42,6 +42,8 @@ slots:
|
||||
|
||||
void on_editAccountBtn_clicked();
|
||||
|
||||
void on_setActiveBtn_clicked();
|
||||
|
||||
// This will be sent when the "close" button is clicked.
|
||||
void on_closeBtnBox_rejected();
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QListView" name="listView"/>
|
||||
<widget class="QTreeView" name="listView"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="manageAcctsBtnBox">
|
||||
@ -65,6 +65,16 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="setActiveBtn">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Set the currently selected account as the active account. The active account is the account that is used to log in (unless it is overridden in an instance-specific setting).</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Set Active</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Reference in New Issue
Block a user