Add an about Qt dialog

This commit is contained in:
spiros
2024-06-22 22:23:19 +03:00
parent b55e168aad
commit 3d980d18b9
9 changed files with 364 additions and 329 deletions

View File

@@ -975,6 +975,22 @@ void MainWindow::on_actionGitHub_triggered()
QDesktopServices::openUrl(QUrl("https://github.com/edisionnano/QDiskInfo"));
}
void MainWindow::on_actionAbout_QDiskInfo_triggered()
{
QString message = tr("An ATA and NVMe S.M.A.R.T. data viewer for Linux") + "\n";
message += tr("Licensed under the GNU G.P.L. Version 3") + "\n";
message += tr("Made by Samantas5855") + "\n";
message += tr("Version") + " " + QString::number(PROJECT_VERSION_MAJOR) + "." + QString::number(PROJECT_VERSION_MINOR);
QMessageBox::about(this, tr("About QDiskInfo"), message);
}
void MainWindow::on_actionAbout_Qt_triggered()
{
QMessageBox::aboutQt(this, tr("About Qt"));
}
void MainWindow::on_actionRescan_Refresh_triggered()
{
QPair<QStringList, QJsonArray> values = Utils.scanDevices(initializing);
@@ -986,16 +1002,6 @@ void MainWindow::on_actionRescan_Refresh_triggered()
}
}
void MainWindow::on_actionAbout_triggered()
{
QString message = tr("An ATA and NVMe S.M.A.R.T. data viewer for Linux") + "\n";
message += tr("Licensed under the GNU G.P.L. Version 3") + "\n";
message += tr("Made by Samantas5855") + "\n";
message += tr("Version") + " " + QString::number(PROJECT_VERSION_MAJOR) + "." + QString::number(PROJECT_VERSION_MINOR);
QMessageBox::about(this, tr("About QDiskInfo"), message);
}
void MainWindow::on_actionIgnore_C4_Reallocation_Event_Count_toggled(bool enabled)
{
settings.setValue("IgnoreC4", enabled);

View File

@@ -34,8 +34,9 @@ private slots:
void on_actionQuit_triggered();
void on_actionSave_JSON_triggered();
void on_actionGitHub_triggered();
void on_actionAbout_QDiskInfo_triggered();
void on_actionAbout_Qt_triggered();
void on_actionRescan_Refresh_triggered();
void on_actionAbout_triggered();
void on_actionIgnore_C4_Reallocation_Event_Count_toggled(bool enabled);
void on_actionHEX_toggled(bool enabled);
void on_actionUse_Fahrenheit_toggled(bool enabled);

View File

@@ -442,7 +442,8 @@
</property>
<addaction name="actionGitHub"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
<addaction name="actionAbout_QDiskInfo"/>
<addaction name="actionAbout_Qt"/>
</widget>
<widget class="QMenu" name="menuDevice">
<property name="title">
@@ -497,12 +498,13 @@
<string>&amp;GitHub</string>
</property>
</action>
<action name="actionAbout">
<action name="actionAbout_QDiskInfo">
<property name="icon">
<iconset theme="help-about"/>
<iconset resource="resources.qrc">
<normaloff>:/icons/icon.svg</normaloff>:/icons/icon.svg</iconset>
</property>
<property name="text">
<string>&amp;About</string>
<string>&amp;About QDiskInfo</string>
</property>
<property name="menuRole">
<enum>QAction::MenuRole::NoRole</enum>
@@ -553,6 +555,14 @@
<string>Use &amp;GB instead of TB</string>
</property>
</action>
<action name="actionAbout_Qt">
<property name="icon">
<iconset theme="help-about"/>
</property>
<property name="text">
<string>About Qt</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>