diff options
-rw-r--r-- | plugins/gtkui/actions.c | 12 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 2 | ||||
-rw-r--r-- | plugins/shellexec/shellexec.c | 7 | ||||
-rw-r--r-- | plugins/shellexecui/interface.c | 12 | ||||
-rw-r--r-- | plugins/shellexecui/shellexec.glade | 25 | ||||
-rw-r--r-- | plugins/shellexecui/shellexecui.c | 5 |
6 files changed, 59 insertions, 4 deletions
diff --git a/plugins/gtkui/actions.c b/plugins/gtkui/actions.c index 3b7bc5c8..f96caee4 100644 --- a/plugins/gtkui/actions.c +++ b/plugins/gtkui/actions.c @@ -28,6 +28,10 @@ #define trace(...) { fprintf(stderr, __VA_ARGS__); } //#define trace(fmt,...) +#define GLADE_HOOKUP_OBJECT(component,widget,name) \ + g_object_set_data_full (G_OBJECT (component), name, \ + g_object_ref(G_OBJECT(widget)), (GDestroyNotify) g_object_unref) + static void on_actionitem_activate (GtkMenuItem *menuitem, DB_plugin_action_t *action) @@ -72,7 +76,7 @@ add_mainmenu_actions (GtkWidget *mainwin) char *prev_title = NULL; - GtkWidget *current = mainwin; + GtkWidget *current = lookup_widget (mainwin, "menubar1"); GtkWidget *previous; while (1) @@ -95,8 +99,9 @@ add_mainmenu_actions (GtkWidget *mainwin) gtk_menu_shell_insert (GTK_MENU_SHELL (current), actionitem, 5); else if (0 == strcmp ("Edit", prev_title)) gtk_menu_shell_insert (GTK_MENU_SHELL (current), actionitem, 7); - else + else { gtk_container_add (GTK_CONTAINER (current), actionitem); + } g_signal_connect ((gpointer) actionitem, "activate", G_CALLBACK (on_actionitem_activate), @@ -109,7 +114,7 @@ add_mainmenu_actions (GtkWidget *mainwin) snprintf (menuname, sizeof (menuname), "%s_menu", ptr); previous = current; - current = lookup_widget (current, menuname); + current = lookup_widget (mainwin, menuname); if (!current) { GtkWidget *newitem; @@ -125,6 +130,7 @@ add_mainmenu_actions (GtkWidget *mainwin) current = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (newitem), current); + GLADE_HOOKUP_OBJECT (mainwin, current, "Plugins_menu"); } prev_title = ptr; ptr = slash + 1; diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index ffbbd893..b067bd23 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -1292,7 +1292,7 @@ gtkui_connect_cb (void *none) { } } gtkui_playlist_changed (); - add_mainmenu_actions (lookup_widget (mainwin, "menubar1")); + add_mainmenu_actions (mainwin); return FALSE; } diff --git a/plugins/shellexec/shellexec.c b/plugins/shellexec/shellexec.c index fcc61aa8..58b21262 100644 --- a/plugins/shellexec/shellexec.c +++ b/plugins/shellexec/shellexec.c @@ -39,6 +39,7 @@ local - command allowed for local files remote - command allowed for non-local files playlist - command allowed for playlist tabs + common - command appears in main menu bar */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -159,6 +160,9 @@ shx_save_actions(Shx_action_t *action_list) if(action->parent.flags & DB_ACTION_ALLOW_MULTIPLE_TRACKS) { strcat(conf_line, "multiple,"); } + if(action->parent.flags & DB_ACTION_COMMON) { + strcat(conf_line, "common,"); + } deadbeef->conf_set_str(conf_key, conf_line); action = (Shx_action_t*)action->parent.next; i++; @@ -235,6 +239,9 @@ shx_get_actions (DB_plugin_action_callback_t callback) if (strstr (flags, "playlist")) action->parent.flags |= DB_ACTION_PLAYLIST; + if (strstr (flags, "common")) + action->parent.flags |= DB_ACTION_COMMON; + if (prev) prev->parent.next = (DB_plugin_action_t *)action; prev = action; diff --git a/plugins/shellexecui/interface.c b/plugins/shellexecui/interface.c index cb986101..671af44c 100644 --- a/plugins/shellexecui/interface.c +++ b/plugins/shellexecui/interface.c @@ -129,6 +129,7 @@ create_shellexec_conf_edit_dialog (void) GtkWidget *local_check; GtkWidget *remote_check; GtkWidget *playlist_check; + GtkWidget *common_check; GtkWidget *dialog_action_area1; GtkWidget *edit_cancel_button; GtkWidget *edit_ok_button; @@ -197,22 +198,32 @@ create_shellexec_conf_edit_dialog (void) single_check = gtk_check_button_new_with_mnemonic (_("Single Tracks")); gtk_widget_show (single_check); gtk_box_pack_start (GTK_BOX (dialog_vbox1), single_check, FALSE, FALSE, 0); + gtk_widget_set_tooltip_text (single_check, _("Works on single track.")); multiple_check = gtk_check_button_new_with_mnemonic (_("Multiple Tracks")); gtk_widget_show (multiple_check); gtk_box_pack_start (GTK_BOX (dialog_vbox1), multiple_check, FALSE, FALSE, 0); + gtk_widget_set_tooltip_text (multiple_check, _("Works on multiple tracks.")); local_check = gtk_check_button_new_with_mnemonic (_("Local")); gtk_widget_show (local_check); gtk_box_pack_start (GTK_BOX (dialog_vbox1), local_check, FALSE, FALSE, 0); + gtk_widget_set_tooltip_text (local_check, _("Works on local files.")); remote_check = gtk_check_button_new_with_mnemonic (_("Remote")); gtk_widget_show (remote_check); gtk_box_pack_start (GTK_BOX (dialog_vbox1), remote_check, FALSE, FALSE, 0); + gtk_widget_set_tooltip_text (remote_check, _("Works on remote files (e.g. http:// streams)")); playlist_check = gtk_check_button_new_with_mnemonic (_("Playlist")); gtk_widget_show (playlist_check); gtk_box_pack_start (GTK_BOX (dialog_vbox1), playlist_check, FALSE, FALSE, 0); + gtk_widget_set_tooltip_text (playlist_check, _("Item should appear on the playlist tab context menu")); + + common_check = gtk_check_button_new_with_mnemonic (_("Common")); + gtk_widget_show (common_check); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), common_check, FALSE, FALSE, 0); + gtk_widget_set_tooltip_text (common_check, _("Item should appear in the main menu")); dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG (shellexec_conf_edit_dialog)); gtk_widget_show (dialog_action_area1); @@ -250,6 +261,7 @@ create_shellexec_conf_edit_dialog (void) GLADE_HOOKUP_OBJECT (shellexec_conf_edit_dialog, local_check, "local_check"); GLADE_HOOKUP_OBJECT (shellexec_conf_edit_dialog, remote_check, "remote_check"); GLADE_HOOKUP_OBJECT (shellexec_conf_edit_dialog, playlist_check, "playlist_check"); + GLADE_HOOKUP_OBJECT (shellexec_conf_edit_dialog, common_check, "common_check"); GLADE_HOOKUP_OBJECT_NO_REF (shellexec_conf_edit_dialog, dialog_action_area1, "dialog_action_area1"); GLADE_HOOKUP_OBJECT (shellexec_conf_edit_dialog, edit_cancel_button, "edit_cancel_button"); GLADE_HOOKUP_OBJECT (shellexec_conf_edit_dialog, edit_ok_button, "edit_ok_button"); diff --git a/plugins/shellexecui/shellexec.glade b/plugins/shellexecui/shellexec.glade index 2b291d9f..e90504e6 100644 --- a/plugins/shellexecui/shellexec.glade +++ b/plugins/shellexecui/shellexec.glade @@ -386,6 +386,7 @@ <child> <widget class="GtkCheckButton" id="single_check"> <property name="visible">True</property> + <property name="tooltip" translatable="yes">Works on single track.</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Single Tracks</property> <property name="use_underline">True</property> @@ -405,6 +406,7 @@ <child> <widget class="GtkCheckButton" id="multiple_check"> <property name="visible">True</property> + <property name="tooltip" translatable="yes">Works on multiple tracks.</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Multiple Tracks</property> <property name="use_underline">True</property> @@ -424,6 +426,7 @@ <child> <widget class="GtkCheckButton" id="local_check"> <property name="visible">True</property> + <property name="tooltip" translatable="yes">Works on local files.</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Local</property> <property name="use_underline">True</property> @@ -443,6 +446,7 @@ <child> <widget class="GtkCheckButton" id="remote_check"> <property name="visible">True</property> + <property name="tooltip" translatable="yes">Works on remote files (e.g. http:// streams)</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Remote</property> <property name="use_underline">True</property> @@ -462,6 +466,7 @@ <child> <widget class="GtkCheckButton" id="playlist_check"> <property name="visible">True</property> + <property name="tooltip" translatable="yes">Item should appear on the playlist tab context menu</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Playlist</property> <property name="use_underline">True</property> @@ -477,6 +482,26 @@ <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="common_check"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Item should appear in the main menu</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Common</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> </child> </widget> diff --git a/plugins/shellexecui/shellexecui.c b/plugins/shellexecui/shellexecui.c index 6662798e..5d76ccff 100644 --- a/plugins/shellexecui/shellexecui.c +++ b/plugins/shellexecui/shellexecui.c @@ -221,6 +221,9 @@ on_edit_button_clicked(GtkButton *button, gpointer user_data) { gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(lookup_widget(edit_dlg, "remote_check")), current_action->shx_flags & SHX_ACTION_REMOTE_ONLY); + gtk_toggle_button_set_active( + GTK_TOGGLE_BUTTON(lookup_widget(edit_dlg, "common_check")), + current_action->parent.flags & DB_ACTION_COMMON); //disable_button(edit_dlg, "edit_ok_button"); // OK button is disabled by default gtk_widget_show(edit_dlg); @@ -325,6 +328,8 @@ on_edit_ok_button_clicked (GtkButton *button, gpointer user_data) { shx_flags = (shx_flags & ~SHX_ACTION_LOCAL_ONLY) | (active?SHX_ACTION_LOCAL_ONLY:0); active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(edit_dlg, "remote_check"))); shx_flags = (shx_flags & ~SHX_ACTION_REMOTE_ONLY) | (active?SHX_ACTION_REMOTE_ONLY:0); + active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(edit_dlg, "common_check"))); + flags = (flags & ~DB_ACTION_COMMON) | (active?DB_ACTION_COMMON:0); current_action->parent.flags = flags; current_action->shx_flags = shx_flags; |