diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index aadc891c37..9a890668aa 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -793,8 +793,15 @@ gnc_main_window_prompt_for_save (GtkWidget *window) GtkWidget *dialog; gint response; const gchar *filename, *tmp; + const gchar *title = _("Save changes to file %s before closing?"); #ifdef HIG_COMPLIANT gint oldest_change, minutes; + const gchar *message = + _("If you don't save, changes from the past %d minutes will be discarded."); +#else + const gchar *message = + _("Changes have been made since the last time it was saved. If you " + "continue without saving these changes will be discarded."); #endif session = qof_session_get_current_session(); @@ -819,32 +826,20 @@ gnc_main_window_prompt_for_save (GtkWidget *window) * case scenario would be if QOF could provide a timestamp of the * oldest unsaved change. */ + dialog = gtk_message_dialog_new(GTK_WINDOW(window), + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + title, + filename); #ifdef HIG_COMPLIANT oldest_change = qof_book_time_changed(book); minutes = (time() - oldest_change) / 60 + 1; - dialog = - gtk_message_dialog_new_with_markup (GTK_WINDOW(window), - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - _("Save changes to file %s before " - "closing?\n\nIf you don't save, " - "changes from the past %d minutes " - "will be discarded."), - filename, minutes); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + message, minutes); #else - dialog = - gtk_message_dialog_new_with_markup (GTK_WINDOW(window), - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - _("Save changes to file %s before " - "closing?\n\nChanges have been " - "made since the last time it was " - "saved. If you continue without " - "saving these changes will be " - "discarded."), - filename); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + message); #endif gtk_dialog_add_buttons(GTK_DIALOG(dialog), @@ -879,6 +874,11 @@ gnc_main_window_delete_event (GtkWidget *window, QofSession *session; GtkWidget *dialog; gint response; + const gchar *title = _("Quit Gnucash?"); + const gchar *message =_("You are attempting to close the last " + "Gnucash window. Doing so will quit the " + "application. Are you sure that this is " + "what you want to do?"); if (g_list_length(active_windows) > 1) return FALSE; @@ -893,17 +893,13 @@ gnc_main_window_delete_event (GtkWidget *window, return TRUE; } - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), - GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - "%s\n\n%s", - _("Quit Gnucash?"), - _("You are attempting to close the last " - "Gnucash window. Doing so will quit the " - "application. Are you sure that this is " - "what you want to do?")); - + dialog = gtk_message_dialog_new(GTK_WINDOW(window), + GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + "%s", title); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", message); gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_QUIT, GTK_RESPONSE_OK, diff --git a/src/gnome/dialog-commodities.c b/src/gnome/dialog-commodities.c index f3acd11007..1b70ecd836 100644 --- a/src/gnome/dialog-commodities.c +++ b/src/gnome/dialog-commodities.c @@ -147,13 +147,13 @@ remove_clicked (CommoditiesDialog *cd) warning = "delete_commodity"; } - dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(cd->dialog), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - "%s\n\n%s", - _("Delete commodity?"), - message); + dialog = gtk_message_dialog_new(GTK_WINDOW(cd->dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "%s", _("Delete commodity?")); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", message); gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_DELETE, GTK_RESPONSE_OK, diff --git a/src/gnome/dialog-price-edit-db.c b/src/gnome/dialog-price-edit-db.c index 0ce7a3a25d..430ec64b1f 100644 --- a/src/gnome/dialog-price-edit-db.c +++ b/src/gnome/dialog-price-edit-db.c @@ -168,14 +168,13 @@ gnc_prices_dialog_remove_clicked (GtkWidget *widget, gpointer data) "Are you sure you want to delete the %d selected prices?", length), length); - dialog = gtk_message_dialog_new_with_markup - (GTK_WINDOW(pdb_dialog->dialog), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - "%s\n\n%s", - _("Delete prices?"), - message); + dialog = gtk_message_dialog_new(GTK_WINDOW(pdb_dialog->dialog), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + "%s", _("Delete prices?")); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", message); g_free(message); gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c index 0a22bd276b..ad0b29f0e8 100644 --- a/src/gnome/gnc-split-reg.c +++ b/src/gnome/gnc-split-reg.c @@ -950,9 +950,9 @@ xaccTransWarnReadOnly (const Transaction *trans) { GtkWidget *dialog; const gchar *reason; - const gchar *format = - _("Cannot modify or delete this transaction. This transaction is " - "marked read-only because:\n\n'%s'"); + const gchar *title = _("Cannot modify or delete this transaction."); + const gchar *message = + _("This transaction is marked read-only with the comment: '%s'"); if (!trans) return FALSE; @@ -962,8 +962,9 @@ xaccTransWarnReadOnly (const Transaction *trans) 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - format, - reason); + "%s", title); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + message, reason); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); return TRUE; @@ -983,7 +984,7 @@ gsr_default_reinit_handler( GNCSplitReg *gsr, gpointer data ) gint response; const gchar *warning; - const char *message = _("Remove the splits from this transaction?"); + const char *title = _("Remove the splits from this transaction?"); const char *recn_warn = _("This transaction contains reconciled splits. " "Modifying it is not a good idea because that will " "cause your reconciled balance to be off."); @@ -993,24 +994,16 @@ gsr_default_reinit_handler( GNCSplitReg *gsr, gpointer data ) trans = gnc_split_register_get_current_trans (reg); if (xaccTransWarnReadOnly(trans)) return; + dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + "%s", title); if (xaccTransHasReconciledSplits (trans)) { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_MODAL - | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - "%s\n\n%s", - message, recn_warn); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", recn_warn); warning = "register_remove_all_splits2"; } else { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_MODAL - | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - "%s", message); warning = "register_remove_all_splits"; } @@ -1109,13 +1102,14 @@ gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data ) char recn; if (split == gnc_split_register_get_current_trans_split (reg, NULL)) { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s\n\n%s", - anchor_error, anchor_split); + dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window), + GTK_DIALOG_MODAL + | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", anchor_error); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", anchor_split); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); return; @@ -1129,29 +1123,22 @@ gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data ) /* ask for user confirmation before performing permanent damage */ buf = g_strdup_printf (format, memo, desc); - + dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window), + GTK_DIALOG_MODAL + | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, + buf); + g_free(buf); recn = xaccSplitGetReconcile (split); if (recn == YREC || recn == FREC) { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_MODAL - | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - "%s\n\n%s", buf, recn_warn); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", recn_warn); warning = "register_delete_split2"; } else { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_MODAL - | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - "%s", buf); warning = "register_delete_split"; } - g_free(buf); gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); @@ -1171,29 +1158,23 @@ gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data ) /* On a transaction cursor with 2 or fewer splits in single or double * mode, we just delete the whole transaction, kerblooie */ { - const char *message = _("Delete the current transaction?"); + const char *title = _("Delete the current transaction?"); const char *recn_warn = _("You would be deleting a transaction " "with reconciled splits! " "This is not a good idea as it will cause your " "reconciled balance to be off."); + dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window), + GTK_DIALOG_MODAL + | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_NONE, + "%s", title); if (xaccTransHasReconciledSplits (trans)) { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, - "%s\n\n%s", message, recn_warn); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", recn_warn); warning = "register_delete_trans2"; } else { - dialog = - gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window), - GTK_DIALOG_MODAL - | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - "%s", message); warning = "register_delete_trans"; } gtk_dialog_add_button(GTK_DIALOG(dialog), @@ -1935,13 +1916,13 @@ gtk_callback_bug_workaround (gpointer argp) const gchar *read_only = "This account register is read-only."; GtkWidget *dialog; - dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(args->gsr->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_CLOSE, - "%s\n\n%s", - read_only, - args->string); + dialog = gtk_message_dialog_new(GTK_WINDOW(args->gsr->window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_CLOSE, + "%s", read_only); + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%s", args->string); gnc_dialog_run(GTK_DIALOG(dialog), "register_read_only"); gtk_widget_destroy(dialog); g_free(args);