Commit f2e652fd authored by Elliot's avatar Elliot
Browse files

Revert "Use different warning when closing an unsaved, read-only document"

This reverts commit 99a77fa3
parent c7740f9c
Pipeline #8822 passed with stages
in 2 minutes and 2 seconds
......@@ -389,8 +389,7 @@ mousepad_dialogs_save_changes (GtkWindow *parent,
GtkWidget *area, *hbox, *vbox;
GtkWidget *button;
GtkWidget *image;
GtkWidget *prompt_label;
GtkWidget *warning_label;
GtkWidget *label;
gint response;
/* create the question dialog */
......@@ -404,13 +403,9 @@ mousepad_dialogs_save_changes (GtkWindow *parent,
mousepad_util_image_button ("edit-delete", _("_Don't Save")),
MOUSEPAD_RESPONSE_DONT_SAVE);
/* warning label */
warning_label = gtk_label_new(NULL);
/* we show the save as button instead of save for readonly document */
if (G_UNLIKELY (readonly))
{
gtk_label_set_text(GTK_LABEL(warning_label), "The document file is read-only. If you don't save the document as another file, all the changes will be lost.");
image = gtk_image_new_from_icon_name ("document-save-as", GTK_ICON_SIZE_DIALOG);
button = mousepad_util_image_button ("document-save-as", _("_Save As"));
gtk_widget_set_can_default (button, TRUE);
......@@ -419,7 +414,6 @@ mousepad_dialogs_save_changes (GtkWindow *parent,
}
else
{
gtk_label_set_text(GTK_LABEL(warning_label), "If you don't save the document, all the changes will be lost.");
image = gtk_image_new_from_icon_name ("document-save", GTK_ICON_SIZE_DIALOG);
button = mousepad_util_image_button ("document-save", _("_Save"));
gtk_widget_set_can_default (button, TRUE);
......@@ -442,16 +436,17 @@ mousepad_dialogs_save_changes (GtkWindow *parent,
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 6);
gtk_widget_show (vbox);
/* prompt text */
prompt_label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (prompt_label),
/* primary text */
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
_("<big><b>Do you want to save the changes before closing?</b></big>"));
gtk_box_pack_start (GTK_BOX (vbox), prompt_label, TRUE, TRUE, 0);
gtk_widget_show (prompt_label);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
/* warning text */
gtk_box_pack_start (GTK_BOX (vbox), warning_label, TRUE, TRUE, 0);
gtk_widget_show (warning_label);
/* secondary text */
label = gtk_label_new (_("If you don't save the document, all the changes will be lost."));
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
/* run the dialog and wait for a response */
response = gtk_dialog_run (GTK_DIALOG (dialog));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment