Make the proxy insensitive if the array is unset
This commit is contained in:
parent
abbfc163a3
commit
aa181a4a6f
1 changed files with 6 additions and 8 deletions
|
@ -223,7 +223,7 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
|
||||||
GtkWidget* menu,
|
GtkWidget* menu,
|
||||||
GtkWidget* proxy)
|
GtkWidget* proxy)
|
||||||
{
|
{
|
||||||
guint n, i;
|
guint i;
|
||||||
KatzeItem* item;
|
KatzeItem* item;
|
||||||
GtkWidget* menuitem;
|
GtkWidget* menuitem;
|
||||||
const gchar* icon_name;
|
const gchar* icon_name;
|
||||||
|
@ -231,11 +231,9 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
|
||||||
GtkWidget* image;
|
GtkWidget* image;
|
||||||
GtkWidget* submenu;
|
GtkWidget* submenu;
|
||||||
|
|
||||||
n = katze_array_get_length (array);
|
i = 0;
|
||||||
if (n > 0)
|
while ((item = katze_array_get_nth_item (array, i++)))
|
||||||
for (i = 0; i < n; i++)
|
|
||||||
{
|
{
|
||||||
item = katze_array_get_nth_item (array, i);
|
|
||||||
/* FIXME: The menu item should reflect changes to the item */
|
/* FIXME: The menu item should reflect changes to the item */
|
||||||
if (!KATZE_IS_ARRAY (item) && !katze_item_get_uri (item))
|
if (!KATZE_IS_ARRAY (item) && !katze_item_get_uri (item))
|
||||||
{
|
{
|
||||||
|
@ -274,7 +272,7 @@ katze_array_action_generate_menu (KatzeArrayAction* array_action,
|
||||||
G_CALLBACK (katze_array_action_menu_item_activate_cb), array_action);
|
G_CALLBACK (katze_array_action_menu_item_activate_cb), array_action);
|
||||||
gtk_widget_show (menuitem);
|
gtk_widget_show (menuitem);
|
||||||
}
|
}
|
||||||
else
|
if (!i)
|
||||||
{
|
{
|
||||||
menuitem = gtk_image_menu_item_new_with_label (_("Empty"));
|
menuitem = gtk_image_menu_item_new_with_label (_("Empty"));
|
||||||
gtk_widget_set_sensitive (menuitem, FALSE);
|
gtk_widget_set_sensitive (menuitem, FALSE);
|
||||||
|
@ -517,6 +515,7 @@ katze_array_action_connect_proxy (GtkAction* action,
|
||||||
g_signal_connect (proxy, "select",
|
g_signal_connect (proxy, "select",
|
||||||
G_CALLBACK (katze_array_action_proxy_clicked_cb), action);
|
G_CALLBACK (katze_array_action_proxy_clicked_cb), action);
|
||||||
}
|
}
|
||||||
|
gtk_widget_set_sensitive (proxy, KATZE_ARRAY_ACTION (action)->array != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -568,9 +567,8 @@ katze_array_action_set_array (KatzeArrayAction* array_action,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do
|
do
|
||||||
if (GTK_IS_TOOL_ITEM (proxies->data))
|
|
||||||
{
|
{
|
||||||
|
gtk_widget_set_sensitive (proxies->data, array != NULL);
|
||||||
}
|
}
|
||||||
while ((proxies = g_slist_next (proxies)));
|
while ((proxies = g_slist_next (proxies)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue