Fix Ubuntu PKEXEC issue, enable spanish translation (not available yet)

This commit is contained in:
spiros
2024-06-19 22:32:55 +03:00
parent c08f59b749
commit 44209e3666
4 changed files with 5 additions and 4 deletions

View File

@@ -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()

View File

@@ -4,5 +4,6 @@
</qresource>
<qresource prefix="/">
<file alias="translations/kdiskinfo_el_GR.qm">../translations/kdiskinfo_el_GR.qm</file>
<file alias="translations/kdiskinfo_es_ES.qm">../translations/kdiskinfo_es_ES.qm</file>
</qresource>
</RCC>

View File

@@ -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"));