#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Sun, 09 Oct 2016 12:11:21 +0200
changeset 16919 070e23357f20
parent 16918 beb0c0bf33c8
child 16920 6411ac77e0d1
#UI_ENHANCEMENT by cg class: Tools::NewSystemBrowser changed: #hasStartableApplicationSelected #startApplication: also allow launch of console programs via launch button.
Tools__NewSystemBrowser.st
--- a/Tools__NewSystemBrowser.st	Sat Oct 08 23:15:33 2016 +0200
+++ b/Tools__NewSystemBrowser.st	Sun Oct 09 12:11:21 2016 +0200
@@ -23317,7 +23317,9 @@
     |cls|
 
     ^ (cls := self theSingleSelectedClass) notNil
-    and:[ cls theNonMetaclass isVisualStartable ]
+    and:[ (cls theNonMetaclass isVisualStartable)
+          or:[ cls isStartableWithMain 
+          or:[ cls isStartableWithStart ]]]
 !
 
 hasStartableApplicationSelectedHolder
@@ -60944,11 +60946,11 @@
     "double-click on a class to exec; or launch button.
      Return true if successful"
 
-    |cls|
+    |cls args|
 
     cls := clsArg theNonMetaclass.
 
-    (cls isBrowserStartable) ifFalse:[^ false].
+    "/ (cls isBrowserStartable) ifFalse:[^ false].
 
     (cls isVisualStartable) ifTrue:[
         self busyLabel:'starting application %1' with:cls name.
@@ -60963,10 +60965,16 @@
     ].
     (cls isStartableWithMain) ifTrue:[
         self busyLabel:'invoking main of %1' with:cls name.
-        "/ (self confirm:('Invoke %1''s main ?' bindWith:clsName)) ifTrue:[
-            cls main.
-        "/ ].
-        ^ true.
+        (cls class includesSelector:'main') ifTrue:[
+            "/ (self confirm:('Invoke %1''s main ?' bindWith:clsName)) ifTrue:[
+                cls main.
+            "/ ].
+            ^ true.
+        ]. 
+        args := Dialog request:'command line arguments:' initialAnswer:'' onCancel:nil.
+        args isNil ifTrue:[^ false].
+        cls main:(args asCollectionOfWords).
+        ^ true
     ].
     (cls isStartableWithStart) ifTrue:[
         self busyLabel:'invoking start of %1' with:cls name.