作図ソフト dia の改良版
Revisión | 02f73b72800626af4e1d77b33c9e1b516c0b3526 (tree) |
---|---|
Tiempo | 2004-04-13 22:30:15 |
Autor | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Disappearing toolbox fix
@@ -1,3 +1,9 @@ | ||
1 | +2004-04-13 Lars Clausen <lc@pc770.sb.statsbiblioteket.dk> | |
2 | + | |
3 | + * app/interface.c (toolbox_delete): | |
4 | + * app/app_procs.[ch] (app_exit): Stop the delete event if the user | |
5 | + cancels quit due to modified diagrams. | |
6 | + | |
1 | 7 | 2004-04-07 Samúel Jón Gunnarsson <sammi@techattack.nu> |
2 | 8 | |
3 | 9 | * is.po: Added "is" to ALL_LINGUAS. |
@@ -574,7 +574,7 @@ set_true_callback(GtkWidget *w, int *data) | ||
574 | 574 | } |
575 | 575 | #endif |
576 | 576 | |
577 | -void | |
577 | +gboolean | |
578 | 578 | app_exit(void) |
579 | 579 | { |
580 | 580 | GList *list; |
@@ -589,7 +589,7 @@ app_exit(void) | ||
589 | 589 | |
590 | 590 | if (app_exit_once) { |
591 | 591 | g_error(_("This shouldn't happen. Please file a bug report at bugzilla.gnome.org\ndescribing how you can cause this message to appear.\n")); |
592 | - return; | |
592 | + return FALSE; | |
593 | 593 | } |
594 | 594 | |
595 | 595 | if (diagram_modified_exists()) { |
@@ -618,7 +618,7 @@ app_exit(void) | ||
618 | 618 | |
619 | 619 | if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_OK) { |
620 | 620 | gtk_widget_destroy(dialog); |
621 | - return; | |
621 | + return FALSE; | |
622 | 622 | } |
623 | 623 | gtk_widget_destroy(dialog); |
624 | 624 | } |
@@ -661,6 +661,8 @@ app_exit(void) | ||
661 | 661 | /* Yuck. -Lars */ |
662 | 662 | printf(_("Thank you for using Dia.\n")); |
663 | 663 | app_exit_once = TRUE; |
664 | + | |
665 | + return TRUE; | |
664 | 666 | } |
665 | 667 | |
666 | 668 | static void create_user_dirs(void) |
@@ -21,7 +21,11 @@ | ||
21 | 21 | #include <lib/filter.h> |
22 | 22 | |
23 | 23 | void app_init(int argc, char **argv); |
24 | -void app_exit(void); | |
24 | +/** Exit the application, but asking the user for confirmation | |
25 | + * if there are changed diagrams. | |
26 | + * Returns TRUE if the application exits. | |
27 | + */ | |
28 | +gboolean app_exit(void); | |
25 | 29 | int app_is_embedded(void); |
26 | 30 | |
27 | 31 | gboolean do_convert(const char *infname, |
@@ -1135,7 +1135,7 @@ toolbox_destroy (GtkWidget *widget, gpointer data) | ||
1135 | 1135 | app_exit(); |
1136 | 1136 | } |
1137 | 1137 | |
1138 | -static void | |
1138 | +static gboolean | |
1139 | 1139 | toolbox_delete (GtkWidget *widget, GdkEvent *event, gpointer data) |
1140 | 1140 | { |
1141 | 1141 | if (!app_is_embedded()) { |
@@ -1147,7 +1147,8 @@ toolbox_delete (GtkWidget *widget, GdkEvent *event, gpointer data) | ||
1147 | 1147 | g_signal_handler_disconnect (GTK_OBJECT (widget), handlerid); |
1148 | 1148 | prefs.recent_sheet = gtk_option_menu_get_history(GTK_OPTION_MENU(sheet_option_menu)); |
1149 | 1149 | |
1150 | - app_exit(); | |
1150 | + /** If the app didn't exit, don't close the window */ | |
1151 | + return (!app_exit()); | |
1151 | 1152 | } |
1152 | 1153 | } |
1153 | 1154 |