chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move track sorting to its own function. Only choose_populate() uses
[disorder]
/
disobedience
/
menu.c
diff --git
a/disobedience/menu.c
b/disobedience/menu.c
index 8dcae3cb33456f41819cd95fbe5509765367656f..73f09091fe4b3f1d231b24c022ae0e4f58590672 100644
(file)
--- a/
disobedience/menu.c
+++ b/
disobedience/menu.c
@@
-59,7
+59,7
@@
static void select_all(gpointer attribute((unused)) callback_data,
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
if(t->selectall_activate)
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
if(t->selectall_activate)
- t->selectall_activate(t->extra);
+ t->selectall_activate(
NULL,
t->extra);
}
/** @brief Called when the select none option is activated
}
/** @brief Called when the select none option is activated
@@
-74,7
+74,7
@@
static void select_none(gpointer attribute((unused)) callback_data,
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
if(t->selectnone_activate)
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
if(t->selectnone_activate)
- t->selectnone_activate(t->extra);
+ t->selectnone_activate(
NULL,
t->extra);
}
/** @brief Called when the track properties option is activated
}
/** @brief Called when the track properties option is activated
@@
-89,7
+89,7
@@
static void properties_item(gpointer attribute((unused)) callback_data,
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
if(t->properties_activate)
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
if(t->properties_activate)
- t->properties_activate(t->extra);
+ t->properties_activate(
NULL,
t->extra);
}
/** @brief Called when the login option is activated */
}
/** @brief Called when the login option is activated */
@@
-115,19
+115,18
@@
static void settings(gpointer attribute((unused)) callback_data,
}
#endif
}
#endif
-/** @brief
Update menu state
+/** @brief
Called when edit menu is shown
*
* Determines option sensitivity according to the current tab and adjusts the
* widgets accordingly. Knows about @ref DISORDER_CONNECTED so the callbacks
* need not.
*
* Determines option sensitivity according to the current tab and adjusts the
* widgets accordingly. Knows about @ref DISORDER_CONNECTED so the callbacks
* need not.
- *
- * TODO: base this on menu popup instead?
*/
*/
-void menu_update(int page) {
+static void edit_menu_show(GtkWidget attribute((unused)) *widget,
+ gpointer attribute((unused)) user_data) {
if(tabs) {
GtkWidget *tab = gtk_notebook_get_nth_page
(GTK_NOTEBOOK(tabs),
if(tabs) {
GtkWidget *tab = gtk_notebook_get_nth_page
(GTK_NOTEBOOK(tabs),
-
page < 0 ? gtk_notebook_current_page(GTK_NOTEBOOK(tabs)) : page
);
+
gtk_notebook_current_page(GTK_NOTEBOOK(tabs))
);
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
assert(t != 0);
const struct tabtype *t = g_object_get_data(G_OBJECT(tab), "type");
assert(t != 0);
@@
-411,6
+410,12
@@
GtkWidget *menubar(GtkWidget *w) {
assert(selectall_widget != 0);
assert(selectnone_widget != 0);
assert(properties_widget != 0);
assert(selectall_widget != 0);
assert(selectnone_widget != 0);
assert(properties_widget != 0);
+
+
+ GtkWidget *edit_widget = gtk_item_factory_get_widget(mainmenufactory,
+ "<GdisorderMain>/Edit");
+ g_signal_connect(edit_widget, "show", G_CALLBACK(edit_menu_show), 0);
+
event_register("rights-changed", menu_rights_changed, 0);
users_set_sensitive(0);
m = gtk_item_factory_get_widget(mainmenufactory,
event_register("rights-changed", menu_rights_changed, 0);
users_set_sensitive(0);
m = gtk_item_factory_get_widget(mainmenufactory,