[master 2/3] refactoring gui.py: setup_window() and setLanguage() are way too similar.

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

 



Merge the methods into one.
---
 gui.py |   24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/gui.py b/gui.py
index 6cc79e5..8814b5d 100755
--- a/gui.py
+++ b/gui.py
@@ -1216,22 +1216,8 @@ class InstallInterface(InstallInterfaceBase):
 class InstallControlWindow:
     def setLanguage (self):
         if not self.__dict__.has_key('window'): return
-
         self.reloadRcQueued = 1
-
-        # need to reload our widgets
-        self.setLtR()
-
-        # reload the glade file, although we're going to keep our toplevel
-        self.loadGlade()
-
-        self.window.destroy()
-        self.window = self.mainxml.get_widget("mainWindow")
-        
-        self.createWidgets()
-        self.connectSignals()
-        self.setScreen()
-        self.window.show()
+        self.setup_window(True)
 
     def setLtR(self):
         ltrrtl = gettext.dgettext("gtk20", "default:LTR")
@@ -1458,15 +1444,17 @@ class InstallControlWindow:
         self.mainxml = gtk.glade.XML(findGladeFile("anaconda.glade"),
                                      domain="anaconda")
 
-    def setup_window (self):
+    def setup_window (self, window_reload):
         self.setLtR()
 
+        if window_reload:
+            self.window.destroy()
+
         self.loadGlade()
         self.window = self.mainxml.get_widget("mainWindow")
 
         self.createWidgets()
         self.connectSignals()
-
         self.setScreen()
         self.window.show()
             
@@ -1477,7 +1465,7 @@ class InstallControlWindow:
         rootPopBusyCursor()
         
     def run (self, runres):
-        self.setup_window()
+        self.setup_window(False)
         gtk.main()
             
 class InstallControlState:
-- 
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux