From 25b4d7ee9e2549a2f28306350ab53acd0acddd80 Mon Sep 17 00:00:00 2001 From: Chris Lahey Date: Sun, 16 Aug 1998 09:04:03 +0000 Subject: [PATCH] Small fixes to the document index. --- ChangeLog | 9 +++++++++ app/docindex.c | 15 +++++++-------- app/docindex.h | 4 ++-- app/docindexif.c | 13 +++---------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index eced0bbe9f..a192aed9d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1998-08-16 Chris Lahey + + * app/docindexif.c: Fixed up the UI to make the document index + look a bit more like a dialog. + + * app/docindex.h: + * app/docindex.c: Just fixed a few small nits. Might have made + the document index a bit more robust during gimp crashes. + Sat Aug 15 22:53:36 CDT 1998 Larry Ewing * app/gdisplay.c (gdisplay_update_cursor): Make sure we check the diff --git a/app/docindex.c b/app/docindex.c index ac8a184d14..5bc3814625 100644 --- a/app/docindex.c +++ b/app/docindex.c @@ -23,12 +23,12 @@ idea_manager *ideas = NULL; static GList *idea_list = NULL; /* of gchar *. */ -static gint x, y, width, height; +static gint x = 0, y = 0, width = 0, height = 0; static char *image_drop_types[] = {"url:ALL"}; -static void create_idea_list(); +static void create_idea_list( void ); static void load_idea_manager( idea_manager * ); static void @@ -94,7 +94,8 @@ idea_window_delete_event_callback( GtkWidget *widget, GdkEvent *event, gpointer void idea_hide_callback( GtkWidget *widget, gpointer data ) { - save_idea_manager( ideas ); + if ( ideas || idea_list || width || height ) + save_idea_manager( ideas ); /* False if exitting */ if( ( ! exit_from_go() ) && ideas) @@ -107,7 +108,7 @@ idea_hide_callback( GtkWidget *widget, gpointer data ) } void -open_idea_window() +open_idea_window( void ) { make_idea_window( -1, -1 ); } @@ -139,8 +140,6 @@ make_idea_window( int x, int y ) menu = ideas->menubar->widget; /* Setup accelerator (hotkey) table */ accel = ideas->menubar->accel_group; - /* Setup the window_menu widget for additions and removals */ - ideas->window_menu = GTK_WIDGET( GTK_MENU_ITEM( g_list_nth( GTK_MENU_SHELL( menu )->children, 1 )->data )->submenu ); /* Add accelerators to window widget */ gtk_window_add_accel_group( GTK_WINDOW( ideas->window ), accel ); @@ -328,7 +327,7 @@ save_to_list( gpointer data, gpointer null_data ) } static void -create_idea_list() +create_idea_list( void ) { gdk_window_get_geometry( ideas->window->window, &x, &y, &width, &height, NULL ); gdk_window_get_origin( ideas->window->window, &x, &y ); @@ -553,7 +552,7 @@ void idea_remove_callback( GtkWidget *widget, gpointer data ) } void -close_idea_window() +close_idea_window( void ) { idea_hide_callback( NULL, NULL ); } diff --git a/app/docindex.h b/app/docindex.h index 709d6bcf92..e399efa767 100644 --- a/app/docindex.h +++ b/app/docindex.h @@ -42,8 +42,8 @@ typedef struct idea_manager } idea_manager; void make_idea_window( gint x, gint y ); -void open_idea_window(); -void close_idea_window(); +void open_idea_window( void ); +void close_idea_window( void ); 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/docindexif.c b/app/docindexif.c index 737dcaeb21..d0a46f1957 100644 --- a/app/docindexif.c +++ b/app/docindexif.c @@ -65,9 +65,7 @@ static GtkMenuEntry idea_menu [] = { "
/File/New", "N", file_new_cmd_callback, NULL }, { "
/File/Open...", "O", file_open_callback, NULL }, { "
/File/", NULL, NULL, NULL }, - { "
/File/Hide Index", "W",idea_hide_callback, NULL }, - { "
/File/Quit", "Q", file_quit_cmd_callback, NULL }, - { "
/Help/About...", NULL, about_dialog_cmd_callback, NULL } + { "
/File/Close Index", "W",idea_hide_callback, NULL }, }; GtkMenuFactory *create_idea_menu() @@ -99,7 +97,7 @@ GtkWidget *create_idea_toolbar() gtk_toolbar_set_button_relief( GTK_TOOLBAR( toolbar ), GTK_RELIEF_NONE ); gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), - "Open File", "Open a file", "Toolbar/Open", + "Open", "Open a file", "Toolbar/Open", NULL, (GtkSignalFunc) file_open_callback, NULL); @@ -119,14 +117,9 @@ GtkWidget *create_idea_toolbar() (GtkSignalFunc) idea_remove_callback, NULL ); gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), - "Hide", "Hide the Document Index", "Toolbar/Hide", + "Close", "Close the Document Index", "Toolbar/Hide", NULL, (GtkSignalFunc) idea_hide_callback, NULL ); - - gtk_toolbar_append_item( GTK_TOOLBAR( toolbar ), - "Quit", "Duh", "Toolbar/Quit", - NULL, - (GtkSignalFunc) file_quit_cmd_callback, NULL ); return toolbar; }