|
Class: SettingsDialog
Object
|
+--Model
|
+--ApplicationModel
|
+--SettingsDialog
- Package:
- stx:libtool
- Category:
- Interface-Smalltalk
- Version:
- rev:
1.176
date: 2019/04/11 16:38:46
- user: stefan
- file: SettingsDialog.st directory: libtool
- module: stx stc-classLibrary: libtool
- Author:
- Christian Penk, eXept Software AG
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.
AbstractLauncherApplication
defaultSettingsApplicationList
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
-
-
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
-
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
-
JV@2012-02-07: Changed to save preferences back to file from which
they have been loaded (if known). If no such file is known,
save to DEFAULT USER SETTINGS file (default ~/.smalltalk/settings.rc)
-
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.
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
-
-
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
-
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
-
-
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
-
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)
-
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.
|
|