[Xfce4-commits] r29433 - in xfce4-settings/trunk: . xfce4-settings-manager

Jannis Pohlmann jannis at xfce.org
Tue Feb 3 00:09:19 CET 2009


Author: jannis
Date: 2009-02-02 23:09:19 +0000 (Mon, 02 Feb 2009)
New Revision: 29433

Modified:
   xfce4-settings/trunk/configure.ac.in
   xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c
Log:
Make support for embedded dialogs optional (and disabled by default). It
can be turned on with --enable-pluggable-dialogs. Fix the xsettings
daemon configure flag.

Modified: xfce4-settings/trunk/configure.ac.in
===================================================================
--- xfce4-settings/trunk/configure.ac.in	2009-02-02 23:09:02 UTC (rev 29432)
+++ xfce4-settings/trunk/configure.ac.in	2009-02-02 23:09:19 UTC (rev 29433)
@@ -114,18 +114,32 @@
 dnl *** Xsettings daemon is optional ***
 dnl ************************************
 AC_ARG_ENABLE([xsettings-daemon],
-              [AC_HELP_STRING([--disable-xsettings-daemon],
-                              [Don't build the XSETTINGS daemon (default=yes)])],
+              [AC_HELP_STRING([--enable-xsettings-daemon],
+                              [Build the XSETTINGS daemon (default=yes)])],
               [build_xfsettingsd=$enableval],
               [build_xfsettingsd=yes])
 AM_CONDITIONAL([BUILD_XFSETTINGSD], [test "x$build_xfsettingsd" = "xyes"])
 
+dnl make pluggable settings dialogs optional
+AC_ARG_ENABLE([pluggable-dialogs],
+              [AC_HELP_STRING([--enable-pluggable-dialogs],
+                              [Enable support for embedded settings dialogs (default=no)])],
+              [enable_pluggable_dialogs=$enableval],
+              [enable_pluggable_dialogs=no])
+if test x"$enable_pluggable_dialogs" = x"yes"; then
+  AC_DEFINE([ENABLE_PLUGGABLE_DIALOGS], [1], [Define to enable embedded settings dialogs])
+  ENABLE_PLUGGABLE_DIALOGS=1
+fi
+AC_SUBST(ENABLE_PLUGGABLE_DIALOGS)
+
 dnl ****************************************
-dnl *** Optional support for Libcamberra ***
+dnl *** Optional support for Libcanberra ***
 dnl ****************************************
+
+dnl Camberra XSettings
 AC_ARG_ENABLE([sound-settings],
               [AC_HELP_STRING([--enable-sound-settings],
-                              [Enable sound XSETTINGS in GUI (from libcamberra) (default=no)])],
+                              [Enable sound XSETTINGS in GUI (from libcanberra) (default=no)])],
               [enable_sound_settings=$enableval],
               [enable_sound_settings=no])
 if test x"$enable_sound_settings" = x"yes"; then
@@ -268,6 +282,11 @@
 else
 echo "* Xcursor support:           no"
 fi
+if test x"$ENABLE_PLUGGABLE_DIALOGS" = x"1"; then
+echo "* Embedded settings dialogs  yes"
+else
+echo "* Embedded settings dialogs  no"
+fi
 if test x"$ENABLE_SOUND_SETTINGS" = x"1"; then
 echo "* Sounds settings support    yes"
 else

Modified: xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c
===================================================================
--- xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c	2009-02-02 23:09:02 UTC (rev 29432)
+++ xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c	2009-02-02 23:09:19 UTC (rev 29433)
@@ -88,8 +88,10 @@
     COL_COMMENT,
     COL_EXEC,
     COL_SNOTIFY,
+#ifdef ENABLE_PLUGGABLE_DIALOGS
     COL_PLUGGABLE,
     COL_HELP_FILE,
+#endif
     COL_DIALOG_NAME,
     N_COLS
 };
@@ -375,10 +377,17 @@
     gchar **dirs, buf[PATH_MAX];
     gint i, icon_size;
 
