diff options
author | waker <wakeroid@gmail.com> | 2012-06-04 08:50:26 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-06-04 08:50:26 +0200 |
commit | d23b8dd63bd2821dd1a4103504af143495dc0ae1 (patch) | |
tree | 285a715089f7ecf61f410ce858044b8b9b740bb2 | |
parent | 4a41e6c82b0ec65a170fcd9e4ba9284d72566199 (diff) |
fixed accidental API break caused by run_dialog
-rw-r--r-- | deadbeef.h | 8 | ||||
-rw-r--r-- | plugins/converter/convgui.c | 3 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 3 | ||||
-rw-r--r-- | plugins/gtkui/pluginconf.c | 2 |
4 files changed, 8 insertions, 8 deletions
@@ -1114,6 +1114,9 @@ typedef struct { const char *layout; void (*set_param) (const char *key, const char *value); void (*get_param) (const char *key, char *value, int len, const char *def); + + // parent was added in 1.4 API + void *parent; } ddb_dialog_t; enum { @@ -1129,12 +1132,9 @@ 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) (void *parentwindow, ddb_dialog_t *dlg, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx); + int (*run_dialog) (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 42d8d1f3..d0692268 100644 --- a/plugins/converter/convgui.c +++ b/plugins/converter/convgui.c @@ -1028,8 +1028,9 @@ on_dsp_preset_plugin_configure_clicked (GtkButton *button, .layout = p->plugin->configdialog, .set_param = dsp_ctx_set_param, .get_param = dsp_ctx_get_param, + .parent = toplevel }; - gtkui_plugin->gui.run_dialog (toplevel, &conf, 0, NULL, NULL); + gtkui_plugin->gui.run_dialog (&conf, 0, NULL, NULL); current_dsp_context = NULL; } diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 7482ed49..4f7e5cac 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -1468,7 +1468,6 @@ static ddb_gtkui_t plugin = { .gui.plugin.disconnect = gtkui_disconnect, .gui.plugin.configdialog = settings_dlg, .gui.plugin.message = gtkui_message, - .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, + .gui.run_dialog = gtkui_run_dialog_root, .get_mainwin = gtkui_get_mainwin, }; diff --git a/plugins/gtkui/pluginconf.c b/plugins/gtkui/pluginconf.c index cdd646cc..33532f67 100644 --- a/plugins/gtkui/pluginconf.c +++ b/plugins/gtkui/pluginconf.c @@ -534,5 +534,5 @@ gtkui_run_dialog (GtkWidget *parentwin, ddb_dialog_t *conf, uint32_t buttons, in int gtkui_run_dialog_root (ddb_dialog_t *conf, uint32_t buttons, int (*callback)(int button, void *ctx), void *ctx) { - return gtkui_run_dialog (mainwin, conf, buttons, callback, ctx); + return gtkui_run_dialog (conf->parent ? conf->parent : mainwin, conf, buttons, callback, ctx); } |