Skip to content

Commit

Permalink
60472
Browse files Browse the repository at this point in the history
19992 Use assert:equals: in simulateKeyStroke tests
	https://pharo.fogbugz.com/f/cases/19992

19463 Improve SessionManager class comment
	https://pharo.fogbugz.com/f/cases/19463

19983 activate the Dark theme by default in the bootstrapped image
	https://pharo.fogbugz.com/f/cases/19983

19991 Use of deprecated name method in TextEditor>>changeStyle
	https://pharo.fogbugz.com/f/cases/19991

http://files.pharo.org/image/60/60472.zip
  • Loading branch information
Jenkins Build Server authored and ci committed Apr 27, 2017
1 parent 9fe3731 commit f71be96
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 31 deletions.
Expand Up @@ -54,7 +54,7 @@ postload: loader package: packageSpec
UIManager default: MorphicUIManager new.
World displayWorldSafely.
UIManager default uiProcess resume.
Pharo3Theme beCurrent.
Pharo3DarkTheme beCurrent.
(World windowsSatisfying: [:w | w model canDiscardEdits]) do: [:w | w delete].
self cleanUpAfterMorphicInitialization.

Expand Down
Expand Up @@ -5,5 +5,5 @@ testSimulateKeystroke
self assert: textMorph canChangeText.
textMorph takeKeyboardFocus.
self simulateKeyStroke: $s.
self assert: textMorph contents = 's'.
self assert: textMorph contents asString equals: 's'.
textMorph delete.
Expand Up @@ -5,5 +5,5 @@ testSimulateKeystrokes
self assert: textMorph canChangeText.
textMorph takeKeyboardFocus.
self simulateKeyStrokes: 'hello'.
self assert: textMorph contents = 'hello'.
self assert: textMorph contents asString equals: 'hello'.
textMorph delete.
@@ -1,4 +1,4 @@
script60471
script60472

