[Ocfs2-tools-commits] manish commits r1103 - trunk/ocfs2console/ocfs2interface

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Oct 21 02:59:31 CDT 2005


Author: manish
Date: 2005-10-21 02:59:30 -0500 (Fri, 21 Oct 2005)
New Revision: 1103

Modified:
   trunk/ocfs2console/ocfs2interface/nodeconfig.py
Log:
Making editing work, and scroll to newly added nodes


Modified: trunk/ocfs2console/ocfs2interface/nodeconfig.py
===================================================================
--- trunk/ocfs2console/ocfs2interface/nodeconfig.py	2005-10-20 00:44:21 UTC (rev 1102)
+++ trunk/ocfs2console/ocfs2interface/nodeconfig.py	2005-10-21 07:59:30 UTC (rev 1103)
@@ -248,13 +248,16 @@
                                   ip_addr, ip_port))
         self.sel.select_iter(iter)
 
+        self.tv.scroll_to_cell(self.store.get_path(iter))
+
         self.can_apply(True)
 
     def edit_node(self, b):
         store, iter = self.sel.get_selected()
         attrs = store[iter]
 
-        node_attrs = self.node_query(title='Edit Node', defaults=attrs)
+        node_attrs = self.node_query(title='Edit Node', defaults=attrs,
+                                     editing=True)
 
         if node_attrs is None:
             return
@@ -311,7 +314,7 @@
         self.load_cluster_state()
         return success
 
-    def node_query(self, title='Node Attributes', defaults=None):
+    def node_query(self, title='Node Attributes', defaults=None, editing=False):
         existing_names = {}
         existing_ip_addrs = {}
 
@@ -319,9 +322,12 @@
             name = row[COLUMN_NAME]
             ip_addr = row[COLUMN_IP_ADDRESS]
 
-            existing_names[name] = 1
-            existing_ip_addrs[ip_addr] = name
+            if not (editing and name == defaults[COLUMN_NAME]):
+                existing_names[name] = 1
 
+            if not (editing and ip_addr == defaults[COLUMN_IP_ADDRESS]):
+                existing_ip_addrs[ip_addr] = name
+
         dialog = Dialog(parent=self, title=title,
                         buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                                  gtk.STOCK_OK,     gtk.RESPONSE_OK))



More information about the Ocfs2-tools-commits mailing list