diff --git a/sources/JadeiteTranscript.cls b/sources/JadeiteTranscript.cls index 1af8a5b5..47c4b731 100644 --- a/sources/JadeiteTranscript.cls +++ b/sources/JadeiteTranscript.cls @@ -1,7 +1,7 @@ "Filed out from Dolphin Smallalk"! JadeTranscript subclass: #JadeiteTranscript - instanceVariableNames: 'projectListPresenter isTranscriptInstalled autoCommit areBreakpointsEnabled autoCompleteEnabled transactionModePresenter lastKnownTransaction' + instanceVariableNames: 'projectListPresenter isTranscriptInstalled autoCommit areBreakpointsEnabled autoCompleteEnabled transactionModePresenter lastKnownTransaction cardContainer' classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: ''! @@ -93,6 +93,12 @@ browseMethodsContaining browseSendersOf ^JadePresenter browseSendersIn: self gciSession! +cardContainer + ^cardContainer! + +cardContainer: anObject + cardContainer := anObject! + committedTransaction self displayLastKnownCommitOrAbort! @@ -105,7 +111,8 @@ createComponents lastKnownTransaction := self add: TextPresenter new name: 'lastKnownTransaction'. lastKnownTransaction value: 'Last Known Commit or Abort: (unknown)'. transactionModePresenter := self add: RadioButtonSetPresenter new name: 'transactionMode'. - transactionModePresenter model: (self aspectValue: #transactionMode)! + transactionModePresenter model: (self aspectValue: #transactionMode). + cardContainer := self add: Presenter new name: 'cardContainer'. "for testing"! createNewProject ^projectListPresenter createNewProject! @@ -493,6 +500,8 @@ browseJadeitePrefs!menu handlers!public! ! browseLiteralReferences!menu handlers!public! ! browseMethodsContaining!menu handlers!public! ! browseSendersOf!menu handlers!public! ! +cardContainer!accessing!private! ! +cardContainer:!accessing!private! ! committedTransaction!event handling!public! ! commitTransaction!menu handlers!public! ! createComponents!initialization!public! ! diff --git a/sources/JadeiteTranscriptTestCase.cls b/sources/JadeiteTranscriptTestCase.cls index 8736213e..c7745ae6 100644 --- a/sources/JadeiteTranscriptTestCase.cls +++ b/sources/JadeiteTranscriptTestCase.cls @@ -612,7 +612,7 @@ test_jadeiteMenuAdHocExecutionItems self assert: displayMenuItem commandDescription acceleratorKey = 4676 "Ctrl-D"! test_menuBarBrowseProjectsHonorsSelection - | randomIndex projectPresenter projectName browseMenu browseProjectsMenuItem projectsPresenter | + | randomIndex projectName browseMenu browseProjectsMenuItem projectsPresenter | randomIndex := (Random new next * 4) ceiling. transcript projectListPresenter projectListPresenter selectionByIndex: randomIndex. projectName := transcript projectListPresenter projectListPresenter selection name. @@ -643,6 +643,68 @@ test_menuNames self assert: checkoutMenuItem command equals: #checkout. self assert: (transcript projectListPresenter class canUnderstand: #checkout)! +test_menuSaveOnlyEnabledOnWorkspace + | fileMenu fileSaveItem fileSaveQuery fileSaveAsItem fileSaveAsQuery | + self testsIssue: #issue953 withTitle: 'File Browser for server files'. + fileMenu := transcript view menuBar items detect: [:menu | '*File*' match: menu text] ifNone: []. + fileSaveItem := fileMenu items detect: [:command | command command = #fileSave] ifNone: []. + fileSaveQuery := CommandQuery commandDescription: fileSaveItem commandDescription + source: transcript view. + fileSaveAsItem := fileMenu items detect: [:command | command command = #fileSaveAs] ifNone: []. + fileSaveAsQuery := CommandQuery commandDescription: fileSaveAsItem commandDescription + source: transcript view. + transcript cardContainer view cardLayout firstCard. + self assert: transcript cardContainer view currentCard name = 'Transcript'. + transcript queryCommand: fileSaveQuery. + self deny: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self deny: fileSaveAsQuery isEnabled. + + transcript cardContainer view cardLayout nextCard. + self assert: transcript cardContainer view currentCard name = 'history'. + transcript queryCommand: fileSaveQuery. + self deny: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self deny: fileSaveAsQuery isEnabled. + + transcript cardContainer view cardLayout nextCard. + self assert: transcript cardContainer view currentCard name = 'Stone'. + transcript queryCommand: fileSaveQuery. + self deny: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self deny: fileSaveAsQuery isEnabled. + + transcript cardContainer view cardLayout nextCard. + self assert: transcript cardContainer view currentCard name = 'My Session'. + transcript queryCommand: fileSaveQuery. + self deny: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self deny: fileSaveAsQuery isEnabled. + + transcript cardContainer view cardLayout nextCard. + self assert: transcript cardContainer view currentCard name = 'All Sessions'. + transcript queryCommand: fileSaveQuery. + self deny: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self deny: fileSaveAsQuery isEnabled. + + transcript cardContainer view cardLayout nextCard. + self assert: transcript cardContainer view currentCard name = 'codePane'. + transcript queryCommand: fileSaveQuery. + self assert: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self assert: fileSaveAsQuery isEnabled. + + transcript cardContainer view cardLayout nextCard. + self assert: transcript cardContainer view currentCard name = 'projectsList'. + transcript queryCommand: fileSaveQuery. + self deny: fileSaveQuery isEnabled. + transcript queryCommand: fileSaveAsQuery. + self deny: fileSaveAsQuery isEnabled. + + +! + test_multiSelectProject | projectServices projectCount | self testsIssue: #issue163 @@ -959,6 +1021,7 @@ test_implementorsSendersSearchList!public!tests! ! test_jadeiteMenuAdHocExecutionItems!public!test menus! ! test_menuBarBrowseProjectsHonorsSelection!public!tests! ! test_menuNames!public!tests! ! +test_menuSaveOnlyEnabledOnWorkspace!public!test menus! ! test_multiSelectProject!public!tests! ! test_openChangesBrowser!public!tests! ! test_openPreferencesFile!public!tests! ! diff --git a/sources/Rowan UI Base.pax b/sources/Rowan UI Base.pax index 2c649e2c..f3b89d2d 100644 --- a/sources/Rowan UI Base.pax +++ b/sources/Rowan UI Base.pax @@ -897,7 +897,7 @@ JadeWorkspace subclass: #JadeiteServerFileWorkspace poolDictionaries: '' classInstanceVariableNames: ''! JadeTranscript subclass: #JadeiteTranscript - instanceVariableNames: 'projectListPresenter isTranscriptInstalled autoCommit areBreakpointsEnabled autoCompleteEnabled transactionModePresenter lastKnownTransaction' + instanceVariableNames: 'projectListPresenter isTranscriptInstalled autoCommit areBreakpointsEnabled autoCompleteEnabled transactionModePresenter lastKnownTransaction cardContainer' classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: ''!