diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index 7b0666af3..b6a34083c 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -14,7 +14,9 @@ #include "CalamaresWindow.h" #include "Branding.h" +#include "CalamaresAbout.h" #include "CalamaresConfig.h" +#include "CalamaresVersion.h" #include "DebugWindow.h" #include "Settings.h" #include "ViewManager.h" @@ -23,6 +25,7 @@ #include "utils/Logger.h" #include "utils/Qml.h" #include "utils/Retranslator.h" +#include "widgets/TranslationFix.h" #include #include @@ -31,6 +34,7 @@ #include #include #include +#include #ifdef WITH_QML #include #include @@ -87,6 +91,30 @@ setButtonIcon( QPushButton* button, const QString& name ) } } +static void +showAboutBox() +{ + QString title = Calamares::Settings::instance()->isSetupMode() + ? QCoreApplication::translate( "WelcomePage", "About %1 setup" ) + : QCoreApplication::translate( "WelcomePage", "About %1 installer" ); + QMessageBox mb( QMessageBox::Information, + title.arg( CALAMARES_APPLICATION_NAME ), + Calamares::aboutString().arg( Calamares::Branding::instance()->versionedName() ), + QMessageBox::Ok, + nullptr ); + Calamares::fixButtonLabels( &mb ); + mb.setIconPixmap( CalamaresUtils::defaultPixmap( + CalamaresUtils::Squid, + CalamaresUtils::Original, + QSize( CalamaresUtils::defaultFontHeight() * 6, CalamaresUtils::defaultFontHeight() * 6 ) ) ); + QGridLayout* layout = reinterpret_cast< QGridLayout* >( mb.layout() ); + if ( layout ) + { + layout->setColumnMinimumWidth( 2, CalamaresUtils::defaultFontHeight() * 24 ); + } + mb.exec(); +} + static QWidget* getWidgetSidebar( Calamares::DebugWindowManager* debug, Calamares::ViewManager* viewManager, @@ -149,7 +177,7 @@ getWidgetSidebar( Calamares::DebugWindowManager* debug, extraButtons->addWidget( aboutDialog ); aboutDialog->setFlat( true ); aboutDialog->setCheckable( true ); - QObject::connect( aboutDialog, &QPushButton::clicked, debug, &Calamares::DebugWindowManager::show ); + QObject::connect( aboutDialog, &QPushButton::clicked, []() { showAboutBox(); } ); } if ( debug && debug->enabled() ) { diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 5b26434a1..597317069 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -27,7 +27,6 @@ #include "utils/Logger.h" #include "utils/NamedEnum.h" #include "utils/Retranslator.h" -#include "widgets/TranslationFix.h" #include #include @@ -48,8 +47,6 @@ WelcomePage::WelcomePage( Config* config, QWidget* parent ) const int defaultFontHeight = CalamaresUtils::defaultFontHeight(); ui->setupUi( this ); - ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap( - CalamaresUtils::Information, CalamaresUtils::Original, 2 * QSize( defaultFontHeight, defaultFontHeight ) ) ); // insert system-check widget below welcome text const int welcome_text_idx = ui->verticalLayout->indexOf( ui->mainText ); @@ -78,7 +75,6 @@ WelcomePage::WelcomePage( Config* config, QWidget* parent ) CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate ); - connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox ); connect( Calamares::ModuleManager::instance(), &Calamares::ModuleManager::requirementsComplete, m_checkingWidget, @@ -216,30 +212,6 @@ WelcomePage::retranslate() ui->supportButton->setText( tr( "%1 support" ).arg( Calamares::Branding::instance()->shortProductName() ) ); } -void -WelcomePage::showAboutBox() -{ - QString title - = Calamares::Settings::instance()->isSetupMode() ? tr( "About %1 setup" ) : tr( "About %1 installer" ); - QMessageBox mb( QMessageBox::Information, - title.arg( CALAMARES_APPLICATION_NAME ), - m_conf->aboutMessage().arg( Calamares::Branding::instance()->versionedName() ), - QMessageBox::Ok, - this ); - Calamares::fixButtonLabels( &mb ); - mb.setIconPixmap( CalamaresUtils::defaultPixmap( - CalamaresUtils::Squid, - CalamaresUtils::Original, - QSize( CalamaresUtils::defaultFontHeight() * 6, CalamaresUtils::defaultFontHeight() * 6 ) ) ); - QGridLayout* layout = reinterpret_cast< QGridLayout* >( mb.layout() ); - if ( layout ) - { - layout->setColumnMinimumWidth( 2, CalamaresUtils::defaultFontHeight() * 24 ); - } - mb.exec(); -} - - void LocaleTwoColumnDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const { diff --git a/src/modules/welcome/WelcomePage.h b/src/modules/welcome/WelcomePage.h index dba1f6a28..d5741240d 100644 --- a/src/modules/welcome/WelcomePage.h +++ b/src/modules/welcome/WelcomePage.h @@ -53,7 +53,6 @@ public: public slots: void retranslate(); - void showAboutBox(); protected: void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus