From 04fcf6384e2415e2eedc3b8caad442f455632655 Mon Sep 17 00:00:00 2001 From: waker Date: Mon, 2 Apr 2012 20:08:11 +0200 Subject: added new option to reset "stop after current" option every time the track was auto-stopped --- plugins/gtkui/callbacks.c | 1 + plugins/gtkui/callbacks.h | 4 ++++ plugins/gtkui/deadbeef.glade | 20 ++++++++++++++++++++ plugins/gtkui/interface.c | 9 +++++++++ plugins/gtkui/prefwin.c | 11 +++++++++++ 5 files changed, 45 insertions(+) (limited to 'plugins/gtkui') diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c index a82733c1..3005bc27 100644 --- a/plugins/gtkui/callbacks.c +++ b/plugins/gtkui/callbacks.c @@ -1257,3 +1257,4 @@ on_sort_by_custom_activate (GtkMenuItem *menuitem, gtk_widget_destroy (dlg); dlg = NULL; } + diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h index e55c6360..e463394d 100644 --- a/plugins/gtkui/callbacks.h +++ b/plugins/gtkui/callbacks.h @@ -1155,3 +1155,7 @@ on_sort_by_custom_activate (GtkMenuItem *menuitem, void on_convert8to16_toggled (GtkToggleButton *togglebutton, gpointer user_data); + +void +on_reset_autostop_toggled (GtkToggleButton *togglebutton, + gpointer user_data); diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade index 3253a4f7..cffda5b5 100644 --- a/plugins/gtkui/deadbeef.glade +++ b/plugins/gtkui/deadbeef.glade @@ -3005,6 +3005,26 @@ Album False + + + + True + True + Auto-reset "Stop after current" + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + False diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c index 16d874b9..57db14db 100644 --- a/plugins/gtkui/interface.c +++ b/plugins/gtkui/interface.c @@ -1678,6 +1678,7 @@ create_prefwin (void) GtkWidget *cli_playlist_name; GtkWidget *resume_last_session; GtkWidget *ignore_archives; + GtkWidget *reset_autostop; GtkWidget *label39; GtkWidget *vbox29; GtkWidget *hbox80; @@ -1958,6 +1959,10 @@ create_prefwin (void) gtk_widget_show (ignore_archives); gtk_box_pack_start (GTK_BOX (vbox8), ignore_archives, FALSE, FALSE, 0); + reset_autostop = gtk_check_button_new_with_mnemonic (_("Auto-reset \"Stop after current\"")); + gtk_widget_show (reset_autostop); + gtk_box_pack_start (GTK_BOX (vbox8), reset_autostop, FALSE, FALSE, 0); + label39 = gtk_label_new (_("Playback")); gtk_widget_show (label39); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1), label39); @@ -2592,6 +2597,9 @@ create_prefwin (void) g_signal_connect ((gpointer) ignore_archives, "toggled", G_CALLBACK (on_ignore_archives_toggled), NULL); + g_signal_connect ((gpointer) reset_autostop, "toggled", + G_CALLBACK (on_reset_autostop_toggled), + NULL); g_signal_connect ((gpointer) dsp_add, "clicked", G_CALLBACK (on_dsp_add_clicked), NULL); @@ -2756,6 +2764,7 @@ create_prefwin (void) GLADE_HOOKUP_OBJECT (prefwin, cli_playlist_name, "cli_playlist_name"); GLADE_HOOKUP_OBJECT (prefwin, resume_last_session, "resume_last_session"); GLADE_HOOKUP_OBJECT (prefwin, ignore_archives, "ignore_archives"); + GLADE_HOOKUP_OBJECT (prefwin, reset_autostop, "reset_autostop"); GLADE_HOOKUP_OBJECT (prefwin, label39, "label39"); GLADE_HOOKUP_OBJECT (prefwin, vbox29, "vbox29"); GLADE_HOOKUP_OBJECT (prefwin, hbox80, "hbox80"); diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c index a50a40e2..6f447792 100644 --- a/plugins/gtkui/prefwin.c +++ b/plugins/gtkui/prefwin.c @@ -533,6 +533,10 @@ on_preferences_activate (GtkMenuItem *menuitem, // add from archives gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "ignore_archives")), deadbeef->conf_get_int ("ignore_archives", 1)); + + // reset autostop + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "reset_autostop")), deadbeef->conf_get_int ("playlist.stop_after_current_reset", 0)); + // titlebar text gtk_entry_set_text (GTK_ENTRY (lookup_widget (w, "titlebar_format_playing")), deadbeef->conf_get_str_fast ("gtkui.titlebar_playing", "%a - %t - DeaDBeeF-%V")); gtk_entry_set_text (GTK_ENTRY (lookup_widget (w, "titlebar_format_stopped")), deadbeef->conf_get_str_fast ("gtkui.titlebar_stopped", "DeaDBeeF-%V")); @@ -1355,6 +1359,13 @@ on_ignore_archives_toggled (GtkToggleButton *togglebutton, deadbeef->conf_set_int ("ignore_archives", gtk_toggle_button_get_active (togglebutton)); } +void +on_reset_autostop_toggled (GtkToggleButton *togglebutton, + gpointer user_data) +{ + deadbeef->conf_set_int ("playlist.stop_after_current_reset", gtk_toggle_button_get_active (togglebutton)); +} + void -- cgit v1.2.3