Index: main.c =================================================================== RCS file: /cvs/gpe/base/gpe-edit/main.c,v retrieving revision 1.52 diff -u -r1.52 main.c --- main.c 25 Aug 2004 12:26:38 -0000 1.52 +++ main.c 2 Sep 2004 18:21:32 -0000 @@ -262,6 +262,9 @@ gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->cancel_button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy), (gpointer) file_selector); + gtk_window_set_transient_for(GTK_WINDOW(file_selector), GTK_WINDOW(main_window)); + gtk_window_set_modal(GTK_WINDOW(file_selector), TRUE); + gtk_widget_show (file_selector); } @@ -284,6 +287,8 @@ suggested_filename = gtk_text_buffer_get_text (buf, &start, &end, FALSE); file_selector = gtk_file_selection_new (_("Save as...")); + gtk_window_set_transient_for(GTK_WINDOW(file_selector), GTK_WINDOW(main_window)); + gtk_window_set_modal(GTK_WINDOW(file_selector), TRUE); gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_selector), suggested_filename); @@ -579,6 +584,7 @@ GtkTooltips *tooltips; GtkWidget *toolbar_icon; GtkTextBuffer *buf; + gint window_x, window_y; if (gpe_application_init (&argc, &argv) == FALSE) exit (1); @@ -598,8 +604,15 @@ bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); textdomain (PACKAGE); bind_textdomain_codeset (PACKAGE, "UTF-8"); - + + window_x = gdk_screen_width() / 2; + window_y = gdk_screen_height() / 2; + if (window_x < 240) window_x = 240; + if (window_y < 310) window_y = 310; + + main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_default_size (GTK_WINDOW (main_window), window_x, window_y); update_window_title (); gtk_widget_set_usize (GTK_WIDGET (main_window), window_x, window_y); @@ -663,11 +676,14 @@ toolbar_icon = gtk_image_new_from_stock (GTK_STOCK_COPY, GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Copy"), _("Copy selected, paste is possible by tap&hold"), _("Copy selected, paste is possible by tap&hold"), toolbar_icon, copy_selection, vbox); -/* - toolbar_icon = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Paste"), + + /* add another icon if we screen is large */ + if (window_x > 260) + { + toolbar_icon = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Paste"), _("Paste from clipboard"), _("Paste from clipboard"), toolbar_icon, paste_clipboard, vbox); -*/ + } toolbar_icon = gtk_image_new_from_stock (GTK_STOCK_QUIT, GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Quit"), _("Exit gpe-edit"), _("Exit gpe-edit"), toolbar_icon, ask_save_before_exit, vbox);