summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-04-02 20:08:11 +0200
committerGravatar waker <wakeroid@gmail.com>2012-04-02 20:08:11 +0200
commit04fcf6384e2415e2eedc3b8caad442f455632655 (patch)
tree81ff4028266744a350e61bea3f8260b725204e90 /plugins
parentb546cdfecc077961205728e4be0af72c23a9d53d (diff)
added new option to reset "stop after current" option every time the track was auto-stopped
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/callbacks.c1
-rw-r--r--plugins/gtkui/callbacks.h4
-rw-r--r--plugins/gtkui/deadbeef.glade20
-rw-r--r--plugins/gtkui/interface.c9
-rw-r--r--plugins/gtkui/prefwin.c11
5 files changed, 45 insertions, 0 deletions
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</property>
<property name="fill">False</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkCheckButton" id="reset_autostop">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Auto-reset &quot;Stop after current&quot;</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_reset_autostop_toggled" last_modification_time="Mon, 02 Apr 2012 17:59:08 GMT"/>
+ </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 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