From 90764f97d94a52517d735ed96d26bb52a2d75de1 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 29 Jan 2013 23:52:37 -0600 Subject: Add instance toolbar. --- gui/mainwindow.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gui/mainwindow.cpp') 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); +} -- cgit v1.2.3