[gnome-latex/wip/misc] MainWindow: use tepl_io_error_info_bar_file_already_open()



commit febc2b6a54c068f302d9b97a98ea56faacbeaa3c
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Mar 31 12:16:26 2020 +0200

    MainWindow: use tepl_io_error_info_bar_file_already_open()

 src/main_window.vala | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/src/main_window.vala b/src/main_window.vala
index e38dee6..467937a 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -1,7 +1,7 @@
 /*
  * This file is part of GNOME LaTeX.
  *
- * Copyright © 2010-2015, 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
@@ -644,15 +644,7 @@ public class MainWindow : ApplicationWindow
                 DocumentTab tab = create_tab_from_location (location, jump_to);
                 tab.document.readonly = true;
 
-                string primary_msg =
-                    _("This file (%s) is already opened in another GNOME LaTeX window.")
-                    .printf (location.get_parse_name ());
-                string secondary_msg = _("GNOME LaTeX opened this instance of the file in a non-editable 
way. Do you want to edit it anyway?");
-
-                InfoBar infobar = new Tepl.InfoBar.simple (MessageType.WARNING,
-                    primary_msg, secondary_msg);
-                infobar.add_button (_("Edit Anyway"), ResponseType.YES);
-                infobar.add_button (_("Don’t Edit"), ResponseType.NO);
+                Tepl.InfoBar infobar = Tepl.io_error_info_bar_file_already_open (location);
                 tab.add_info_bar (infobar);
                 infobar.show ();
 


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