summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-11-27 22:47:15 +0000
committerSky <git@bunnies.cc>2013-11-27 22:47:15 +0000
commit70973d111a35c65072b9431420d3d854bd82e8f5 (patch)
tree304c235d1690b60c56a1161558ca7681cabffda9 /gui/MainWindow.cpp
parent69d8ab16c58509bafb98694f9aa998ae51ff4b7f (diff)
downloadMultiMC-70973d111a35c65072b9431420d3d854bd82e8f5.tar
MultiMC-70973d111a35c65072b9431420d3d854bd82e8f5.tar.gz
MultiMC-70973d111a35c65072b9431420d3d854bd82e8f5.tar.lz
MultiMC-70973d111a35c65072b9431420d3d854bd82e8f5.tar.xz
MultiMC-70973d111a35c65072b9431420d3d854bd82e8f5.zip
Use player face in accounts dropdown, grab all valid account skins on startup
Diffstat (limited to 'gui/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index 5295a8a5..2917bf95 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -191,23 +191,29 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
ui->mainToolBar->addAction(accountMenuButtonAction);
- MojangAccountPtr account = MMC->accounts()->activeAccount();
- if(account != nullptr)
- {
- auto job = new NetJob("Startup player skins: " + account->username());
+ std::shared_ptr<MojangAccountList> accounts = MMC->accounts();
- for(AccountProfile profile : account->profiles())
+ // TODO: Nicer way to iterate?
+ for(int i = 0; i < accounts->count(); i++)
+ {
+ MojangAccountPtr account = accounts->at(i);
+ if(account != nullptr)
{
- 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;
- }
+ auto job = new NetJob("Startup player skins: " + account->username());
- connect(job, SIGNAL(succeeded()), SLOT(activeAccountChanged()));
- job->start();
+ 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()), SLOT(activeAccountChanged()));
+ job->start();
+ }
}
// run the things that load and download other things... FIXME: this is NOT the place
@@ -285,6 +291,7 @@ void MainWindow::repopulateAccountsMenu()
action->setChecked(true);
}
+ action->setIcon(SkinUtils::getFaceFromCache(profile.name()));
accountMenu->addAction(action);
connect(action, SIGNAL(triggered(bool)), SLOT(changeActiveAccount()));
}