Show/hide recent files and implement setting
This commit is contained in:
@@ -19,6 +19,7 @@ PreferencesDialog::PreferencesDialog(const EditorSettings &settings, QWidget *pa
|
||||
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->checkBoxShowRecentFiles->setChecked(settings.showRecentFiles());
|
||||
m_ui->checkBoxHideWebsiteLogo->setChecked(settings.hideWebsiteImage());
|
||||
}
|
||||
|
||||
@@ -26,5 +27,6 @@ PreferencesDialog::~PreferencesDialog() = default;
|
||||
|
||||
void PreferencesDialog::save(EditorSettings &settings)
|
||||
{
|
||||
settings.setShowRecentFiles(m_ui->checkBoxShowRecentFiles->isChecked());
|
||||
settings.setHideWebsiteImage(m_ui->checkBoxHideWebsiteLogo->isChecked());
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,0,0,0,0,0,0,0,0,0,0,0,1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<widget class="QCheckBox" name="checkBoxShowRecentFiles">
|
||||
<property name="text">
|
||||
<string>&Show recently edited games in the file menu</string>
|
||||
</property>
|
||||
|
||||
@@ -83,6 +83,16 @@ TransparentBackgroundPattern EditorSettings::transparentBackgroundPattern() cons
|
||||
};
|
||||
}
|
||||
|
||||
bool EditorSettings::showRecentFiles() const
|
||||
{
|
||||
return value("showRecentFiles", true).toBool();
|
||||
}
|
||||
|
||||
void EditorSettings::setShowRecentFiles(bool showRecentFiles)
|
||||
{
|
||||
setValue("showRecentFiles", showRecentFiles);
|
||||
}
|
||||
|
||||
bool EditorSettings::hideWebsiteImage() const
|
||||
{
|
||||
return value("hideWebsiteImage", false).toBool();
|
||||
|
||||
@@ -34,6 +34,9 @@ public:
|
||||
|
||||
TransparentBackgroundPattern transparentBackgroundPattern() const;
|
||||
|
||||
bool showRecentFiles() const;
|
||||
void setShowRecentFiles(bool showRecentFiles);
|
||||
|
||||
bool hideWebsiteImage() const;
|
||||
void setHideWebsiteImage(bool hideWebsiteImage);
|
||||
};
|
||||
|
||||
@@ -946,6 +946,7 @@ void MainWindow::updateTitle()
|
||||
|
||||
void MainWindow::updateVisibilities()
|
||||
{
|
||||
m_ui->menuRecentFiles->menuAction()->setVisible(m_settings.showRecentFiles());
|
||||
m_ui->logo->setHidden(m_settings.hideWebsiteImage());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user