Use player face in accounts dropdown, grab all valid account skins on startup

This commit is contained in:
Sky 2013-11-27 22:47:15 +00:00
parent 69d8ab16c5
commit 70973d111a

View File

@ -191,7 +191,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
ui->mainToolBar->addAction(accountMenuButtonAction);
MojangAccountPtr account = MMC->accounts()->activeAccount();
std::shared_ptr<MojangAccountList> accounts = MMC->accounts();
// TODO: Nicer way to iterate?
for(int i = 0; i < accounts->count(); i++)
{
MojangAccountPtr account = accounts->at(i);
if(account != nullptr)
{
auto job = new NetJob("Startup player skins: " + account->username());
@ -209,6 +214,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
connect(job, SIGNAL(succeeded()), SLOT(activeAccountChanged()));
job->start();
}
}
// run the things that load and download other things... FIXME: this is NOT the place
// FIXME: invisible actions in the background = NOPE.
@ -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()));
}