fix: add screenshot and icons directory settings back to Settings dialog

- Add Directories group to General tab
- Settings for screenshots directory
- Settings for extracted icons directory
- Browse buttons for both directories
- Values saved to QSettings
This commit is contained in:
LemonNexus 2026-02-11 15:22:42 +00:00
parent 1a0c0d4231
commit d01f98503a
1 changed files with 60 additions and 0 deletions

View File

@ -65,6 +65,10 @@ class SettingsDialog(QDialog):
self._cv_use_gpu = self._settings.value("cv/use_gpu", True, type=bool) self._cv_use_gpu = self._settings.value("cv/use_gpu", True, type=bool)
self._cv_confidence = self._settings.value("cv/confidence", 0.5, type=float) self._cv_confidence = self._settings.value("cv/confidence", 0.5, type=float)
# Directories
self._screenshots_dir = self._settings.value("dirs/screenshots", "", type=str)
self._icons_dir = self._settings.value("dirs/icons", "", type=str)
def _setup_ui(self): def _setup_ui(self):
"""Setup the dialog UI with tabs.""" """Setup the dialog UI with tabs."""
layout = QVBoxLayout(self) layout = QVBoxLayout(self)
@ -173,6 +177,36 @@ class SettingsDialog(QDialog):
layout.addWidget(activity_group) layout.addWidget(activity_group)
# Directories
dirs_group = QGroupBox("📁 Directories")
dirs_form = QFormLayout(dirs_group)
# Screenshots directory
screenshots_layout = QHBoxLayout()
self.screenshots_dir_edit = QLineEdit(self._screenshots_dir)
self.screenshots_dir_edit.setPlaceholderText("Default: data/screenshots/")
screenshots_layout.addWidget(self.screenshots_dir_edit)
screenshots_browse = QPushButton("Browse...")
screenshots_browse.clicked.connect(self._browse_screenshots_dir)
screenshots_layout.addWidget(screenshots_browse)
dirs_form.addRow("Screenshots:", screenshots_layout)
# Icons directory
icons_layout = QHBoxLayout()
self.icons_dir_edit = QLineEdit(self._icons_dir)
self.icons_dir_edit.setPlaceholderText("Default: ~/.lemontropia/extracted_icons/")
icons_layout.addWidget(self.icons_dir_edit)
icons_browse = QPushButton("Browse...")
icons_browse.clicked.connect(self._browse_icons_dir)
icons_layout.addWidget(icons_browse)
dirs_form.addRow("Extracted Icons:", icons_layout)
layout.addWidget(dirs_group)
layout.addStretch() layout.addStretch()
return tab return tab
@ -497,6 +531,28 @@ class SettingsDialog(QDialog):
default_path = Path.home() / "Documents" / "Entropia Universe" / "chat.log" default_path = Path.home() / "Documents" / "Entropia Universe" / "chat.log"
self.log_path_edit.setText(str(default_path)) self.log_path_edit.setText(str(default_path))
def _browse_screenshots_dir(self):
"""Browse for screenshots directory."""
dir_path = QFileDialog.getExistingDirectory(
self,
"Select Screenshots Directory",
str(Path.home()),
QFileDialog.Option.ShowDirsOnly
)
if dir_path:
self.screenshots_dir_edit.setText(dir_path)
def _browse_icons_dir(self):
"""Browse for extracted icons directory."""
dir_path = QFileDialog.getExistingDirectory(
self,
"Select Icons Directory",
str(Path.home()),
QFileDialog.Option.ShowDirsOnly
)
if dir_path:
self.icons_dir_edit.setText(dir_path)
def _test_hotkey(self, hotkey_type: str): def _test_hotkey(self, hotkey_type: str):
"""Test a screenshot hotkey.""" """Test a screenshot hotkey."""
try: try:
@ -586,6 +642,10 @@ class SettingsDialog(QDialog):
self._settings.setValue("log/auto_detect", self.auto_detect_check.isChecked()) self._settings.setValue("log/auto_detect", self.auto_detect_check.isChecked())
self._settings.setValue("activity/default", self.default_activity_combo.currentData()) self._settings.setValue("activity/default", self.default_activity_combo.currentData())
# Directories
self._settings.setValue("dirs/screenshots", self.screenshots_dir_edit.text().strip())
self._settings.setValue("dirs/icons", self.icons_dir_edit.text().strip())
# Hotkeys # Hotkeys
self._settings.setValue("hotkey/screenshot_full", self.hotkey_full_edit.text().strip()) self._settings.setValue("hotkey/screenshot_full", self.hotkey_full_edit.text().strip())
self._settings.setValue("hotkey/screenshot_region", self.hotkey_region_edit.text().strip()) self._settings.setValue("hotkey/screenshot_region", self.hotkey_region_edit.text().strip())