reverted last change.

2005-08-18  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/procedure-browser.c (run): reverted last change.

	* libgimp/gimpprocbrowserdialog.[ch]: emit new signal "row-activated"
	instead of emitting "response" with GTK_RESPONSE_APPLY.

	* plug-ins/pygimp/procbrowser.c
	* plug-ins/script-fu/script-fu-console.c: connect to "row-activated"
	and call gtk_dialog_response() with GTK_RESPONSE_APPLY.
This commit is contained in:
Sven Neumann 2005-08-18 13:55:14 +00:00 committed by Sven Neumann
parent b80a584f9a
commit 6265478d0b
6 changed files with 82 additions and 34 deletions

View file

@ -1,3 +1,14 @@
2005-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/procedure-browser.c (run): reverted last change.
* libgimp/gimpprocbrowserdialog.[ch]: emit new signal "row-activated"
instead of emitting "response" with GTK_RESPONSE_APPLY.
* plug-ins/pygimp/procbrowser.c
* plug-ins/script-fu/script-fu-console.c: connect to "row-activated"
and call gtk_dialog_response() with GTK_RESPONSE_APPLY.
2005-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/procedure-browser.c (run): only close the dialog

View file

@ -19,13 +19,6 @@
* Boston, MA 02111-1307, USA.
*/
/*
* dbbrowser_utils.c
* 0.08 26th sept 97 by Thomas NOEL <thomas@minet.net>
*
* 98/12/13 Sven Neumann <sven@gimp.org> : added help display
*/
#include "config.h"
#include <string.h>
@ -51,6 +44,7 @@
enum
{
SELECTION_CHANGED,
ROW_ACTIVATED,
LAST_SIGNAL
};
@ -129,6 +123,12 @@ gimp_proc_browser_dialog_class_init (GimpProcBrowserDialogClass *klass)
{
parent_class = g_type_class_peek_parent (klass);
/**
* GimpProcBrowserDialog::selection-changed:
* @dialog: the object that received the signal
*
* Emitted when the selection in the contained #GtkTreeView changes.
*/
dialog_signals[SELECTION_CHANGED] =
g_signal_new ("selection-changed",
G_TYPE_FROM_CLASS (klass),
@ -139,7 +139,24 @@ gimp_proc_browser_dialog_class_init (GimpProcBrowserDialogClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
/**
* GimpProcBrowserDialog::row-activated:
* @dialog: the object that received the signal
*
* Emitted when one of the rows in the contained #GtkTreeView is activated.
*/
dialog_signals[ROW_ACTIVATED] =
g_signal_new ("row-activated",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GimpProcBrowserDialogClass,
row_activated),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
klass->selection_changed = NULL;
klass->row_activated = NULL;
}
static void
@ -281,7 +298,7 @@ browser_row_activated (GtkTreeView *treeview,
GtkTreeViewColumn *column,
GimpProcBrowserDialog *dialog)
{
gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY);
g_signal_emit (dialog, dialog_signals[ROW_ACTIVATED], 0);
}
static void

View file

@ -55,6 +55,7 @@ struct _GimpProcBrowserDialogClass
GimpDialogClass parent_class;
void (* selection_changed) (GimpProcBrowserDialog *dialog);
void (* row_activated) (GimpProcBrowserDialog *dialog);
/* Padding for future expansion */
void (* _gimp_reserved1) (void);

View file

@ -125,7 +125,7 @@ run (const gchar *name,
dialog = gimp_proc_browser_dialog_new ();
gtk_dialog_add_button (GTK_DIALOG (dialog),
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
while (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_CLOSE);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
break;

View file

@ -40,9 +40,9 @@ typedef struct
static void
proxy_apply_callback(GtkWidget *widget,
gint response_id,
ProxyData *proxy_data)
proxy_response (GtkWidget *widget,
gint response_id,
ProxyData *proxy_data)
{
PyObject *pdb_func, *ret;
gchar *name;
@ -117,15 +117,21 @@ bail:
static void
proxy_cleanup(gpointer data, GClosure *closure)
{
ProxyData *proxy_data = data;
ProxyData *proxy_data = data;
if (!data)
return;
if (!data)
return;
Py_DECREF(proxy_data->func);
Py_XDECREF(proxy_data->data);
Py_DECREF(proxy_data->func);
Py_XDECREF(proxy_data->data);
g_free(proxy_data);
g_free(proxy_data);
}
static void
proxy_row_activated(GtkDialog *dialog)
{
gtk_dialog_response (dialog, GTK_RESPONSE_APPLY);
}
static PyObject *
@ -175,8 +181,11 @@ proc_browser_dialog_new(PyObject *self, PyObject *args, PyObject *kwargs)
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
g_signal_connect_data(dlg, "response",
G_CALLBACK(proxy_apply_callback), proxy_data,
G_CALLBACK(proxy_response), proxy_data,
proxy_cleanup, 0);
g_signal_connect(dlg, "row-activated",
G_CALLBACK(proxy_row_activated),
NULL);
gtk_widget_show(GTK_WIDGET(dlg));

View file

@ -55,22 +55,23 @@ typedef struct
/*
* Local Functions
*/
static void script_fu_console_interface (void);
static void script_fu_response (GtkWidget *widget,
gint response_id,
ConsoleInterface *console);
static void script_fu_browse_callback (GtkWidget *widget,
ConsoleInterface *console);
static void script_fu_browse_response (GtkWidget *widget,
gint response_id,
ConsoleInterface *console);
static gboolean script_fu_cc_is_empty (ConsoleInterface *console);
static gboolean script_fu_cc_key_function (GtkWidget *widget,
GdkEventKey *event,
ConsoleInterface *console);
static void script_fu_console_interface (void);
static void script_fu_response (GtkWidget *widget,
gint response_id,
ConsoleInterface *console);
static void script_fu_browse_callback (GtkWidget *widget,
ConsoleInterface *console);
static void script_fu_browse_response (GtkWidget *widget,
gint response_id,
ConsoleInterface *console);
static void script_fu_browse_row_activated (GtkDialog *dialog);
static gboolean script_fu_cc_is_empty (ConsoleInterface *console);
static gboolean script_fu_cc_key_function (GtkWidget *widget,
GdkEventKey *event,
ConsoleInterface *console);
static void script_fu_open_siod_console (void);
static void script_fu_close_siod_console (void);
static void script_fu_open_siod_console (void);
static void script_fu_close_siod_console (void);
/*
@ -306,6 +307,9 @@ script_fu_browse_callback (GtkWidget *widget,
g_signal_connect (console->proc_browser, "response",
G_CALLBACK (script_fu_browse_response),
console);
g_signal_connect (console->proc_browser, "row-activated",
G_CALLBACK (script_fu_browse_row_activated),
console);
}
gtk_window_present (GTK_WINDOW (console->proc_browser));
@ -379,6 +383,12 @@ script_fu_browse_response (GtkWidget *widget,
gimp_destroy_paramdefs (return_vals, n_return_vals);
}
static void
script_fu_browse_row_activated (GtkDialog *dialog)
{
gtk_dialog_response (dialog, GTK_RESPONSE_APPLY);
}
static gboolean
script_fu_console_idle_scroll_end (ConsoleInterface *console)
{