^ 'AST-Core-TheIntegrator.494.mcz
AST-Tests-Core-TheIntegrator.134.mcz
Expand All @@ -19,7 +19,7 @@ BaselineOfBasicTools-TheIntegrator.8.mcz
BaselineOfDisplay-TheIntegrator.4.mcz
BaselineOfIDE-TheIntegrator.46.mcz
BaselineOfMetacello-EstebanLorenzano.89.mcz
BaselineOfMorphic-TheIntegrator.30.mcz
BaselineOfMorphic-TheIntegrator.32.mcz
BaselineOfMorphicCore-TheIntegrator.7.mcz
BaselineOfPharoBootstrap-TheIntegrator.4.mcz
BaselineOfSUnit-TheIntegrator.4.mcz
Expand Down Expand Up @@ -60,10 +60,10 @@ Deprecated60-TheIntegrator.18.mcz
EmbeddedFreeType-TheIntegrator.30.mcz
EmbeddedFreeType-Tests-TheIntegrator.4.mcz
EmergencyEvaluator-TheIntegrator.35.mcz
Epicea-TheIntegrator.839.mcz
EpiceaBrowsers-MartinDias.143.mcz
EpiceaBrowsersTests-MartinDias.17.mcz
EpiceaTests-MartinDias.19.mcz
Epicea-MartinDias.853.mcz
EpiceaBrowsers-MartinDias.177.mcz
EpiceaBrowsersTests-MartinDias.30.mcz
EpiceaTests-MartinDias.24.mcz
FFI-Kernel-EstebanLorenzano.45.mcz
FFI-Pools-eem.3.mcz
FileSystem-Core-TheIntegrator.220.mcz
Expand Down Expand Up @@ -141,7 +141,7 @@ Graphics-Transformations-TheIntegrator.17.mcz
Growl-TheIntegrator.47.mcz
HelpSystem-Core-TheIntegrator.172.mcz
HelpSystem-Tests-TheIntegrator.32.mcz
Hiedra-MartinDias.145.mcz
Hiedra-MartinDias.146.mcz
HiedraTests-MartinDias.2.mcz
HowToContributeHelp-TheIntegrator.4.mcz
HudsonBuildTools20-TheIntegrator.100.mcz
Expand Down Expand Up @@ -245,8 +245,8 @@ OSWindow-SDL2-TheIntegrator.110.mcz
OSWindow-SDL2-Examples-TheIntegrator.16.mcz
OSWindow-Tests-RonieSalgado.3.mcz
OSWindow-VM-MerwanOuddane.4.mcz
Ombu-MartinDias.261.mcz
OmbuTests-MartinDias.27.mcz
Ombu-MartinDias.274.mcz
OmbuTests-MartinDias.33.mcz
OpalCompiler-Core-TheIntegrator.890.mcz
OpalCompiler-Tests-TheIntegrator.380.mcz
OpalTools-TheIntegrator.24.mcz
Expand Down Expand Up @@ -309,7 +309,7 @@ SUnit-Help-MarcusDenker.9.mcz
SUnit-Rules-TheIntegrator.5.mcz
SUnit-Tests-TheIntegrator.64.mcz
SUnit-UI-TheIntegrator.153.mcz
SUnit-UITesting-TheIntegrator.34.mcz
SUnit-UITesting-TheIntegrator.36.mcz
ScriptLoader-Tests-TheIntegrator.4.mcz
ScriptingExtensions-TheIntegrator.6.mcz
ScriptingExtensions-Tests-TheIntegrator.3.mcz
Expand Down Expand Up @@ -363,7 +363,7 @@ System-OSEnvironments-TheIntegrator.33.mcz
System-Object Events-TheIntegrator.28.mcz
System-Platforms-TheIntegrator.85.mcz
System-Serial Port-StephaneDucasse.23.mcz
System-SessionManager-TheIntegrator.38.mcz
System-SessionManager-TheIntegrator.41.mcz
System-SessionManager-Tests-ChristopheDemarey.9.mcz
System-Settings-TheIntegrator.372.mcz
System-Settings-Rules-TheIntegrator.2.mcz
Expand All @@ -377,7 +377,7 @@ System-VMEvents-TheIntegrator.19.mcz
Tests-TheIntegrator.794.mcz
Text-Core-TheIntegrator.66.mcz
Text-Diff-TheIntegrator.6.mcz
Text-Edition-TheIntegrator.126.mcz
Text-Edition-TheIntegrator.128.mcz
Text-Edition-Tests-EstebanLorenzano.3.mcz
Text-Scanning-TheIntegrator.33.mcz
Text-Tests-TheIntegrator.10.mcz
Expand Down

This file was deleted.

