Commit 7863fe64 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

let gimp_proc_browser_dialog_new() take standard dialog parameters,

2005-09-27  Sven Neumann  <sven@gimp.org>

	* libgimp/gimpprocbrowserdialog.[ch]: let
	gimp_proc_browser_dialog_new() take standard dialog parameters,
	similar to gimp_dialog_new().

	* plug-ins/common/procedure-browser.c
	* plug-ins/pygimp/procbrowser.c
	* plug-ins/script-fu/script-fu-console.c: changed accordingly.
parent 63b5c472
2005-09-27 Sven Neumann <sven@gimp.org>
* libgimp/gimpprocbrowserdialog.[ch]: let
gimp_proc_browser_dialog_new() take standard dialog parameters,
similar to gimp_dialog_new().
* plug-ins/common/procedure-browser.c
* plug-ins/pygimp/procbrowser.c
* plug-ins/script-fu/script-fu-console.c: changed accordingly.
2005-09-27 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-interface.c (script_fu_interface):
......
......@@ -232,11 +232,27 @@ gimp_proc_browser_dialog_init (GimpProcBrowserDialog *dialog)
/* public functions */
GtkWidget *
gimp_proc_browser_dialog_new (void)
gimp_proc_browser_dialog_new (const gchar *title,
const gchar *role,
GimpHelpFunc help_func,
const gchar *help_id,
...)
{
GimpProcBrowserDialog *dialog;
va_list args;
dialog = g_object_new (GIMP_TYPE_PROC_BROWSER_DIALOG, NULL);
va_start (args, help_id);
dialog = g_object_new (GIMP_TYPE_PROC_BROWSER_DIALOG,
"title", title,
"role", role,
"help-func", help_func,
"help-id", help_id,
NULL);
gimp_dialog_add_buttons_valist (GIMP_DIALOG (dialog), args);
va_end (args);
/* first search (all procedures) */
browser_search (GIMP_BROWSER (dialog->browser), "", SEARCH_TYPE_ALL,
......
......@@ -67,7 +67,12 @@ struct _GimpProcBrowserDialogClass
GType gimp_proc_browser_dialog_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_proc_browser_dialog_new (void);
GtkWidget * gimp_proc_browser_dialog_new (const gchar *title,
const gchar *role,
GimpHelpFunc help_func,
const gchar *help_id,
...);
gchar * gimp_proc_browser_dialog_get_selected (GimpProcBrowserDialog *dialog);
......
......@@ -122,9 +122,14 @@ run (const gchar *name,
gimp_ui_init (PLUG_IN_BINARY, FALSE);
dialog = gimp_proc_browser_dialog_new ();
gtk_dialog_add_button (GTK_DIALOG (dialog),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
dialog =
gimp_proc_browser_dialog_new (_("Procedure Browser"), PLUG_IN_BINARY,
gimp_standard_help_func, PLUG_IN_PROC,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
......
......@@ -168,7 +168,10 @@ proc_browser_dialog_new(PyObject *self, PyObject *args, PyObject *kwargs)
}
}
dlg = G_OBJECT(gimp_proc_browser_dialog_new());
dlg = G_OBJECT(gimp_proc_browser_dialog_new("Python Procedure Browser",
"python-fu-procedure-browser",
gimp_standard_help_func, NULL,
NULL));
if (has_apply) {
gtk_dialog_add_button(GTK_DIALOG(dlg),
......
......@@ -34,6 +34,8 @@
#define BUFSIZE 256
#define PROC_NAME "plug-in-script-fu-console"
typedef struct
{
......@@ -160,10 +162,10 @@ script_fu_console_interface (void)
console->history_cur = 0;
console->history_max = 50;
console->dialog = gimp_dialog_new (_("Script-Fu Console"), "script-fu-console",
console->dialog = gimp_dialog_new (_("Script-Fu Console"),
"script-fu-console",
NULL, 0,
gimp_standard_help_func,
"plug-in-script-fu-console",
gimp_standard_help_func, PROC_NAME,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
......@@ -290,12 +292,16 @@ script_fu_browse_callback (GtkWidget *widget,
{
if (! console->proc_browser)
{
console->proc_browser = gimp_proc_browser_dialog_new ();
console->proc_browser =
gimp_proc_browser_dialog_new (_("Script-Fu Procedure Browser"),
"script-fu-procedure-browser",
gimp_standard_help_func, PROC_NAME,
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_add_buttons (GTK_DIALOG (console->proc_browser),
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (console->proc_browser),
GTK_RESPONSE_APPLY);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment