1998-07-29 05:11:47 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* errorconsole.c - text window for collecting error messages
|
|
|
|
* Copyright (C) 1998 Nick Fetchak <nuke@bayside.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
1999-02-21 07:20:54 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1999-06-15 06:18:02 +08:00
|
|
|
#include <glib.h>
|
|
|
|
|
1998-07-29 05:11:47 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
1999-04-23 23:20:10 +08:00
|
|
|
#include <sys/types.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#ifdef HAVE_DIRENT_H
|
1998-07-29 05:11:47 +08:00
|
|
|
#include <dirent.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
1998-07-29 05:11:47 +08:00
|
|
|
#include <unistd.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#endif
|
1998-07-29 05:11:47 +08:00
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/stat.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <io.h>
|
|
|
|
#ifndef S_IRUSR
|
|
|
|
#define S_IRUSR _S_IREAD
|
|
|
|
#endif
|
|
|
|
#ifndef S_IWUSR
|
|
|
|
#define S_IWUSR _S_IWRITE
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include "apptypes.h"
|
|
|
|
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ERRORS_ALL,
|
|
|
|
ERRORS_SELECTION
|
|
|
|
};
|
|
|
|
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
static GtkWidget *error_console = NULL;
|
|
|
|
static GtkWidget *text_view = NULL;
|
|
|
|
static GtkTextBuffer *text_buffer = NULL;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
1998-08-03 03:05:02 +08:00
|
|
|
|
|
|
|
static void
|
1998-07-29 05:11:47 +08:00
|
|
|
error_console_close_callback (GtkWidget *widget,
|
1999-04-05 20:48:48 +08:00
|
|
|
gpointer data)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
1998-08-03 03:05:02 +08:00
|
|
|
gtk_widget_hide (error_console);
|
1999-07-25 02:26:33 +08:00
|
|
|
|
|
|
|
/* FIXME: interact with preferences */
|
|
|
|
message_handler = MESSAGE_BOX;
|
1998-08-03 03:05:02 +08:00
|
|
|
}
|
|
|
|
|
1999-08-22 03:00:41 +08:00
|
|
|
static void
|
|
|
|
error_console_clear_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
GtkTextIter start_iter;
|
|
|
|
GtkTextIter end_iter;
|
|
|
|
|
|
|
|
buffer = (GtkTextBuffer *) data;
|
|
|
|
|
|
|
|
gtk_text_buffer_get_start_iter (buffer, &start_iter);
|
|
|
|
gtk_text_buffer_get_end_iter (buffer, &end_iter);
|
|
|
|
|
|
|
|
gtk_text_buffer_delete (buffer, &start_iter, &end_iter);
|
1999-08-22 03:00:41 +08:00
|
|
|
}
|
|
|
|
|
1998-08-03 03:05:02 +08:00
|
|
|
void
|
|
|
|
error_console_free (void)
|
|
|
|
{
|
|
|
|
if (error_console)
|
2001-04-18 00:00:27 +08:00
|
|
|
{
|
|
|
|
gtk_widget_destroy (error_console);
|
|
|
|
error_console = NULL;
|
|
|
|
}
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
|
2001-07-26 19:46:40 +08:00
|
|
|
static gboolean
|
|
|
|
error_console_write_file (const gchar *path,
|
|
|
|
gint textscope)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkTextIter start_iter;
|
|
|
|
GtkTextIter end_iter;
|
|
|
|
gint fd;
|
|
|
|
gint text_length;
|
|
|
|
gint bytes_written;
|
|
|
|
gchar *text_contents;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
|
|
|
fd = open (path, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
|
|
|
|
|
|
|
|
if (fd == -1)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (textscope == ERRORS_ALL)
|
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
gtk_text_buffer_get_bounds (text_buffer, &start_iter, &end_iter);
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
gtk_text_buffer_get_selection_bounds (text_buffer, &start_iter, &end_iter);
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
text_contents = gtk_text_buffer_get_text (text_buffer,
|
|
|
|
&start_iter, &end_iter, TRUE);
|
|
|
|
|
1998-07-29 05:11:47 +08:00
|
|
|
text_length = strlen (text_contents);
|
|
|
|
|
|
|
|
if (text_contents && (text_length > 0))
|
|
|
|
{
|
|
|
|
bytes_written = write (fd, text_contents, text_length);
|
|
|
|
|
|
|
|
g_free (text_contents);
|
|
|
|
close (fd);
|
|
|
|
|
|
|
|
if (bytes_written != text_length)
|
|
|
|
return FALSE;
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
close (fd);
|
2001-07-27 23:18:20 +08:00
|
|
|
|
1998-07-29 05:11:47 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-07-25 02:26:33 +08:00
|
|
|
error_console_file_ok_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
GtkWidget *filesel;
|
|
|
|
const gchar *filename;
|
|
|
|
gint textscope;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
filesel = (GtkWidget *) data;
|
1998-07-29 05:11:47 +08:00
|
|
|
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel));
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
textscope = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (filesel),
|
|
|
|
"text-scope"));
|
|
|
|
|
|
|
|
if (! error_console_write_file (filename, textscope))
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
gchar *message;
|
|
|
|
|
|
|
|
message = g_strdup_printf (_("Error opening file %s: %s"),
|
|
|
|
filename, g_strerror (errno));
|
|
|
|
|
|
|
|
g_message (message);
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_free (message);
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
else
|
2001-07-27 23:18:20 +08:00
|
|
|
{
|
|
|
|
gtk_widget_destroy (filesel);
|
|
|
|
}
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
error_console_menu_callback (gint textscope)
|
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
GtkWidget *filesel;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
if (! gtk_text_buffer_get_selection_bounds (text_buffer, NULL, NULL) &&
|
|
|
|
textscope == ERRORS_SELECTION)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
g_message (_("Can't save, nothing selected!"));
|
1998-07-29 05:11:47 +08:00
|
|
|
return;
|
|
|
|
}
|
2001-07-27 23:18:20 +08:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
filesel = gtk_file_selection_new (_("Save error log to file..."));
|
1998-12-04 07:01:44 +08:00
|
|
|
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
|
1998-07-29 05:11:47 +08:00
|
|
|
gtk_window_set_wmclass (GTK_WINDOW (filesel), "save_errors", "Gimp");
|
1999-12-31 04:16:58 +08:00
|
|
|
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (filesel), 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (GTK_FILE_SELECTION (filesel)->button_area), 2);
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button),
|
|
|
|
"clicked",
|
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
filesel);
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_object_set_data (G_OBJECT (filesel), "text-scope",
|
|
|
|
GINT_TO_POINTER (textscope));
|
|
|
|
g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filesel)->ok_button),
|
|
|
|
"clicked",
|
|
|
|
G_CALLBACK (error_console_file_ok_callback),
|
|
|
|
filesel);
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filesel)->cancel_button),
|
|
|
|
"delete_event",
|
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
filesel);
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
/* Connect the "F1" help key */
|
2001-08-01 07:28:56 +08:00
|
|
|
gimp_help_connect (filesel,
|
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/error_console.html");
|
1999-09-28 01:58:10 +08:00
|
|
|
|
1998-07-29 05:11:47 +08:00
|
|
|
gtk_widget_show (filesel);
|
|
|
|
}
|
|
|
|
|
2001-07-26 19:46:40 +08:00
|
|
|
static gboolean
|
1999-09-28 01:58:10 +08:00
|
|
|
text_clicked_callback (GtkWidget *widget,
|
2001-07-27 23:18:20 +08:00
|
|
|
GdkEventButton *event,
|
1999-09-28 01:58:10 +08:00
|
|
|
gpointer data)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
GtkMenu *menu = (GtkMenu *) data;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
menu = (GtkMenu *) data;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
1999-07-25 02:26:33 +08:00
|
|
|
switch (event->button)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
1999-07-25 02:26:33 +08:00
|
|
|
case 1:
|
|
|
|
case 2:
|
2001-07-27 23:18:20 +08:00
|
|
|
return FALSE;
|
1999-07-25 02:26:33 +08:00
|
|
|
break;
|
1998-07-29 05:11:47 +08:00
|
|
|
|
1999-07-25 02:26:33 +08:00
|
|
|
case 3:
|
|
|
|
gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time);
|
|
|
|
|
|
|
|
/* wheelmouse support */
|
|
|
|
case 4:
|
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkAdjustment *adj = GTK_TEXT_VIEW (text_view)->vadjustment;
|
|
|
|
gdouble new_value = adj->value - adj->page_increment / 2;
|
1999-07-25 02:26:33 +08:00
|
|
|
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
|
|
|
gtk_adjustment_set_value (adj, new_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkAdjustment *adj = GTK_TEXT_VIEW (text_view)->vadjustment;
|
|
|
|
gdouble new_value = adj->value + adj->page_increment / 2;
|
1999-07-25 02:26:33 +08:00
|
|
|
new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size);
|
|
|
|
gtk_adjustment_set_value (adj, new_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
2001-07-27 23:18:20 +08:00
|
|
|
|
|
|
|
return TRUE;
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
GtkWidget *
|
|
|
|
error_console_create (void)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkWidget *scrolled_window;
|
1999-09-28 01:58:10 +08:00
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *menuitem;
|
|
|
|
|
2001-04-18 00:00:27 +08:00
|
|
|
if (error_console)
|
|
|
|
return error_console;
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
text_buffer = gtk_text_buffer_new (NULL);
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
error_console = gimp_dialog_new (_("GIMP Error Console"), "error_console",
|
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/error_console.html",
|
|
|
|
GTK_WIN_POS_NONE,
|
|
|
|
TRUE, TRUE, FALSE,
|
|
|
|
|
2001-08-04 22:10:58 +08:00
|
|
|
GTK_STOCK_CLEAR, error_console_clear_callback,
|
2001-07-27 23:18:20 +08:00
|
|
|
text_buffer, NULL, NULL, FALSE, FALSE,
|
2001-08-04 03:43:19 +08:00
|
|
|
GTK_STOCK_CLOSE, error_console_close_callback,
|
2001-07-27 23:18:20 +08:00
|
|
|
text_buffer, NULL, NULL, TRUE, TRUE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
NULL);
|
1999-01-11 07:20:33 +08:00
|
|
|
|
1998-08-03 03:05:02 +08:00
|
|
|
/* The next line should disappear when setting the size works in SM */
|
|
|
|
gtk_widget_set_usize (error_console, 250, 300);
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
|
|
|
GTK_POLICY_AUTOMATIC,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (error_console)->vbox),
|
|
|
|
scrolled_window);
|
|
|
|
gtk_widget_show (scrolled_window);
|
1998-07-29 05:11:47 +08:00
|
|
|
|
|
|
|
menu = gtk_menu_new ();
|
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
menuitem = gtk_menu_item_new_with_label (_("Write all errors to file..."));
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
|
2001-08-04 03:43:19 +08:00
|
|
|
gtk_widget_show (menuitem);
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_signal_connect_swapped (G_OBJECT (menuitem), "activate",
|
|
|
|
G_CALLBACK (error_console_menu_callback),
|
|
|
|
GINT_TO_POINTER (ERRORS_ALL));
|
1998-07-29 05:11:47 +08:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
menuitem = gtk_menu_item_new_with_label (_("Write selection to file..."));
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
|
2001-08-04 03:43:19 +08:00
|
|
|
gtk_widget_show (menuitem);
|
|
|
|
|
2001-07-27 23:18:20 +08:00
|
|
|
g_signal_connect_swapped (G_OBJECT (menuitem), "activate",
|
|
|
|
G_CALLBACK (error_console_menu_callback),
|
|
|
|
GINT_TO_POINTER (ERRORS_SELECTION));
|
1998-07-29 05:11:47 +08:00
|
|
|
|
|
|
|
/* The output text widget */
|
2001-07-27 23:18:20 +08:00
|
|
|
text_view = gtk_text_view_new_with_buffer (text_buffer);
|
|
|
|
g_object_unref (G_OBJECT (text_buffer));
|
|
|
|
|
|
|
|
gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), FALSE);
|
|
|
|
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
|
|
|
|
gtk_widget_show (text_view);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (text_view), "button_press_event",
|
|
|
|
G_CALLBACK (text_clicked_callback),
|
|
|
|
GTK_MENU (menu));
|
1998-07-29 05:11:47 +08:00
|
|
|
|
1998-08-03 03:05:02 +08:00
|
|
|
gtk_widget_show (error_console);
|
2001-04-18 00:00:27 +08:00
|
|
|
|
|
|
|
/* FIXME: interact with preferences */
|
|
|
|
message_handler = ERROR_CONSOLE;
|
|
|
|
|
|
|
|
return error_console;
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2001-07-26 19:46:40 +08:00
|
|
|
error_console_add (const gchar *errormsg)
|
1998-07-29 05:11:47 +08:00
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
if (! error_console)
|
1998-08-03 03:05:02 +08:00
|
|
|
{
|
2001-04-18 00:00:27 +08:00
|
|
|
error_console_create ();
|
|
|
|
}
|
1998-08-03 03:05:02 +08:00
|
|
|
else
|
|
|
|
{
|
2001-04-18 00:00:27 +08:00
|
|
|
if (! GTK_WIDGET_VISIBLE (error_console))
|
1999-07-25 02:26:33 +08:00
|
|
|
{
|
|
|
|
gtk_widget_show (error_console);
|
|
|
|
|
|
|
|
/* FIXME: interact with preferences */
|
|
|
|
message_handler = ERROR_CONSOLE;
|
|
|
|
}
|
1998-08-03 03:05:02 +08:00
|
|
|
else
|
|
|
|
gdk_window_raise (error_console->window);
|
|
|
|
}
|
2001-07-27 23:18:20 +08:00
|
|
|
|
1998-07-29 05:11:47 +08:00
|
|
|
if (errormsg)
|
|
|
|
{
|
2001-07-27 23:18:20 +08:00
|
|
|
GtkTextIter end;
|
|
|
|
|
|
|
|
gtk_text_buffer_get_end_iter (text_buffer, &end);
|
|
|
|
gtk_text_buffer_place_cursor (text_buffer, &end);
|
|
|
|
|
|
|
|
gtk_text_buffer_insert_at_cursor (text_buffer, errormsg, -1);
|
|
|
|
gtk_text_buffer_insert_at_cursor (text_buffer, "\n", -1);
|
1998-07-29 05:11:47 +08:00
|
|
|
}
|
|
|
|
}
|