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 > Redhat > Fedora Desktop

 
 
LinkBack Thread Tools
 
Old 04-27-2011, 03:12 PM
Ales Kozumplik
 
Default iscsi: disable the 'Login' button with no nodes selected.

Resolves: rhbz#700085
---
data/ui/iscsi-dialogs.glade | 2 +-
pyanaconda/iw/advanced_storage.py | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/data/ui/iscsi-dialogs.glade b/data/ui/iscsi-dialogs.glade
index 342a0b5..591cbf1 100644
--- a/data/ui/iscsi-dialogs.glade
+++ b/data/ui/iscsi-dialogs.glade
@@ -311,7 +311,7 @@
</packing>
</child>
<child>
- <widget class="GtkButton" id="button3">
+ <widget class="GtkButton" id="button_login">
<property name="label" translatable="yes">_Login</property>
<property name="response_id">1</property>
<property name="visible">True</property>
diff --git a/pyanaconda/iw/advanced_storage.py b/pyanaconda/iw/advanced_storage.py
index 40a3585..ade1135 100644
--- a/pyanaconda/iw/advanced_storage.py
+++ b/pyanaconda/iw/advanced_storage.py
@@ -19,6 +19,7 @@ import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)

# UI methods for supporting adding advanced storage devices.
+import functools
import gobject
import gtk
import gtk.glade
@@ -222,6 +223,9 @@ class iSCSIGuiWizard(pih.iSCSIWizard):
return self._run_dialog(self.login_dialog.dialog)

def display_nodes_dialog(self, found_nodes):
+ def _login_button_disabler(device_selector, login_button, checked, item):
+ login_button.set_sensitive(len(device_selector.get Selected()) > 0)
+
(xml, dialog) = gui.getGladeWidget("iscsi-dialogs.glade", "nodes_dialog")
store = gtk.TreeStore(
gobject.TYPE_PYOBJECT, # teh object
@@ -237,7 +241,7 @@ class iSCSIGuiWizard(pih.iSCSIWizard):
False, # not immutable
node.name)), # node's name
found_nodes)
-
+
# create and setup the device selector
model = store.filter_new()
view = gtk.TreeView(model)
@@ -245,7 +249,10 @@ class iSCSIGuiWizard(pih.iSCSIWizard):
store,
model,
view)
- ds.createSelectionCol()
+ callback = functools.partial(_login_button_disabler,
+ ds,
+ xml.get_widget("button_login"))
+ ds.createSelectionCol(toggledCB=callback)
ds.addColumn(_("Node Name"), self.NODE_NAME_COL)
# attach the treeview to the dialog
sw = xml.get_widget("nodes_scrolled_window")
--
1.7.3.3

_______________________________________________
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 09:15 AM.

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