mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-14 12:37:23 +00:00
Main window geometry and state saving/reloading
This commit is contained in:
@@ -336,6 +336,10 @@ void MultiMC::initGlobalSettings()
|
||||
QUuid uuid = QUuid::createUuid();
|
||||
m_settings->set("YggdrasilClientToken", uuid.toString());
|
||||
}
|
||||
|
||||
// Window state and geometry
|
||||
m_settings->registerSetting(new Setting("MainWindowState", ""));
|
||||
m_settings->registerSetting(new Setting("MainWindowGeometry", ""));
|
||||
}
|
||||
|
||||
void MultiMC::initHttpMetaCache()
|
||||
@@ -398,6 +402,8 @@ int main_gui(MultiMC &app)
|
||||
{
|
||||
// show main window
|
||||
MainWindow mainWin;
|
||||
mainWin.restoreState(QByteArray::fromBase64(MMC->settings()->get("MainWindowState").toByteArray()));
|
||||
mainWin.restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("MainWindowGeometry").toByteArray()));
|
||||
mainWin.show();
|
||||
mainWin.checkSetDefaultJava();
|
||||
return app.exec();
|
||||
|
||||
Reference in New Issue
Block a user