|
Class: SettingsDialog
Object
|
+--Model
|
+--ApplicationModel
|
+--SettingsDialog
- Package:
- stx:libtool
- Category:
- Interface-Smalltalk
- Version:
- rev:
1.199
date: 2023/09/07 21:11:23
- user: stefan
- file: SettingsDialog.st directory: libtool
- module: stx stc-classLibrary: libtool
This is an application which presents a hierarchy of settings applications.
It is used (among others) in the launcher's and filebrowser's settings-dialogs.
However, it is rather generic and can be setup for any application's setting dialog.
The actual contents (i.e. the organization tree and tab contents) is provided
by a spec-array (the settingsList).
You will find a default settings list here, but in theory, applications may provide
their own one, or modify a copy of that list for specialized settings dialogs.
See class >> examples, #defaultSettingsApplicationList
and AbstractLauncherApplication >> settingsList for more info.
copyrightCOPYRIGHT (c) 2002 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
itemClass
-
application icons
-
defaultSettingsAppIcon
-
-
settingsFolderIcon
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
-
settingsIcon
-
-
settingsIcon2
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self settingsIcon2 inspect
ImageEditor openOnClass:self andSelector:#settingsIcon2
Icon flushCachedIcons
|
-
wheelIcon
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self wheelIcon inspect
ImageEditor openOnClass:self andSelector:#wheelIcon
Icon flushCachedIcons
|
default settingslist
-
defaultSettingsApplicationList
-
unless the settingsDialog is opened with an explicit settings list,
this one is used (it is also the one used by the ST/X IDE
defaults
-
autoSaveChangedSettingsOnClose
-
-
autoSaveChangedSettingsOnClose: aBoolean
-
-
defaultIcon
-
(comment from inherited method)
default is: no icon (should be redefined by concrete class if an icon is wanted).
-
expandParents
-
-
resourcePackName
-
return the name which is used as the fileNameBase of my resource file.
Here, use the same resources as the Launcher
help specs
-
helpSpec
-
This resource specification was automatically generated
by the UIHelpTool of ST/X.
initialization
-
initialize
-
(comment from inherited method)
ApplicationModel initialize
interface specs
-
windowSpec
-
This resource specification was automatically generated
by the UIPainter of ST/X.
Usage example(s):
UIPainter new openOnClass:SettingsDialog andSelector:#windowSpec
SettingsDialog new openInterface:#windowSpec
SettingsDialog open
|
menu actions
-
askForFileAndSaveSettings
-
not canceled
-
currentSettingsFilename
-
-
saveSettingsAsDefaultSettings
-
-
saveSettingsTo: file
-
-
saveSettingsWithoutAskingForFile
-
menu specs
-
mainMenu
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
Usage example(s):
MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu
(Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp
|
startup
-
openWithList: settingsList label: label
-
-
openWithList: settingsList label: label initialSettingsClass: settingsClassToSelectOrNil
-
given a list of page-label/class pairs,
open a settings dialog showing that set of items.
Usage example(s):
|list|
list := #(
#('Tools/Compiler' #'AbstractSettingsApplication::GeneralCompilerSettingsAppl' )
#('Tools/Compiler/ByteCode' #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl' )
#('Tools/Compiler/STC' #'AbstractSettingsApplication::STCCompilerSettingsAppl' )
).
self
openWithList:list
label:(i'Compiler Settings')
initialSettingsClass:AbstractSettingsApplication::ByteCodeCompilerSettingsAppl
|
accessing
-
requestor
-
return the 'requestor' of the SettingsDialog
-
requestor: something
-
-
rootItem
-
-
rootItemLabel
-
-
rootItemLabel: aString
-
-
selectedItemsName
-
-
showRoot: aBoolean
-
-
subCanvasApplication
-
actions
-
changeLabelTo: aLabel application: aApplication
-
-
destroyAll
-
-
doIndicatorClick: index
-
handle a click on the indicator
-
doReload
-
discard button was pressed
-
doSave
-
accept button was pressed
-
expandItemForApplication: aApplication
-
-
help
-
-
reopenLauncher
-
force the launcher to reopen an instance of itself.
Done whenever relevant look&feel settings are changed
(actually a workaround - a much better solution would be to teach
all smalltalk applications/views to dynamically update their style).
-
sendLoadRequestToAll
-
ask all subApps to reload their idea of the current settings.
Do this, after userPrefs have been loaded from a file,
while a settingsDialog is open
-
sendSaveRequestToAll
-
give all subapps a chance to apply any changes.
No longer needed, as we do this at the time the subApp
is changed; so only the current app needs this chance again,
when about to close (seesendSaveRequestToCurrent)
-
sendSaveRequestToCurrent
-
when about to close the dialog, give the current
subapp a chance to apply any changes
application list access
-
addApplClass: aClassName forApplication: anApplication label: aLabel expand: aBoolean
-
add an application to the settingsTree, take the icon from the application classes defaultIcon method
-
addApplClass: aClass withName: aName
-
add an application to the settingsTree, take the icon from the application classes defaultIcon method
-
addApplClass: aClass withName: aName expand: aBoolean
-
add an application to the settingsTree, take the icon from the application classes defaultIcon method
-
addApplClass: aClass withName: aName icon: icon
-
-
addApplClass: aClassName withName: aName icon: icon expand: doExpand
-
(self applicationNames includes:aName) ifTrue:[
-
addIcon: aIcon forCategory: aCategoryName
-
add a new category Icon for a category
-
applicationNames
-
-
categoryIcons
-
-
childrenApplicationItemFor: aApplication fromItem: anItem
-
-
getAllChildrenAppsForApplication: aApplication
-
-
getAllChildrenAppsForApplication: aApplication childrenClass: aClass
-
-
getAllChildrenAppsForApplication: aApplication matchBlock: aMatchBlock
-
-
getAllChildrenByApplication: aApplication
-
-
getApplicationsByClass: aClass
-
-
getItemByApplication: anApplication
-
-
getNameOfApplication: aApplication
-
-
installSettingsEntries: aCollection
-
-
installSettingsEntries: entries expand: expand
-
Installs given settings list. If expand is true,
dynamic settings list is expanded
-
installSettingsEntry: entry
-
-
installSettingsEntry: entry expand: expand
-
a directory entry
-
parentApplicationFor: aApplication
-
-
remApplClassByName: aName
-
remove an application from the settingsTree
-
removeAllApplicationsByClass: aClass
-
-
removeAllSubApplicationsFor: aApp
-
-
removeApplicationByClass: aClass
-
-
removeApplicationFromTree: aApplication
-
-
removeByApplication: aApplication
-
-
sortSubApplicationsFor: anApplication
-
application list access-private
-
addCategoriesFor: aName
-
create all the categories
-
createItemForApplication: anApplication class: aClass label: aLabel icon: anIcon expandParent: expandParent replaceExisting: doReplaceExisting
-
create an application item in my application list
-
createItemName: aNameString label: aLabel class: aClass icon: anIcon
-
-
createItemName: aNameString label: aLabel class: aClass icon: anIcon expandParent: expandParent
-
-
createItemName: aNameString label: untranslatedLabel class: aClass icon: anIcon expandParent: expandParent replaceExisting: doReplaceExisting
-
create an application item in my application list
-
createItemName: aNameString label: aLabel icon: anIcon
-
create an application item in my application list
-
createItemName: aNameString label: aLabel icon: anIcon replaceExisting: doReplaceExisting
-
create an application item in my application list
-
getItemForName: aName
-
-
realApplications
-
return a collection of all real (non-folder) applications.
A helper to avoid code duplication
-
realApplicationsDo: aBlock
-
evaluate aBlock for all real (non-folder) applications.
A helper to avoid code duplication
-
removeItem: anItem
-
remove an application from the settingsTree
-
treeName: aName butLast: last do: aBlock
-
-
treeName: aName do: aBlock
-
aspects
-
applicationList
-
-
closeButtonVisibleHolder
-
-
enableHelp
-
-
enableOK
-
-
enableReload
-
-
loadAndSaveSettingsItemVisible
-
for now, only show these if I have a requestor
(i.e. I am a full settings Dialog as opposed to a DebugView, FileBrowser or other
settingsDialog. I think this has to be reworked...
Usage example(s):
loadAndSaveSettingsItemVisible
|
-
quickSearchFieldShownHolder
-
when the search box is opened, warp the focus into the field
-
quickSearchStringHolder
-
-
selectedItem
-
-
showNonDefaultSettingsHolder
-
-
showNonDefaultSettingsMenuItemVisibleHolder
-
-
subCanvasApplicationHolder
-
-
whyDisabledInfoHolder
-
change & update
-
modifiedChanged
-
-
quickSearchStringHolderChanged
-
the text in the quick search entry field has changed.
remember the current selection,
update the highlighting of matching fields (and expand corresponding tree nodes),
then reselect (because the treeView is too stupid in loosing the selection,
when expanding/hiding)
-
selectionChanged
-
settings selection has changed;
first send the previous application a saveRequest;
then construct the new selected application (if not yet done before),
and set it in the right subcanvas
-
update: something with: aParameter from: changedObject
-
(comment from inherited method)
dependent is notified of some change -
Default is to try update:with:
changed settings highlighting
-
highlightWidgetsWithChangedSettings
-
whenever an app is selected AND a quick search string is present,
go through the widgets and highlight those which match.
This is done by looking at the helpkey and model aspects for a match
-
showNonDefaultSettingsHolderChanged
-
the show-non-default settings check box has changed.
remember the current selection,
update the highlighting of matching fields (and expand corresponding tree nodes),
then reselect (because the treeView is too stupid in loosing the selection,
when expanding/hiding)
-
widgetsWithChangedSettingsIn: anApplication
-
helper:
go through the widgets and find those which have a value different
from the default settings.
This is done by looking at model value (hope they have)
initialization & release
-
closeRequest
-
This is a hook method.
It will be invoked when your app/dialog-window is about to be closed.
This method has a chance to suppress the close by returning false.
See also #closeDownViews, which is invoked when the close is really done.
-
createRootItem
-
this is stupidly wrong!
-
initialize
-
false
-
postBuildSubCanvas: aWidget
-
-
postBuildWith: aBuilder
-
(comment from inherited method)
this is sent after an interface is built from a spec,
but only iff the appModel is not the same as the topView's app
(i.e. if it is not a build for the same appModel again).
In the other case, postBuildAsSubcanvasWith is invoked.
Can be redefined in subclasses for additional setup after
the view has been built, but not yet opened.
-
postOpenWith: aBuilder
-
if there is only one child, select it initially
menu actions
-
askForFileAndSaveSettings
-
-
loadSettingsFromFile
-
restore settings from a settings-file.
-
menuCollapseAll
-
-
menuExpandAll
-
-
saveSettingsWithoutAskingForFile
-
opening
-
reopenAfterChangedViewStyleSetting
-
open the dialog. Take care to redefine some superclass behavior
quick search support
-
getWordMatchPattern
-
pattern is needed at multiple places
-
getWordMatchPatterns
-
patterns are needed at multiple places
-
highlightApplicationsForWhich: aBlock
-
common code for string search and changed-settings search.
Enumerates all applications with aBlock;
if it return true, it will be collectet and highlighted.
-
highlightWidgets: aSetOfWidget
-
highlight a matching widget
-
highlightWidgetsWithMatchingSearchString
-
whenever an app is selected AND a quick search string is present,
go through the widgets and highlight those which match.
This is done by looking at the helpkey and model aspects for a match
-
unhighlightFoundItemsFromSearch
-
undo any highlighting of matching fields (from the previous show matching items)
-
unhighlightWidgets
-
unhighlight all previously highligted widgets
(restore their previous attributes)
-
widgetsWithMatchingSearchStringIn: anApplication
-
helper:
go through the widgets and find those which match.
This is done by looking at the helpkey and model aspects for a match
selection
-
selectItem: anEntryInTheSettingsList
-
-
selectItemWithClass: aClass
-
select an item based on the sub-settings application class
-
selectItemWithName: aPathString
-
select an item based on the sub-settings page name.
See standardRawSettingsList for a list of names
HierarchicalApplicationList
SettingsFilenameAppl
start a Settings Dialog with a language Settings Application under root
| settingsApp |
settingsApp := self new.
settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl'
withName:'Language'.
settingsApp open.
|
start a Settings Dialog with a language Settings Application under root/Test
| settingsApp |
settingsApp := self new.
settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl'
withName:'Test/Language'.
settingsApp open.
|
start a Settings Dialog with a language Settings Application under root/Test
with an other category test icon
| settingsApp |
settingsApp := self new.
settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl'
withName:'Test/Language'.
settingsApp addIcon:ToolbarIconLibrary start22x22Icon forCategory:'Test'.
settingsApp open.
|
start a Settings Dialog with a language and memory Settings Application
in different categories
| settingsApp |
settingsApp := self new.
settingsApp addIcon:ToolbarIconLibrary start22x22Icon forCategory:'Test'.
settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl'
withName:'Test/Language'.
settingsApp addApplClass:#'AbstractSettingsApplication::MemorySettingsAppl'
withName:'Test2/Memory'.
settingsApp open.
|
|