summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-23 22:13:56 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-23 22:27:04 +0100
commit3ae93cdb7ea742d8ad9b69b8839cfbf87c6be3c6 (patch)
tree38cd5565aebc23589378b9e27a2ee2eda105674e /plugins/gtkui
parent5da531bad2dbd67d04dcc84500da049520d3e371 (diff)
gtkui: disallow adding playlist and tabbed_playlist at the same time
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/widgets.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index 597ccd05..ec18b804 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -749,6 +749,15 @@ w_create (const char *type) {
if (!strcmp (c->type, type)) {
if (c->flags & DDB_WF_SINGLE_INSTANCE) {
int num = get_num_widgets (rootwidget, c->type);
+ // HACK: playlist and tabbed playlist are essentially the same
+ // widgets with single-instance limit
+
+ if (!strcmp (c->type, "tabbed_playlist")) {
+ num += get_num_widgets (rootwidget, "playlist");
+ }
+ else if (!strcmp (c->type, "playlist")) {
+ num += get_num_widgets (rootwidget, "tabbed_playlist");
+ }
if (num) {
// create dummy
w_dummy_t *w = (w_dummy_t *)w_create ("dummy");