summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/AccountListDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/dialogs/AccountListDialog.cpp')
-rw-r--r--gui/dialogs/AccountListDialog.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/gui/dialogs/AccountListDialog.cpp b/gui/dialogs/AccountListDialog.cpp
index c685c164..ea6861c6 100644
--- a/gui/dialogs/AccountListDialog.cpp
+++ b/gui/dialogs/AccountListDialog.cpp
@@ -21,6 +21,7 @@
#include <logger/QsLog.h>
#include <logic/auth/AuthenticateTask.h>
+#include <logic/net/NetJob.h>
#include <gui/dialogs/LoginDialog.h>
#include <gui/dialogs/ProgressDialog.h>
@@ -56,6 +57,8 @@ void AccountListDialog::on_rmAccountBtn_clicked()
{
QModelIndex selected = selection.first();
m_accounts->removeAccount(selected);
+
+ emit activeAccountChanged();
}
}
@@ -72,7 +75,9 @@ void AccountListDialog::on_setActiveBtn_clicked()
QModelIndex selected = selection.first();
MojangAccountPtr account = selected.data(MojangAccountList::PointerRole).value<MojangAccountPtr>();
m_accounts->setActiveAccount(account->username());
- }
+
+ emit activeAccountChanged();
+ }
}
void AccountListDialog::on_closeBtnBox_rejected()
@@ -108,5 +113,21 @@ void AccountListDialog::onLoginComplete()
MojangAccountPtr account = m_authTask->getMojangAccount();
m_accounts->addAccount(account);
//ui->listView->update();
+
+ // Grab associated player skins
+ auto job = new NetJob("Player skins: " + account->username());
+
+ for(AccountProfile profile : account->profiles())
+ {
+ auto meta = MMC->metacache()->resolveEntry("skins", profile.name() + ".png");
+ auto action = CacheDownload::make(
+ QUrl("http://skins.minecraft.net/MinecraftSkins/" + profile.name() + ".png"),
+ meta);
+ job->addNetAction(action);
+ meta->stale = true;
+ }
+
+ connect(job, SIGNAL(succeeded()), SIGNAL(activeAccountChanged()));
+ job->start();
}