-    dialog->ls = gtk_list_store_new(N_COLS, G_TYPE_STRING, G_TYPE_STRING,
-                                    G_TYPE_STRING, G_TYPE_STRING,
-                                    G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, 
-                                    G_TYPE_STRING, G_TYPE_STRING);
+    dialog->ls = gtk_list_store_new(N_COLS, 
+                                    G_TYPE_STRING, 
+                                    G_TYPE_STRING,
+                                    G_TYPE_STRING, 
+                                    G_TYPE_STRING,
+                                    G_TYPE_BOOLEAN, 
+#ifdef ENABLE_PLUGGABLE_DIALOGS
+                                    G_TYPE_BOOLEAN, 
+                                    G_TYPE_STRING, 
+#endif
+                                    G_TYPE_STRING);
     
     dirs = xfce_resource_lookup_all(XFCE_RESOURCE_DATA, "applications/");
     if(!dirs)
@@ -478,8 +487,10 @@
                                COL_COMMENT, xfce_rc_read_entry(rcfile, "Comment", NULL),
                                COL_EXEC, exec,
                                COL_SNOTIFY, xfce_rc_read_bool_entry(rcfile, "StartupNotify", FALSE),
+#ifdef ENABLE_PLUGGABLE_DIALOGS
                                COL_PLUGGABLE, xfce_rc_read_bool_entry(rcfile, "X-XfcePluggable", FALSE),
                                COL_HELP_FILE, xfce_rc_read_entry(rcfile, "X-XfceHelpFile", FALSE),
+#endif
                                COL_DIALOG_NAME, dialog_name,
                                -1);
             
@@ -507,10 +518,12 @@
 {
     XfceSettingsManagerDialog *dialog = user_data;
     GtkTreeIter iter;
-    gchar *exec = NULL, *name, *comment, *icon_name, *primary, *help_file, 
-          *command;
+    gchar *exec = NULL, *name, *comment, *icon_name, *primary, *command;
     gboolean snotify = FALSE;
+#ifdef ENABLE_PLUGGABLE_DIALOGS
     gboolean pluggable = FALSE;
+    gchar *help_file;
+#endif
     GError *error = NULL;
 
     if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->ls), &iter, path))
@@ -522,13 +535,16 @@
                        COL_EXEC, &exec,
                        COL_ICON_NAME, &icon_name,
                        COL_SNOTIFY, &snotify,
+#ifdef ENABLE_PLUGGABLE_DIALOGS
                        COL_PLUGGABLE, &pluggable,
                        COL_HELP_FILE, &help_file,
+#endif
                        -1);
 
     /* Kill the previously spawned dialog (if there is any) */
     xfce_settings_manager_dialog_recreate_socket(dialog);
 
+#ifdef ENABLE_PLUGGABLE_DIALOGS
     if(pluggable) {
         /* Update dialog title and icon */
         gtk_window_set_title(GTK_WINDOW(dialog), name);
@@ -570,6 +586,7 @@
 
         g_free(command);
     } else {
+#endif
         /* Switch to the main view (just to be sure) */
         xfce_settings_manager_dialog_reset_view(dialog, TRUE);
 
@@ -585,13 +602,15 @@
             g_free(primary);
             g_error_free(error);
         }
+#ifdef ENABLE_PLUGGABLE_DIALOGS
     }
 
+    g_free(help_file);
+#endif
     g_free(exec);
     g_free(name);
     g_free(comment);
     g_free(icon_name);
-    g_free(help_file);
 }
 
 static void
@@ -650,8 +669,15 @@
 static gboolean
 xfce_settings_manager_dialog_show_client(XfceSettingsManagerDialog *dialog)
 {
+    GdkWindow *window;
+    gint width, height;
+
     g_return_val_if_fail(XFCE_IS_SETTINGS_MANAGER_DIALOG(dialog), FALSE);
 
+    window = gtk_socket_get_plug_window(GTK_SOCKET(dialog->socket));
+    gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
+    g_debug ("geometry = (%i,%i)", width, height);
+
     gtk_widget_show(dialog->client_frame);
     return FALSE;
 }




More information about the Xfce4-commits mailing list