AbstractLauncherApplication.st
changeset 17417 37220c1b6b48
parent 17399 4777d0d080fc
child 17583 57658c266723
equal deleted inserted replaced
17416:ccd3335a762a 17417:37220c1b6b48
    99     "return the launcher running on the current screen.
    99     "return the launcher running on the current screen.
   100      (for access via addMenu/ removeMenu)"
   100      (for access via addMenu/ removeMenu)"
   101 
   101 
   102     |currentScreen|
   102     |currentScreen|
   103 
   103 
   104     OpenLaunchers size > 0 ifTrue:[
   104     OpenLaunchers notEmptyOrNil ifTrue:[
   105         currentScreen := Screen current.
   105         currentScreen := Screen current.
   106         ^ OpenLaunchers detect:[:eachLauncher | eachLauncher graphicsDevice == currentScreen] ifNone:nil
   106         ^ OpenLaunchers detect:[:eachLauncher | eachLauncher graphicsDevice == currentScreen] ifNone:nil
   107     ].
   107     ].
   108     ^ nil.
   108     ^ nil.
   109 
   109 
   110     "
   110     "
   111      NewLauncher current
   111      NewLauncher current
   112     "
   112     "
   113 
   113 
   114     "Modified: / 9.9.1996 / 22:41:36 / stefan"
   114     "Modified: / 09-09-1996 / 22:41:36 / stefan"
   115     "Modified: / 13.10.1998 / 16:09:50 / cg"
   115     "Modified: / 17-02-2017 / 08:26:01 / cg"
   116 !
   116 !
   117 
   117 
   118 openLaunchers
   118 openLaunchers
   119     "return all opened launchers"
   119     "return all opened launchers"
   120 
   120 
  1566 
  1566 
  1567     selector := Dialog
  1567     selector := Dialog
  1568                     requestSelector:(resources string:'Browse Senders of (Tab for Completion):')
  1568                     requestSelector:(resources string:'Browse Senders of (Tab for Completion):')
  1569                     okLabel:(resources string:'Browse')
  1569                     okLabel:(resources string:'Browse')
  1570                     initialAnswer:''.
  1570                     initialAnswer:''.
  1571     selector size > 0 ifTrue:[
  1571     selector notEmptyOrNil ifTrue:[
  1572         self withWaitCursorDo:[
  1572         self withWaitCursorDo:[
  1573             browserClass browseAllCallsOn:selector
  1573             browserClass browseAllCallsOn:selector
  1574         ]
  1574         ]
  1575     ].
  1575     ].
  1576 
  1576 
  1577     "Modified: / 14-02-2012 / 14:20:56 / cg"
  1577     "Modified: / 17-02-2017 / 08:25:32 / cg"
  1578 !
  1578 !
  1579 
  1579 
  1580 browseUnboundGlobals
  1580 browseUnboundGlobals
  1581     "open a browser on methods refering to unbound global variables"
  1581     "open a browser on methods refering to unbound global variables"
  1582 
  1582 
  1714 
  1714 
  1715     host := Dialog
  1715     host := Dialog
  1716                 request:(resources string:'Remote Launcher on which display:')
  1716                 request:(resources string:'Remote Launcher on which display:')
  1717                 initialAnswer:'{hostName}:0'
  1717                 initialAnswer:'{hostName}:0'
  1718                 initialSelection:(1 to:10).
  1718                 initialSelection:(1 to:10).
  1719     host size > 0 ifTrue:[
  1719     host notEmptyOrNil ifTrue:[
  1720         (host includes:$:) ifFalse:[
  1720         (host includes:$:) ifFalse:[
  1721             host := (host , ':0')
  1721             host := (host , ':0')
  1722         ].
  1722         ].
  1723 
  1723 
  1724         remoteDisplayClass := XWorkstation.
  1724         remoteDisplayClass := XWorkstation.
  1746             do:[
  1746             do:[
  1747                 self class open.
  1747                 self class open.
  1748             ]
  1748             ]
  1749     ].
  1749     ].
  1750 
  1750 
  1751     "Created: / 10.9.1998 / 11:48:42 / cg"
  1751     "Created: / 10-09-1998 / 11:48:42 / cg"
       
  1752     "Modified: / 17-02-2017 / 08:25:56 / cg"
  1752 ! !
  1753 ! !
  1753 
  1754 
  1754 !AbstractLauncherApplication methodsFor:'user actions-file'!
  1755 !AbstractLauncherApplication methodsFor:'user actions-file'!
  1755 
  1756 
  1756 exit
  1757 exit
  2301     |possibleGroups v|
  2302     |possibleGroups v|
  2302 
  2303 
  2303     possibleGroups := WindowGroup allInstances select:[:eachGroup |
  2304     possibleGroups := WindowGroup allInstances select:[:eachGroup |
  2304                                         eachGroup graphicsDevice == Screen current
  2305                                         eachGroup graphicsDevice == Screen current
  2305                                         and:[eachGroup isModal not
  2306                                         and:[eachGroup isModal not
  2306                                         and:[eachGroup topViews size > 0]]].
  2307                                         and:[eachGroup topViews notEmptyOrNil]]].
  2307     possibleGroups isEmpty ifTrue:[
  2308     possibleGroups isEmpty ifTrue:[
  2308         self information:'No windows found which could be migrated to some other display.'.
  2309         self information:'No windows found which could be migrated to some other display.'.
  2309         ^ self
  2310         ^ self
  2310     ].
  2311     ].
  2311 
  2312 
  2312     v := self findWindow:'Select window to migrate:' windowGroupFilter:possibleGroups.
  2313     v := self findWindow:'Select window to migrate:' windowGroupFilter:possibleGroups.
  2313     v notNil ifTrue:[
  2314     v notNil ifTrue:[
  2314         self migrateWindow:v topView
  2315         self migrateWindow:v topView
  2315     ]
  2316     ]
       
  2317 
       
  2318     "Modified: / 17-02-2017 / 08:25:38 / cg"
  2316 !
  2319 !
  2317 
  2320 
  2318 findAndMigrateWindowBack
  2321 findAndMigrateWindowBack
  2319     "find a window (by name) and migrate it back to this display"
  2322     "find a window (by name) and migrate it back to this display"
  2320 
  2323 
  2321     |possibleGroups v|
  2324     |possibleGroups v|
  2322 
  2325 
  2323     possibleGroups := WindowGroup allInstances select:[:eachGroup |
  2326     possibleGroups := WindowGroup allInstances select:[:eachGroup |
  2324                                         eachGroup graphicsDevice ~~ Screen current
  2327                                         eachGroup graphicsDevice ~~ Screen current
  2325                                         and:[eachGroup isModal not
  2328                                         and:[eachGroup isModal not
  2326                                         and:[eachGroup topViews size > 0]]].
  2329                                         and:[eachGroup topViews notEmptyOrNil]]].
  2327     possibleGroups isEmpty ifTrue:[
  2330     possibleGroups isEmpty ifTrue:[
  2328         self information:'No windows are open on any other display.'.
  2331         self information:'No windows are open on any other display.'.
  2329         ^ self
  2332         ^ self
  2330     ].
  2333     ].
  2331 
  2334 
  2332     v := self findWindow:'Select window to migrate back:' windowGroupFilter:possibleGroups.
  2335     v := self findWindow:'Select window to migrate back:' windowGroupFilter:possibleGroups.
  2333     v notNil ifTrue:[
  2336     v notNil ifTrue:[
  2334         v windowGroup migrateTo:(Screen current)
  2337         v windowGroup migrateTo:(Screen current)
  2335     ]
  2338     ]
       
  2339 
       
  2340     "Modified: / 17-02-2017 / 08:25:45 / cg"
  2336 !
  2341 !
  2337 
  2342 
  2338 findAndRaiseWindow
  2343 findAndRaiseWindow
  2339     "find a window (by name) and raise it"
  2344     "find a window (by name) and raise it"
  2340 
  2345 
  2417         ^ self warn:'Cannot open display: ', ex parameter.
  2422         ^ self warn:'Cannot open display: ', ex parameter.
  2418     ].
  2423     ].
  2419 
  2424 
  2420     toMigrate := WindowGroup allInstances
  2425     toMigrate := WindowGroup allInstances
  2421         select:[:each | each graphicsDevice == Screen current
  2426         select:[:each | each graphicsDevice == Screen current
  2422                         and:[each topViews size > 0
  2427                         and:[each topViews notEmptyOrNil
  2423                         and:[each isModal not]]
  2428                         and:[each isModal not]]
  2424                ].
  2429                ].
  2425     toMigrate do:[:eachGroup |
  2430     toMigrate do:[:eachGroup |
  2426         eachGroup migrateTo:anotherDisplay
  2431         eachGroup migrateTo:anotherDisplay
  2427     ]
  2432     ]
       
  2433 
       
  2434     "Modified: / 17-02-2017 / 08:25:51 / cg"
  2428 !
  2435 !
  2429 
  2436 
  2430 migrateWindow:aWindow
  2437 migrateWindow:aWindow
  2431     "migrate a view to some other display"
  2438     "migrate a view to some other display"
  2432 
  2439 
  4540 
  4547 
  4541                        newFormat := Dialog request:
  4548                        newFormat := Dialog request:
  4542                                         'Define the Format of Window Labels:\\  %1 - Label\  %2 - Hostname\  %3 - Username\  %4 - ProcessId\'
  4549                                         'Define the Format of Window Labels:\\  %1 - Label\  %2 - Hostname\  %3 - Username\  %4 - ProcessId\'
  4543                                            withCRs initialAnswer:StandardSystemView windowLabelFormat.
  4550                                            withCRs initialAnswer:StandardSystemView windowLabelFormat.
  4544 
  4551 
  4545                        newFormat size > 0 ifTrue:[
  4552                        newFormat notEmptyOrNil ifTrue:[
  4546                            newWindowLabelFormat := newFormat
  4553                            newWindowLabelFormat := newFormat
  4547                        ].
  4554                        ].
  4548                       ]).
  4555                       ]).
  4549     box makeTabable:butt.
  4556     box makeTabable:butt.
  4550     butt left:0.6; width:0.4.
  4557     butt left:0.6; width:0.4.
  4622             Processor supportDynamicPriorities:dynamicPrios value
  4629             Processor supportDynamicPriorities:dynamicPrios value
  4623         ].
  4630         ].
  4624     ].
  4631     ].
  4625     box destroy
  4632     box destroy
  4626 
  4633 
  4627     "Modified: / 9.9.1996 / 22:43:36 / stefan"
  4634     "Modified: / 09-09-1996 / 22:43:36 / stefan"
  4628     "Modified: / 20.5.1999 / 18:33:55 / cg"
  4635     "Modified: / 03-12-1999 / 17:11:38 / ps"
  4629     "Modified: / 3.12.1999 / 17:11:38 / ps"
  4636     "Modified: / 17-02-2017 / 08:26:12 / cg"
  4630 !
  4637 !
  4631 
  4638 
  4632 printerSettings
  4639 printerSettings
  4633     "open a dialog on printer related settings; returns true if accepted.
  4640     "open a dialog on printer related settings; returns true if accepted.
  4634      Obsoleted by the settings application"
  4641      Obsoleted by the settings application"
  4709     printOutField := box addInputFieldOn:printFile tabable:true.
  4716     printOutField := box addInputFieldOn:printFile tabable:true.
  4710     printOutField width:0.75; left:0.25; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
  4717     printOutField width:0.75; left:0.25; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
  4711     printFile
  4718     printFile
  4712         onChangeEvaluate:
  4719         onChangeEvaluate:
  4713             [
  4720             [
  4714                 printFile value size > 0 ifTrue:[
  4721                 printFile value notEmptyOrNil ifTrue:[
  4715                     commandListPop disable.
  4722                     commandListPop disable.
  4716                 ] ifFalse:[
  4723                 ] ifFalse:[
  4717                     commandListPop enable.
  4724                     commandListPop enable.
  4718                 ]
  4725                 ]
  4719             ].
  4726             ].
  4919         ].
  4926         ].
  4920     ].
  4927     ].
  4921     box destroy.
  4928     box destroy.
  4922     ^ accepted
  4929     ^ accepted
  4923 
  4930 
  4924     "Modified: 9.9.1996 / 22:43:51 / stefan"
  4931     "Modified: / 09-09-1996 / 22:43:51 / stefan"
  4925     "Modified: 28.2.1997 / 14:00:13 / cg"
  4932     "Modified: / 17-02-2017 / 08:26:20 / cg"
  4926 !
  4933 !
  4927 
  4934 
  4928 saveSettings
  4935 saveSettings
  4929     SettingsDialog saveSettingsWithoutAskingForFile.
  4936     SettingsDialog saveSettingsWithoutAskingForFile.
  4930 !
  4937 !
  5149 
  5156 
  5150             manager notNil ifTrue:[
  5157             manager notNil ifTrue:[
  5151 "/                localSourceFirst value ifFalse:[
  5158 "/                localSourceFirst value ifFalse:[
  5152 
  5159 
  5153                     nm := sourceCacheDir value.
  5160                     nm := sourceCacheDir value.
  5154                     nm size > 0 ifTrue:[
  5161                     nm notEmptyOrNil ifTrue:[
  5155                         (fn := nm asFilename) exists ifFalse:[
  5162                         (fn := nm asFilename) exists ifFalse:[
  5156                             (self confirm:('CVS cache directory ''' , nm , ''' does not exist\create ?' withCRs)) ifTrue:[
  5163                             (self confirm:('CVS cache directory ''' , nm , ''' does not exist\create ?' withCRs)) ifTrue:[
  5157                                 fn makeDirectory;
  5164                                 fn makeDirectory;
  5158                                    makeReadableForAll;
  5165                                    makeReadableForAll;
  5159                                    makeWritableForAll;
  5166                                    makeWritableForAll;
  5195     box destroy
  5202     box destroy
  5196 
  5203 
  5197     "Modified: / 09-09-1996 / 22:43:36 / stefan"
  5204     "Modified: / 09-09-1996 / 22:43:36 / stefan"
  5198     "Created: / 17-01-1997 / 17:39:33 / cg"
  5205     "Created: / 17-01-1997 / 17:39:33 / cg"
  5199     "Modified: / 16-04-1998 / 17:18:47 / ca"
  5206     "Modified: / 16-04-1998 / 17:18:47 / ca"
  5200     "Modified: / 09-02-2011 / 20:32:56 / cg"
  5207     "Modified: / 17-02-2017 / 08:26:27 / cg"
  5201 !
  5208 !
  5202 
  5209 
  5203 stcCompilerSettings
  5210 stcCompilerSettings
  5204     "open an extra dialog on stc-compiler related settings.
  5211     "open an extra dialog on stc-compiler related settings.
  5205      Obsoleted by STCCompilerSettingsApp"
  5212      Obsoleted by STCCompilerSettingsApp"
  6200                             cvsRoot := (bindings at:#perModuleRoot) value.
  6207                             cvsRoot := (bindings at:#perModuleRoot) value.
  6201                             (listOfModules includes:module) ifFalse:[
  6208                             (listOfModules includes:module) ifFalse:[
  6202                                 listOfModules add:module.
  6209                                 listOfModules add:module.
  6203                                 listOfModules sort.
  6210                                 listOfModules sort.
  6204                             ].
  6211                             ].
  6205                             cvsRoot size > 0 ifTrue:[
  6212                             cvsRoot notEmptyOrNil ifTrue:[
  6206                                 rootsPerModule at:module put:cvsRoot.
  6213                                 rootsPerModule at:module put:cvsRoot.
  6207                             ].
  6214                             ].
  6208                           ].
  6215                           ].
  6209     bindings at:#removePerModuleRoot put:[
  6216     bindings at:#removePerModuleRoot put:[
  6210                             |module|
  6217                             |module|
  6234 
  6241 
  6235     "
  6242     "
  6236      self cvsConfigurationDialog
  6243      self cvsConfigurationDialog
  6237     "
  6244     "
  6238 
  6245 
  6239     "Modified: / 21-09-2006 / 16:54:20 / cg"
  6246     "Modified: / 17-02-2017 / 08:26:06 / cg"
  6240 !
  6247 !
  6241 
  6248 
  6242 fontBoxForEncoding:encodingMatch
  6249 fontBoxForEncoding:encodingMatch
  6243     "open a fontBox, showing fonts which match some encoding
  6250     "open a fontBox, showing fonts which match some encoding
  6244      (used when changing to japanese ...)"
  6251      (used when changing to japanese ...)"
  8136             ].
  8143             ].
  8137         ].
  8144         ].
  8138     ].
  8145     ].
  8139     comment notEmptyOrNil ifTrue:[
  8146     comment notEmptyOrNil ifTrue:[
  8140         comment := comment asStringCollection.
  8147         comment := comment asStringCollection.
  8141         [ comment size > 0 and:[comment first isEmpty]] whileTrue:[ comment removeFirst ].
  8148         [ comment notEmptyOrNil and:[comment first isEmpty]] whileTrue:[ comment removeFirst ].
  8142         (comment conform:[:line | line isEmpty or:[line startsWith:'    ']]) ifTrue:[
  8149         (comment conform:[:line | line isEmpty or:[line startsWith:'    ']]) ifTrue:[
  8143             comment := comment collect:[:line | 
  8150             comment := comment collect:[:line | 
  8144                         (line startsWith:'    ') ifTrue:[
  8151                         (line startsWith:'    ') ifTrue:[
  8145                             line copyFrom:5
  8152                             line copyFrom:5
  8146                         ] ifFalse:[
  8153                         ] ifFalse:[
  8153         (projectDir notNil and:[ (readMeFile := projectDir / 'README') exists]) ifTrue:[
  8160         (projectDir notNil and:[ (readMeFile := projectDir / 'README') exists]) ifTrue:[
  8154             info := info , '\\The README file there says:\\' withCRs , (readMeFile contents asString).
  8161             info := info , '\\The README file there says:\\' withCRs , (readMeFile contents asString).
  8155         ].            
  8162         ].            
  8156     ].
  8163     ].
  8157     infoTextHolder value:info.
  8164     infoTextHolder value:info.
       
  8165 
       
  8166     "Modified: / 17-02-2017 / 08:26:32 / cg"
  8158 !
  8167 !
  8159 
  8168 
  8160 updateAction:whatChanged parameter:parameter
  8169 updateAction:whatChanged parameter:parameter
  8161     |item isLoaded packageID|
  8170     |item isLoaded packageID|
  8162 
  8171