FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Development

 
 
LinkBack Thread Tools
 
Old 04-06-2010, 03:30 PM
Ales Kozumplik
 
Default refactoring gui.py: setup_window() and setLanguage() are way too similar.

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org