@@ -0,0 +1,15 @@
update60472
"self new update60472"
self withUpdateLog: '19992 Use assert:equals: in simulateKeyStroke tests
https://pharo.fogbugz.com/f/cases/19992
19463 Improve SessionManager class comment
https://pharo.fogbugz.com/f/cases/19463
19983 activate the Dark theme by default in the bootstrapped image
https://pharo.fogbugz.com/f/cases/19983
19991 Use of deprecated name method in TextEditor>>changeStyle
https://pharo.fogbugz.com/f/cases/19991'.
self loadTogether: self script60472 merge: false.
self flushCaches.
@@ -1,3 +1,12 @@
commentForCurrentUpdate
^ '19912 Epicea: Integrate release 8.2.1
https://pharo.fogbugz.com/f/cases/19912'
^ '19992 Use assert:equals: in simulateKeyStroke tests
https://pharo.fogbugz.com/f/cases/19992
19463 Improve SessionManager class comment
https://pharo.fogbugz.com/f/cases/19463
19983 activate the Dark theme by default in the bootstrapped image
https://pharo.fogbugz.com/f/cases/19983
19991 Use of deprecated name method in TextEditor>>changeStyle
https://pharo.fogbugz.com/f/cases/19991'
@@ -1 +1 @@
I'm the entry point of the session (betwen start/save/stop) management mechanism.I replace the old startup and shutdown list mechanism.There is a default instance of me used by the system accessible through: self default.I can create new sessions and manage categories.I also provide a facade to register new session handlers.I can provide the list of handlers by order of priority (categories order and categories priority) either for the startup or the shutdown. self default startupList. self default shutdownList.Note: the shutdown list is just the startup list reversed
I am the object responsible of managing how sessions work in Pharo.A session defines the boundaries of work in the image.A new session starts when the image starts.A session stops when the image quits.There is only one active session at a single point of time.The current active session is held by myself, the singleton session manager. It can be accessed by doing: SessionManager default currentSession.The most important responsibility of the session manager is to manage how resources and services in the image are started up and shut down at the beginning and end of a session respectively. For example, when the image starts, several initialization routines should be executed to make sure that the image has access to the graphic drivers, the standard input/output file descriptors and so on.Such initialization happens in the #snapshot:andQuit: method. #snapshot:andQuit: will: - stop current session - save current image if requested - quit if requested - start a new session When a session is started, all elements registered in the startup list are started up.When a session is stopped, all elements registered in the shutdown list are shut down.# Managing Startup and Shutdown listsThe startup and shutdown lists can be accessed through the messages: SessionManager default startupList. SessionManager default shutdownList.In general terms, the shutdown list is the startup list reversed.Upon a startup [shutdown], all elements in the startup list are sent the message #startup: [#shutdown:] with a boolean as argument that indicates wether the image is being saved [closed].Internally, startup and shutdown lists are prioritised. Priorities are managed by startup categories. By default the session manager includes the following categories in decreasing priority order:- System- Network- Graphical User Interface- Tools- UserCategories can be accessed as follows: SessionManager default categoryNamed: aName.New categories can be registered in the system using the messages: SessionManager default createCategory: aCategoryName. SessionManager default createCategory: aCategoryName after: anotherCategoryName.Finally, to subscribe some resource handler to the startup shutdown lists, we need to subscribe a handler, subclass of AbstractSessionHandler.The most common handler implementation so far is the ClassSessionHandler, that allows to subscribe a class for startup and shutdown, keeping backwards compatibility to the old startup mechanism. ClassSessionHandler forClassNamed: aClassNameWe can register a session handler as follows SessionManager default register: (ClassSessionHandler forClassNamed: self name) inCategory: SessionManager default systemCategory. Or alternatively, by talking to the corresponding category: SessionManager default systemCategory register: (ClassSessionHandler forClassNamed: self name)# System Category PrioritiesA system category internally prioritizes its elements to provide a fine grained control on the startup and shutdown order.All methods above have variants that allow developers to specify the priority inside the category: SessionManager default register: (ClassSessionHandler forClassNamed: self name) inCategory: SessionManager default systemCategory atPriority: 100. SessionManager default systemCategory register: (ClassSessionHandler forClassNamed: self name) atPriority: 100 By default, if no priority is specified, a default priority is used. Every category answers to the message #defaultPriority.# How does an image restart from the point it was beforeAn important point in the image startup is how does it manage to restart from the point where it was executing when it was saved.When the image is saved, using the snapshot primitive, the entire image is freezed at the point of the snapshot.More particularly, the process that invoked the snapshot primitive is freezed at the point of the primitive call.This works as a process fork: the running image will return from the snapshot primitive and the saved file will also start from the freezed point.To differentiate whether we are executing in the running image or in the freshly-saved image, the snapshot primitive returns a boolean indicating it.Read the comment of #snapshotPrimitive for more details.
Expand Down
Expand Up @@ -5,7 +5,7 @@ changeStyle
current := TextStyle default copy.
names := TextStyle actualTextStyles keys.
menuList := names collect: [ :styleName |
(styleName = current name) -> styleName ].
(styleName = current printString) -> styleName ].
reply := UIManager default chooseFrom: menuList values: names.
reply ifNotNil: [
(style := TextStyle named: reply) ifNil: [ ^ true].
Expand Down

0 comments on commit f71be96

Please sign in to comment.