[welcome] Rip out the "details" dialog for requirements
- The dialog gave very little extra information - The text descriptions from the dialog are already available as tooltips in the existing list view.
This commit is contained in:
parent
7650795f48
commit
e102e2630e
@ -54,12 +54,10 @@ Config::retranslate()
|
|||||||
{
|
{
|
||||||
message = setup ? tr( "This computer does not satisfy the minimum "
|
message = setup ? tr( "This computer does not satisfy the minimum "
|
||||||
"requirements for setting up %1.<br/>"
|
"requirements for setting up %1.<br/>"
|
||||||
"Setup cannot continue. "
|
"Setup cannot continue." )
|
||||||
"<a href=\"#details\">Details...</a>" )
|
|
||||||
: tr( "This computer does not satisfy the minimum "
|
: tr( "This computer does not satisfy the minimum "
|
||||||
"requirements for installing %1.<br/>"
|
"requirements for installing %1.<br/>"
|
||||||
"Installation cannot continue. "
|
"Installation cannot continue." );
|
||||||
"<a href=\"#details\">Details...</a>" );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -124,9 +122,9 @@ Config::initLanguages()
|
|||||||
QLocale defaultLocale = QLocale( QLocale::system().name() );
|
QLocale defaultLocale = QLocale( QLocale::system().name() );
|
||||||
|
|
||||||
cDebug() << "Matching locale" << defaultLocale;
|
cDebug() << "Matching locale" << defaultLocale;
|
||||||
int matchedLocaleIndex = m_languages->find( [&]( const QLocale& x ) {
|
int matchedLocaleIndex = m_languages->find(
|
||||||
return x.language() == defaultLocale.language() && x.country() == defaultLocale.country();
|
[ & ]( const QLocale& x )
|
||||||
} );
|
{ return x.language() == defaultLocale.language() && x.country() == defaultLocale.country(); } );
|
||||||
|
|
||||||
if ( matchedLocaleIndex < 0 )
|
if ( matchedLocaleIndex < 0 )
|
||||||
{
|
{
|
||||||
@ -191,7 +189,8 @@ Config::setLocaleIndex( int index )
|
|||||||
|
|
||||||
QLocale::setDefault( selectedTranslation.locale() );
|
QLocale::setDefault( selectedTranslation.locale() );
|
||||||
const auto* branding = Calamares::Branding::instance();
|
const auto* branding = Calamares::Branding::instance();
|
||||||
CalamaresUtils::installTranslator( selectedTranslation.id(), branding ? branding->translationsDirectory() : QString() );
|
CalamaresUtils::installTranslator( selectedTranslation.id(),
|
||||||
|
branding ? branding->translationsDirectory() : QString() );
|
||||||
if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() )
|
if ( Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() )
|
||||||
{
|
{
|
||||||
CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(),
|
CalamaresUtils::Locale::insertGS( *Calamares::JobQueue::instance()->globalStorage(),
|
||||||
@ -367,7 +366,10 @@ setGeoIP( Config* config, const QVariantMap& configurationMap )
|
|||||||
if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None )
|
if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None )
|
||||||
{
|
{
|
||||||
auto* future = new FWString();
|
auto* future = new FWString();
|
||||||
QObject::connect( future, &FWString::finished, [config, future, handler]() {
|
QObject::connect( future,
|
||||||
|
&FWString::finished,
|
||||||
|
[ config, future, handler ]()
|
||||||
|
{
|
||||||
QString countryResult = future->future().result();
|
QString countryResult = future->future().result();
|
||||||
cDebug() << "GeoIP result for welcome=" << countryResult;
|
cDebug() << "GeoIP result for welcome=" << countryResult;
|
||||||
::setCountry( config, countryResult, handler );
|
::setCountry( config, countryResult, handler );
|
||||||
|
@ -27,71 +27,6 @@
|
|||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
/** @brief A "details" dialog for the results-list
|
|
||||||
*
|
|
||||||
* This displays the same RequirementsList as ResultsListWidget,
|
|
||||||
* but the *details* part rather than the show description.
|
|
||||||
*
|
|
||||||
* This is an internal-to-the-widget class.
|
|
||||||
*/
|
|
||||||
class ResultsListDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
/** @brief Create a dialog for the given @p checkEntries list of requirements.
|
|
||||||
*
|
|
||||||
* The list must continue to exist for the lifetime of the dialog,
|
|
||||||
* or UB happens.
|
|
||||||
*/
|
|
||||||
ResultsListDialog( QAbstractItemModel* model, QWidget* parent );
|
|
||||||
~ResultsListDialog() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QLabel* m_title;
|
|
||||||
|
|
||||||
void retranslate();
|
|
||||||
};
|
|
||||||
|
|
||||||
ResultsListDialog::ResultsListDialog( QAbstractItemModel* model, QWidget* parent )
|
|
||||||
: QDialog( parent )
|
|
||||||
{
|
|
||||||
auto* mainLayout = new QVBoxLayout;
|
|
||||||
|
|
||||||
m_title = new QLabel( this );
|
|
||||||
m_title->setObjectName( "resultDialogTitle" );
|
|
||||||
|
|
||||||
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this );
|
|
||||||
buttonBox->setObjectName( "resultDialogButtons" );
|
|
||||||
|
|
||||||
mainLayout->addWidget( m_title );
|
|
||||||
|
|
||||||
auto* listview = new QListView( this );
|
|
||||||
listview->setSelectionMode( QAbstractItemView::NoSelection );
|
|
||||||
listview->setDragDropMode( QAbstractItemView::NoDragDrop );
|
|
||||||
listview->setAcceptDrops( false );
|
|
||||||
listview->setItemDelegate( new ResultDelegate( this, Calamares::RequirementsModel::Details ) );
|
|
||||||
listview->setModel( model );
|
|
||||||
|
|
||||||
mainLayout->addWidget( listview );
|
|
||||||
mainLayout->addWidget( buttonBox );
|
|
||||||
|
|
||||||
setLayout( mainLayout );
|
|
||||||
|
|
||||||
connect( buttonBox, &QDialogButtonBox::clicked, this, &QDialog::close );
|
|
||||||
|
|
||||||
CALAMARES_RETRANSLATE_SLOT( &ResultsListDialog::retranslate );
|
|
||||||
}
|
|
||||||
|
|
||||||
ResultsListDialog::~ResultsListDialog() {}
|
|
||||||
|
|
||||||
void
|
|
||||||
ResultsListDialog::retranslate()
|
|
||||||
{
|
|
||||||
m_title->setText( tr( "For best results, please ensure that this computer:" ) );
|
|
||||||
setWindowTitle( tr( "System requirements" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent )
|
ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, m_config( config )
|
, m_config( config )
|
||||||
@ -129,19 +64,6 @@ ResultsListWidget::ResultsListWidget( Config* config, QWidget* parent )
|
|||||||
mainLayout->addStretch();
|
mainLayout->addStretch();
|
||||||
|
|
||||||
connect( config, &Config::warningMessageChanged, m_explanation, &QLabel::setText );
|
connect( config, &Config::warningMessageChanged, m_explanation, &QLabel::setText );
|
||||||
connect( m_explanation, &QLabel::linkActivated, this, &ResultsListWidget::linkClicked );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
ResultsListWidget::linkClicked( const QString& link )
|
|
||||||
{
|
|
||||||
if ( link == "#details" )
|
|
||||||
{
|
|
||||||
auto* dialog = new ResultsListDialog( m_config->requirementsModel(), this );
|
|
||||||
dialog->exec();
|
|
||||||
dialog->deleteLater();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -27,8 +27,6 @@ public:
|
|||||||
explicit ResultsListWidget( Config* config, QWidget* parent );
|
explicit ResultsListWidget( Config* config, QWidget* parent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// @brief A link in the explanatory text has been clicked
|
|
||||||
void linkClicked( const QString& link );
|
|
||||||
/// @brief The model of requirements changed
|
/// @brief The model of requirements changed
|
||||||
void requirementsChanged();
|
void requirementsChanged();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user