[gnome-subtitles] If there are unsaved translation changes, ask the user if they want to save them. Use the encoding t



commit 0022d955b2f580aef34456de58dc2e88ceb1ee94
Author: Pedro Castro <mail pedrocastro org>
Date:   Mon Jun 9 10:58:04 2014 +0100

    If there are unsaved translation changes, ask the user if they want to save them. Use the encoding that 
was selected when opening the translation.

 src/GnomeSubtitles/Ui/MainUi.cs |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/GnomeSubtitles/Ui/MainUi.cs b/src/GnomeSubtitles/Ui/MainUi.cs
index 263636e..fa83a6e 100644
--- a/src/GnomeSubtitles/Ui/MainUi.cs
+++ b/src/GnomeSubtitles/Ui/MainUi.cs
@@ -217,6 +217,15 @@ public class MainUi {
        }
     }
 
+       /// <summary>Reloads the current translation file.</summary>
+       /// <remarks>If there's a translation currently open with unsaved changes, a warning dialog
+       /// is shown before opening the new file.</remarks>
+       public void TranslationReload () {
+               if (ToOpenTranslationAfterWarning()) {
+                       OpenTranslation(Base.Document.TranslationFile.Path, 
Base.Document.TranslationFile.Encoding.CodePage);
+               }
+       }
+
     /// <summary>Executes a Save operation regarding the translation.</summary>
     /// <remarks>If the translation hasn't been saved before, a TranslationSaveAs is executed.</remarks>
     /// <returns>Whether the translation file was saved or not.</returns>
@@ -229,14 +238,6 @@ public class MainUi {
                        return TranslationSaveAs();
     }
        
-       /// <summary>
-       /// Reopens current translation file
-       /// </summary>
-       public void TranslationReload () {
-               //FIXME: encoding is autodetected, which is fine for me, but it should be remembered somewhere
-               OpenTranslation(Base.Document.TranslationFile.Path, -1); 
-       }
-
     /// <summary>Executes a translation SaveAs operation.</summary>
     /// <returns>Whether the translation file was saved or not.</returns>
     public bool TranslationSaveAs () {


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