[Commits] (jed) Fixed Bug#1437 (Deselect sidebar) - Selecting Untitled now clears the sidebar selection

commits at osafoundation.org commits at osafoundation.org
Tue Aug 3 18:08:24 PDT 2004


Commit by: jed
Modified files:
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.89 1.90
chandler/parcels/osaf/views/main/TabbedView.py 1.20 1.21

Log message:
Fixed Bug#1437 (Deselect sidebar) - Selecting Untitled now clears the sidebar selection
Fixed Bug#1691 (Selecting "Untitled" tab causes error) - Selecting Untitled now clears sidebar selection
Fixed Bug#1440 (Update sidebar when clicking in tabs) - Fixed outstanding bugs
Fixed Bug#1690 (Close tab sometimes fails) - Close now does the right thing thanks to other fixes.

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.89&r2=text&tr2=1.90
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/TabbedView.py.diff?r1=text&tr1=1.20&r2=text&tr2=1.21

Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.89 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.90
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.89	Tue Aug  3 02:29:20 2004
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py	Tue Aug  3 18:08:23 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.89 $"
-__date__ = "$Date: 2004/08/03 09:29:20 $"
+__version__ = "$Revision: 1.90 $"
+__date__ = "$Date: 2004/08/04 01:08:23 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -514,8 +514,8 @@
     def GoToItem(self, item):
         try:
             row = self.blockItem.contents.index (item)
-        except LookupError:
-            pass
+        except ValueError:
+            self.ClearSelection()
         else:
             cursorColumn = 0
             try:

Index: chandler/parcels/osaf/views/main/TabbedView.py
diff -u chandler/parcels/osaf/views/main/TabbedView.py:1.20 chandler/parcels/osaf/views/main/TabbedView.py:1.21
--- chandler/parcels/osaf/views/main/TabbedView.py:1.20	Tue Jul 20 02:06:27 2004
+++ chandler/parcels/osaf/views/main/TabbedView.py	Tue Aug  3 18:08:23 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.20 $"
-__date__ = "$Date: 2004/07/20 09:06:27 $"
+__version__ = "$Revision: 1.21 $"
+__date__ = "$Date: 2004/08/04 01:08:23 $"
 __copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -41,22 +41,27 @@
         name = self._getUniqueName("Untitled")
         newItem = originalItem.copy(name, self)
         newItem.contents._ItemCollection__refresh() # @@@ Hack to work around Bug#1568
-
+        newItem.contents.displayName = name
+        
         self.widget.selectedTab = self.widget.GetPageCount()
         newItem.parentBlock = self
         newItem.render()
         self.synchronizeWidget()
+        self.Post (Globals.repository.findPath ('//parcels/osaf/framework/blocks/Events/SelectionChanged'),
+                   {'item':newItem})
 
     def onCloseEvent (self, notification):
         "Close the current tab"
         selection = self.widget.GetSelection()
         page = self.widget.GetPage(selection)
-        if selection > (self.widget.GetPageCount() - 1):
+        if selection == (self.widget.GetPageCount() - 1):
             self.widget.selectedTab = selection - 1
         else:
             self.widget.selectedTab = selection
         page.blockItem.parentBlock = None
         self.synchronizeWidget()
+        self.Post (Globals.repository.findPath ('//parcels/osaf/framework/blocks/Events/SelectionChanged'),
+                   {'item':self.widget.GetPage(self.widget.selectedTab).blockItem})
         
     def onCloseEventUpdateUI(self, notification):
         notification.data['Enable'] = (self.widget.GetPageCount() > 1)
@@ -65,10 +70,10 @@
         if not self.hasChild(name):
             return name
         number = 1
-        uniqueName = name + " " + str(number)
+        uniqueName = name + "-" + str(number)
         while self.hasChild(uniqueName):
             number += 1
-            uniqueName = name + " " + str(number)
+            uniqueName = name + "-" + str(number)
         return uniqueName
 
         



More information about the Commits mailing list