r2529 - people/synrg/xjig

Ben Armstrong synrg at alioth.debian.org
Wed Apr 4 23:54:16 UTC 2007


Author: synrg
Date: 2007-04-04 23:54:16 +0000 (Wed, 04 Apr 2007)
New Revision: 2529

Modified:
   people/synrg/xjig/xjig-menu
Log:
Fixed kdialog, renabled in dialog=auto mode

Modified: people/synrg/xjig/xjig-menu
===================================================================
--- people/synrg/xjig/xjig-menu	2007-04-04 21:44:37 UTC (rev 2528)
+++ people/synrg/xjig/xjig-menu	2007-04-04 23:54:16 UTC (rev 2529)
@@ -150,11 +150,10 @@
          dialog_answer="$(kdialog --error "${2}")"
          ;;
       text)
-         # FIXME: in testing, dimensions did not match 40x1
-         dialog_answer="$(kdialog --title "${2}" --textinputbox "${3}" "" 40 1)"
+         dialog_answer="$(kdialog --title "${2}" --inputbox "${3}" "")"
          ;;
       file)
-         dialog_answer="$(kdialog --title "${2}" --getopenfilename "$directory")"
+         dialog_answer="$(strace -f -okdialog.log kdialog --title "${2}" --getopenfilename "$directory")"
          ;;
    esac
 }
@@ -174,6 +173,13 @@
    esac
 }
 
+SetupDialog ()
+{
+   if [ "$dialog" = "kdialog" ] ; then 
+      kdeinit &>/dev/null
+   fi
+}
+
 Dialog ()
 {
    case $dialog in
@@ -291,13 +297,13 @@
       kdialog)
          if [ ! -x /usr/bin/kdialog ]; then
             dialog="none"
-            Dialog error "${PROGRAM}: Missing /usr/bin/kdialog"
+            Error "${PROGRAM}: Missing /usr/bin/kdialog"
          fi
          ;;
       zenity)
          if [ ! -x /usr/bin/zenity ]; then
             dialog="none"
-            Dialog error "${PROGRAM}: Missing /usr/bin/zenity"
+            Error "${PROGRAM}: Missing /usr/bin/zenity"
          fi
          ;;
       auto)
@@ -306,12 +312,9 @@
 #        match the user's session type (kdialog for KDE, zenity for
 #        GNOME & XFCE).  If zenity ever supports previews, do this kind
 #        of autodetection of the user's desktop.
-# FIXME: In tests on a non-KDE desktop kdialog was so slow it was
-#        unusable.  Disabled until I can figure out why and fix it.
-#         if [ -x /usr/bin/kdialog ]; then
-#            dialog="kdialog"
-#         elif [ -x /usr/bin/zenity ]; then
-         if [ -x /usr/bin/zenity ]; then
+         if [ -x /usr/bin/kdialog ]; then
+            dialog="kdialog"
+         elif [ -x /usr/bin/zenity ]; then
             dialog="zenity"
          else
             dialog="none"
@@ -322,7 +325,7 @@
       *)
          specified_dialog="$dialog"
          dialog="none"
-         Dialog error "${PROGRAM}: Invalid dialog: $specified_dialog"
+         Error "${PROGRAM}: Invalid dialog: $specified_dialog"
          ;;
    esac
    if [ -z "$filename" ] ; then
@@ -386,6 +389,7 @@
    Defaults
    Arguments "${@}"
    Validate
+   SetupDialog
    if [ "$make" = "enabled" ] ; then
       Error "${PROGRAM}: FIXME: make a desktop link in $desktop_directory"
    else




More information about the Pkg-games-commits mailing list