diff --git a/ChangeLog b/ChangeLog index 268e4a9b7c..ece71ea934 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +1998-07-08 Chris Lahey + + * app/menus.c (toolbox_entries): Made it so that you won't get two + document indexes open at the same time. (docindex.c assumes that + you only have one open.) + + * app/docindex.h: Added a function to close the document index + from outside docindex.c. + + * app/docindex.c: Got rid of warnings about isspace(). + (create_idea_toolbar): Got rid of the warnings about pixmaps. + (close_idea_window): Added a function to close the document index + from outside docindex.c. + (idea_hide_callback): Made this function work correctly if called + when ideas is NULL. + + * app/app_procs.c (really_quit_callback): + (app_exit): Made it so that the document index saves even if you + quit without closing it. + + * app/fileops.c (file_save): Made Save As add to the document index. + 1998-07-08 Chris Lahey * app/docindex.h: diff --git a/app/app_procs.c b/app/app_procs.c index ecef343425..5793e32036 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -59,6 +59,7 @@ #include "undo.h" #include "xcf.h" #include "errors.h" +#include "docindex.h" #include "config.h" @@ -592,7 +593,10 @@ app_exit (int kill_it) if (kill_it == 0 && gdisplays_dirty () && no_interface == FALSE) really_quit_dialog (); else if (no_interface == FALSE) - toolbox_free (); + { + toolbox_free (); + close_idea_window(); + } else app_exit_finish (); } @@ -607,6 +611,7 @@ really_quit_callback (GtkButton *button, { gtk_widget_destroy (dialog); toolbox_free (); + close_idea_window(); } static void diff --git a/app/docindex.c b/app/docindex.c index e2c61e3f1e..29331b1e33 100644 --- a/app/docindex.c +++ b/app/docindex.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "gimage.h" @@ -38,53 +39,30 @@ static char *image_drop_types[] = {"url:ALL"}; GtkWidget *create_idea_toolbar() { - GtkWidget *wpixmap; - GdkPixmap *pixmap; - GdkBitmap *mask; GtkWidget *toolbar; toolbar = gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); gtk_widget_show( toolbar ); gtk_toolbar_set_button_relief( GTK_TOOLBAR( toolbar ), GTK_RELIEF_NONE ); - pixmap = gdk_pixmap_create_from_xpm( (GdkWindow *)&gdk_root_parent, &mask, - &toolbar->style->bg[GTK_STATE_NORMAL], - DATADIR "/go/tb_up_arrow.xpm" ); - wpixmap = gtk_pixmap_new( pixmap, mask ); - gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "Up", "Move the selected entry up in the index", "Toolbar/Up", - wpixmap, + NULL, (GtkSignalFunc) idea_up_callback, NULL); - pixmap = gdk_pixmap_create_from_xpm( (GdkWindow *)&gdk_root_parent, &mask, - &toolbar->style->bg[GTK_STATE_NORMAL], - DATADIR "/go/tb_down_arrow.xpm" ); - wpixmap = gtk_pixmap_new( pixmap, mask ); - gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "Down", "Move the selected entry down in the index", "Toolbar/Down", - wpixmap, + NULL, (GtkSignalFunc) idea_down_callback, NULL ); - pixmap = gdk_pixmap_create_from_xpm( (GdkWindow *)&gdk_root_parent, &mask, - &toolbar->style->bg[GTK_STATE_NORMAL], - DATADIR "/go/cancel.xpm" ); - wpixmap = gtk_pixmap_new( pixmap, mask ); - gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "Remove", "Remove the selected entry from the index", "Toolbar/Remove", - wpixmap, + NULL, (GtkSignalFunc) idea_remove_callback, NULL ); - pixmap = gdk_pixmap_create_from_xpm( (GdkWindow *)&gdk_root_parent, &mask, - &toolbar->style->bg[GTK_STATE_NORMAL], - DATADIR "/go/tb_exit.xpm" ); - wpixmap = gtk_pixmap_new( pixmap, mask ); - gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), "Hide", "Hide the Document Index", "Toolbar/Hide", - wpixmap, + NULL, (GtkSignalFunc) idea_hide_callback, NULL ); return toolbar; } @@ -226,10 +204,13 @@ idea_window_delete_event_callback( GtkWidget *widget, GdkEvent *event, gpointer static void idea_hide_callback( GtkWidget *widget, gpointer data ) { - save_idea_manager( ideas ); - gtk_widget_destroy( ideas->window ); - free( ideas ); - ideas = 0; + if ( ideas ) + { + save_idea_manager( ideas ); + gtk_widget_destroy( ideas->window ); + free( ideas ); + ideas = 0; + } } void @@ -238,6 +219,12 @@ open_idea_window() make_idea_window( -1, -1 ); } +void +close_idea_window() +{ + idea_hide_callback( NULL, NULL ); +} + void make_idea_window( int x, int y ) { diff --git a/app/docindex.h b/app/docindex.h index a9f6a4a349..2581406561 100644 --- a/app/docindex.h +++ b/app/docindex.h @@ -43,6 +43,7 @@ typedef struct idea_manager void make_idea_window( gint x, gint y ); void open_idea_window(); +void close_idea_window(); void idea_add( gchar *label ); void idea_add_in_position( gchar *label, gint position ); void raise_idea_callback( GtkWidget *widget, gpointer data ); diff --git a/app/fileops.c b/app/fileops.c index 1f8bf136e8..515f0b39eb 100644 --- a/app/fileops.c +++ b/app/fileops.c @@ -808,6 +808,8 @@ file_save (GimpImage* gimage, g_free (return_vals); g_free (args); + idea_add( filename ); + return return_val; } diff --git a/app/gui/menus.c b/app/gui/menus.c index 8e6b28c89f..a82ee3d7aa 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -51,7 +51,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/---", NULL, NULL, 0, "" }, - { "/File/Document Index...", NULL, open_idea_window, 0 }, + { "/File/Document Index...", NULL, raise_idea_callback, 0 }, { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); diff --git a/app/menus.c b/app/menus.c index 8e6b28c89f..a82ee3d7aa 100644 --- a/app/menus.c +++ b/app/menus.c @@ -51,7 +51,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/---", NULL, NULL, 0, "" }, - { "/File/Document Index...", NULL, open_idea_window, 0 }, + { "/File/Document Index...", NULL, raise_idea_callback, 0 }, { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); diff --git a/app/menus/menus.c b/app/menus/menus.c index 8e6b28c89f..a82ee3d7aa 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -51,7 +51,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/---", NULL, NULL, 0, "" }, - { "/File/Document Index...", NULL, open_idea_window, 0 }, + { "/File/Document Index...", NULL, raise_idea_callback, 0 }, { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]); diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 8e6b28c89f..a82ee3d7aa 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -51,7 +51,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/---", NULL, NULL, 0, "" }, - { "/File/Document Index...", NULL, open_idea_window, 0 }, + { "/File/Document Index...", NULL, raise_idea_callback, 0 }, { "/File/Quit", "Q", file_quit_cmd_callback, 0 }, }; static guint n_toolbox_entries = sizeof (toolbox_entries) / sizeof (toolbox_entries[0]);