summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-05-30 21:42:13 +0200
committerGravatar waker <wakeroid@gmail.com>2012-05-30 21:42:13 +0200
commit2b90261fad9288df60d4a215083eb16c7818102f (patch)
treefa6ccba8e9116d8e88ee423af3f307fdf4fd4426
parent64be2fcd81d26135f6b3e6bbbdf8c6785e6e9c0f (diff)
gtkui: run_dialog now supports specifying parent window
-rw-r--r--deadbeef.h5
-rw-r--r--plugins/converter/convgui.c2
-rw-r--r--plugins/gtkui/gtkui.c3
-rw-r--r--plugins/gtkui/pluginconf.c3
4 files changed, 10 insertions, 3 deletions
diff --git a/deadbeef.h b/deadbeef.h
index 8775bf6d..6d797fe0 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -1129,9 +1129,12 @@ enum {
typedef struct DB_gui_s {
DB_plugin_t plugin;
+ // obsolete, don't use
+ int (*run_dialog_1) (ddb_dialog_t *dlg, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx);
+
// returns response code (ddb_button_*)
// buttons is a bitset, e.g. (1<<ddb_button_ok)|(1<<ddb_button_cancel)
- int (*run_dialog) (ddb_dialog_t *dlg, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx);
+ int (*run_dialog) (void *parentwindow, ddb_dialog_t *dlg, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx);
} DB_gui_t;
// playlist plugin
diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c
index 8054768b..6e8cf1cc 100644
--- a/plugins/converter/convgui.c
+++ b/plugins/converter/convgui.c
@@ -1016,7 +1016,7 @@ on_dsp_preset_plugin_configure_clicked (GtkButton *button,
.set_param = dsp_ctx_set_param,
.get_param = dsp_ctx_get_param,
};
- gtkui_plugin->gui.run_dialog (&conf, 0, NULL, NULL);
+ gtkui_plugin->gui.run_dialog (toplevel, &conf, 0, NULL, NULL);
current_dsp_context = NULL;
}
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 4a1e82cf..894ff2e5 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -1464,6 +1464,7 @@ static ddb_gtkui_t plugin = {
.gui.plugin.disconnect = gtkui_disconnect,
.gui.plugin.configdialog = settings_dlg,
.gui.plugin.message = gtkui_message,
- .gui.run_dialog = gtkui_run_dialog_root,
+ .gui.run_dialog_1 = gtkui_run_dialog_root,
+ .gui.run_dialog = (int (*) (void *parentwindow, ddb_dialog_t *dlg, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx))gtkui_run_dialog,
.get_mainwin = gtkui_get_mainwin,
};
diff --git a/plugins/gtkui/pluginconf.c b/plugins/gtkui/pluginconf.c
index 1f265372..cdd646cc 100644
--- a/plugins/gtkui/pluginconf.c
+++ b/plugins/gtkui/pluginconf.c
@@ -212,6 +212,9 @@ ddb_button_from_gtk_response (int response) {
int
gtkui_run_dialog (GtkWidget *parentwin, ddb_dialog_t *conf, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx) {
+ if (!parentwin) {
+ parentwin = mainwin;
+ }
// create window
char title[200];
snprintf (title, sizeof (title), _("Configure %s"), conf->title);