This commit is contained in:
Ignacio Serantes
2026-04-12 11:56:39 +02:00
parent 1508e629c0
commit 8ade5fde54
6 changed files with 72 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ Classes:
MainWindow: The main application window containing the thumbnail grid and docks.
"""
__appname__ = "BagheeraView"
__version__ = "0.9.20"
__version__ = "0.9.21"
__author__ = "Ignacio Serantes"
__email__ = "kde@aynoa.net"
__license__ = "LGPL"

View File

@@ -29,7 +29,7 @@ if FORCE_X11:
# --- CONFIGURATION ---
PROG_NAME = "Bagheera Image Viewer"
PROG_ID = "bagheeraview"
PROG_VERSION = "0.9.20"
PROG_VERSION = "0.9.21"
PROG_AUTHOR = "Ignacio Serantes"
# --- CACHE SETTINGS ---
@@ -137,6 +137,11 @@ SCANNER_SETTINGS_DEFAULTS = {
"person_tags": "",
"generation_threads": 4,
"search_engine": "",
"face_use_last_name": False,
"pet_use_last_name": False,
"body_use_last_name": False,
"object_use_last_name": False,
"landmark_use_last_name": False,
"duplicate_threshold": 90, # Similarity percentage (50-100)
"duplicate_method": "histogram_hashing",
"duplicate_confirm_delete": True,
@@ -634,6 +639,9 @@ _UI_TEXTS = {
"landmark names to remember.",
"SETTINGS_PATH_NOT_FOUND_WARNING": "Warning: Path not found or is not "
"a directory: {}",
"SETTINGS_USE_LAST_NAME_LABEL": "Use last name by default",
"SETTINGS_USE_LAST_NAME_TOOLTIP": "Automatically fill the assignment window "
"with the last used name.",
"SETTINGS_FACE_HISTORY_COUNT_LABEL": "Max face history:",
"SETTINGS_THUMBS_REFRESH_LABEL": "Thumbs refresh interval (ms):",
"MENU_VIEWER_SETTINGS": "Viewer Settings",
@@ -1181,6 +1189,9 @@ _UI_TEXTS = {
"usados recientemente para recordar.",
"SETTINGS_PATH_NOT_FOUND_WARNING": "Advertencia: La ruta no existe o "
"no es un directorio: {}",
"SETTINGS_USE_LAST_NAME_LABEL": "Usar último nombre por defecto",
"SETTINGS_USE_LAST_NAME_TOOLTIP": "Rellena automáticamente la ventana de "
"asignación con el último nombre utilizado.",
"SETTINGS_FACE_HISTORY_COUNT_LABEL": "Máximo historial de caras:",
"SETTINGS_THUMBS_REFRESH_LABEL": "Intervalo refresco miniaturas (ms):",
"SETTINGS_THUMBS_BG_COLOR_LABEL": "Color de fondo de miniaturas:",
@@ -1730,6 +1741,9 @@ _UI_TEXTS = {
"usados recentemente para lembrar.",
"SETTINGS_PATH_NOT_FOUND_WARNING": "Advertencia: A ruta non existe ou "
"non é un directorio: {}",
"SETTINGS_USE_LAST_NAME_LABEL": "Usar o último nome por defecto",
"SETTINGS_USE_LAST_NAME_TOOLTIP": "Rechea automáticamente a ventá de "
"asignación có último nome utilizado.",
"SETTINGS_FACE_HISTORY_COUNT_LABEL": "Máximo historial de caras:",
"SETTINGS_THUMBS_REFRESH_LABEL": "Intervalo refresco miniaturas (ms):",
"SETTINGS_THUMBS_BG_COLOR_LABEL": "Cor de fondo de miniaturas:",

View File

@@ -1013,8 +1013,12 @@ class FaceCanvas(QLabel):
history = history_list \
if self.viewer.main_win else []
setting_key = f"{region_type.lower()}_use_last_name"
suggested = history[0] if history and APP_CONFIG.get(
setting_key, False) else ""
full_tag, updated_history, ok = FaceNameDialog.get_name(
self.viewer, history,
self.viewer, history, current_name=suggested,
main_win=self.viewer.main_win, region_type=region_type)
if ok and full_tag:
@@ -3114,8 +3118,10 @@ class ImageViewer(QWidget):
QApplication.processEvents()
history = self.main_win.face_names_history if self.main_win else []
suggested = history[0] if history and APP_CONFIG.get(
"face_use_last_name", False) else ""
full_tag, updated_history, ok = FaceNameDialog.get_name(
self, history, main_win=self.main_win)
self, history, current_name=suggested, main_win=self.main_win)
if ok and full_tag:
new_face['name'] = full_tag
@@ -3171,8 +3177,10 @@ class ImageViewer(QWidget):
QApplication.processEvents()
history = self.main_win.pet_names_history if self.main_win else []
suggested = history[0] if history and APP_CONFIG.get(
"pet_use_last_name", False) else ""
full_tag, updated_history, ok = FaceNameDialog.get_name(
self, history, main_win=self.main_win, region_type="Pet")
self, history, current_name=suggested, main_win=self.main_win, region_type="Pet")
if ok and full_tag:
new_pet['name'] = full_tag
@@ -3229,8 +3237,10 @@ class ImageViewer(QWidget):
# For bodies, we typically don't ask for a name immediately unless desired
# Or we can treat it like pets/faces and ask. Let's ask.
history = self.main_win.body_names_history if self.main_win else []
suggested = history[0] if history and APP_CONFIG.get(
"body_use_last_name", False) else ""
full_tag, updated_history, ok = FaceNameDialog.get_name(
self, history, main_win=self.main_win, region_type="Body")
self, history, current_name=suggested, main_win=self.main_win, region_type="Body")
if ok and full_tag:
new_body['name'] = full_tag

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "bagheeraview"
version = "0.9.20"
version = "0.9.21"
authors = [
{ name = "Ignacio Serantes" }
]

View File

@@ -614,6 +614,10 @@ class SettingsDialog(QDialog):
self.face_history_spin.setToolTip(UITexts.SETTINGS_FACE_HISTORY_TOOLTIP)
faces_layout.addLayout(face_history_layout)
self.face_use_last_name_check = QCheckBox(UITexts.SETTINGS_USE_LAST_NAME_LABEL)
self.face_use_last_name_check.setToolTip(UITexts.SETTINGS_USE_LAST_NAME_TOOLTIP)
faces_layout.addWidget(self.face_use_last_name_check)
# --- Pets Section ---
faces_layout.addSpacing(10)
pets_header = QLabel(UITexts.TYPE_PET)
@@ -670,6 +674,10 @@ class SettingsDialog(QDialog):
self.pet_history_spin.setToolTip(UITexts.SETTINGS_PET_HISTORY_TOOLTIP)
faces_layout.addLayout(pet_history_layout)
self.pet_use_last_name_check = QCheckBox(UITexts.SETTINGS_USE_LAST_NAME_LABEL)
self.pet_use_last_name_check.setToolTip(UITexts.SETTINGS_USE_LAST_NAME_TOOLTIP)
faces_layout.addWidget(self.pet_use_last_name_check)
# --- Body Section ---
faces_layout.addSpacing(10)
body_header = QLabel(UITexts.TYPE_BODY)
@@ -717,6 +725,10 @@ class SettingsDialog(QDialog):
self.body_history_spin.setToolTip(UITexts.SETTINGS_BODY_HISTORY_TOOLTIP)
faces_layout.addLayout(body_history_layout)
self.body_use_last_name_check = QCheckBox(UITexts.SETTINGS_USE_LAST_NAME_LABEL)
self.body_use_last_name_check.setToolTip(UITexts.SETTINGS_USE_LAST_NAME_TOOLTIP)
faces_layout.addWidget(self.body_use_last_name_check)
# --- Object Section ---
faces_layout.addSpacing(10)
object_header = QLabel(UITexts.TYPE_OBJECT)
@@ -763,6 +775,10 @@ class SettingsDialog(QDialog):
self.object_history_spin.setToolTip(UITexts.SETTINGS_OBJECT_HISTORY_TOOLTIP)
faces_layout.addLayout(object_history_layout)
self.object_use_last_name_check = QCheckBox(UITexts.SETTINGS_USE_LAST_NAME_LABEL)
self.object_use_last_name_check.setToolTip(UITexts.SETTINGS_USE_LAST_NAME_TOOLTIP)
faces_layout.addWidget(self.object_use_last_name_check)
# --- Landmark Section ---
faces_layout.addSpacing(10)
landmark_header = QLabel(UITexts.TYPE_LANDMARK)
@@ -810,6 +826,10 @@ class SettingsDialog(QDialog):
faces_layout.addLayout(landmark_history_layout)
faces_layout.addStretch()
self.landmark_use_last_name_check = QCheckBox(UITexts.SETTINGS_USE_LAST_NAME_LABEL)
self.landmark_use_last_name_check.setToolTip(UITexts.SETTINGS_USE_LAST_NAME_TOOLTIP)
faces_layout.addWidget(self.landmark_use_last_name_check)
# --- Viewer Tab ---
viewer_wheel_layout = QHBoxLayout()
viewer_wheel_label = QLabel(UITexts.SETTINGS_VIEWER_WHEEL_SPEED_LABEL)
@@ -911,6 +931,12 @@ class SettingsDialog(QDialog):
landmark_history_count = APP_CONFIG.get(
"landmark_menu_max_items", FACES_MENU_MAX_ITEMS_DEFAULT)
face_use_last_name = APP_CONFIG.get("face_use_last_name", False)
pet_use_last_name = APP_CONFIG.get("pet_use_last_name", False)
body_use_last_name = APP_CONFIG.get("body_use_last_name", False)
object_use_last_name = APP_CONFIG.get("object_use_last_name", False)
landmark_use_last_name = APP_CONFIG.get("landmark_use_last_name", False)
thumbs_refresh_interval = APP_CONFIG.get(
"thumbnails_refresh_interval", THUMBNAILS_REFRESH_INTERVAL_DEFAULT)
thumbs_bg_color = APP_CONFIG.get(
@@ -1026,6 +1052,12 @@ class SettingsDialog(QDialog):
self.object_history_spin.setValue(object_history_count)
self.landmark_history_spin.setValue(landmark_history_count)
self.face_use_last_name_check.setChecked(face_use_last_name)
self.pet_use_last_name_check.setChecked(pet_use_last_name)
self.body_use_last_name_check.setChecked(body_use_last_name)
self.object_use_last_name_check.setChecked(object_use_last_name)
self.landmark_use_last_name_check.setChecked(landmark_use_last_name)
self.thumbs_refresh_spin.setValue(thumbs_refresh_interval)
self.set_thumbs_bg_button_color(thumbs_bg_color)
self.set_thumbs_filename_button_color(thumbs_filename_color)
@@ -1282,6 +1314,13 @@ class SettingsDialog(QDialog):
APP_CONFIG["landmark_menu_max_items"] = self.landmark_history_spin.value()
APP_CONFIG["thumbnails_refresh_interval"] = self.thumbs_refresh_spin.value()
APP_CONFIG["face_use_last_name"] = self.face_use_last_name_check.isChecked()
APP_CONFIG["pet_use_last_name"] = self.pet_use_last_name_check.isChecked()
APP_CONFIG["body_use_last_name"] = self.body_use_last_name_check.isChecked()
APP_CONFIG["object_use_last_name"] = self.object_use_last_name_check.isChecked()
APP_CONFIG["landmark_use_last_name"] = \
self.landmark_use_last_name_check.isChecked()
APP_CONFIG["thumbnails_bg_color"] = self.current_thumbs_bg_color
APP_CONFIG["thumbnails_filename_color"] = self.current_thumbs_filename_color
APP_CONFIG["thumbnails_tags_color"] = self.current_thumbs_tags_color

View File

@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="bagheeraview",
version="0.9.20",
version="0.9.21",
author="Ignacio Serantes",
description="Bagheera Image Viewer - An image viewer for KDE with Baloo in mind",
long_description="A fast image viewer built with PySide6, featuring search and "