From ddd76ecac83e3b81f4a1116a4d43a774b40a12d6 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 15 Sep 2014 17:16:46 +0200 Subject: [PATCH] Fixed #67. --- resources/text/CHANGELOG | 2 +- src/gui/formmain.cpp | 21 ++++++++++++--------- src/gui/formmain.h | 3 --- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index 50be2435d..25789c41d 100644 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -3,7 +3,7 @@ Fixed: diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp index 52f8ea119..e48edb883 100755 --- a/src/gui/formmain.cpp +++ b/src/gui/formmain.cpp @@ -151,11 +151,6 @@ void FormMain::prepareMenus() { } } -void FormMain::quit() { - qDebug("Quitting the application."); - qApp->quit(); -} - void FormMain::switchFullscreenMode() { if (!isFullScreen()) { showFullScreen(); @@ -279,11 +274,13 @@ void FormMain::loadSize() { m_ui->m_actionFullscreen->setChecked(true); } - // Hide the main menu if user wants it. - if (!settings->value(APP_CFG_GUI, "main_menu_visible", true).toBool()) { - m_ui->m_actionSwitchMainMenu->setChecked(false); + if (settings->value(APP_CFG_GUI, "window_is_maximized", false).toBool()) { + setWindowState(windowState() | Qt::WindowMaximized); } + // Hide the main menu if user wants it. + m_ui->m_actionSwitchMainMenu->setChecked(settings->value(APP_CFG_GUI, "main_menu_visible", true).toBool()); + // Adjust dimensions of "feeds & messages" widget. m_ui->m_tabWidget->feedMessageViewer()->loadSize(); m_ui->m_actionSwitchToolBars->setChecked(settings->value(APP_CFG_GUI, "enable_toolbars", true).toBool()); @@ -293,14 +290,20 @@ void FormMain::loadSize() { void FormMain::saveSize() { Settings *settings = qApp->settings(); bool is_fullscreen = isFullScreen(); + bool is_maximized = isMaximized(); if (is_fullscreen) { m_ui->m_actionFullscreen->setChecked(false); } + if (is_maximized) { + setWindowState(windowState() & ~Qt::WindowMaximized); + } + settings->setValue(APP_CFG_GUI, "main_menu_visible", m_ui->m_actionSwitchMainMenu->isChecked()); settings->setValue(APP_CFG_GUI, "window_position", pos()); settings->setValue(APP_CFG_GUI, "window_size", size()); + settings->setValue(APP_CFG_GUI, "window_is_maximized", is_maximized); settings->setValue(APP_CFG_GUI, "start_in_fullscreen", is_fullscreen); m_ui->m_tabWidget->feedMessageViewer()->saveSize(); @@ -314,7 +317,7 @@ void FormMain::createConnections() { // Menu "File" connections. connect(m_ui->m_actionExportFeeds, SIGNAL(triggered()), this, SLOT(exportFeeds())); connect(m_ui->m_actionImportFeeds, SIGNAL(triggered()), this, SLOT(importFeeds())); - connect(m_ui->m_actionQuit, SIGNAL(triggered()), this, SLOT(quit())); + connect(m_ui->m_actionQuit, SIGNAL(triggered()), qApp, SLOT(quit())); // Menu "View" connections. connect(m_ui->m_actionFullscreen, SIGNAL(toggled(bool)), this, SLOT(switchFullscreenMode())); diff --git a/src/gui/formmain.h b/src/gui/formmain.h index 5b0f96134..c5b23d984 100755 --- a/src/gui/formmain.h +++ b/src/gui/formmain.h @@ -78,9 +78,6 @@ class FormMain : public QMainWindow { void setupIcons(); public slots: - // Quits the application. - void quit(); - // Displays window on top or switches its visibility. void display();