[longomatch] Add a function to clear the player information from the widgets and use it.



commit 9d25d937bc13a926e28df4a6934636ee4f4586b0
Author: Julien Moutte <julien fluendo com>
Date:   Fri Aug 29 18:48:37 2014 +0200

    Add a function to clear the player information from the widgets and use it.

 LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs 
b/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs
index 3c3db3f..2774ae4 100644
--- a/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs
+++ b/LongoMatch.GUI/Gui/Component/TeamTemplateEditor.cs
@@ -91,6 +91,7 @@ namespace LongoMatch.Gui.Component
                                ignoreChanges = false;
                                Edited = false;
                                // Start with disabled widget until something get selected
+                               ClearPlayerFrame ();
                                playerframe.Sensitive = false;
                        }
                }
@@ -201,6 +202,24 @@ namespace LongoMatch.Gui.Component
                        mailentry.Text = p.Mail ?? "";
                        playerimage.Pixbuf = PlayerPhoto (p);
                }
+
+               void ClearPlayerFrame () {
+                       ignoreChanges = true;
+
+                       nameentry.Text = "";
+                       lastnameentry.Text = "";
+                       nicknameentry.Text = "";
+                       positionentry.Text = "";
+                       numberspinbutton.Value = 0;
+                       heightspinbutton.Value = 0;
+                       weightspinbutton.Value = 0;
+                       nationalityentry.Text = "";
+                       bdaydatepicker.Date = new DateTime ();
+                       mailentry.Text = "";
+                       playerimage.Pixbuf = playerimage.Pixbuf = IconTheme.Default.LoadIcon 
("longomatch-player-pic", 45, IconLookupFlags.ForceSvg);
+
+                       ignoreChanges = false;
+               }
                
                void ParseTactics () {
                        try {


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