[longomatch] Prompt to save the template before exiting



commit 87564b1c86c02d2e5af0d8b3754d8ad46e37daf5
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu May 29 15:46:52 2014 +0200

    Prompt to save the template before exiting

 LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs b/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
index 9c642de..c1e07e3 100644
--- a/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/TeamsTemplatesPanel.cs
@@ -76,6 +76,7 @@ namespace LongoMatch.Gui.Panel
                        teamtemplateeditor1.TemplateSaved += (s, e) => {SaveLoadedTeam ();};
                        
                        backbutton.Clicked += (sender, o) => {
+                               PromptSave ();
                                if (BackEvent != null)
                                        BackEvent();
                        };
@@ -123,17 +124,19 @@ namespace LongoMatch.Gui.Panel
                        }
                }
                
-               void LoadTeam (string teamName) {
+               void PromptSave () {
                        if (loadedTeam != null) {
                                if (teamtemplateeditor1.Edited) {
                                        string msg = Catalog.GetString ("Do you want to save the current 
template");
                                        if (Config.GUIToolkit.QuestionMessage (msg, null, this)) {
                                                SaveLoadedTeam ();
-                                       } else {
-                                               return;
                                        }
                                }
                        }
+               }
+               
+               void LoadTeam (string teamName) {
+                       PromptSave ();
                        
                        try  {
                                loadedTeam = provider.Load (teamName);


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