diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-08-12 21:17:28 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-08-12 21:17:28 +0200 |
commit | 7be7cfb77696e8e952997f3daf44bc3a1fdf64be (patch) | |
tree | 2d3803867386c681292ca34331b5e6963db61d2b /plugins/gtkui | |
parent | ac633ff319b0a1aaa0f3bc431249d3fe5a1971fd (diff) |
added option to open files from command line in named playlist
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/callbacks.c | 1 | ||||
-rw-r--r-- | plugins/gtkui/callbacks.h | 8 | ||||
-rw-r--r-- | plugins/gtkui/deadbeef.glade | 53 | ||||
-rw-r--r-- | plugins/gtkui/interface.c | 25 | ||||
-rw-r--r-- | plugins/gtkui/prefwin.c | 23 |
5 files changed, 110 insertions, 0 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index 26b9a028..7f930caa 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -1059,3 +1059,4 @@ create_seekbar (gchar *widget_name, gchar *string1, gchar *string2, } + diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h index 8b99d942..839b57a2 100644 --- a/plugins/gtkui/callbacks.h +++ b/plugins/gtkui/callbacks.h @@ -958,3 +958,11 @@ on_titlebar_format_playing_changed (GtkEditable *editable, void on_titlebar_format_stopped_changed (GtkEditable *editable, gpointer user_data); + +void +on_cli_add_to_playlist_toggled (GtkToggleButton *togglebutton, + gpointer user_data); + +void +on_cli_playlist_name_changed (GtkEditable *editable, + gpointer user_data); diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index dde2daf9..be214120 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -2936,6 +2936,59 @@ Album</property> <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkHBox" id="hbox66"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">8</property> + + <child> + <widget class="GtkCheckButton" id="cli_add_to_playlist"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Add files from command line (or file manager) to this playlist:</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> + <signal name="toggled" handler="on_cli_add_to_playlist_toggled" last_modification_time="Thu, 12 Aug 2010 19:12:26 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="cli_playlist_name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + <signal name="changed" handler="on_cli_playlist_name_changed" last_modification_time="Thu, 12 Aug 2010 19:12:30 GMT"/> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> <packing> <property name="tab_expand">False</property> diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index f2a896c5..61521323 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -1567,6 +1567,9 @@ create_prefwin (void) GtkWidget *hbox65; GtkWidget *label102; GtkWidget *titlebar_format_stopped; + GtkWidget *hbox66; + GtkWidget *cli_add_to_playlist; + GtkWidget *cli_playlist_name; GtkWidget *label2; GtkWidget *notebook4; GtkWidget *vbox21; @@ -1850,6 +1853,19 @@ create_prefwin (void) gtk_box_pack_start (GTK_BOX (hbox65), titlebar_format_stopped, TRUE, TRUE, 0); gtk_entry_set_invisible_char (GTK_ENTRY (titlebar_format_stopped), 8226); + hbox66 = gtk_hbox_new (FALSE, 8); + gtk_widget_show (hbox66); + gtk_box_pack_start (GTK_BOX (vbox9), hbox66, FALSE, FALSE, 0); + + cli_add_to_playlist = gtk_check_button_new_with_mnemonic (_("Add files from command line (or file manager) to this playlist:")); + gtk_widget_show (cli_add_to_playlist); + gtk_box_pack_start (GTK_BOX (hbox66), cli_add_to_playlist, FALSE, FALSE, 0); + + cli_playlist_name = gtk_entry_new (); + gtk_widget_show (cli_playlist_name); + gtk_box_pack_start (GTK_BOX (hbox66), cli_playlist_name, TRUE, TRUE, 0); + gtk_entry_set_invisible_char (GTK_ENTRY (cli_playlist_name), 9679); + label2 = gtk_label_new (_("GUI")); gtk_widget_show (label2); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2), label2); @@ -2510,6 +2526,12 @@ create_prefwin (void) g_signal_connect ((gpointer) titlebar_format_stopped, "changed", G_CALLBACK (on_titlebar_format_stopped_changed), NULL); + g_signal_connect ((gpointer) cli_add_to_playlist, "toggled", + G_CALLBACK (on_cli_add_to_playlist_toggled), + NULL); + g_signal_connect ((gpointer) cli_playlist_name, "changed", + G_CALLBACK (on_cli_playlist_name_changed), + NULL); g_signal_connect ((gpointer) override_bar_colors, "toggled", G_CALLBACK (on_override_bar_colors_toggled), NULL); @@ -2662,6 +2684,9 @@ create_prefwin (void) GLADE_HOOKUP_OBJECT (prefwin, hbox65, "hbox65"); GLADE_HOOKUP_OBJECT (prefwin, label102, "label102"); GLADE_HOOKUP_OBJECT (prefwin, titlebar_format_stopped, "titlebar_format_stopped"); + GLADE_HOOKUP_OBJECT (prefwin, hbox66, "hbox66"); + GLADE_HOOKUP_OBJECT (prefwin, cli_add_to_playlist, "cli_add_to_playlist"); + GLADE_HOOKUP_OBJECT (prefwin, cli_playlist_name, "cli_playlist_name"); GLADE_HOOKUP_OBJECT (prefwin, label2, "label2"); GLADE_HOOKUP_OBJECT (prefwin, notebook4, "notebook4"); GLADE_HOOKUP_OBJECT (prefwin, vbox21, "vbox21"); diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c index 59bc78cc..633d0803 100644 --- a/plugins/gtkui/prefwin.c +++ b/plugins/gtkui/prefwin.c @@ -516,6 +516,12 @@ on_preferences_activate (GtkMenuItem *menuitem, gtk_entry_set_text (GTK_ENTRY (lookup_widget (w, "titlebar_format_playing")), deadbeef->conf_get_str ("gtkui.titlebar_playing", "%a - %t - DeaDBeeF-%V")); gtk_entry_set_text (GTK_ENTRY (lookup_widget (w, "titlebar_format_stopped")), deadbeef->conf_get_str ("gtkui.titlebar_stopped", "DeaDBeeF-%V")); + // cli playlist + int active = deadbeef->conf_get_int ("cli_add_to_specific_playlist", 1); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "cli_add_to_playlist")), active); + gtk_widget_set_sensitive (lookup_widget (prefwin, "cli_playlist_name"), active); + gtk_entry_set_text (GTK_ENTRY (lookup_widget (prefwin, "cli_playlist_name")), deadbeef->conf_get_str ("cli_add_playlist_name", "Default")); + // override bar colors int override = deadbeef->conf_get_int ("gtkui.override_bar_colors", 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (prefwin, "override_bar_colors")), override); @@ -1277,3 +1283,20 @@ on_titlebar_format_stopped_changed (GtkEditable *editable, gtkui_set_titlebar (NULL); } +void +on_cli_add_to_playlist_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + int active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton)); + deadbeef->conf_set_int ("cli_add_to_specific_playlist", active); + gtk_widget_set_sensitive (lookup_widget (prefwin, "cli_playlist_name"), active); +} + + +void +on_cli_playlist_name_changed (GtkEditable *editable, + gpointer user_data) +{ + deadbeef->conf_set_str ("cli_add_playlist_name", gtk_entry_get_text (GTK_ENTRY (editable))); +} + |