oops - startup did not enable directoryUp
authorClaus Gittinger <cg@exept.de>
Fri, 07 Jun 2013 11:58:29 +0200
changeset 12873 0bf1fc08cfd1
parent 12872 2f2d2bb58976
child 12874 f08360e7ac62
oops - startup did not enable directoryUp button in the FileDialog. Reason is too much knowledge in AbstractFileBrowser and too much inheritance in its components.
AbstractDirectoryBrowser.st
--- a/AbstractDirectoryBrowser.st	Thu Jun 06 22:37:07 2013 +0200
+++ b/AbstractDirectoryBrowser.st	Fri Jun 07 11:58:29 2013 +0200
@@ -186,20 +186,37 @@
 
 !AbstractDirectoryBrowser methodsFor:'startup & release'!
 
-commonPostOpen
-    self postOpenFromMaster:true.
-!
-
 initialize
 
     inDropMode := false.
     ^ super initialize.
 !
 
+postOpenAsSubcanvasWith:aBuilder
+    "this is sent after the applications window is opened inside another application.
+     Can be redefined in subclasses for actions after showing the canvas view."
+
+    "/ cg: used to be unconditionally true hew;
+    "/ but then, when a FileDialog (which is not an AbstractFileBrowser) is opened,
+    "/ the commonPostBuild will not properly update its enable chanels;
+    "/ especially the enableDirectoryUp is false.
+    "/ This whole FileBrowser is so complicated that it became almost unusable.
+    "/ (too much inheritance and knowledge - DirTree and DirContents should each only do
+    "/ what it should and not depend on shared functionality from their superclass)
+    self postOpenFromMaster:(self masterApplication class includesBehavior:AbstractFileBrowser).
+!
+
 postOpenFromMaster:fromMaster 
     self subclassResponsibility
 !
 
+postOpenWith:aBuilder
+    "this is sent after the applications main window is opened.
+     Can be redefined in subclasses for actions after opening the view."
+
+    self postOpenFromMaster:false.
+!
+
 preBuildWith:aBuilder
 
     self masterApplication isNil ifTrue:[
@@ -211,9 +228,10 @@
 !AbstractDirectoryBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractDirectoryBrowser.st,v 1.25 2010-02-02 14:34:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractDirectoryBrowser.st,v 1.26 2013-06-07 09:58:29 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractDirectoryBrowser.st,v 1.25 2010-02-02 14:34:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractDirectoryBrowser.st,v 1.26 2013-06-07 09:58:29 cg Exp $'
 ! !
+