165 lines
5.4 KiB
Python
165 lines
5.4 KiB
Python
from typing import Dict, Any
|
|
|
|
|
|
class Config:
|
|
# Application settings
|
|
APP_NAME = "Programm-Shortcut"
|
|
APP_VERSION = "2.0"
|
|
APP_AUTHOR = "© 2025 Akamaru"
|
|
APP_DESCRIPTION = "Erstellt mit Hilfe von Claude"
|
|
SOURCE_URL = "https://git.ponywave.de/Akamaru/Programm-Shortcut"
|
|
|
|
# Window settings
|
|
DEFAULT_WINDOW_WIDTH = 700
|
|
DEFAULT_WINDOW_HEIGHT = 550
|
|
MIN_WINDOW_WIDTH = 600
|
|
MIN_WINDOW_HEIGHT = 450
|
|
|
|
# GUI settings
|
|
TREEVIEW_ROW_HEIGHT = 24
|
|
CATEGORY_LIST_HEIGHT = 15
|
|
CATEGORY_LIST_WIDTH = 15
|
|
PROGRAM_NAME_PADDING = " " # 3 spaces for icon alignment
|
|
|
|
# Icon settings
|
|
ICON_SIZE = (16, 16)
|
|
ICON_FILE = "icon.ico"
|
|
|
|
# File settings
|
|
DATA_FILE = "data.json"
|
|
LEGACY_FILE = "program_list.json"
|
|
|
|
|
|
# Modern color themes
|
|
THEMES = {
|
|
"modern_dark": {
|
|
"bg_primary": "#2b2b2b",
|
|
"bg_secondary": "#3c3c3c",
|
|
"bg_tertiary": "#4a4a4a",
|
|
"accent": "#007acc",
|
|
"accent_hover": "#1e90ff",
|
|
"success": "#28a745",
|
|
"success_hover": "#34ce57",
|
|
"danger": "#dc3545",
|
|
"text_primary": "#ffffff",
|
|
"text_secondary": "#cccccc",
|
|
"text_muted": "#888888",
|
|
"border": "#555555",
|
|
"selection": "#007acc",
|
|
"selection_hover": "#1e90ff"
|
|
},
|
|
"modern_light": {
|
|
"bg_primary": "#ffffff",
|
|
"bg_secondary": "#f8f9fa",
|
|
"bg_tertiary": "#e9ecef",
|
|
"accent": "#007acc",
|
|
"accent_hover": "#1e90ff",
|
|
"success": "#28a745",
|
|
"success_hover": "#34ce57",
|
|
"danger": "#dc3545",
|
|
"text_primary": "#212529",
|
|
"text_secondary": "#495057",
|
|
"text_muted": "#6c757d",
|
|
"border": "#dee2e6",
|
|
"selection": "#007acc",
|
|
"selection_hover": "#1e90ff"
|
|
},
|
|
"gradient_blue": {
|
|
"bg_primary": "#f0f2f5",
|
|
"bg_secondary": "#ffffff",
|
|
"bg_tertiary": "#e3f2fd",
|
|
"accent": "#1976d2",
|
|
"accent_hover": "#1565c0",
|
|
"success": "#4caf50",
|
|
"success_hover": "#43a047",
|
|
"danger": "#f44336",
|
|
"text_primary": "#263238",
|
|
"text_secondary": "#546e7a",
|
|
"text_muted": "#90a4ae",
|
|
"border": "#cfd8dc",
|
|
"selection": "#1976d2",
|
|
"selection_hover": "#1565c0"
|
|
}
|
|
}
|
|
|
|
# Current theme (can be changed)
|
|
CURRENT_THEME = "gradient_blue"
|
|
|
|
@classmethod
|
|
def get_theme(cls) -> dict:
|
|
return cls.THEMES[cls.CURRENT_THEME]
|
|
|
|
# Modern typography
|
|
FONTS = {
|
|
"heading": ("Segoe UI", 18, "bold"),
|
|
"subheading": ("Segoe UI", 14, "bold"),
|
|
"body": ("Segoe UI", 11),
|
|
"body_small": ("Segoe UI", 10),
|
|
"caption": ("Segoe UI", 9),
|
|
"button": ("Segoe UI", 10, "bold"),
|
|
"link": ("Segoe UI", 10, "underline")
|
|
}
|
|
|
|
# Compact UI Spacing
|
|
SPACING = {
|
|
"xs": 2,
|
|
"sm": 4,
|
|
"md": 6,
|
|
"lg": 8,
|
|
"xl": 12,
|
|
"xxl": 16
|
|
}
|
|
|
|
# Compact button styles
|
|
BUTTON_STYLES = {
|
|
"primary": {"style": "primary", "width": 80, "padding": (6, 4)},
|
|
"secondary": {"style": "secondary", "width": 70, "padding": (4, 3)},
|
|
"small": {"style": "small", "width": 24, "padding": (2, 2)},
|
|
"icon": {"style": "icon", "width": 28, "padding": (3, 3)}
|
|
}
|
|
|
|
# Border radius for modern look
|
|
BORDER_RADIUS = 8
|
|
|
|
# Compact card styling
|
|
CARD_PADDING = 8
|
|
CARD_SHADOW = {"x": 0, "y": 1, "blur": 3}
|
|
|
|
# Sort options
|
|
SORT_OPTIONS = [
|
|
"Keine",
|
|
"Programm (A-Z)",
|
|
"Programm (Z-A)",
|
|
"Kategorie (A-Z)",
|
|
"Kategorie (Z-A)"
|
|
]
|
|
|
|
# Messages
|
|
MESSAGES = {
|
|
"no_program_selected": "Bitte wählen Sie ein Programm aus.",
|
|
"no_category_selected": "Bitte wählen Sie eine Kategorie zum Entfernen aus.",
|
|
"cannot_remove_all": "Die Kategorie 'Alle' kann nicht entfernt werden.",
|
|
"fill_all_fields": "Bitte füllen Sie alle Felder aus.",
|
|
"path_not_exists": "Der angegebene Pfad existiert nicht.",
|
|
"category_exists": "Die Kategorie '{}' existiert bereits.",
|
|
"program_not_found": "Programm '{}' konnte nicht gefunden werden.",
|
|
"error_starting_program": "Fehler beim Starten des Programms: {}",
|
|
"error_loading_data": "Fehler beim Laden der Daten: {}\nEine neue Liste wird erstellt.",
|
|
"error_saving_data": "Fehler beim Speichern der Daten: {}",
|
|
"error_opening_url": "Fehler beim Öffnen der URL: {}",
|
|
"icon_libraries_missing": "Warnung: Die Bibliotheken für Programm-Icons fehlen. Installieren Sie diese mit: pip install pywin32 Pillow",
|
|
"confirm_remove_category": "Möchten Sie die Kategorie '{}' wirklich entfernen?\n\nAlle Programme in dieser Kategorie werden ohne Kategorie gespeichert.",
|
|
"confirm_remove_program": "Möchten Sie '{}' wirklich entfernen?",
|
|
"help_text": "Wählen Sie ein Programm zum Starten oder fügen Sie ein neues hinzu"
|
|
}
|
|
|
|
@classmethod
|
|
def get_default_options(cls) -> Dict[str, Any]:
|
|
return {
|
|
"default_sort_column": None,
|
|
"default_sort_reverse": False,
|
|
"remember_last_category": False,
|
|
"last_category": "Alle",
|
|
"window_width": cls.DEFAULT_WINDOW_WIDTH,
|
|
"window_height": cls.DEFAULT_WINDOW_HEIGHT
|
|
} |