summaryrefslogtreecommitdiff
path: root/raveos-calamares/0003-restart-button.patch
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-calamares/0003-restart-button.patch')
-rw-r--r--raveos-calamares/0003-restart-button.patch28
1 files changed, 8 insertions, 20 deletions
diff --git a/raveos-calamares/0003-restart-button.patch b/raveos-calamares/0003-restart-button.patch
index bf8608e..0d8e0f4 100644
--- a/raveos-calamares/0003-restart-button.patch
+++ b/raveos-calamares/0003-restart-button.patch
@@ -8,19 +8,18 @@
#include "viewpages/ViewStep.h"
#include <QApplication>
-@@ -34,7 +35,11 @@
+@@ -34,7 +35,10 @@
#endif
#include <QFile>
#include <QFileInfo>
+#include <QDialog>
#include <QLabel>
-+#include <QLocale>
+#include <QProcess>
+#include <QPushButton>
#ifdef WITH_QML
#include <QQmlContext>
#include <QQmlEngine>
-@@ -207,6 +212,49 @@
+@@ -207,6 +211,38 @@
return sideBox;
}
@@ -28,24 +27,13 @@
+static bool
+raveosConfirmRestart( QWidget* parent )
+{
-+ const QString lang = QLocale().name();
-+ const bool hu = lang.startsWith( QStringLiteral( "hu" ) );
-+ const bool de = lang.startsWith( QStringLiteral( "de" ) );
-+ const QString question = hu ? QStringLiteral( "Újraindítod a számítógépet?" )
-+ : ( de ? QStringLiteral( "Computer neu starten?" )
-+ : QStringLiteral( "Restart the computer?" ) );
-+ const QString okText = hu ? QStringLiteral( "Újraindítás" )
-+ : ( de ? QStringLiteral( "Neu starten" ) : QStringLiteral( "Restart" ) );
-+ const QString cancelText = hu ? QStringLiteral( "Mégse" )
-+ : ( de ? QStringLiteral( "Abbrechen" ) : QStringLiteral( "Cancel" ) );
-+
+ QDialog dialog( parent );
+ dialog.setObjectName( QStringLiteral( "raveosDialog" ) );
+ dialog.setWindowTitle( QStringLiteral( "RaveOS" ) );
+ dialog.setMinimumWidth( 420 );
+
+ auto* layout = new QVBoxLayout( &dialog );
-+ auto* label = new QLabel( question, &dialog );
++ auto* label = new QLabel( QCoreApplication::translate( "raveos", "Restart the computer?" ), &dialog );
+ label->setObjectName( QStringLiteral( "raveosDialogLabel" ) );
+ label->setWordWrap( true );
+ layout->addWidget( label );
@@ -53,9 +41,9 @@
+
+ auto* buttons = new QHBoxLayout;
+ buttons->addStretch();
-+ auto* cancel = new QPushButton( cancelText, &dialog );
++ auto* cancel = new QPushButton( QCoreApplication::translate( "raveos", "Cancel" ), &dialog );
+ cancel->setObjectName( QStringLiteral( "raveosDialogCancel" ) );
-+ auto* ok = new QPushButton( okText, &dialog );
++ auto* ok = new QPushButton( QCoreApplication::translate( "raveos", "Restart" ), &dialog );
+ ok->setObjectName( QStringLiteral( "raveosDialogOk" ) );
+ buttons->addWidget( cancel );
+ buttons->addWidget( ok );
@@ -70,7 +58,7 @@
static QWidget*
getWidgetNavigation( Calamares::DebugWindowManager*,
Calamares::ViewManager* viewManager,
-@@ -216,6 +264,45 @@
+@@ -216,6 +252,45 @@
{
QWidget* navigation = new QWidget( parent );
QBoxLayout* bottomLayout = new QHBoxLayout;
@@ -80,6 +68,7 @@
+ {
+ auto* restart = new QPushButton( navigation );
+ restart->setObjectName( "restartButton" );
++ restart->setIcon( getButtonIcon( QStringLiteral( "view-refresh" ) ) );
+ CALAMARES_RETRANSLATE_FOR(
+ restart,
+ restart->setText( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(),
@@ -88,7 +77,6 @@
+ restart->setToolTip( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(),
+ "Restart the computer",
+ "@tooltip" ) ); );
-+ restart->setIcon( getButtonIcon( QStringLiteral( "view-refresh" ) ) );
+ QObject::connect( restart,
+ &QPushButton::clicked,
+ restart,
@@ -116,7 +104,7 @@
bottomLayout->addStretch();
// Create buttons and sets an initial icon; the icons may change
-@@ -272,7 +359,7 @@
+@@ -272,7 +347,7 @@
bottomLayout->addWidget( quit );
}