add menu entry to reset to default settings
This commit is contained in:
@ -140,7 +140,8 @@ LammpsGui::LammpsGui(QWidget *parent, const char *filename) :
|
||||
connect(ui->actionAbout_LAMMPS_GUI, &QAction::triggered, this, &LammpsGui::about);
|
||||
connect(ui->action_Help, &QAction::triggered, this, &LammpsGui::help);
|
||||
connect(ui->actionLAMMPS_Manual, &QAction::triggered, this, &LammpsGui::manual);
|
||||
connect(ui->actionEdit_Preferences, &QAction::triggered, this, &LammpsGui::preferences);
|
||||
connect(ui->actionPreferences, &QAction::triggered, this, &LammpsGui::preferences);
|
||||
connect(ui->actionDefaults, &QAction::triggered, this, &LammpsGui::defaults);
|
||||
connect(ui->textEdit->document(), &QTextDocument::modificationChanged, this,
|
||||
&LammpsGui::modified);
|
||||
|
||||
@ -619,6 +620,13 @@ void LammpsGui::manual()
|
||||
QDesktopServices::openUrl(QUrl("https://docs.lammps.org/"));
|
||||
}
|
||||
|
||||
void LammpsGui::defaults()
|
||||
{
|
||||
QSettings settings;
|
||||
settings.clear();
|
||||
settings.sync();
|
||||
}
|
||||
|
||||
void LammpsGui::preferences()
|
||||
{
|
||||
Preferences prefs(&lammps);
|
||||
|
||||
@ -76,6 +76,7 @@ private slots:
|
||||
void logupdate();
|
||||
void modified();
|
||||
void preferences();
|
||||
void defaults();
|
||||
|
||||
private:
|
||||
Ui::LammpsGui *ui;
|
||||
@ -97,8 +98,8 @@ private:
|
||||
QList<QString> recent_files;
|
||||
std::vector<char *> lammps_args;
|
||||
};
|
||||
|
||||
#endif // LAMMPSGUI_H
|
||||
|
||||
// Local Variables:
|
||||
// c-basic-offset: 4
|
||||
// End:
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>24</height>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
@ -59,7 +59,8 @@
|
||||
<addaction name="actionCut"/>
|
||||
<addaction name="actionPaste"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionEdit_Preferences"/>
|
||||
<addaction name="actionPreferences"/>
|
||||
<addaction name="actionDefaults"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Run">
|
||||
<property name="title">
|
||||
@ -180,7 +181,7 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>C&ut</string>
|
||||
<string>Cu&t</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Cut Selected Text to Clipboard</string>
|
||||
@ -321,13 +322,13 @@
|
||||
<string>Ctrl+Shift+/</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEdit_Preferences">
|
||||
<action name="actionPreferences">
|
||||
<property name="icon">
|
||||
<iconset theme="preferences-desktop">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Preferences...</string>
|
||||
<string>Pre&ferences...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+P</string>
|
||||
@ -342,6 +343,14 @@
|
||||
<string>LAMMPS &Manual</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDefaults">
|
||||
<property name="icon">
|
||||
<iconset theme="document-revert"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reset to &Defaults</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
Reference in New Issue
Block a user