[Commits] (jed) New tab now makes a copy of the untitled view and
uses that rather than a blank page.
commits at osafoundation.org
commits at osafoundation.org
Mon Jul 19 19:31:13 PDT 2004
Commit by: jed
Modified files:
chandler/parcels/osaf/views/main/TabbedView.py 1.18 1.19
Log message:
New tab now makes a copy of the untitled view and uses that rather than a blank page.
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/views/main/TabbedView.py.diff?r1=text&tr1=1.18&r2=text&tr2=1.19
Index: chandler/parcels/osaf/views/main/TabbedView.py
diff -u chandler/parcels/osaf/views/main/TabbedView.py:1.18 chandler/parcels/osaf/views/main/TabbedView.py:1.19
--- chandler/parcels/osaf/views/main/TabbedView.py:1.18 Mon Jul 19 16:23:44 2004
+++ chandler/parcels/osaf/views/main/TabbedView.py Mon Jul 19 19:31:12 2004
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.18 $"
-__date__ = "$Date: 2004/07/19 23:23:44 $"
+__version__ = "$Revision: 1.19 $"
+__date__ = "$Date: 2004/07/20 02:31:12 $"
__copyright__ = "Copyright (c) 2003 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -39,14 +39,15 @@
def onNewEvent (self, notification):
"Create a new tab"
- kind = Globals.repository.findPath("parcels/osaf/framework/blocks/HTML")
- name = self._getUniqueName("untitled")
+ originalItem = Globals.repository.findPath('parcels/osaf/views/content/UntitledView')
+ name = self._getUniqueName("Untitled")
+ newItem = originalItem.copy(name, self)
+ newItem.contents._ItemCollection__refresh() # @@@ Hack to work around Bug#1568
+
self.widget.selectedTab = len(self.tabNames)
self.tabNames.append(name)
- item = kind.newItem(name, self)
- item.url = ""
- item.parentBlock = self
- item.render()
+ newItem.parentBlock = self
+ newItem.render()
self.synchronizeWidget()
def onCloseEvent (self, notification):
@@ -68,7 +69,7 @@
if not self.hasChild(name):
return name
number = 1
- while self.hasChild(name + str(number)):
+ while self.hasChild(name + " " + str(number)):
number += 1
return name + str(number)
More information about the Commits
mailing list