[chronojump] Deletes warning - stops using a private member variable to hold the parent in some widgets.



commit e3ab70b1ce2f10982df6be2ae6789b96da011735
Author: Carles Pina i Estany <carles pina cat>
Date:   Mon Oct 17 10:45:56 2016 +0200

    Deletes warning - stops using a private member variable to hold the parent in some widgets.
    
    Previously the constructor saved the parent variable into a private
    member variable, and parent was never used. Probably for some reason
    (e.g. avoid the parent to get destroyed while the child existed).
    
    Now it uses the parent Gtk member variable so it avoids warnings and
    Gtk knows who is the parent window in case of need.

 src/gui/executeAuto.cs  |    3 +--
 src/gui/jump.cs         |    3 +--
 src/gui/jumpType.cs     |    3 +--
 src/gui/person.cs       |   10 +++-------
 src/gui/personSelect.cs |    5 ++---
 src/gui/pulse.cs        |    3 +--
 src/gui/report.cs       |    4 +---
 src/gui/run.cs          |    3 +--
 src/gui/runType.cs      |    3 +--
 src/gui/server.cs       |    3 +--
 src/gui/session.cs      |    9 +++------
 11 files changed, 16 insertions(+), 33 deletions(-)
---
diff --git a/src/gui/executeAuto.cs b/src/gui/executeAuto.cs
index 462beb7..1c3e29d 100644
--- a/src/gui/executeAuto.cs
+++ b/src/gui/executeAuto.cs
@@ -77,7 +77,6 @@ public class ExecuteAutoWindow
        TreeStore store_result;
        
        static ExecuteAutoWindow ExecuteAutoWindowBox;
-       Gtk.Window parent;
        int sessionID;
 
        ExecuteAuto.ModeTypes mode;
@@ -90,7 +89,7 @@ public class ExecuteAutoWindow
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "execute_auto", 
null);
                gladeXML.Autoconnect(this);
-               this.parent =  parent;
+               execute_auto.Parent = parent;
                
                //put an icon to window
                UtilGtk.IconWindow(execute_auto);
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index b830c7d..3ea08b4 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -582,7 +582,6 @@ public class RepairJumpRjWindow
        [Widget] Gtk.TextView textview1;
 
        static RepairJumpRjWindow RepairJumpRjWindowBox;
-       Gtk.Window parent;
        //int pDN;
 
        JumpType jumpType;
@@ -597,7 +596,7 @@ public class RepairJumpRjWindow
                //put an icon to window
                UtilGtk.IconWindow(repair_sub_event);
        
-               this.parent = parent;
+               repair_sub_event.Parent = parent;
                this.jumpRj = myJump;
 
                //this.pDN = pDN;
diff --git a/src/gui/jumpType.cs b/src/gui/jumpType.cs
index 07045d4..5c44d25 100644
--- a/src/gui/jumpType.cs
+++ b/src/gui/jumpType.cs
@@ -57,7 +57,6 @@ public class JumpTypeAddWindow
        [Widget] Gtk.TextView textview_description;
 
        static JumpTypeAddWindow JumpTypeAddWindowBox;
-       Gtk.Window parent;
 
        public bool InsertedSimple;
 
@@ -65,7 +64,7 @@ public class JumpTypeAddWindow
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "jump_type_add", 
"chronojump");
                gladeXML.Autoconnect(this);
-               this.parent =  parent;
+               jump_type_add.Parent = parent;
                
                fakeButtonAccept = new Gtk.Button();
 
diff --git a/src/gui/person.cs b/src/gui/person.cs
index c299a89..9019aa9 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -837,8 +837,6 @@ public class PersonAddModifyWindow
        
        static PersonAddModifyWindow PersonAddModifyWindowBox;
        
-       Gtk.Window parent;
-       
        DialogCalendar myDialogCalendar;
        DateTime dateTime;
        Sport sport;
@@ -879,7 +877,7 @@ public class PersonAddModifyWindow
                //put an icon to window
                UtilGtk.IconWindow(person_win);
        
