[welcome] Move about-calamares box to Calamares (main)
This commit is contained in:
parent
006c3f99e6
commit
18363ca183
@ -14,7 +14,9 @@
|
|||||||
#include "CalamaresWindow.h"
|
#include "CalamaresWindow.h"
|
||||||
|
|
||||||
#include "Branding.h"
|
#include "Branding.h"
|
||||||
|
#include "CalamaresAbout.h"
|
||||||
#include "CalamaresConfig.h"
|
#include "CalamaresConfig.h"
|
||||||
|
#include "CalamaresVersion.h"
|
||||||
#include "DebugWindow.h"
|
#include "DebugWindow.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
@ -23,6 +25,7 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Qml.h"
|
#include "utils/Qml.h"
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
|
#include "widgets/TranslationFix.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
@ -31,6 +34,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QMessageBox>
|
||||||
#ifdef WITH_QML
|
#ifdef WITH_QML
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
@ -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*
|
static QWidget*
|
||||||
getWidgetSidebar( Calamares::DebugWindowManager* debug,
|
getWidgetSidebar( Calamares::DebugWindowManager* debug,
|
||||||
Calamares::ViewManager* viewManager,
|
Calamares::ViewManager* viewManager,
|
||||||
@ -149,7 +177,7 @@ getWidgetSidebar( Calamares::DebugWindowManager* debug,
|
|||||||
extraButtons->addWidget( aboutDialog );
|
extraButtons->addWidget( aboutDialog );
|
||||||
aboutDialog->setFlat( true );
|
aboutDialog->setFlat( true );
|
||||||
aboutDialog->setCheckable( true );
|
aboutDialog->setCheckable( true );
|
||||||
QObject::connect( aboutDialog, &QPushButton::clicked, debug, &Calamares::DebugWindowManager::show );
|
QObject::connect( aboutDialog, &QPushButton::clicked, []() { showAboutBox(); } );
|
||||||
}
|
}
|
||||||
if ( debug && debug->enabled() )
|
if ( debug && debug->enabled() )
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/NamedEnum.h"
|
#include "utils/NamedEnum.h"
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
#include "widgets/TranslationFix.h"
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
@ -48,8 +47,6 @@ WelcomePage::WelcomePage( Config* config, QWidget* parent )
|
|||||||
|
|
||||||
const int defaultFontHeight = CalamaresUtils::defaultFontHeight();
|
const int defaultFontHeight = CalamaresUtils::defaultFontHeight();
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
ui->aboutButton->setIcon( CalamaresUtils::defaultPixmap(
|
|
||||||
CalamaresUtils::Information, CalamaresUtils::Original, 2 * QSize( defaultFontHeight, defaultFontHeight ) ) );
|
|
||||||
|
|
||||||
// insert system-check widget below welcome text
|
// insert system-check widget below welcome text
|
||||||
const int welcome_text_idx = ui->verticalLayout->indexOf( ui->mainText );
|
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 );
|
CALAMARES_RETRANSLATE_SLOT( &WelcomePage::retranslate );
|
||||||
|
|
||||||
connect( ui->aboutButton, &QPushButton::clicked, this, &WelcomePage::showAboutBox );
|
|
||||||
connect( Calamares::ModuleManager::instance(),
|
connect( Calamares::ModuleManager::instance(),
|
||||||
&Calamares::ModuleManager::requirementsComplete,
|
&Calamares::ModuleManager::requirementsComplete,
|
||||||
m_checkingWidget,
|
m_checkingWidget,
|
||||||
@ -216,30 +212,6 @@ WelcomePage::retranslate()
|
|||||||
ui->supportButton->setText( tr( "%1 support" ).arg( Calamares::Branding::instance()->shortProductName() ) );
|
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
|
void
|
||||||
LocaleTwoColumnDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
LocaleTwoColumnDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,6 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void retranslate();
|
void retranslate();
|
||||||
void showAboutBox();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
|
void focusInEvent( QFocusEvent* e ) override; //choose the child widget to focus
|
||||||
|
Loading…
Reference in New Issue
Block a user