summaryrefslogtreecommitdiffstats
path: root/gui/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-01-29 23:52:37 -0600
committerAndrew <forkk@forkk.net>2013-01-29 23:52:37 -0600
commit90764f97d94a52517d735ed96d26bb52a2d75de1 (patch)
tree082db6f2a45778b65f3bcc91177f27d1b126a673 /gui/mainwindow.cpp
parentdcc21b7e649f79fa0cac75507ba9a314735744d9 (diff)
downloadMultiMC-90764f97d94a52517d735ed96d26bb52a2d75de1.tar
MultiMC-90764f97d94a52517d735ed96d26bb52a2d75de1.tar.gz
MultiMC-90764f97d94a52517d735ed96d26bb52a2d75de1.tar.lz
MultiMC-90764f97d94a52517d735ed96d26bb52a2d75de1.tar.xz
MultiMC-90764f97d94a52517d735ed96d26bb52a2d75de1.zip
Add instance toolbar.
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r--gui/mainwindow.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index e2a3abfb..e257f5ae 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -32,6 +32,9 @@ MainWindow::MainWindow(QWidget *parent) :
setWindowTitle(QString("MultiMC %1").arg(Version::current.toString()));
+ restoreGeometry(settings->getConfig().value("MainWindowGeometry", saveGeometry()).toByteArray());
+ restoreState(settings->getConfig().value("MainWindowState", saveState()).toByteArray());
+
instList.initialLoad("instances");
ui->instanceView->setModel(&instList);
}
@@ -86,3 +89,18 @@ void MainWindow::on_actionAbout_triggered()
{
}
+
+void MainWindow::on_mainToolBar_visibilityChanged(bool)
+{
+ // Don't allow hiding the main toolbar.
+ // This is the only way I could find to prevent it... :/
+ ui->mainToolBar->setVisible(true);
+}
+
+void MainWindow::closeEvent(QCloseEvent *event)
+{
+ // Save the window state and geometry.
+ settings->getConfig().setValue("MainWindowGeometry", saveGeometry());
+ settings->getConfig().setValue("MainWindowState", saveState());
+ QMainWindow::closeEvent(event);
+}