#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Tue, 24 Jan 2017 12:21:38 +0100
changeset 3842 df8f461d3d31
parent 3841 0ec7ea1037b5
child 3843 52c875014c46
#UI_ENHANCEMENT by cg class: ApplicationModel changed: #openOnXScreenNamed: #rememberRecentlyOpenedApplication
ApplicationModel.st
--- a/ApplicationModel.st	Mon Jan 23 11:01:02 2017 +0100
+++ b/ApplicationModel.st	Tue Jan 24 12:21:38 2017 +0100
@@ -794,11 +794,17 @@
 !
 
 rememberRecentlyOpenedApplication
+    "support for the launcher's ''open recent...'' menu function.
+     It is questionable, if dialogs should also be remembered
+     (although it might be convenient dor developers)"
+    
+    |myName|
+
+    myName := self name.
     RecentlyOpenedApplications isNil ifTrue:[
-	RecentlyOpenedApplications := OrderedCollection new.
+        RecentlyOpenedApplications := OrderedCollection new.
     ].
-    RecentlyOpenedApplications remove:(self name) ifAbsent:[].
-    RecentlyOpenedApplications addFirst:(self name).
+    RecentlyOpenedApplications removeAndAddFirst:myName.
 ! !
 
 !ApplicationModel class methodsFor:'private'!
@@ -1158,11 +1164,16 @@
 
     |newDevice|
 
+    (XWorkstation notNil and:[ XWorkstation isLoaded ]) ifFalse:[
+        self warn:(self resources string:'Could not open display: %1 (no XWorkstation class)' with:aScreenName).
+        ^ self
+    ].    
+
     [
-	newDevice := XWorkstation newDispatchingFor:aScreenName.
+        newDevice := XWorkstation newDispatchingFor:aScreenName.
     ] on:Screen deviceOpenErrorSignal do:[:ex|
-	self warn:'Could not open display: ' , aScreenName.
-	^ self
+        self warn:(self resources string:'Could not open display: %1' with:aScreenName).
+        ^ self
     ].
     ^ self openOnDevice:newDevice.
 
@@ -1173,6 +1184,7 @@
      NewLauncher openOnXScreenNamed:'bitsy:0'
      SystemBrowser openOnXScreenNamed:'dawn:0'
      SystemBrowser openOnXScreenNamed:'bitsy:0'
+     SystemBrowser openOnXScreenNamed:'localhost:0'
     "
 
     "Modified: 13.1.1997 / 20:55:27 / cg"