From 006c3f99e68c466604763949d1295163ce3c1c69 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 29 May 2022 15:22:02 +0200 Subject: [PATCH] [calamares] Add 'about calamares' button alongside the debug-button --- CHANGES-3.2 | 1 + src/calamares/CalamaresWindow.cpp | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGES-3.2 b/CHANGES-3.2 index d74a491bc..e54fd78ce 100644 --- a/CHANGES-3.2 +++ b/CHANGES-3.2 @@ -36,6 +36,7 @@ or translations are expected. This is also the final release done - *partition* will cycle out a LUKS key if all the key slots are in use and a new key is added, rather than crashing the installer. (Thanks Arjen) + # 3.2.58.2 (2022-05-24) This is a extra-quick release for an issue that shows up when using a diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index 81e7ca97f..7b0666af3 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -130,14 +130,37 @@ getWidgetSidebar( Calamares::DebugWindowManager* debug, tv->setFocusPolicy( Qt::NoFocus ); sideLayout->addWidget( tv ); + QHBoxLayout* extraButtons = new QHBoxLayout; + sideLayout->addLayout( extraButtons ); + + const int defaultFontHeight = CalamaresUtils::defaultFontHeight(); + + if ( /* About-Calamares Button enabled */ true ) + { + QPushButton* aboutDialog = new QPushButton; + aboutDialog->setObjectName( "aboutDialogButton" ); + aboutDialog->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Information, + CalamaresUtils::Original, + 2 * QSize( defaultFontHeight, defaultFontHeight ) ) ); + CALAMARES_RETRANSLATE_FOR( + aboutDialog, + aboutDialog->setToolTip( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(), + "Show information about Calamares" ) ); ); + extraButtons->addWidget( aboutDialog ); + aboutDialog->setFlat( true ); + aboutDialog->setCheckable( true ); + QObject::connect( aboutDialog, &QPushButton::clicked, debug, &Calamares::DebugWindowManager::show ); + } if ( debug && debug->enabled() ) { QPushButton* debugWindowBtn = new QPushButton; debugWindowBtn->setObjectName( "debugButton" ); + debugWindowBtn->setIcon( CalamaresUtils::defaultPixmap( + CalamaresUtils::Bugs, CalamaresUtils::Original, 2 * QSize( defaultFontHeight, defaultFontHeight ) ) ); CALAMARES_RETRANSLATE_FOR( debugWindowBtn, - debugWindowBtn->setText( QCoreApplication::translate( + debugWindowBtn->setToolTip( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(), "Show debug information" ) ); ); - sideLayout->addWidget( debugWindowBtn ); + extraButtons->addWidget( debugWindowBtn ); debugWindowBtn->setFlat( true ); debugWindowBtn->setCheckable( true ); QObject::connect( debugWindowBtn, &QPushButton::clicked, debug, &Calamares::DebugWindowManager::show );