mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Use the gtk2.6 secondary message text function now that there is a 2.4
emulation routine available. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13020 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -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,
|
||||
_("<b>Save changes to file %s before "
|
||||
"closing?</b>\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,
|
||||
_("<b>Save changes to file %s before "
|
||||
"closing?</b>\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),
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(window),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_WARNING,
|
||||
GTK_BUTTONS_NONE,
|
||||
"<b>%s</b>\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?"));
|
||||
|
||||
"%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,
|
||||
|
||||
@@ -147,13 +147,13 @@ remove_clicked (CommoditiesDialog *cd)
|
||||
warning = "delete_commodity";
|
||||
}
|
||||
|
||||
dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(cd->dialog),
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(cd->dialog),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_NONE,
|
||||
"<b>%s</b>\n\n%s",
|
||||
_("Delete commodity?"),
|
||||
message);
|
||||
"%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,
|
||||
|
||||
@@ -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),
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(pdb_dialog->dialog),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_NONE,
|
||||
"<b>%s</b>\n\n%s",
|
||||
_("Delete prices?"),
|
||||
message);
|
||||
"%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,
|
||||
|
||||
@@ -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;
|
||||
if (xaccTransHasReconciledSplits (trans)) {
|
||||
dialog =
|
||||
gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window),
|
||||
GTK_DIALOG_MODAL
|
||||
| GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_WARNING,
|
||||
GTK_BUTTONS_NONE,
|
||||
"<b>%s</b>\n\n%s",
|
||||
message, recn_warn);
|
||||
"%s", title);
|
||||
if (xaccTransHasReconciledSplits (trans)) {
|
||||
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,
|
||||
"<b>%s</b>", 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,
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
|
||||
GTK_DIALOG_MODAL
|
||||
| GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
"<b>%s</b>\n\n%s",
|
||||
anchor_error, anchor_split);
|
||||
"%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);
|
||||
|
||||
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,
|
||||
"<b>%s</b>\n\n%s", buf, recn_warn);
|
||||
warning = "register_delete_split2";
|
||||
} else {
|
||||
dialog =
|
||||
gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window),
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
|
||||
GTK_DIALOG_MODAL
|
||||
| GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_NONE,
|
||||
"<b>%s</b>", buf);
|
||||
buf);
|
||||
g_free(buf);
|
||||
recn = xaccSplitGetReconcile (split);
|
||||
if (recn == YREC || recn == FREC)
|
||||
{
|
||||
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
|
||||
"%s", recn_warn);
|
||||
warning = "register_delete_split2";
|
||||
} else {
|
||||
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.");
|
||||
|
||||
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,
|
||||
"<b>%s</b>\n\n%s", message, recn_warn);
|
||||
warning = "register_delete_trans2";
|
||||
} else {
|
||||
dialog =
|
||||
gtk_message_dialog_new_with_markup(GTK_WINDOW(gsr->window),
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(gsr->window),
|
||||
GTK_DIALOG_MODAL
|
||||
| GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_MESSAGE_WARNING,
|
||||
GTK_BUTTONS_NONE,
|
||||
"<b>%s</b>", message);
|
||||
"%s", title);
|
||||
if (xaccTransHasReconciledSplits (trans)) {
|
||||
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
|
||||
"%s", recn_warn);
|
||||
warning = "register_delete_trans2";
|
||||
} else {
|
||||
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),
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(args->gsr->window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_WARNING,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"<b>%s</b>\n\n%s",
|
||||
read_only,
|
||||
args->string);
|
||||
"%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);
|
||||
|
||||
Reference in New Issue
Block a user