summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/AccountListDialog.cpp
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-11-27 14:20:42 -0600
committerAndrew <forkk@forkk.net>2013-11-27 14:20:42 -0600
commitd794a4d0bfac0341c15bd5273e8dc81fe82531ef (patch)
tree23cdea484bd18b7abee2ce0e6e61e5ff03cb1214 /gui/dialogs/AccountListDialog.cpp
parent7e87278da9fa8afcaab53a00e2d670371a4ab52d (diff)
parent38732636d3c1f1563c2dceeae723fd51f7b5fda6 (diff)
downloadMultiMC-d794a4d0bfac0341c15bd5273e8dc81fe82531ef.tar
MultiMC-d794a4d0bfac0341c15bd5273e8dc81fe82531ef.tar.gz
MultiMC-d794a4d0bfac0341c15bd5273e8dc81fe82531ef.tar.lz
MultiMC-d794a4d0bfac0341c15bd5273e8dc81fe82531ef.tar.xz
MultiMC-d794a4d0bfac0341c15bd5273e8dc81fe82531ef.zip
Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop
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();
}