From b78eacd7a8ae364ad0a5f2a2a661c47b1a5f71d9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Oct 2019 19:47:58 +0200 Subject: [PATCH] [libcalamaresui] Set button texts always - if the welcome module wasn't loaded (or loading otherwise failed) then no text was set, leading to confusing screens with buttons with icons but no label. --- src/libcalamaresui/ViewManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 6da81e7af..06fd97009 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -86,9 +86,11 @@ setButtonIcon( QPushButton* button, const QString& name ) * to worry about as well as state. */ static inline QPushButton* -makeButton( QWidget* parent, const QString& name ) +makeButton( QWidget* parent, const QString& name, const QString& label ) { QPushButton* button = new QPushButton( parent ); + button->setObjectName( name ); + button->setText( label ); setButtonIcon( button, name ); return button; } @@ -108,9 +110,9 @@ ViewManager::ViewManager( QObject* parent ) mainLayout->addWidget( m_stack ); // Create buttons and sets an initial icon; the icons may change - m_back = makeButton( m_widget, "go-previous" ); - m_next = makeButton( m_widget, "go-next" ); - m_quit = makeButton( m_widget, "dialog-cancel" ); + m_back = makeButton( m_widget, QStringLiteral( "go-previous" ), tr( "&Back" ) ); + m_next = makeButton( m_widget, QStringLiteral( "go-next" ), tr( "&Next" ) ); + m_quit = makeButton( m_widget, QStringLiteral( "dialog-cancel" ), tr( "&Cancel" ) ); CALAMARES_RETRANSLATE_SLOT( &ViewManager::updateButtonLabels )