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 > 64 Studio > 64 Studio User

 
 
LinkBack Thread Tools
 
Old 12-18-2009, 06:41 PM
Chris Lumens
 
Default Make Callbacks._update_size_label callable from outside the object.

Having it be private was based upon the old assumption that you couldn't add
devices during installation. Of course, that's incorrect for things like
iSCSI and FCOE. So now that we need to update the size label when the
Add Advanced button is clicked, it needs to be renamed.
---
iw/filter_gui.py | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index e2a9172..b540621 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -109,7 +109,7 @@ class Callbacks(object):
self.xml = xml

self.sizeLabel = self.xml.get_widget("sizeLabel")
- self.sizeLabel.connect("realize", self._update_size_label)
+ self.sizeLabel.connect("realize", self.update)

def addToUI(self, tuple):
pass
@@ -125,12 +125,18 @@ class Callbacks(object):
selectedDevices -= 1
selectedSize -= device["XXX_SIZE"]

- self._update_size_label()
+ self.update()

def isMember(self, info):
return info and not isRAID(info) and not isCCISS(info) and
not isMultipath(info) and not isOther(info)

+ def update(self, *args, **kwargs):
+ global selectedDevices, totalDevices
+ global selectedSize, totalSize
+
+ self.sizeLabel.set_markup(_("<b>%s device(s) (%s MB) selected</b> out of %s device(s) (%s MB) total.") % (selectedDevices, selectedSize, totalDevices, totalSize))
+
def visible(self, model, iter, view):
# Most basic visibility function - does the model say this row
# should be visible? Subclasses can define their own more specific
@@ -139,12 +145,6 @@ class Callbacks(object):
return self.isMember(model.get_value(iter, OBJECT_COL)) and
model.get_value(iter, 1)

- def _update_size_label(self, *args, **kwargs):
- global selectedDevices, totalDevices
- global selectedSize, totalSize
-
- self.sizeLabel.set_markup(_("<b>%s device(s) (%s MB) selected</b> out of %s device(s) (%s MB) total.") % (selectedDevices, selectedSize, totalDevices, totalSize))
-
class RAIDCallbacks(Callbacks):
def isMember(self, info):
return info and (isRAID(info) or isCCISS(info))
@@ -396,6 +396,9 @@ class FilterWindow(InstallWindow):

self.populate(nonraids, mpaths, raids)

+ # Make sure to update the size label at the bottom.
+ self.pages[0].cb.update()
+
self._cachedDevices.extend(nonraids)
self._cachedMPaths.extend(mpaths)
self._cachedRaidDevices.extend(raids)
--
1.6.5.1

_______________________________________________
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 07:05 PM.

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