--- a/AbstractLauncherApplication.st Mon Nov 11 18:54:11 2002 +0100
+++ b/AbstractLauncherApplication.st Mon Nov 11 18:54:50 2002 +0100
@@ -21,9 +21,9 @@
!
AbstractSettingsApplication subclass:#KbdMappingSettingsAppl
- instanceVariableNames:'useNewVersionDiffBrowser transcriptBufferSize useNewInspector
- showClockInLauncher useNewChangesBrowser useNewFileBrowser
- useNewSystemBrowser currentUserPrefs modifiedChannel'
+ instanceVariableNames:'modifiedChannel selectedRawKey macroTextHolder
+ selectedFunctionKey labelTextHolder functionKeyList rawKeyList
+ mappings'
classVariableNames:''
poolDictionaries:''
privateIn:AbstractLauncherApplication
@@ -46,12 +46,21 @@
!
ApplicationModel subclass:#SettingsDialog
- instanceVariableNames:'canvasHolder appList selectionHolder selection requestor'
+ instanceVariableNames:'canvasHolder appList selectionHolder selection requestor
+ colOfInstances'
classVariableNames:'ApplicationList'
poolDictionaries:''
privateIn:AbstractLauncherApplication
!
+AbstractSettingsApplication subclass:#StyleSettingsAppl
+ instanceVariableNames:'modifiedChannel showStandardStylesOnly styleList selectedStyle
+ styleDirectoryContents infoLabelHolder noticeLabelHolder'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:AbstractLauncherApplication
+!
+
AbstractSettingsApplication subclass:#ToolsSettingsAppl
instanceVariableNames:'useNewVersionDiffBrowser transcriptBufferSize useNewInspector
showClockInLauncher useNewChangesBrowser useNewFileBrowser
@@ -1693,9 +1702,9 @@
the UIPainter may not be able to read the specification."
"
- UIPainter new openOnClass:AbstractLauncherApplication::ToolsSettingsAppl andSelector:#windowSpec
- AbstractLauncherApplication::ToolsSettingsAppl new openInterface:#windowSpec
- AbstractLauncherApplication::ToolsSettingsAppl open
+ UIPainter new openOnClass:AbstractLauncherApplication::KbdMappingSettingsAppl andSelector:#windowSpec
+ AbstractLauncherApplication::KbdMappingSettingsAppl new openInterface:#windowSpec
+ AbstractLauncherApplication::KbdMappingSettingsAppl open
"
<resource: #canvas>
@@ -1705,86 +1714,75 @@
#name: #windowSpec
#window:
#(#WindowSpec
- #label: 'AbstractLauncherApplication::LauncherDialogs::ToolsSettingsAppl'
- #name: 'AbstractLauncherApplication::LauncherDialogs::ToolsSettingsAppl'
+ #label: 'Keyboard Mappings'
+ #name: 'Keyboard Mappings'
#min: #(#Point 10 10)
#max: #(#Point 1024 768)
- #bounds: #(#Rectangle 16 42 491 313)
+ #bounds: #(#Rectangle 16 42 491 620)
)
#component:
#(#SpecCollection
#collection: #(
- #(#CheckBoxSpec
- #label: 'Use the New Changes Browser'
- #name: 'ChangesBrowser'
- #layout: #(#LayoutFrame 5 0 5 0 250 0 30 0)
- #model: #useNewChangesBrowser
- #translateLabel: true
- )
- #(#DividerSpec
- #name: 'Separator1'
- #layout: #(#LayoutFrame 0 0.0 35 0 0 1 38 0)
- )
- #(#CheckBoxSpec
- #label: 'Use the New System Browser'
- #name: 'NewSystemBrowser'
- #layout: #(#LayoutFrame 250 0 5 0 0 1 30 0)
- #model: #useNewSystemBrowser
- #translateLabel: true
- )
- #(#DividerSpec
- #name: 'Separator2'
- #layout: #(#LayoutFrame 0 0.0 70 0 0 1 73 0)
- )
- #(#CheckBoxSpec
- #label: 'Use the New VersionDiff Browser'
- #name: 'VersionDiffBrowser'
- #layout: #(#LayoutFrame 5 0 40 0 250 0 65 0)
- #model: #useNewVersionDiffBrowser
- #translateLabel: true
- )
- #(#DividerSpec
- #name: 'Separator3'
- #layout: #(#LayoutFrame 0 0.0 105 0 0 1 108 0)
- )
- #(#CheckBoxSpec
- #label: 'Use the New File Browser'
- #name: 'NewFileBrowser'
- #layout: #(#LayoutFrame 250 0 40 0 0 1 65 0)
- #model: #useNewFileBrowser
- #translateLabel: true
- )
- #(#CheckBoxSpec
- #label: 'Use Hierarchical Inspector'
- #name: 'HierarchicalInspector'
- #layout: #(#LayoutFrame 5 0 75 0 250 0 100 0)
- #model: #useNewInspector
- #translateLabel: true
- )
- #(#CheckBoxSpec
- #label: 'Show Clock in Launcher'
- #name: 'Clock'
- #layout: #(#LayoutFrame 250 0 75 0 0 1 100 0)
- #model: #showClockInLauncher
- #translateLabel: true
- )
- #(#LabelSpec
- #label: '''Transcripts Buffer Size:'''
- #name: 'Label1'
- #layout: #(#LayoutFrame 9 0 133 0 154 0 155 0)
- #translateLabel: true
- #adjust: #left
- )
- #(#InputFieldSpec
- #name: 'Transcripts Buffer Size'
- #layout: #(#LayoutFrame 159 0 133 0 214 0 155 0)
- #model: #transcriptBufferSize
- #type: #number
- #immediateAccept: true
- #acceptOnReturn: true
- #acceptOnTab: true
- #acceptOnLostFocus: true
- #acceptOnPointerLeave: false
+ #(#VariableVerticalPanelSpec
+ #name: 'VariableVerticalPanel1'
+ #layout: #(#LayoutFrame 0 0.0 60 0 0 1.0 -34 1)
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#VariableHorizontalPanelSpec
+ #name: 'VariableHorizontalPanel1'
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#SequenceViewSpec
+ #name: 'RawKeyList'
+ #model: #selectedRawKey
+ #hasHorizontalScrollBar: true
+ #hasVerticalScrollBar: true
+ #useIndex: false
+ #sequenceList: #rawKeyList
+ )
+ #(#SequenceViewSpec
+ #name: 'FunctionKeyList'
+ #model: #selectedFunctionKey
+ #hasHorizontalScrollBar: true
+ #hasVerticalScrollBar: true
+ #useIndex: false
+ #sequenceList: #functionKeyList
+ )
+ )
+
+ )
+ #handles: #(#Any 0.5 1.0)
+ )
+ #(#ViewSpec
+ #name: 'Box1'
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#TextEditorSpec
+ #name: 'MacroText'
+ #layout: #(#LayoutFrame 0 0.0 20 0 0 1.0 0 1.0)
+ #model: #macroTextHolder
+ #hasHorizontalScrollBar: true
+ #hasVerticalScrollBar: true
+ #isReadOnly: true
+ )
+ #(#LabelSpec
+ #label: 'Macro text (if any):'
+ #name: 'MacroTextLabel'
+ #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 20 0)
+ #translateLabel: true
+ #adjust: #left
+ )
+ )
+
+ )
+ )
+ )
+
+ )
+ #handles: #(#Any 0.5 1.0)
)
#(#HorizontalPanelViewSpec
#name: 'HorizontalPanel1'
@@ -1797,16 +1795,9 @@
#(#SpecCollection
#collection: #(
#(#ActionButtonSpec
- #label: 'OK'
- #name: 'OK'
- #translateLabel: true
- #model: #saveSettings
- #enableChannel: #modifiedChannel
- #extent: #(#Point 125 22)
- )
- #(#ActionButtonSpec
- #label: 'Cancel'
+ #label: 'Close'
#name: 'Cancel'
+ #visibilityChannel: #isNotPartOfSettinsDialog
#translateLabel: true
#model: #doCancel
#extent: #(#Point 125 22)
@@ -1822,6 +1813,15 @@
)
)
+ #(#LabelSpec
+ #label: 'NoticeText'
+ #name: 'Text'
+ #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 60 0)
+ #translateLabel: true
+ #labelChannel: #labelTextHolder
+ #resizeForLabel: true
+ #adjust: #left
+ )
)
)
@@ -1833,7 +1833,7 @@
doCancel
self isPartOfSettinsDialog ifTrue:[
- self loadSettings.
+ self loadRequest.
].
self closeRequest.
!
@@ -1845,18 +1845,11 @@
help
- self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/toolSettings.html'].
-!
-
-loadSettings
-
- self showClockInLauncher value:currentUserPrefs showClockInLauncher.
- self transcriptBufferSize value:Transcript current lineLimit.
- self useNewChangesBrowser value:currentUserPrefs useNewChangesBrowser.
- self useNewFileBrowser value:currentUserPrefs useNewFileBrowser.
- self useNewInspector value:currentUserPrefs useNewInspector.
- self useNewSystemBrowser value:currentUserPrefs useNewSystemBrowser.
- self useNewVersionDiffBrowser value:currentUserPrefs useNewVersionDiffBrowser.
+ self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/keyboardSetting.html'].
+!
+
+loadRequest
+
self modifiedChannel value:false.
!
@@ -1874,41 +1867,61 @@
!
saveSettings
-
- | showClock launcher |
-
- currentUserPrefs useNewInspector:self useNewInspector value.
- currentUserPrefs useNewChangesBrowser:self useNewChangesBrowser value.
- currentUserPrefs useNewSystemBrowser:self useNewSystemBrowser value.
- currentUserPrefs useNewVersionDiffBrowser:self useNewVersionDiffBrowser value.
- currentUserPrefs useNewFileBrowser:self useNewFileBrowser value.
- (Smalltalk at:#FileBrowserV2) isBehavior ifTrue:[
- self useNewFileBrowser value ifTrue:[
- FileBrowserV2 installInLauncher.
- ] ifFalse:[
- FileBrowserV2 isLoaded ifTrue:[
- FileBrowserV2 removeFromLauncher.
- ]
- ].
- ].
- showClock := self showClockInLauncher value.
- currentUserPrefs showClockInLauncher ~= showClock ifTrue:[
- currentUserPrefs showClockInLauncher:showClock.
- launcher := Transcript application.
- (launcher isKindOf:ToolApplicationModel) ifTrue:[
- showClock ifTrue:[
- launcher startClock
- ] ifFalse:[
- launcher stopClock
- ]
- ]
- ].
- Inspector := currentUserPrefs inspectorClassSetting.
- Transcript current lineLimit:self transcriptBufferSize value.
! !
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'aspects'!
+functionKeyList
+ "automatically generated by UIPainter ..."
+
+ "*** the code below creates a default model when invoked."
+ "*** (which may not be the one you wanted)"
+ "*** Please change as required and accept it in the browser."
+ "*** (and replace this comment by something more useful ;-)"
+
+ functionKeyList isNil ifTrue:[
+ functionKeyList := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/ functionKeyList addDependent:self.
+"/ functionKeyList onChangeSend:#functionKeyListChanged to:self.
+ ].
+ ^ functionKeyList.
+!
+
+labelTextHolder
+ "automatically generated by UIPainter ..."
+
+ "*** the code below creates a default model when invoked."
+ "*** (which may not be the one you wanted)"
+ "*** Please change as required and accept it in the browser."
+ "*** (and replace this comment by something more useful ;-)"
+
+ labelTextHolder isNil ifTrue:[
+ labelTextHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/ labelTextHolder addDependent:self.
+"/ labelTextHolder onChangeSend:#labelTextHolderChanged to:self.
+ ].
+ ^ labelTextHolder.
+!
+
+macroTextHolder
+ "automatically generated by UIPainter ..."
+
+ "*** the code below creates a default model when invoked."
+ "*** (which may not be the one you wanted)"
+ "*** Please change as required and accept it in the browser."
+ "*** (and replace this comment by something more useful ;-)"
+
+ macroTextHolder isNil ifTrue:[
+ macroTextHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/ macroTextHolder addDependent:self.
+"/ macroTextHolder onChangeSend:#macroTextHolderChanged to:self.
+ ].
+ ^ macroTextHolder.
+!
+
modifiedChannel
modifiedChannel isNil ifTrue:[
@@ -1917,67 +1930,112 @@
^ modifiedChannel
!
-showClockInLauncher
-
- showClockInLauncher isNil ifTrue:[
- showClockInLauncher := currentUserPrefs showClockInLauncher asValue.
- showClockInLauncher onChangeSend:#evaluateModified to:self
- ].
- ^ showClockInLauncher.
-!
-
-transcriptBufferSize
-
- transcriptBufferSize isNil ifTrue:[
- transcriptBufferSize := Transcript current lineLimit asValue.
- transcriptBufferSize onChangeSend:#evaluateModified to:self
- ].
- ^ transcriptBufferSize.
-!
-
-useNewChangesBrowser
-
- useNewChangesBrowser isNil ifTrue:[
- useNewChangesBrowser := currentUserPrefs useNewChangesBrowser asValue.
- useNewChangesBrowser onChangeSend:#evaluateModified to:self
- ].
- ^ useNewChangesBrowser.
-!
-
-useNewFileBrowser
-
- useNewFileBrowser isNil ifTrue:[
- useNewFileBrowser := currentUserPrefs useNewFileBrowser asValue.
- useNewFileBrowser onChangeSend:#evaluateModified to:self
- ].
- ^ useNewFileBrowser.
-!
-
-useNewInspector
-
- useNewInspector isNil ifTrue:[
- useNewInspector := currentUserPrefs useNewInspector asValue.
- useNewInspector onChangeSend:#evaluateModified to:self
- ].
- ^ useNewInspector.
-!
-
-useNewSystemBrowser
-
- useNewSystemBrowser isNil ifTrue:[
- useNewSystemBrowser := currentUserPrefs useNewSystemBrowser asValue.
- useNewSystemBrowser onChangeSend:#evaluateModified to:self
- ].
- ^ useNewSystemBrowser.
-!
-
-useNewVersionDiffBrowser
-
- useNewVersionDiffBrowser isNil ifTrue:[
- useNewVersionDiffBrowser := currentUserPrefs useNewVersionDiffBrowser asValue.
- useNewVersionDiffBrowser onChangeSend:#evaluateModified to:self
- ].
- ^ useNewVersionDiffBrowser.
+rawKeyList
+ "automatically generated by UIPainter ..."
+
+ "*** the code below creates a default model when invoked."
+ "*** (which may not be the one you wanted)"
+ "*** Please change as required and accept it in the browser."
+ "*** (and replace this comment by something more useful ;-)"
+
+ rawKeyList isNil ifTrue:[
+ rawKeyList := List new.
+ ].
+ ^ rawKeyList.
+!
+
+selectedFunctionKey
+
+ selectedFunctionKey isNil ifTrue:[
+ selectedFunctionKey := ValueHolder new.
+ selectedFunctionKey addDependent:self.
+ ].
+ ^ selectedFunctionKey.
+!
+
+selectedRawKey
+
+ selectedRawKey isNil ifTrue:[
+ selectedRawKey := ValueHolder new.
+ selectedRawKey addDependent:self.
+ ].
+ ^ selectedRawKey.
+! !
+
+!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'change & update'!
+
+changeFunctionKeySelection
+
+ |raw|
+ raw := self selectedRawKey value.
+ self selectedFunctionKey value:(mappings at:raw asSymbol) asString.
+!
+
+changeMacroText
+
+ |f macro indent|
+
+ f := self selectedFunctionKey value.
+ (f startsWith:'Cmd') ifTrue:[
+ f := f copyFrom:4
+ ].
+ macro := UserPreferences current functionKeySequences
+ at:(f asSymbol) ifAbsent:nil.
+ macro notNil ifTrue:[
+ macro := macro asStringCollection.
+ indent := macro
+ inject:99999 into:[:min :element |
+ |stripped|
+
+ stripped := element withoutLeadingSeparators.
+ stripped size == 0 ifTrue:[
+ min
+ ] ifFalse:[
+ min min:(element size - stripped size)
+ ]
+ ].
+ indent ~~ 0 ifTrue:[
+ macro := macro collect:[:line |
+ line size > indent ifTrue:[
+ line copyFrom:indent+1
+ ] ifFalse:[
+ line
+ ].
+ ]
+ ].
+ ].
+ macroTextHolder value:macro.
+!
+
+changeRawKeySelection
+ |f raw|
+
+ f := self selectedFunctionKey value.
+ raw := mappings keyAtValue:f asString.
+ raw isNil ifTrue:[
+ raw := mappings keyAtValue:f first.
+ raw isNil ifTrue:[
+ raw := mappings keyAtValue:f asSymbol.
+ ]
+ ].
+ self selectedRawKey value:raw.
+!
+
+update:something with:aParameter from:changedObject
+ "Invoked when an object that I depend upon sends a change notification."
+
+ "stub code automatically generated - please change as required"
+
+ changedObject == self selectedFunctionKey ifTrue:[
+ self changeRawKeySelection.
+ self changeMacroText.
+ ^ self
+ ].
+ changedObject == self selectedRawKey ifTrue:[
+ self changeFunctionKeySelection.
+ ^ self
+ ].
+ super update:something with:aParameter from:changedObject
! !
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'initialization & release'!
@@ -2010,77 +2068,22 @@
initialize
- currentUserPrefs := UserPreferences current.
+ resources := self class owningClass classResources.
+
+ mappings := Screen current keyboardMap.
+
+ rawKeyList := (mappings keys asArray collect:[:key | key asString]) sort.
+ functionKeyList := (mappings values asSet asArray collect:[:key | key asString]) sort.
+
+ self labelTextHolder value:(resources at:'KEY_MSG2' default:'keyboard mapping:') withCRs.
super initialize
! !
-!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'menu actions'!
-
-menuNew
- "This method was generated by the Browser.
- It will be invoked when the menu-item 'new' is selected."
-
- "/ change below and add any actions as required here ...
- self warn:'no action for ''new'' available.'.
-!
-
-menuOpen
- "This method was generated by the Browser.
- It will be invoked when the menu-item 'open' is selected."
-
- "/ change below and add any actions as required here ...
- self warn:'no action for ''open'' available.'.
-!
-
-menuSave
- "This method was generated by the Browser.
- It will be invoked when the menu-item 'save' is selected."
-
- "/ change below and add any actions as required here ...
- self warn:'no action for ''save'' available.'.
-!
-
-menuSaveAs
- "This method was generated by the Browser.
- It will be invoked when the menu-item 'saveAs' is selected."
-
- "/ change below and add any actions as required here ...
- self warn:'no action for ''saveAs'' available.'.
-!
-
-openAboutThisApplication
- "This method was generated by the Browser.
- It will be invoked when the menu-item 'help-about' is selected."
-
- "/ could open a customized aboutBox here ...
- super openAboutThisApplication
-!
-
-openDocumentation
- "This method was generated by the Browser.
- It will be invoked when the menu-item 'help-documentation' is selected."
-
- "/ change below as required ...
-
- "/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
- HTMLDocumentView openFullOnDocumentationFile:'TOP.html'.
-
- "/ add application-specific help files under the 'doc/online/<language>/help/appName'
- "/ directory, and open a viewer with:
- "/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
-! !
-
!AbstractLauncherApplication::KbdMappingSettingsAppl methodsFor:'queries'!
hasUnsavedChanges
- ^ ((self useNewInspector value ~= currentUserPrefs useNewInspector) or:[
- (self useNewChangesBrowser value ~= currentUserPrefs useNewChangesBrowser) or:[
- (self useNewSystemBrowser value ~= currentUserPrefs useNewSystemBrowser) or:[
- (self showClockInLauncher value ~= currentUserPrefs showClockInLauncher) or:[
- (self useNewVersionDiffBrowser value ~= currentUserPrefs useNewVersionDiffBrowser) or:[
- (self useNewFileBrowser value ~= currentUserPrefs useNewFileBrowser) or:[
- (self transcriptBufferSize value ~= Transcript current lineLimit)]]]]]])
+ ^ false
! !
!AbstractLauncherApplication::LanguageSettingsAppl class methodsFor:'interface specs'!
@@ -2148,6 +2151,7 @@
#name: 'OK'
#translateLabel: true
#model: #saveSettings
+ #enableChannel: #modifiedChannel
#extent: #(#Point 125 22)
)
#(#ActionButtonSpec
@@ -2223,7 +2227,7 @@
doCancel
self isPartOfSettinsDialog ifTrue:[
- self loadSettings.
+ self loadRequest.
].
self closeRequest.
!
@@ -2243,9 +2247,10 @@
self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/languageSetting.html'].
!
-loadSettings
+loadRequest
self languageHolder value:self currentLanguage.
+ self currentLanguageChannel value:self currentLanguage.
self modifiedChannel value:false.
!
@@ -2373,6 +2378,7 @@
languageHolder isNil ifTrue:[
languageHolder := self currentLanguage asValue.
+ languageHolder onChangeSend:#evaluateModified to:self.
].
^ languageHolder.
!
@@ -7299,10 +7305,32 @@
^ #(
#('Tools' #'AbstractLauncherApplication::ToolsSettingsAppl')
#('Language' #'AbstractLauncherApplication::LanguageSettingsAppl')
+ #('Keyboard Mappings' #'AbstractLauncherApplication::KbdMappingSettingsAppl')
+ #('Style Selection' #'AbstractLauncherApplication::StyleSettingsAppl')
).
!
+removeApplClass:aClass
+
+ |index|
+
+ ApplicationList isNil ifTrue:[
+ self initialize.
+ ].
+ index := ApplicationList findFirst:[:el |
+ el second == aClass asSymbol
+ ].
+ index ~~ 0 ifTrue:[
+ ApplicationList removeIndex:index.
+ ].
+!
+
+settingsAppListClasses
+
+ ^ self applList collect:[:entry | entry last].
+!
+
settingsAppListNames
^ self applList collect:[:entry | entry first].
@@ -7345,7 +7373,7 @@
#name: 'Settings Dialog'
#min: #(#Point 10 10)
#max: #(#Point 1024 768)
- #bounds: #(#Rectangle 16 42 516 363)
+ #bounds: #(#Rectangle 16 42 516 562)
#menu: #mainMenu
)
#component:
@@ -7433,11 +7461,18 @@
!AbstractLauncherApplication::SettingsDialog methodsFor:'actions'!
+sendLoadRequest
+
+ colOfInstances do:[:settInst|
+ settInst loadRequest.
+ ].
+!
+
sendSaveRequest
|oldClient|
- oldClient := self canvasHolder value client.
+ oldClient := self canvasHolder value application.
oldClient notNil ifTrue:[
oldClient saveRequest ifFalse:[^ false].
].
@@ -7449,7 +7484,7 @@
canvasHolder
canvasHolder isNil ifTrue:[
- canvasHolder := SubCanvas new.
+ canvasHolder := ValueHolder new.
].
^ canvasHolder.
!
@@ -7463,20 +7498,12 @@
selection:something
"set the selection; update canvas
"
- | className cls|
-
selection ~~ something ifTrue:[
self sendSaveRequest ifFalse:[ ^ self].
selection := something.
selection ~~ 0 ifTrue:[
- className := (self class applList at:selection) last.
- cls := Smalltalk classNamed:className.
- cls isNil ifTrue:[
- Transcript showCR:'no class named:' , className
- ] ifFalse:[
- self canvasHolder value client:(cls new).
- ]
+ self canvasHolder value:((colOfInstances at:selection) window).
].
].
!
@@ -7550,15 +7577,708 @@
"/ add any code here ...
+ colOfInstances := OrderedCollection new.
+ self class settingsAppListClasses do:[:cls| | className |
+ className := Smalltalk classNamed:cls.
+ cls isNil ifTrue:[
+ Transcript showCR:'no class named:' , className
+ ] ifFalse:[
+ | appl window|
+ appl := className new.
+ window := ApplicationSubView new.
+ appl createBuilder.
+ window client:appl.
+
+ colOfInstances add:appl.
+ ]
+ ].
self selectionHolder value:1.
^ super postOpenWith:aBuilder
! !
!AbstractLauncherApplication::SettingsDialog methodsFor:'menu actions'!
+loadSettings
+
+ "restore settings from a settings-file."
+
+ "a temporary kludge - we need a central systemSettings object for this,
+ which can be saved/restored with a single store/read."
+
+ |fileName|
+
+ fileName := Dialog
+ requestFileName:(resources string:'Load Settings From:')
+ default:'settings.stx'
+ ok:(resources string:'Load')
+ abort:(resources string:'Cancel')
+ pattern:'*.stx'
+ fromDirectory:nil.
+
+ (fileName size == 0) ifTrue:[
+ "/ canceled
+ ^ self
+ ].
+
+ self withWaitCursorDo:[
+ Smalltalk fileIn:fileName.
+ Transcript current topView model reOpen.
+ self sendLoadRequest.
+ ].
+!
+
saveSettings
- AbstractLauncherApplication::LauncherDialogs saveSettings
+ |fileName resources|
+
+ resources := self class owningClass classResources.
+
+ fileName := Dialog
+ requestFileName:(resources string:'Save settings in:')
+ default:'settings.stx'
+ ok:(resources string:'Save')
+ abort:(resources string:'Cancel')
+ pattern:'*.stx'
+ fromDirectory:'.'.
+
+ fileName size ~~ 0 ifTrue:[
+ "not canceled"
+ self saveSettingsIn:fileName.
+ ]
+!
+
+saveSettingsIn:fileName
+ "save settings to a settings-file."
+
+ "a temporary kludge - we need a central systemSettings object for this,
+ which can be saved/restored with a single store/read.
+ Will move entries over to UserPreferences over time;
+ new items should always go there."
+
+ |resources s screen currentUserPrefs|
+
+ resources := self class owningClass classResources.
+
+ s := fileName asFilename writeStream.
+ s isNil ifTrue:[
+ self warn:(resources string:'Cannot write the %1 file !!' with:fileName).
+ ^ self
+ ].
+
+ currentUserPrefs := UserPreferences current.
+ screen := Screen current.
+
+ s nextPutLine:'"/ ST/X saved settings';
+ nextPutLine:'"/ DO NOT MODIFY MANUALLY';
+ nextPutLine:'"/ (modifications would be lost with next save-settings)';
+ nextPutLine:'"/';
+ nextPutLine:'"/ this file was automatically generated by the';
+ nextPutLine:'"/ ''save settings'' function of the Launcher';
+ nextPutLine:'"/'.
+ s cr.
+
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString.
+ s nextPutLine:'"/'.
+ s cr.
+
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Display settings:'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ only restore the display settings, if on the same Display ...'.
+ s nextPutLine:'Display notNil ifTrue:['.
+ s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['.
+ screen fixColors notNil ifTrue:[
+ s nextPutLine:' Image flushDeviceImages.'.
+ s nextPutLine:' Color colorAllocationFailSignal catch:['.
+ s nextPutLine:' Color getColorsRed:6 green:6 blue:4 on:Display'.
+ s nextPutLine:' ].'.
+ ] ifFalse:[
+ s nextPutLine:' Display releaseFixColors.'.
+ ].
+ s nextPutLine:' Display hasColors: ' , (screen hasColors storeString) , '.'.
+ s nextPutLine:' Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'.
+ s nextPutLine:' Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'.
+ s nextPutLine:' Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'.
+ s nextPutLine:' Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'.
+ s nextPutLine:' View defaultStyle:' , View defaultStyle storeString , '.'.
+ s nextPutLine:' ].'.
+ s nextPutLine:'].'.
+ s cr.
+
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Compiler settings:'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.';
+ nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.';
+ nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.';
+ nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.';
+ nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.';
+ nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.';
+ nextPutLine:'Compiler allowSqueakExtensions: ' , (Compiler allowSqueakExtensions storeString) , '.';
+ nextPutLine:'Compiler allowDolphinExtensions: ' , (Compiler allowDolphinExtensions storeString) , '.';
+ nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.';
+ nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.';
+
+ nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.';
+ nextPutLine:'Compiler stcCompilation: ' , (Compiler stcCompilation storeString) , '.';
+ nextPutLine:'OperatingSystem getOSType = ' , (OperatingSystem getOSType storeString) , ' ifTrue:[';
+ nextPutLine:' Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.';
+ nextPutLine:' Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.';
+ nextPutLine:' Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.';
+ nextPutLine:' ' , (Compiler stcModulePath storeString) , ' asFilename exists ifTrue:[';
+ nextPutLine:' Compiler stcModulePath: ' , (Compiler stcModulePath storeString) , '.';
+ nextPutLine:' ].';
+ nextPutLine:' Compiler stcPath: ' , (Compiler stcPath storeString) , '.';
+ nextPutLine:' Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.';
+ nextPutLine:' Compiler ccPath: ' , (Compiler ccPath storeString) , '.';
+ nextPutLine:' ObjectFileLoader linkArgs: ' , (ObjectFileLoader linkArgs storeString) , '.';
+ nextPutLine:' ObjectFileLoader linkCommand: ' , (ObjectFileLoader linkCommand storeString) , '.';
+ nextPutLine:' ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.';
+ nextPutLine:' ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.';
+ nextPutLine:'].';
+
+ nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.';
+ nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'.
+
+ HistoryManager notNil ifTrue:[
+ HistoryManager isActive ifTrue:[
+ s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'.
+ s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'.
+ ] ifFalse:[
+ s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'.
+ ].
+ ].
+
+ ObjectFileLoader notNil ifTrue:[
+ s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'.
+ s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'.
+ ].
+
+ s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'.
+ s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'.
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Info & Debug Messages:'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.';
+ nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.';
+ nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.';
+ nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'.
+
+ FlyByHelp isActive ifTrue:[
+ s nextPutLine:'FlyByHelp start.'
+ ].
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Edit settings:'.
+ s nextPutLine:'"/'.
+ "/ s nextPutLine:'EditTextView st80Mode: ' , (EditTextView st80Mode storeString) , '.'.
+ s nextPutLine:'TextView st80SelectMode: ' , (TextView st80SelectMode storeString) , '.'.
+ s nextPutLine:'UserPreferences current syntaxColoring: ' , (currentUserPrefs syntaxColoring storeString) , '.'.
+ (ListView userDefaultTabPositions = ListView tab4Positions) ifTrue:[
+ s nextPutLine:'ListView userDefaultTabPositions:(ListView tab4Positions).'.
+ ] ifFalse:[
+ s nextPutLine:'ListView userDefaultTabPositions:(ListView tab8Positions).'.
+ ].
+
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ User preference values:'.
+ s nextPutLine:'"/'.
+ currentUserPrefs keysAndValuesDo:[:k :v |
+ (UserPreferences includesSelector:(k , ':') asSymbol) ifTrue:[
+ s nextPutLine:'UserPreferences current ' , k , ':' , v storeString , '.'.
+ ] ifFalse:[
+ s nextPutLine:'UserPreferences current at:' , k storeString , ' put:' , v storeString , '.'.
+ ]
+ ].
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Misc settings:'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.';
+ nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.';
+ nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.';
+ nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.';
+ nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.';
+
+ "/ claus - I dont think its a good idea to save those ...
+ nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.';
+ nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.';
+
+ nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.';
+ nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.';
+ nextPutLine:'Display notNil ifTrue:[';
+ nextPutLine:' Display activateOnClick: ' , ((screen activateOnClick:nil) storeString) , '.';
+ nextPutLine:'].';
+ nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.';
+ nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'.
+ (Exception emergencyHandler == AbstractLauncherApplication notifyingEmergencyHandler) ifTrue:[
+ s nextPutLine:'Exception emergencyHandler:(AbstractLauncherApplication notifyingEmergencyHandler).'.
+ ].
+ Processor isTimeSlicing ifTrue:[
+ s nextPutLine:'Processor startTimeSlicing.'.
+ s nextPutLine:('Processor supportDynamicPriorities:' , (Processor supportDynamicPriorities ? false) storeString , '.').
+ ] ifFalse:[
+ s nextPutLine:'Processor stopTimeSlicing.'.
+ ].
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Printer settings:'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'Printer := ' , (Printer name) , '.';
+ nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'.
+
+ Printer supportsPageSizes ifTrue:[
+ s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'.
+ s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'.
+ ].
+ Printer supportsMargins ifTrue:[
+ s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'.
+ s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'.
+ s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'.
+ s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'.
+ ].
+ Printer supportsPostscript ifTrue:[
+ s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'.
+ ].
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Font settings:'.
+ s nextPutLine:'"/ (only restored, if image is restarted on the same display)'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'Display notNil ifTrue:['.
+ s nextPutLine:' Display displayName = ' , (screen displayName storeString) , ' ifTrue:['.
+ s nextPutLine:' View defaultFont: ' , (View defaultFont storeString) , '.'.
+ s nextPutLine:' Label defaultFont: ' , (Label defaultFont storeString) , '.'.
+ s nextPutLine:' Button defaultFont: ' , (Button defaultFont storeString) , '.'.
+ s nextPutLine:' Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'.
+ s nextPutLine:' SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'.
+ s nextPutLine:' MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'.
+ s nextPutLine:' PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'.
+ s nextPutLine:' TextView defaultFont: ' , (TextView defaultFont storeString) , '.'.
+ s nextPutLine:' EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'.
+ s nextPutLine:' CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'.
+ s nextPutLine:' ].'.
+ s nextPutLine:'].'.
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ Language setting:'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'.
+ s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'.
+
+ s cr.
+ s nextPutLine:'"/'.
+ s nextPutLine:'"/ SourceCodeManager settings:'.
+ s nextPutLine:'"/ (only restored, if image is restarted on the same host)'.
+ s nextPutLine:'"/'.
+ s nextPutLine:'OperatingSystem getHostName = ' , (OperatingSystem getHostName storeString) , ' ifTrue:['.
+ s nextPutLine:' Class tryLocalSourceFirst:' , Class tryLocalSourceFirst storeString , '.'.
+ (Smalltalk at:#SourceCodeManager) == CVSSourceCodeManager ifTrue:[
+ s nextPutLine:' Smalltalk at:#SourceCodeManager put: CVSSourceCodeManager.'.
+ s nextPutLine:' AbstractSourceCodeManager cacheDirectoryName:' , AbstractSourceCodeManager cacheDirectoryName storeString , '.'.
+ s nextPutLine:' CVSSourceCodeManager cvsBinDirectory:' , CVSSourceCodeManager cvsBinDirectory storeString , '.'.
+ s nextPutLine:' CVSSourceCodeManager repositoryNamesPerModule:' , CVSSourceCodeManager repositoryNamesPerModule storeString , '.'.
+ s nextPutLine:' CVSSourceCodeManager initializeForRepository:' , CVSSourceCodeManager repositoryName storeString , '.'.
+ ].
+ s nextPutLine:'].'.
+
+ s close.
+
+ "
+ Transcript topView application saveSettings
+ "
+
+ "Modified: / 6.1.1999 / 14:24:16 / cg"
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'defaults'!
+
+standardStyles
+
+ ^ #(
+ 'decWindows'
+ 'iris'
+ 'motif'
+ 'mswindows95'
+ 'next'
+ 'normal'
+ 'os2'
+ 'st80'
+ )
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl class methodsFor:'interface specs'!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:AbstractLauncherApplication::StyleSettingsAppl andSelector:#windowSpec
+ AbstractLauncherApplication::StyleSettingsAppl new openInterface:#windowSpec
+ AbstractLauncherApplication::StyleSettingsAppl open
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(#FullSpec
+ #name: #windowSpec
+ #window:
+ #(#WindowSpec
+ #label: 'Style Selection'
+ #name: 'Style Selection'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1024 768)
+ #bounds: #(#Rectangle 12 22 487 553)
+ )
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#LabelSpec
+ #label: 'Label'
+ #name: 'Label1'
+ #layout: #(#LayoutFrame 0 0.0 -71 1 0 1.0 -34 1)
+ #style: #(#FontDescription #helvetica #bold #roman 12)
+ #translateLabel: true
+ #labelChannel: #infoLabelHolder
+ #resizeForLabel: true
+ #adjust: #left
+ )
+ #(#HorizontalPanelViewSpec
+ #name: 'HorizontalPanel1'
+ #layout: #(#LayoutFrame 0 0.0 -34 1 0 1.0 0 1)
+ #horizontalLayout: #center
+ #verticalLayout: #center
+ #horizontalSpace: 3
+ #verticalSpace: 3
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#ActionButtonSpec
+ #label: 'OK'
+ #name: 'OK'
+ #translateLabel: true
+ #model: #saveSettings
+ #enableChannel: #modifiedChannel
+ #extent: #(#Point 125 22)
+ )
+ #(#ActionButtonSpec
+ #label: 'Cancel'
+ #name: 'Cancel'
+ #translateLabel: true
+ #model: #doCancel
+ #extent: #(#Point 125 22)
+ )
+ #(#ActionButtonSpec
+ #label: 'Help'
+ #name: 'Help'
+ #translateLabel: true
+ #model: #help
+ #extent: #(#Point 125 22)
+ )
+ )
+
+ )
+ )
+ #(#LabelSpec
+ #label: 'NoticeText'
+ #name: 'Text'
+ #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 160 0)
+ #translateLabel: true
+ #labelChannel: #noticeLabelHolder
+ #resizeForLabel: true
+ #adjust: #left
+ )
+ #(#CheckBoxSpec
+ #label: 'standard styles only'
+ #name: 'CheckBox1'
+ #layout: #(#LayoutFrame 0 0.0 160 0 0 1.0 182 0)
+ #model: #showStandardStylesOnly
+ #translateLabel: true
+ )
+ #(#SequenceViewSpec
+ #name: 'StyleList'
+ #layout: #(#LayoutFrame 0 0.0 182 0 0 1.0 -74 1)
+ #model: #selectedStyle
+ #hasHorizontalScrollBar: true
+ #hasVerticalScrollBar: true
+ #useIndex: false
+ #sequenceList: #styleList
+ )
+ )
+
+ )
+ )
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'actions'!
+
+doCancel
+
+ self isPartOfSettinsDialog ifTrue:[
+ self loadRequest.
+ ].
+ self closeRequest.
+!
+
+evaluateModified
+
+ self modifiedChannel value:(self hasUnsavedChanges).
+!
+
+help
+
+ self warn:'no help available here'.
+"/ self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/keyboardSetting.html'].
+!
+
+loadRequest
+
+ self modifiedChannel value:false.
+!
+
+saveRequest
+ | result |
+
+ (self hasUnsavedChanges) ifTrue:[
+ result := self confirmWithCancel:(resources string:'Save changed Tool Settings ?').
+ result isNil ifTrue:[ ^ false].
+ result ifTrue:[
+ self saveSettings.
+ ]
+ ].
+ ^ true
+!
+
+saveSettings
+
+ | newStyle master requestor|
+
+ self halt.
+ newStyle := self selectedStyle value.
+ master := self masterApplication.
+ master notNil ifTrue:[
+ requestor := master requestor.
+ ].
+ self halt.
+ self hasUnsavedChanges ifTrue:[
+ self withWaitCursorDo:[
+ Transcript showCR:'change style to ' , newStyle , ' ...'.
+ View defaultStyle:newStyle asSymbol.
+ ].
+ requestor notNil ifTrue:[
+ self halt.
+ requestor reopenLauncher.
+ ].
+ DebugView newDebugger.
+ self modifiedChannel value:false.
+ ].
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'aspects'!
+
+infoLabelHolder
+
+ infoLabelHolder isNil ifTrue:[
+ infoLabelHolder := '' asValue.
+ ].
+ ^ infoLabelHolder.
+!
+
+labelTextHolder
+ "automatically generated by UIPainter ..."
+
+ "*** the code below creates a default model when invoked."
+ "*** (which may not be the one you wanted)"
+ "*** Please change as required and accept it in the browser."
+ "*** (and replace this comment by something more useful ;-)"
+
+ labelTextHolder isNil ifTrue:[
+ labelTextHolder := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/ labelTextHolder addDependent:self.
+"/ labelTextHolder onChangeSend:#labelTextHolderChanged to:self.
+ ].
+ ^ labelTextHolder.
+!
+
+modifiedChannel
+
+ modifiedChannel isNil ifTrue:[
+ modifiedChannel := false asValue.
+ ].
+ ^ modifiedChannel
+!
+
+noticeLabelHolder
+
+ noticeLabelHolder isNil ifTrue:[
+ noticeLabelHolder := '' asValue.
+ ].
+ ^ noticeLabelHolder.
+!
+
+selectedStyle
+
+ selectedStyle isNil ifTrue:[
+ selectedStyle := ValueHolder new.
+ selectedStyle addDependent:self.
+ ].
+ ^ selectedStyle.
+!
+
+showStandardStylesOnly
+
+ showStandardStylesOnly isNil ifTrue:[
+ showStandardStylesOnly := true asValue.
+ showStandardStylesOnly addDependent:self.
+ ].
+ ^ showStandardStylesOnly.
+!
+
+styleList
+
+ styleList isNil ifTrue:[
+ styleList := List new.
+ styleList addDependent:self.
+ ].
+ ^ styleList.
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'change & update'!
+
+changeInfoLabel
+
+ |nm sheet comment|
+
+ comment := ''.
+ nm := self selectedStyle value.
+ nm notNil ifTrue:[
+ sheet := ViewStyle fromFile:(nm , '.style').
+ comment := (sheet at:#comment ifAbsent:'') withoutSeparators.
+ ].
+ comment := comment withCRs asStringCollection.
+ comment size == 1 ifTrue:[
+ comment := comment first
+ ].
+ self infoLabelHolder value:comment
+!
+
+update:something with:aParameter from:changedObject
+ "Invoked when an object that I depend upon sends a change notification."
+
+ "stub code automatically generated - please change as required"
+
+ changedObject == self showStandardStylesOnly ifTrue:[
+ self updateList.
+ ^ self.
+ ].
+ changedObject == self selectedStyle ifTrue:[
+ self changeInfoLabel.
+ self evaluateModified.
+ ^ self.
+ ].
+
+ super update:something with:aParameter from:changedObject
+!
+
+updateList
+
+ |listOfStyles lastSelection|
+
+ lastSelection := self selectedStyle value.
+ listOfStyles := styleDirectoryContents select:[:aFileName | aFileName asFilename hasSuffix:'style'].
+ listOfStyles := listOfStyles collect:[:aFileName | aFileName asFilename withoutSuffix name].
+ Filename isCaseSensitive ifFalse:[
+ listOfStyles := listOfStyles collect:[:aStyleName | aStyleName asLowercase].
+ ].
+ listOfStyles remove:'generic' ifAbsent:nil; remove:'mswindows3' ifAbsent:nil.
+ showStandardStylesOnly value ifTrue:[
+ listOfStyles := listOfStyles select:[:aStyleName | self class standardStyles includes:aStyleName].
+ ].
+
+ listOfStyles sort.
+ self styleList contents:listOfStyles.
+ self selectedStyle value:lastSelection.
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'initialization & release'!
+
+closeDownViews
+ "This is a hook method generated by the Browser.
+ It will be invoked when your app/dialog-window is really closed.
+ See also #closeDownViews, which is invoked before and may suppress the close
+ or ask the user for confirmation."
+
+ "/ change the code below as required ...
+ "/ This should cleanup any leftover resources
+ "/ (for example, temporary files)
+ "/ super closeRequest will initiate the closeDown
+
+ "/ add your code here
+
+ "/ do not remove the one below ...
+ ^ super closeDownViews
+!
+
+closeRequest
+
+ self saveRequest ifFalse:[
+ ^ self
+ ].
+
+ ^ super closeRequest.
+!
+
+initialize
+
+ |someRsrcFile resourceDir|
+
+ resources := self class owningClass classResources.
+ someRsrcFile := Smalltalk getSystemFileName:('resources' asFilename constructString:'normal.style').
+ someRsrcFile isNil ifTrue:[
+ someRsrcFile := Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'.
+ someRsrcFile isNil ifTrue:[
+ someRsrcFile := Smalltalk getResourceFileName:'styles/normal.style' forPackage:'stx:libview'.
+ ].
+ ].
+ someRsrcFile notNil ifTrue:[
+ resourceDir := someRsrcFile asFilename directoryName
+ ] ifFalse:[
+ resourceDir := Smalltalk getSystemFileName:'resources'.
+ ].
+
+ resourceDir isNil ifTrue:[
+ self warn:'no styles found (missing ''resources'' directory)'.
+ ^ self
+ ].
+ styleDirectoryContents := resourceDir asFilename directoryContents.
+ self updateList.
+ (self class standardStyles includes:View defaultStyle) ifFalse:[
+ showStandardStylesOnly value:false
+ ].
+ self selectedStyle value:(View defaultStyle).
+ self noticeLabelHolder value:(resources at:'STYLE_MSG' default:'Select a Style') withCRs.
+ super initialize
+! !
+
+!AbstractLauncherApplication::StyleSettingsAppl methodsFor:'queries'!
+
+hasUnsavedChanges
+
+ ^ (self selectedStyle value ~= View defaultStyle)
! !
!AbstractLauncherApplication::ToolsSettingsAppl class methodsFor:'interface specs'!
@@ -7711,7 +8431,7 @@
doCancel
self isPartOfSettinsDialog ifTrue:[
- self loadSettings.
+ self loadRequest.
].
self closeRequest.
!
@@ -7726,7 +8446,7 @@
self withWaitCursorDo:[HTMLDocumentView openFullOnHelpFile:'Launcher/toolSettings.html'].
!
-loadSettings
+loadRequest
self showClockInLauncher value:currentUserPrefs showClockInLauncher.
self transcriptBufferSize value:Transcript current lineLimit.
@@ -7964,7 +8684,7 @@
!AbstractLauncherApplication class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/AbstractLauncherApplication.st,v 1.225 2002-11-11 09:38:19 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/AbstractLauncherApplication.st,v 1.226 2002-11-11 17:54:50 penk Exp $'
! !
AbstractLauncherApplication::SettingsDialog initialize!