[gnome-latex: 2/2] DocumentTab: use tepl_io_error_info_bar_externally_modified()



commit 0300013279bb2059cf86bee3e65a745be6e29715
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Mar 31 12:28:02 2020 +0200

    DocumentTab: use tepl_io_error_info_bar_externally_modified()

 src/document_tab.vala | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/src/document_tab.vala b/src/document_tab.vala
index f58b238..7ca7215 100644
--- a/src/document_tab.vala
+++ b/src/document_tab.vala
@@ -1,7 +1,7 @@
 /*
  * This file is part of GNOME LaTeX.
  *
- * Copyright © 2010, 2011, 2017 Sébastien Wilmet
+ * Copyright © 2010-2020 Sébastien Wilmet
  *
  * GNOME LaTeX is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -163,19 +163,8 @@ public class DocumentTab : Tepl.Tab
         {
             ask_if_externally_modified = true;
 
-            string primary_msg = _("The file %s changed on disk.")
-                .printf (document.location.get_parse_name ());
-
-            string secondary_msg;
-            if (document.get_modified ())
-                secondary_msg = _("Do you want to drop your changes and reload the file?");
-            else
-                secondary_msg = _("Do you want to reload the file?");
-
-            Tepl.InfoBar infobar = new Tepl.InfoBar.simple (MessageType.WARNING,
-                primary_msg, secondary_msg);
-            infobar.add_button (_("_Reload"), ResponseType.OK);
-            infobar.add_button (_("_Cancel"), ResponseType.CANCEL);
+            Tepl.InfoBar infobar = Tepl.io_error_info_bar_externally_modified (document.location,
+                document.get_modified ());
             add_info_bar (infobar);
             infobar.show ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]