From 7eeeacd7041caf80713e78e1b3c8f6c7a6035185 Mon Sep 17 00:00:00 2001 From: waker Date: Tue, 24 Apr 2012 20:15:30 +0200 Subject: shellexecui: added support for 'common' flag to GUI config, added some tooltips shellexed: save/load 'common' flag gtkui: fixed duplication when adding new custom popup menus --- plugins/shellexecui/interface.c | 12 ++++++++++++ plugins/shellexecui/shellexec.glade | 25 +++++++++++++++++++++++++ plugins/shellexecui/shellexecui.c | 5 +++++ 3 files changed, 42 insertions(+) (limited to 'plugins/shellexecui') 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 @@ True + Works on single track. True Single Tracks True @@ -405,6 +406,7 @@ True + Works on multiple tracks. True Multiple Tracks True @@ -424,6 +426,7 @@ True + Works on local files. True Local True @@ -443,6 +446,7 @@ True + Works on remote files (e.g. http:// streams) True Remote True @@ -462,6 +466,7 @@ True + Item should appear on the playlist tab context menu True Playlist True @@ -477,6 +482,26 @@ False + + + + True + Item should appear in the main menu + True + Common + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + 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; -- cgit v1.2.3