-               this.parent = parent;
+               person_win.Parent = parent;
                this.currentSession = currentSession;
                this.currentPerson = currentPerson;
 
@@ -1742,7 +1740,6 @@ public class PersonAddMultipleWindow {
        [Widget] Gtk.Button button_accept;
        
        static PersonAddMultipleWindow PersonAddMultipleWindowBox;
-       Gtk.Window parent;
 
        private Person currentPerson;
        Session currentSession;
@@ -1761,7 +1758,7 @@ public class PersonAddMultipleWindow {
                //put an icon to window
                UtilGtk.IconWindow(person_multiple_infinite);
        
-               this.parent = parent;
+               person_multiple_infinite.Parent = parent;
                this.currentSession = currentSession;
        }
        
@@ -2291,7 +2288,6 @@ public class PersonShowAllEventsWindow {
        
        static PersonShowAllEventsWindow PersonShowAllEventsWindowBox;
 
-       Gtk.Window parent;      
        protected int sessionID;
        
        protected Person currentPerson;
@@ -2304,7 +2300,7 @@ public class PersonShowAllEventsWindow {
                //put an icon to window
                UtilGtk.IconWindow(person_show_all_events);
 
-               this.parent = parent;
+               person_show_all_events.Parent = parent;
                this.sessionID = sessionID;
                this.currentPerson = currentPerson;
        
diff --git a/src/gui/personSelect.cs b/src/gui/personSelect.cs
index d6d2fa7..a3f2314 100644
--- a/src/gui/personSelect.cs
+++ b/src/gui/personSelect.cs
@@ -37,7 +37,6 @@ public class PersonSelectWindow
        [Widget] Gtk.Button button_add;
        
        static PersonSelectWindow PersonSelectWindowBox;
-       Gtk.Window parent;
        
        private ArrayList persons;
        public Person SelectedPerson;
@@ -54,6 +53,7 @@ public class PersonSelectWindow
                
                //put an icon to window
                UtilGtk.IconWindow(person_select_window);
+               person_select_window.Parent = parent;
                
                FakeButtonAddPerson = new Gtk.Button();
                FakeButtonEditPerson = new Gtk.Button();
@@ -66,8 +66,7 @@ public class PersonSelectWindow
                if (PersonSelectWindowBox == null) {
                        PersonSelectWindowBox = new PersonSelectWindow (parent);
                }
-               
-               PersonSelectWindowBox.parent = parent;
+
                PersonSelectWindowBox.persons = persons;
                
                PersonSelectWindowBox.createTable();
diff --git a/src/gui/pulse.cs b/src/gui/pulse.cs
index 4446d07..d7a8ba2 100644
--- a/src/gui/pulse.cs
+++ b/src/gui/pulse.cs
@@ -206,7 +206,6 @@ public class RepairPulseWindow
        [Widget] Gtk.TextView textview1;
 
        static RepairPulseWindow RepairPulseWindowBox;
-       Gtk.Window parent;
 
        PulseType pulseType;
        Pulse myPulse; //used on button_accept
@@ -220,7 +219,7 @@ public class RepairPulseWindow
                //put an icon to window
                UtilGtk.IconWindow(repair_sub_event);
 
-               this.parent = parent;
+               repair_sub_event.Parent = parent;
                this.myPulse = myPulse;
        
                repair_sub_event.Title = Catalog.GetString("Repair pulse");
diff --git a/src/gui/report.cs b/src/gui/report.cs
index 9455f46..a07fc27 100644
--- a/src/gui/report.cs
+++ b/src/gui/report.cs
@@ -56,8 +56,6 @@ public class ReportWindow {
        
        static ReportWindow ReportWindowBox;
 
-       Gtk.Window parent;
-       
        //private int sessionID;
 
        Report report;
@@ -70,7 +68,7 @@ public class ReportWindow {
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "report_window", 
"chronojump");
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               report_window.Parent = parent;
                
                //put an icon to window
                UtilGtk.IconWindow(report_window);
diff --git a/src/gui/run.cs b/src/gui/run.cs
index 856c165..553ed80 100644
--- a/src/gui/run.cs
+++ b/src/gui/run.cs
@@ -575,7 +575,6 @@ public class RepairRunIntervalWindow
        [Widget] Gtk.TextView textview1;
 
        static RepairRunIntervalWindow RepairRunIntervalWindowBox;
-       Gtk.Window parent;
 
        RunType type;
        RunInterval runInterval; //used on button_accept
@@ -585,7 +584,7 @@ public class RepairRunIntervalWindow
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", 
"repair_sub_event", null);
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               repair_sub_event.Parent = parent;
                
                //put an icon to window
                UtilGtk.IconWindow(repair_sub_event);
diff --git a/src/gui/runType.cs b/src/gui/runType.cs
index 25cb137..b009c82 100644
--- a/src/gui/runType.cs
+++ b/src/gui/runType.cs
@@ -79,7 +79,6 @@ public class RunTypeAddWindow
        [Widget] Gtk.Entry dd9;
 
        static RunTypeAddWindow RunTypeAddWindowBox;
-       Gtk.Window parent;
 
        public bool InsertedSimple;
 
@@ -87,7 +86,7 @@ public class RunTypeAddWindow
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "run_type_add", 
"chronojump");
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               run_type_add.Parent = parent;
                
                fakeButtonAccept = new Gtk.Button();
 
diff --git a/src/gui/server.cs b/src/gui/server.cs
index e75b496..f9d835f 100644
--- a/src/gui/server.cs
+++ b/src/gui/server.cs
@@ -102,13 +102,12 @@ public class SessionUploadWindow {
 
 
        static SessionUploadWindow SessionUploadWindowBox;
-       Gtk.Window parent;
        
        SessionUploadWindow (Gtk.Window parent) {
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", 
"session_upload", "chronojump");
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               session_upload.Parent = parent;
                
                //put an icon to window
                UtilGtk.IconWindow(session_upload);
diff --git a/src/gui/session.cs b/src/gui/session.cs
index 9c2287c..2f40a85 100644
--- a/src/gui/session.cs
+++ b/src/gui/session.cs
@@ -75,14 +75,13 @@ public class SessionAddEditWindow {
        
        GenericWindow genericWin;
        static SessionAddEditWindow SessionAddEditWindowBox;
-       Gtk.Window parent;
        
        
        SessionAddEditWindow (Gtk.Window parent, Session currentSession) {
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", 
"session_add_edit", null);
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               session_add_edit.Parent = parent;
                
                //put an icon to window
                UtilGtk.IconWindow(session_add_edit);
@@ -662,7 +661,6 @@ public class SessionLoadWindow {
        [Widget] Gtk.HBox session_import_box;
 
        static SessionLoadWindow SessionLoadWindowBox;
-       Gtk.Window parent;
        
        private Session currentSession;
        private WindowType type;
@@ -672,7 +670,7 @@ public class SessionLoadWindow {
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "session_load", 
null);
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               session_load.Parent = parent;
 
                // Hides and shows widgets only needed by some of the functionality
                session_import_box.Visible = (type == WindowType.IMPORT_SESSION);
@@ -1025,7 +1023,6 @@ public class SessionSelectStatsWindow {
        [Widget] Gtk.Button button_accept;
 
        static SessionSelectStatsWindow SessionSelectStatsWindowBox;
-       Gtk.Window parent;
        
        private ArrayList arrayOfSelectedSessions;
        
@@ -1033,7 +1030,7 @@ public class SessionSelectStatsWindow {
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", 
"stats_select_sessions", "chronojump");
                gladeXML.Autoconnect(this);
-               this.parent = parent;
+               stats_select_sessions.Parent = parent;
                
                //put an icon to window
                UtilGtk.IconWindow(stats_select_sessions);


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