diff --git a/src/modules/greeting/GreetingPage.cpp b/src/modules/greeting/GreetingPage.cpp index 659da1b69..f35632437 100644 --- a/src/modules/greeting/GreetingPage.cpp +++ b/src/modules/greeting/GreetingPage.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -121,38 +122,15 @@ GreetingPage::GreetingPage( QWidget* parent ) ui->mainText->setWordWrap( true ); ui->mainText->setOpenExternalLinks( true ); - if ( Calamares::Branding::instance()-> - string( Calamares::Branding::ProductUrl ).isEmpty() || - Calamares::Branding::instance()-> - string( Calamares::Branding::ProductUrlText ).isEmpty() ) - { - CALAMARES_RETRANSLATE( - ui->mainText->setText( tr( "

Welcome to the %1 installer.


" - "This program will ask you some questions and " - "set up %2 on your computer." ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::ProductName ) ) ); - ) - } - else - { - CALAMARES_RETRANSLATE( - ui->mainText->setText( tr( "

Welcome to the %1 installer.


" - "This program will ask you some questions and " - "set up %2 on your computer.
" - " %4 " ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::ProductName ) ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::ProductUrl ) ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::ProductUrlText ) ) ); - ) - } + CALAMARES_RETRANSLATE( + ui->mainText->setText( tr( "

Welcome to the %1 installer.


" + "This program will ask you some questions and " + "set up %2 on your computer." ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::VersionedName ) ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::ProductName ) ) ); + ) ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Information, CalamaresUtils::Original, @@ -184,6 +162,55 @@ GreetingPage::GreetingPage( QWidget* parent ) } +void +GreetingPage::setUpLinks( bool showSupportUrl, + bool showKnownIssuesUrl, + bool showReleaseNotesUrl ) +{ + using namespace Calamares; + Branding* b = Branding::instance(); + if ( showSupportUrl && !b->string( Branding::SupportUrl ).isEmpty() ) + { + CALAMARES_RETRANSLATE( + ui->supportButton->setText( tr( "%1 support" ) + .arg( b->string( Branding::ShortProductName ) ) ); + ) + connect( ui->supportButton, &QPushButton::clicked, [] + { + QDesktopServices::openUrl( Branding::instance()->string( Branding::SupportUrl ) ); + } ); + } + else + { + ui->supportButton->hide(); + } + + if ( showKnownIssuesUrl && !b->string( Branding::KnownIssuesUrl ).isEmpty() ) + { + connect( ui->knownIssuesButton, &QPushButton::clicked, [] + { + QDesktopServices::openUrl( Branding::instance()->string( Branding::KnownIssuesUrl ) ); + } ); + } + else + { + ui->knownIssuesButton->hide(); + } + + if ( showReleaseNotesUrl && !b->string( Branding::ReleaseNotesUrl ).isEmpty() ) + { + connect( ui->releaseNotesButton, &QPushButton::clicked, [] + { + QDesktopServices::openUrl( Branding::instance()->string( Branding::ReleaseNotesUrl ) ); + } ); + } + else + { + ui->releaseNotesButton->hide(); + } +} + + void GreetingPage::focusInEvent( QFocusEvent* e ) { diff --git a/src/modules/greeting/GreetingPage.h b/src/modules/greeting/GreetingPage.h index e6825c9b9..209598bd8 100644 --- a/src/modules/greeting/GreetingPage.h +++ b/src/modules/greeting/GreetingPage.h @@ -32,6 +32,10 @@ class GreetingPage : public QWidget public: explicit GreetingPage( QWidget* parent = nullptr ); + void setUpLinks( bool showSupportUrl, + bool showKnownIssuesUrl, + bool showReleaseNotesUrl ); + protected: void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus diff --git a/src/modules/greeting/GreetingPage.ui b/src/modules/greeting/GreetingPage.ui index d43a857ed..713c7cefe 100644 --- a/src/modules/greeting/GreetingPage.ui +++ b/src/modules/greeting/GreetingPage.ui @@ -97,14 +97,48 @@ - - - &About - - - true - - + + + + + &Release notes + + + true + + + + + + + &Known issues + + + true + + + + + + + &Support + + + true + + + + + + + &About + + + true + + + +