summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-02-17 21:52:56 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-02-17 21:52:56 +0100
commit3a00a98d33a52ce0330fd6a65867b493a96fa529 (patch)
treefcb2172161be3b9d442b52ddbe54c1f27471aee3 /plugins/gtkui
parentad0a396c181349e77bda1e6fbecaa8e755662a40 (diff)
gtkui: automatically upgrade layout from pre-0.6.2
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/gtkui.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index f9aac874..912b210b 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -799,6 +799,8 @@ gtkui_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
return 0;
}
+static const char gtkui_def_layout[] = "vbox expand=\"0 1\" fill=\"1 1\" homogeneous=0 {hbox expand=\"0 1 0\" fill=\"1 1 1\" homogeneous=0 {playtb {} seekbar {} volumebar {} } tabbed_playlist hideheaders=0 {} }";
+
static void
init_widget_layout (void) {
w_init ();
@@ -808,7 +810,16 @@ init_widget_layout (void) {
// load layout
char layout[20000];
- deadbeef->conf_get_str ("gtkui.layout", "vbox expand=\"0 1\" fill=\"1 1\" homogeneous=0 {hbox expand=\"0 1 0\" fill=\"1 1 1\" homogeneous=0 {playtb {} seekbar {} volumebar {} } tabbed_playlist hideheaders=0 {} }", layout, sizeof (layout));
+ deadbeef->conf_get_str ("gtkui.layout", gtkui_def_layout, layout, sizeof (layout));
+
+ if (strcmp (layout, gtkui_def_layout) && !deadbeef->conf_get_int ("gtkui.layout_062_upgraded", 0)) {
+ // add top bar
+ char layout_upgrade[20000];
+ snprintf (layout_upgrade, sizeof (layout_upgrade), "vbox expand=\"0 1\" fill=\"1 1\" homogeneous=0 {hbox expand=\"0 1 0\" fill=\"1 1 1\" homogeneous=0 {playtb {} seekbar {} volumebar {} } %s }", layout);
+ strcpy (layout, layout_upgrade);
+ deadbeef->conf_set_str ("gtkui.layout", layout);
+ deadbeef->conf_set_int ("gtkui.layout_062_upgraded", 1);
+ }
ddb_gtkui_widget_t *w = NULL;
w_create_from_string (layout, &w);