remember last-saved fileName for next default
authorClaus Gittinger <cg@exept.de>
Wed, 19 Oct 2005 14:39:43 +0200
changeset 6408 e0f701a20cae
parent 6407 ab440db06a50
child 6409 b4e8b1c4c2d6
remember last-saved fileName for next default
MultiViewToolApplication.st
WorkspaceApplication.st
--- a/MultiViewToolApplication.st	Tue Oct 18 18:39:16 2005 +0200
+++ b/MultiViewToolApplication.st	Wed Oct 19 14:39:43 2005 +0200
@@ -204,9 +204,18 @@
 "/    workspaceHolder value:aWindow.
 !
 
+defaultFileNameForSave
+    ^ 'file.wsp'
+!
+
+defaultFileNameForSaveAll
+   ^ 'file.wsp'
+!
+
 menuSaveAllAs
     self 
         askForFile:'Save all Buffers into:' 
+        default:(self defaultFilenameForSaveAll)
         thenDo:[:file :doAppend |
             |ws append|
 
@@ -226,7 +235,8 @@
 
 menuSaveAs
     self 
-        askForFile:'Save Buffer into:' 
+        askForFile:'Save Buffer into:'
+        default:(self defaultFileNameForSave)
         thenDo:[:file :doAppend |
             |ws|
 
@@ -331,10 +341,10 @@
 
 !MultiViewToolApplication methodsFor:'private'!
 
-askForFile:question thenDo:aBlock
+askForFile:question default:defaultFilename thenDo:aBlock
     Dialog
         requestSaveFileName:(resources string:question) 
-        default:'file.wsp' 
+        default:defaultFilename 
         fromDirectory:nil 
         action:[:fileName | aBlock value:fileName value:false] 
         appendAction:[:fileName | aBlock value:fileName value:true]
@@ -356,6 +366,11 @@
 "/    ].
 !
 
+askForFile:question thenDo:aBlock
+    ^ self
+        askForFile:question default:'file.wsp' thenDo:aBlock
+!
+
 askIfAnyModified:arg1 yesButton:arg2 
     "raise an error: must be redefined in concrete subclass(es)"
 
@@ -434,5 +449,5 @@
 !MultiViewToolApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.5 2005-07-13 15:45:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MultiViewToolApplication.st,v 1.6 2005-10-19 12:39:39 cg Exp $'
 ! !
--- a/WorkspaceApplication.st	Tue Oct 18 18:39:16 2005 +0200
+++ b/WorkspaceApplication.st	Wed Oct 19 14:39:43 2005 +0200
@@ -954,6 +954,10 @@
     Workspace clearDoItHistory
 !
 
+defaultFileNameForSave
+    ^ self selectedWorkspace defaultFileNameForFileDialog ? super defaultFileNameForSave
+!
+
 doIt
     self selectedWorkspacesTextView doIt
 !
@@ -1438,5 +1442,5 @@
 !WorkspaceApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.102 2005-07-13 15:43:57 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.103 2005-10-19 12:39:43 cg Exp $'
 ! !