From 44209e3666ed8b6c3e006c14caaf4a38d12f604f Mon Sep 17 00:00:00 2001 From: spiros Date: Wed, 19 Jun 2024 22:32:55 +0300 Subject: [PATCH] Fix Ubuntu PKEXEC issue, enable spanish translation (not available yet) --- src/mainwindow.cpp | 4 ++-- src/resources.qrc | 1 + src/utils.cpp | 4 ++-- translations/kdiskinfo_es_ES.qm | Bin 0 -> 33 bytes 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 translations/kdiskinfo_es_ES.qm diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3a745bb..2f2ef45 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -117,8 +117,8 @@ void MainWindow::onPrevButtonClicked() void MainWindow::updateNavigationButtons(int currentIndex) { - prevButton->setEnabled(currentIndex > 0||(ui->actionCyclic_Navigation->isChecked() && buttonGroup->buttons().size() > 1)); // We can use setVisible if we want to mimic CrystalDiskInfo - nextButton->setEnabled(currentIndex < buttonGroup->buttons().size() - 1||ui->actionCyclic_Navigation->isChecked()); + prevButton->setEnabled(currentIndex > 0 || (ui->actionCyclic_Navigation->isChecked() && buttonGroup->buttons().size() > 1)); // We can use setVisible if we want to mimic CrystalDiskInfo + nextButton->setEnabled(currentIndex < buttonGroup->buttons().size() - 1 || ui->actionCyclic_Navigation->isChecked()); } void MainWindow::updateUI() diff --git a/src/resources.qrc b/src/resources.qrc index 06f0355..ecf9b2a 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -4,5 +4,6 @@ ../translations/kdiskinfo_el_GR.qm + ../translations/kdiskinfo_es_ES.qm diff --git a/src/utils.cpp b/src/utils.cpp index 7ee7b49..b789ee1 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -45,7 +45,7 @@ QString utils::getSmartctlOutput(const QStringList &arguments, bool root, bool i process.waitForFinished(-1); } - if (process.exitCode() == 127) { + if (process.exitCode() == 126 || process.exitCode() == 127) { QMessageBox::critical(nullptr, QObject::tr("KDiskInfo Error"), QObject::tr("KDiskInfo needs root access in order to read S.M.A.R.T. data!")); if (initializing) { QTimer::singleShot(0, qApp, &QApplication::quit); @@ -136,7 +136,7 @@ void utils::cancelSelfTest(const QString &deviceNode) process.start("pkexec", arguments); process.waitForFinished(-1); - if (process.exitCode() == 127) { + if (process.exitCode() == 126 || process.exitCode() == 127) { QMessageBox::critical(nullptr, QObject::tr("KDiskInfo Error"), QObject::tr("KDiskInfo needs root access in order to abort a self-test!")); } else if (process.exitCode() == QProcess::NormalExit) { QMessageBox::information(nullptr, QObject::tr("Test Requested"), QObject::tr("The self-test has been aborted")); diff --git a/translations/kdiskinfo_es_ES.qm b/translations/kdiskinfo_es_ES.qm new file mode 100644 index 0000000000000000000000000000000000000000..4320da8dcc8d0a7b77bea37c418246084c904642 GIT binary patch literal 33 ocmcE7ks@*G{hX<16=n7(EZlo{IRgU&Yie=4Yj6jU#l*-60Q>d}#sB~S literal 0 HcmV?d00001