[Xfce4-commits] <xfce4-panel:devel> Set sensitivity of some launcher dialog widgets.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:28:41 CEST 2009
Updating branch refs/heads/devel
to 34c47b61549bc79b1600eedc4fa0a72a27a2a04d (commit)
from d181bbdac59dff3aaae8e45cb8aec4eae89ac9e2 (commit)
commit 34c47b61549bc79b1600eedc4fa0a72a27a2a04d
Author: Nick Schermer <nick at xfce.org>
Date: Fri Mar 6 19:57:08 2009 +0100
Set sensitivity of some launcher dialog widgets.
plugins/launcher/launcher-dialog.c | 16 ++++++++++++++--
plugins/launcher/launcher-dialog.glade | 2 +-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index 9b1c55c..1d26165 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -599,10 +599,14 @@ launcher_dialog_items_changed (XfconfChannel *channel,
LauncherPluginDialog *dialog)
{
XfceMenuItem *item;
- GObject *store;
+ GObject *store, *object;
GSList *items, *li;
gboolean update = TRUE;
GtkTreeIter iter;
+ gboolean multiple_items;
+ guint i;
+ const gchar *widget_names[] = {"arrow-position", "move-first",
+ "arrow-position-label" };
/* only do something when the items changed */
if (!exo_str_is_equal (property_name, "/items"))
@@ -651,6 +655,15 @@ launcher_dialog_items_changed (XfconfChannel *channel,
/* model is not empty but the channel is */
gtk_list_store_clear (GTK_LIST_STORE (store));
}
+
+ /* set the sensitivity of some dialog widgets */
+ multiple_items = LIST_HAS_TWO_OR_MORE_ENTRIES (items);
+ for (i = 0; i < G_N_ELEMENTS (widget_names); i++)
+ {
+ object = gtk_builder_get_object (dialog->builder, widget_names[i]);
+ panel_return_if_fail (GTK_IS_WIDGET (object));
+ gtk_widget_set_sensitive (GTK_WIDGET (object), multiple_items);
+ }
}
@@ -667,7 +680,6 @@ launcher_dialog_show (XfceLauncherPlugin *plugin)
"item-move-up", "item-move-down",
"item-edit", "item-new" };
-
panel_return_if_fail (XFCE_IS_LAUNCHER_PLUGIN (plugin));
builder = gtk_builder_new ();
diff --git a/plugins/launcher/launcher-dialog.glade b/plugins/launcher/launcher-dialog.glade
index 071a9c4..9af636e 100644
--- a/plugins/launcher/launcher-dialog.glade
+++ b/plugins/launcher/launcher-dialog.glade
@@ -310,7 +310,7 @@
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
- <object class="GtkLabel" id="label3">
+ <object class="GtkLabel" id="arrow-position-label">
<property name="visible">True</property>
<property name="label" translatable="yes">_Arrow button position:</property>
<property name="use_underline">True</property>
More information about the Xfce4-commits
mailing list