~artem-anufrij/scratch/dont-force-to-save-unsaved

« back to all changes in this revision

Viewing changes to src/Services/Document.vala

  • Committer: artem-anufrij
  • Date: 2014-10-13 19:10:14 UTC
  • Revision ID: artem-anufrij-20141013191014-xhtujbyiudexrmt8
code fixing

Show diffs side-by-side

added added

removed removed

Lines of Context:
527
527
            if (this.error_shown)
528
528
                return;
529
529
            this.error_shown = true;
530
 
            string message = _("File \"<b>%s</b>\" cannot be read. Maybe it is corrupt\nor you do not have the necessary permissions to read it.").printf (get_basename ());
 
530
            string message = _("File \"%s\" cannot be read. Maybe it is corrupt\nor you do not have the necessary permissions to read it.").printf ("<b>%s</b>".printf (get_basename ()));
531
531
            var parent_window = source_view.get_toplevel () as Gtk.Window;
532
532
            var dialog = new Gtk.MessageDialog.with_markup (parent_window, Gtk.DialogFlags.MODAL,
533
533
                                                 Gtk.MessageType.ERROR,
543
543
            // If the file does not exist anymore
544
544
            if (!exists ()) {
545
545
                if (mounted == false) {
546
 
                    string message = _("The location containing the file") +  " \"<b>%s</b>\" ".printf (get_basename ()) +
547
 
                                     _("was unmounted. Do you want to save somewhere else?");
 
546
                    string message = _("The location containing the file \"%s\" was unmounted. Do you want to save somewhere else?").printf ("<b>%s</b>".printf (get_basename ()));
548
547
 
549
548
                    set_message (Gtk.MessageType.WARNING, message, _("Save As…"), () => {
550
549
                        this.save_as ();
551
550
                        hide_info_bar ();
552
551
                    });
553
552
                } else {
554
 
                    string message = _("File") +  " \"<b>%s</b>\" ".printf (get_basename ()) +
555
 
                                     _("was deleted. Do you want to save it anyway?");
 
553
                    string message = _("File \"%s\" was deleted. Do you want to save it anyway?").printf ("<b>%s</b>".printf (get_basename ()));
556
554
 
557
555
                    set_message (Gtk.MessageType.WARNING, message, _("Save"), () => {
558
556
                        this.save ();
565
563
            }
566
564
            // If the file can't be written
567
565
            if (!can_write ()) {
568
 
                string message = _("You cannot save changes on file") +  " \"<b>%s</b>\". ".printf (get_basename ()) +
569
 
                                 _("Do you want to save the changes to this file in a different location?");
 
566
                string message = _("You cannot save changes on file \"%s\". Do you want to save the changes to this file in a different location?").printf ("<b>%s</b>".printf (get_basename ()));
570
567
 
571
568
                set_message (Gtk.MessageType.WARNING, message, _("Save changes elsewhere"), () => {
572
569
                    this.save_as ();
593
590
                    if (settings.autosave)
594
591
                        this.source_view.set_text (text, false);
595
592
                    else {
596
 
                        string message =  _("File %s was modified by an external application. Do you want to load it again or continue your editing?").printf ("<b>%s</b>".printf (get_basename ()));
 
593
                        string message =  _("File \"%s\" was modified by an external application. Do you want to load it again or continue your editing?").printf ("<b>%s</b>".printf (get_basename ()));
597
594
                        set_message (Gtk.MessageType.WARNING, message, _("Load"), () => {
598
595
                            this.source_view.set_text (text, false);
599
596
                            hide_info_bar ();