summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/callbacks.c1
-rw-r--r--plugins/gtkui/callbacks.h4
-rw-r--r--plugins/gtkui/deadbeef.glade126
-rw-r--r--plugins/gtkui/interface.c61
-rw-r--r--plugins/gtkui/prefwin.c11
5 files changed, 126 insertions, 77 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index ee9422f7..a152aef5 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -1070,3 +1070,4 @@ create_seekbar (gchar *widget_name, gchar *string1, gchar *string2,
{
return GTK_WIDGET (ddb_seekbar_new ());
}
+
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index 9777427d..62d79f38 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -971,3 +971,7 @@ gboolean
on_statusbar_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
+
+void
+on_resume_last_session_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index be214120..c2dd31f0 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -2684,6 +2684,79 @@ 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>
+
+ <child>
+ <widget class="GtkCheckButton" id="resume_last_session">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Resume previous session on startup</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_resume_last_session_toggled" last_modification_time="Mon, 30 Aug 2010 18:39:14 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>
@@ -2694,7 +2767,7 @@ Album</property>
<child>
<widget class="GtkLabel" id="label39">
<property name="visible">True</property>
- <property name="label" translatable="yes">Sound (adv.)</property>
+ <property name="label" translatable="yes">Playback</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2938,56 +3011,7 @@ Album</property>
</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>
+ <placeholder/>
</child>
</widget>
<packing>
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 61521323..e6f59396 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -1554,6 +1554,10 @@ create_prefwin (void)
GtkWidget *label8;
GtkWidget *pref_replaygain_mode;
GtkWidget *pref_replaygain_scale;
+ GtkWidget *hbox66;
+ GtkWidget *cli_add_to_playlist;
+ GtkWidget *cli_playlist_name;
+ GtkWidget *resume_last_session;
GtkWidget *label39;
GtkWidget *vbox9;
GtkWidget *pref_close_send_to_tray;
@@ -1567,9 +1571,6 @@ 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;
@@ -1796,7 +1797,24 @@ create_prefwin (void)
gtk_widget_show (pref_replaygain_scale);
gtk_box_pack_start (GTK_BOX (vbox8), pref_replaygain_scale, FALSE, FALSE, 0);
- label39 = gtk_label_new (_("Sound (adv.)"));
+ hbox66 = gtk_hbox_new (FALSE, 8);
+ gtk_widget_show (hbox66);
+ gtk_box_pack_start (GTK_BOX (vbox8), 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);
+
+ resume_last_session = gtk_check_button_new_with_mnemonic (_("Resume previous session on startup"));
+ gtk_widget_show (resume_last_session);
+ gtk_box_pack_start (GTK_BOX (vbox8), resume_last_session, 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);
@@ -1853,19 +1871,6 @@ 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);
@@ -2505,6 +2510,15 @@ create_prefwin (void)
g_signal_connect ((gpointer) pref_replaygain_scale, "clicked",
G_CALLBACK (on_pref_replaygain_scale_clicked),
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) resume_last_session, "toggled",
+ G_CALLBACK (on_resume_last_session_toggled),
+ NULL);
g_signal_connect ((gpointer) pref_close_send_to_tray, "clicked",
G_CALLBACK (on_pref_close_send_to_tray_clicked),
NULL);
@@ -2526,12 +2540,6 @@ 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);
@@ -2671,6 +2679,10 @@ create_prefwin (void)
GLADE_HOOKUP_OBJECT (prefwin, label8, "label8");
GLADE_HOOKUP_OBJECT (prefwin, pref_replaygain_mode, "pref_replaygain_mode");
GLADE_HOOKUP_OBJECT (prefwin, pref_replaygain_scale, "pref_replaygain_scale");
+ 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, resume_last_session, "resume_last_session");
GLADE_HOOKUP_OBJECT (prefwin, label39, "label39");
GLADE_HOOKUP_OBJECT (prefwin, vbox9, "vbox9");
GLADE_HOOKUP_OBJECT (prefwin, pref_close_send_to_tray, "pref_close_send_to_tray");
@@ -2684,9 +2696,6 @@ 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 633d0803..d206e362 100644
--- a/plugins/gtkui/prefwin.c
+++ b/plugins/gtkui/prefwin.c
@@ -522,6 +522,9 @@ on_preferences_activate (GtkMenuItem *menuitem,
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"));
+ // resume last session
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (w, "resume_last_session")), deadbeef->conf_get_int ("resume_last_session", 0));
+
// 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);
@@ -1300,3 +1303,11 @@ on_cli_playlist_name_changed (GtkEditable *editable,
deadbeef->conf_set_str ("cli_add_playlist_name", gtk_entry_get_text (GTK_ENTRY (editable)));
}
+void
+on_resume_last_session_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data)
+{
+ int active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton));
+ deadbeef->conf_set_int ("resume_last_session", active);
+}
+