[Ocfs2-tools-commits] manish commits r1105 - branches/ocfs2-tools-1.0/ocfs2console/ocfs2interface

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Oct 21 11:39:58 CDT 2005


Author: manish
Date: 2005-10-21 11:39:57 -0500 (Fri, 21 Oct 2005)
New Revision: 1105

Modified:
   branches/ocfs2-tools-1.0/ocfs2console/ocfs2interface/nodeconfig.py
Log:
Making editing work, and scroll to newly added nodes


Modified: branches/ocfs2-tools-1.0/ocfs2console/ocfs2interface/nodeconfig.py
===================================================================
--- branches/ocfs2-tools-1.0/ocfs2console/ocfs2interface/nodeconfig.py	2005-10-21 08:00:04 UTC (rev 1104)
+++ branches/ocfs2-tools-1.0/ocfs2console/ocfs2interface/nodeconfig.py	2005-10-21 16:39:57 UTC (rev 1105)
@@ -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