mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-07 20:09:55 +03:00
Add a clear settings button
This commit is contained in:
@@ -1297,3 +1297,20 @@ void MainWindow::mousePressEvent(QMouseEvent *event)
|
||||
onPrevButtonClicked();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionClear_Settings_triggered()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle(QObject::tr("Clear Settings"));
|
||||
msgBox.setText(QObject::tr("Are you sure you want to clear the settings saved on disk?"));
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.addButton(QMessageBox::Cancel);
|
||||
QPushButton *clearSettingsButton = msgBox.addButton(QMessageBox::Ok);
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
if (msgBox.clickedButton() == clearSettingsButton) {
|
||||
settings.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ private slots:
|
||||
void on_actionCyclic_Navigation_toggled(bool arg1);
|
||||
void on_actionUse_GB_instead_of_TB_toggled(bool arg1);
|
||||
|
||||
void on_actionClear_Settings_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QSettings settings;
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>30</height>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
@@ -509,6 +509,8 @@
|
||||
<addaction name="actionUse_Fahrenheit"/>
|
||||
<addaction name="actionCyclic_Navigation"/>
|
||||
<addaction name="actionUse_GB_instead_of_TB"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionClear_Settings"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
@@ -637,6 +639,11 @@
|
||||
<string>About &Qt</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClear_Settings">
|
||||
<property name="text">
|
||||
<string>Clear Settings</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
|
||||
Reference in New Issue
Block a user