mirror of https://github.com/GNOME/gimp.git
Applied a patch from Simon.Budig@unix-ag.org (gimp-simon-220598-0).
Cosmetic changes to the script-fu dialog. Added session-managment to the error-console. --Sven
This commit is contained in:
parent
3de98de2c4
commit
5ebfaaae74
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
Sun Aug 2 21:00:04 MEST 1998 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/script-fu/script-fu-scripts.c: Applied a patch from
|
||||
Simon.Budig@unix-ag.org (gimp-simon-220598-0).
|
||||
Cosmetic changes to the script-fu dialog.
|
||||
|
||||
* app/app_procs.c
|
||||
* app/commands.[ch]
|
||||
* app/errorconsole.[ch]
|
||||
* app/gimprc.c
|
||||
* app/session.[ch]: Added session-managment to the error-console.
|
||||
|
||||
Sun Aug 2 06:02:01 1998 Scott Goehring <scott@poverty.bloomington.in.us>
|
||||
|
||||
* app/tile_manager.c (tile_manager_map): I am an idiot.
|
||||
|
|
|
@ -1017,11 +1017,18 @@ dialogs_input_devices_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
dialogs_device_status_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
create_device_status ();
|
||||
}
|
||||
|
||||
void
|
||||
dialogs_error_console_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
error_console_add (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
about_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
|
|
|
@ -89,6 +89,7 @@ void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
|
|||
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
|
||||
void about_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "devices.h"
|
||||
#include "gdisplay.h"
|
||||
#include "colormaps.h"
|
||||
#include "errorconsole.h"
|
||||
#include "fileops.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
|
@ -583,6 +584,7 @@ app_exit_finish (void)
|
|||
plug_in_kill ();
|
||||
procedural_db_free ();
|
||||
device_status_free ();
|
||||
error_console_free ();
|
||||
menus_quit ();
|
||||
tile_swap_exit ();
|
||||
|
||||
|
|
|
@ -1017,11 +1017,18 @@ dialogs_input_devices_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
dialogs_device_status_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
create_device_status ();
|
||||
}
|
||||
|
||||
void
|
||||
dialogs_error_console_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
error_console_add (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
about_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
|
|
|
@ -89,6 +89,7 @@ void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
|
|||
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
|
||||
void about_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
|
|
|
@ -29,24 +29,31 @@
|
|||
#include <sys/stat.h>
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
#include "commands.h"
|
||||
#include "session.h"
|
||||
|
||||
#define ERRORS_ALL 0
|
||||
#define ERRORS_SELECTION 1
|
||||
|
||||
void error_console_add (gchar *errormsg);
|
||||
void error_console_show_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static GtkWidget *dialog;
|
||||
static GtkWidget *error_console = NULL;
|
||||
static GtkWidget *text;
|
||||
|
||||
static gint
|
||||
|
||||
static void
|
||||
error_console_close_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
gdk_window_hide (dialog->window);
|
||||
|
||||
return TRUE;
|
||||
gtk_widget_hide (error_console);
|
||||
}
|
||||
|
||||
void
|
||||
error_console_free (void)
|
||||
{
|
||||
if (error_console)
|
||||
session_get_window_info (error_console, &error_console_session_info);
|
||||
}
|
||||
|
||||
gint
|
||||
|
@ -125,7 +132,7 @@ error_console_file_ok_callback (GtkWidget *widget, gpointer data)
|
|||
{
|
||||
GString *string;
|
||||
|
||||
g_string_new ("");
|
||||
string = g_string_new ("");
|
||||
g_string_sprintf (string, "Error opening file %s: %s", filename, g_strerror (errno));
|
||||
g_message (string->str);
|
||||
g_string_free (string, TRUE);
|
||||
|
@ -177,7 +184,7 @@ text_clicked_callback (GtkWidget *widget,
|
|||
{
|
||||
gtk_signal_emit_stop_by_name (GTK_OBJECT (text), "button_press_event");
|
||||
|
||||
gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, time(NULL));
|
||||
gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -192,20 +199,22 @@ error_console_create_window (void)
|
|||
GtkWidget *menu;
|
||||
GtkWidget *menuitem;
|
||||
|
||||
dialog = gtk_dialog_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), "GIMP Error console");
|
||||
gtk_widget_set_usize (dialog, 250, 300);
|
||||
gtk_window_set_policy (GTK_WINDOW(dialog), TRUE, TRUE, FALSE);
|
||||
gtk_signal_connect (GTK_OBJECT (dialog), "delete_event",
|
||||
error_console = gtk_dialog_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (error_console), "GIMP Error console");
|
||||
session_set_window_geometry (error_console, &error_console_session_info, TRUE);
|
||||
/* The next line should disappear when setting the size works in SM */
|
||||
gtk_widget_set_usize (error_console, 250, 300);
|
||||
gtk_window_set_policy (GTK_WINDOW(error_console), TRUE, TRUE, FALSE);
|
||||
gtk_signal_connect (GTK_OBJECT (error_console), "delete_event",
|
||||
(GtkSignalFunc) error_console_close_callback, NULL);
|
||||
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (error_console)->vbox), 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (GTK_DIALOG (error_console)->action_area), 2);
|
||||
|
||||
/* Action area */
|
||||
button = gtk_button_new_with_label ("Close");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
(GtkSignalFunc) error_console_close_callback, NULL);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (error_console)->action_area), button, TRUE, TRUE, 0);
|
||||
gtk_widget_show (button);
|
||||
|
||||
menu = gtk_menu_new ();
|
||||
|
@ -228,7 +237,7 @@ error_console_create_window (void)
|
|||
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2);
|
||||
gtk_container_border_width (GTK_CONTAINER (table), 0);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), table, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (error_console)->vbox), table, TRUE, TRUE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
/* The output text widget */
|
||||
|
@ -250,18 +259,24 @@ error_console_create_window (void)
|
|||
GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
gtk_widget_show (vscrollbar);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
gtk_widget_show (error_console);
|
||||
}
|
||||
|
||||
void
|
||||
error_console_add (gchar *errormsg)
|
||||
{
|
||||
|
||||
if (!dialog)
|
||||
error_console_create_window ();
|
||||
|
||||
gdk_window_show (dialog->window);
|
||||
gdk_window_raise (dialog->window);
|
||||
if (!error_console)
|
||||
{
|
||||
error_console_create_window ();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GTK_WIDGET_VISIBLE (error_console))
|
||||
gtk_widget_show (error_console);
|
||||
else
|
||||
gdk_window_raise (error_console->window);
|
||||
}
|
||||
|
||||
if (errormsg)
|
||||
{
|
||||
|
@ -270,7 +285,3 @@ error_console_add (gchar *errormsg)
|
|||
}
|
||||
}
|
||||
|
||||
void error_console_show_callback (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
error_console_add (NULL);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,10 @@
|
|||
#ifndef __ERRORCONSOLE_H__
|
||||
#define __ERRORCONSOLE_H__
|
||||
|
||||
void error_console_add (gchar *errormsg);
|
||||
void error_console_show_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void error_console_add (gchar *errormsg);
|
||||
|
||||
/* Free error_console (only for session-managment) */
|
||||
void error_console_free (void);
|
||||
|
||||
|
||||
#endif /* __ERRORCONSOLE_H__ */
|
||||
|
|
|
@ -249,7 +249,8 @@ static SessionInfo *session_infos[] =
|
|||
&brush_select_session_info,
|
||||
&pattern_select_session_info,
|
||||
&gradient_editor_session_info,
|
||||
&device_status_session_info
|
||||
&device_status_session_info,
|
||||
&error_console_session_info
|
||||
};
|
||||
static int nsession_infos = sizeof (session_infos) / sizeof (session_infos[0]);
|
||||
|
||||
|
|
|
@ -1017,11 +1017,18 @@ dialogs_input_devices_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
dialogs_device_status_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
create_device_status ();
|
||||
}
|
||||
|
||||
void
|
||||
dialogs_error_console_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
error_console_add (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
about_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
|
|
|
@ -89,6 +89,7 @@ void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
|
|||
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
|
||||
void about_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
|
|
|
@ -1017,11 +1017,18 @@ dialogs_input_devices_cmd_callback (GtkWidget *widget,
|
|||
|
||||
void
|
||||
dialogs_device_status_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
gpointer client_data)
|
||||
{
|
||||
create_device_status ();
|
||||
}
|
||||
|
||||
void
|
||||
dialogs_error_console_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
error_console_add (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
about_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
|
|
|
@ -89,6 +89,7 @@ void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
|
|||
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
|
||||
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
|
||||
void about_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "commands.h"
|
||||
#include "errorconsole.h"
|
||||
#include "fileops.h"
|
||||
#include "general.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -58,7 +57,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
|
|||
{ "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Document Index...", NULL, raise_idea_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, error_console_show_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, dialogs_error_console_cmd_callback, 0 },
|
||||
{ "/File/---", NULL, NULL, 0, "<Separator>" },
|
||||
};
|
||||
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
|
||||
|
|
|
@ -79,6 +79,8 @@ SessionInfo gradient_editor_session_info =
|
|||
{ "gradient-editor", (GtkItemFactoryCallback)dialogs_gradient_editor_cmd_callback, 170, 180, 0, 0, FALSE };
|
||||
SessionInfo device_status_session_info =
|
||||
{ "device-status", (GtkItemFactoryCallback)dialogs_device_status_cmd_callback, 0, 600, 0, 0, FALSE };
|
||||
SessionInfo error_console_session_info =
|
||||
{ "error-console", (GtkItemFactoryCallback)dialogs_error_console_cmd_callback, 400, 0, 250, 300, FALSE };
|
||||
|
||||
/* public functions */
|
||||
void
|
||||
|
|
|
@ -45,6 +45,7 @@ extern SessionInfo brush_select_session_info;
|
|||
extern SessionInfo pattern_select_session_info;
|
||||
extern SessionInfo gradient_editor_session_info;
|
||||
extern SessionInfo device_status_session_info;
|
||||
extern SessionInfo error_console_session_info;
|
||||
|
||||
extern GList *session_info_updates; /* This list holds all session_infos
|
||||
that should be written to the
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "commands.h"
|
||||
#include "errorconsole.h"
|
||||
#include "fileops.h"
|
||||
#include "general.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -58,7 +57,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
|
|||
{ "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Document Index...", NULL, raise_idea_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, error_console_show_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, dialogs_error_console_cmd_callback, 0 },
|
||||
{ "/File/---", NULL, NULL, 0, "<Separator>" },
|
||||
};
|
||||
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "commands.h"
|
||||
#include "errorconsole.h"
|
||||
#include "fileops.h"
|
||||
#include "general.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -58,7 +57,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
|
|||
{ "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Document Index...", NULL, raise_idea_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, error_console_show_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, dialogs_error_console_cmd_callback, 0 },
|
||||
{ "/File/---", NULL, NULL, 0, "<Separator>" },
|
||||
};
|
||||
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
|
||||
|
|
|
@ -79,6 +79,8 @@ SessionInfo gradient_editor_session_info =
|
|||
{ "gradient-editor", (GtkItemFactoryCallback)dialogs_gradient_editor_cmd_callback, 170, 180, 0, 0, FALSE };
|
||||
SessionInfo device_status_session_info =
|
||||
{ "device-status", (GtkItemFactoryCallback)dialogs_device_status_cmd_callback, 0, 600, 0, 0, FALSE };
|
||||
SessionInfo error_console_session_info =
|
||||
{ "error-console", (GtkItemFactoryCallback)dialogs_error_console_cmd_callback, 400, 0, 250, 300, FALSE };
|
||||
|
||||
/* public functions */
|
||||
void
|
||||
|
|
|
@ -45,6 +45,7 @@ extern SessionInfo brush_select_session_info;
|
|||
extern SessionInfo pattern_select_session_info;
|
||||
extern SessionInfo gradient_editor_session_info;
|
||||
extern SessionInfo device_status_session_info;
|
||||
extern SessionInfo error_console_session_info;
|
||||
|
||||
extern GList *session_info_updates; /* This list holds all session_infos
|
||||
that should be written to the
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "appenv.h"
|
||||
#include "colormaps.h"
|
||||
#include "commands.h"
|
||||
#include "errorconsole.h"
|
||||
#include "fileops.h"
|
||||
#include "general.h"
|
||||
#include "gimprc.h"
|
||||
|
@ -58,7 +57,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
|
|||
{ "/File/Dialogs/Input Devices...", NULL, dialogs_input_devices_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Device Status...", NULL, dialogs_device_status_cmd_callback, 0 },
|
||||
{ "/File/Dialogs/Document Index...", NULL, raise_idea_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, error_console_show_callback, 0 },
|
||||
{ "/File/Dialogs/Error Console...", NULL, dialogs_error_console_cmd_callback, 0 },
|
||||
{ "/File/---", NULL, NULL, 0, "<Separator>" },
|
||||
};
|
||||
static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);
|
||||
|
|
|
@ -906,9 +906,17 @@ script_fu_interface (SFScript *script)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX(hbox), script->args_widgets[i],
|
||||
(script->arg_types[i] == SF_VALUE),
|
||||
(script->arg_types[i] == SF_VALUE), 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), script->args_widgets[i],
|
||||
1, 2, i, i + 1, 0, 0, 4, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, /* script->args_widgets[i], */
|
||||
1, 2, i, i + 1,
|
||||
GTK_FILL | ((script->arg_types[i] == SF_VALUE) ?
|
||||
GTK_EXPAND : 0),
|
||||
GTK_FILL, 4, 2);
|
||||
gtk_widget_show (script->args_widgets[i]);
|
||||
}
|
||||
gtk_widget_show (table);
|
||||
|
|
|
@ -906,9 +906,17 @@ script_fu_interface (SFScript *script)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX(hbox), script->args_widgets[i],
|
||||
(script->arg_types[i] == SF_VALUE),
|
||||
(script->arg_types[i] == SF_VALUE), 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), script->args_widgets[i],
|
||||
1, 2, i, i + 1, 0, 0, 4, 2);
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, /* script->args_widgets[i], */
|
||||
1, 2, i, i + 1,
|
||||
GTK_FILL | ((script->arg_types[i] == SF_VALUE) ?
|
||||
GTK_EXPAND : 0),
|
||||
GTK_FILL, 4, 2);
|
||||
gtk_widget_show (script->args_widgets[i]);
|
||||
}
|
||||
gtk_widget_show (table);
|
||||
|
|
Loading…
Reference in New Issue