fix: GUI-Dialogauswahl und Konsolen-Fallback in darktable_wrapper

- darktable_wrapper.sh: DIALOG_BIN-Prüfung für fehlende GUI-Tools
- darktable_common.sh: Verbesserte Fehlerbehandlung bei Dialog-Auswahl

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 15:55:32 +02:00
parent 41f2ce85cc
commit 50e3b46cc9
2 changed files with 8 additions and 5 deletions
+7 -5
View File
@@ -83,6 +83,7 @@ log() {
} }
log_step() { log_step() {
echo ""
echo "=== $* ===" echo "=== $* ==="
} }
@@ -171,14 +172,15 @@ server_reachable() {
ask_user() { ask_user() {
local title="$1" text="$2" ans local title="$1" text="$2" ans
if command -v zenity &>/dev/null; then if [ "${DARKTABLE_SYNC_MODE:-}" = "gui" ] && command -v zenity &>/dev/null; then
zenity --question --title="$title" --text="$text" 2>/dev/null zenity --question --title="$title" --text="$text" 2>/dev/null
return $? return $?
elif command -v kdialog &>/dev/null; then elif [ "${DARKTABLE_SYNC_MODE:-}" = "gui" ] && command -v kdialog &>/dev/null; then
kdialog --title "$title" --yesno "$text" 2>/dev/null kdialog --title "$title" --yesno "$text" 2>/dev/null
return $? return $?
else else
read -r -p "$text [j/N] " ans || true printf '%b\n' "$text"
read -r -p "[j/N] " ans || true
[[ "$ans" =~ ^[jJyY] ]] [[ "$ans" =~ ^[jJyY] ]]
return $? return $?
fi fi
@@ -190,7 +192,7 @@ ask_conflict_resolution() {
local TITLE="Darktable Sync Konflikt" local TITLE="Darktable Sync Konflikt"
local EXPLAIN="Ein anderer Rechner hat die Datenbank seit deinem letzten Sync verändert.\nDeine lokalen Änderungen wurden noch NICHT auf den Server übertragen.\n\nWas soll passieren?" local EXPLAIN="Ein anderer Rechner hat die Datenbank seit deinem letzten Sync verändert.\nDeine lokalen Änderungen wurden noch NICHT auf den Server übertragen.\n\nWas soll passieren?"
if command -v zenity &>/dev/null; then if [ "${DARKTABLE_SYNC_MODE:-}" = "gui" ] && command -v zenity &>/dev/null; then
local choice local choice
choice=$(zenity --list \ choice=$(zenity --list \
--title="$TITLE" \ --title="$TITLE" \
@@ -207,7 +209,7 @@ ask_conflict_resolution() {
*) echo "download" ;; *) echo "download" ;;
esac esac
elif command -v kdialog &>/dev/null; then elif [ "${DARKTABLE_SYNC_MODE:-}" = "gui" ] && command -v kdialog &>/dev/null; then
local btn local btn
btn=$(kdialog --title "$TITLE" \ btn=$(kdialog --title "$TITLE" \
--menu "$EXPLAIN" \ --menu "$EXPLAIN" \
+1
View File
@@ -17,6 +17,7 @@ validate_config
log "Konfiguration geladen: Server=$SERVER_USER@$SERVER_IP:$SERVER_SSH_PORT" log "Konfiguration geladen: Server=$SERVER_USER@$SERVER_IP:$SERVER_SSH_PORT"
export DISPLAY="${DISPLAY:-:0}" export DISPLAY="${DISPLAY:-:0}"
export DARKTABLE_SYNC_MODE=gui
log "Prüfen ob Darktable bereits läuft..." log "Prüfen ob Darktable bereits läuft..."
if pgrep -x darktable &>/dev/null; then if pgrep -x darktable &>/dev/null; then