From ce534d2536a5f7bc47f8313a395ebdcbcf118414 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 29 Apr 2019 22:41:10 +0200 Subject: [PATCH] Allow to reset window size from launcher --- src/blackgui/guiapplication.cpp | 5 +++-- src/swiftlauncher/swiftlauncher.cpp | 7 +++--- src/swiftlauncher/swiftlauncher.ui | 35 +++++++++++++++++------------ 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/blackgui/guiapplication.cpp b/src/blackgui/guiapplication.cpp index 45f620ec6..873cfb871 100644 --- a/src/blackgui/guiapplication.cpp +++ b/src/blackgui/guiapplication.cpp @@ -378,13 +378,14 @@ namespace BlackGui { if (!window) { return false; } const QSettings settings("swift-project.org", this->getApplicationName()); + const QString location = settings.fileName(); + CLogMessage(this).info(u"GUI settings are here: '%1'") << location; + const QByteArray g = settings.value("geometry").toByteArray(); const QByteArray s = settings.value("windowState").toByteArray(); if (g.isEmpty() || s.isEmpty()) { return false; } window->restoreGeometry(g); window->restoreState(s); - const QString location = settings.fileName(); - CLogMessage(this).info(u"GUI settings are here: '%1'") << location; return true; } diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index ca1f1e66a..f79860220 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -246,10 +246,8 @@ bool CSwiftLauncher::setSwiftCoreExecutable() if (!sGui || sGui->isShuttingDown()) { return false; } this->saveSetup(); QStringList args = ui->comp_DBusSelector->getDBusCmdLineArgs(); - if (ui->rb_SwiftCoreAudioOnCore->isChecked()) - { - args.append("--coreaudio"); - } + if (ui->rb_SwiftCoreAudioOnCore->isChecked()) { args.append("--coreaudio"); } + if (ui->cb_resetWindow->isChecked()) { args.append("--resetsize"); } m_executableArgs = sGui->argumentsJoined(args); m_executable = CDirectoryUtils::executableFilePath(CBuildConfig::swiftCoreExecutableName()); @@ -273,6 +271,7 @@ bool CSwiftLauncher::setSwiftGuiExecutable() "--window", CEnableForFramelessWindow::windowModeToString(getWindowMode()) }; + if (ui->cb_resetWindow->isChecked()) { args << "--resetsize"; } if (!this->isStandaloneGuiSelected()) { const QString dBus(ui->comp_DBusSelector->getDBusAddress()); diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index 162336a0d..9c45ad057 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -559,16 +559,6 @@ 1 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - @@ -701,6 +691,23 @@ + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + reset window + + + @@ -756,9 +763,9 @@ - BlackGui::COverlayMessagesFrame + BlackGui::Components::CDbLoadOverviewComponent QFrame -
blackgui/overlaymessagesframe.h
+
blackgui/components/dbloadoverviewcomponent.h
1
@@ -768,9 +775,9 @@ 1 - BlackGui::Components::CDbLoadOverviewComponent + BlackGui::COverlayMessagesFrame QFrame -
blackgui/components/dbloadoverviewcomponent.h
+
blackgui/overlaymessagesframe.h
1