summaryrefslogtreecommitdiff
path: root/plugins/gtkui/ddbtabstrip.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-06 19:27:21 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-06 19:27:21 +0200
commit80f7aa0cfe21fc2715af029cc5bea6e8b4e18a5f (patch)
tree9df38c9c686e3f803fdb74492f89677b2ea8704a /plugins/gtkui/ddbtabstrip.c
parent40522448588f63d6d72ef775e0340b7fae548a05 (diff)
added auto-saving config/playlist files
Diffstat (limited to 'plugins/gtkui/ddbtabstrip.c')
-rw-r--r--plugins/gtkui/ddbtabstrip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c
index 8d9b6675..98ec3f1a 100644
--- a/plugins/gtkui/ddbtabstrip.c
+++ b/plugins/gtkui/ddbtabstrip.c
@@ -201,6 +201,8 @@ static int tab_overlap_size = 0; // widget_height/2
static int tabs_left_margin = 4;
static int min_tab_size = 80;
+static int tab_moved = 0;
+
void
ddb_tabstrip_draw_tab (GtkWidget *widget, GdkDrawable *drawable, int selected, int x, int y, int w, int h) {
GdkPoint points_filled[] = {
@@ -452,6 +454,7 @@ on_tabstrip_button_press_event (GtkWidget *widget,
ts->prepare = 1;
ts->dragging = tab_clicked;
ts->prev_x = event->x;
+ tab_moved = 0;
}
else if (event->button == 3) {
GtkWidget *menu = create_plmenu ();
@@ -481,6 +484,10 @@ on_tabstrip_button_release_event (GtkWidget *widget,
ts->prepare = 0;
tabstrip_render (ts);
tabstrip_expose (ts, 0, 0, widget->allocation.width, widget->allocation.height);
+ if (tab_moved) {
+ deadbeef->pl_save_all ();
+ deadbeef->conf_save ();
+ }
}
}
return FALSE;
@@ -558,6 +565,7 @@ on_tabstrip_motion_notify_event (GtkWidget *widget,
snprintf (str2, sizeof (str2), "playlist.scroll.%d", inspos);
pos2 = deadbeef->conf_get_int (str2, 0);
deadbeef->plt_move (ts->dragging, inspos);
+ tab_moved = 1;
deadbeef->conf_set_int (str1, pos2);
deadbeef->conf_set_int (str2, pos1);
ts->dragging = inspos;