Show/hide recent files and implement setting

This commit is contained in:
2025-12-20 15:10:53 +01:00
parent 347e0c00c7
commit acd87be943
5 changed files with 17 additions and 1 deletions
+2
View File
@@ -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());
}
+1 -1
View File
@@ -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>&amp;Show recently edited games in the file menu</string>
</property>
+10
View File
@@ -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();
+3
View File
@@ -34,6 +34,9 @@ public:
TransparentBackgroundPattern transparentBackgroundPattern() const;
bool showRecentFiles() const;
void setShowRecentFiles(bool showRecentFiles);
bool hideWebsiteImage() const;
void setHideWebsiteImage(bool hideWebsiteImage);
};
+1
View File
@@ -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());
}