Commit 9d4002c3 authored by Jannis Pohlmann's avatar Jannis Pohlmann

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.

(Old svn revision: 29433)
parent 7371072e
......@@ -114,18 +114,32 @@ dnl ************************************
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 @@ echo "* Xcursor support: yes"
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
......
......@@ -88,8 +88,10 @@ enum
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 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog)
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 @@ xfce_settings_manager_dialog_create_liststore(XfceSettingsManagerDialog *dialog)
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 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
{
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 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
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 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
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 @@ xfce_settings_manager_dialog_item_activated(ExoIconView *iconview,
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 @@ xfce_settings_manager_dialog_response(GtkDialog *dialog,
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment