AbstractLauncherApplication.st
changeset 3664 77fb767b5368
parent 3644 7fcc80a16f12
child 3690 828698baf5ac
equal deleted inserted replaced
3663:5163f3c2d560 3664:77fb767b5368
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person. No title to or ownership of the software is
     9  other person. No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
       
    13 
       
    14 'From Smalltalk/X, Version:4.1.4 on 20-Mai-2002 at 15:13:15'                    !
    13 
    15 
    14 "{ Package: 'stx:libtool' }"
    16 "{ Package: 'stx:libtool' }"
    15 
    17 
    16 ToolApplicationModel subclass:#AbstractLauncherApplication
    18 ToolApplicationModel subclass:#AbstractLauncherApplication
    17 	instanceVariableNames:'transcript'
    19 	instanceVariableNames:'transcript'
   860 "/        and:[Screen current isTrueGL not])
   862 "/        and:[Screen current isTrueGL not])
   861 "/        ifTrue:[
   863 "/        ifTrue:[
   862 "/            remoteDisplayClass := GLXWorkstation.
   864 "/            remoteDisplayClass := GLXWorkstation.
   863 "/        ].
   865 "/        ].
   864 
   866 
   865         remoteDisplay := remoteDisplayClass newDispatchingFor:host.
   867         [
   866         remoteDisplay isNil ifTrue:[
   868             remoteDisplay := remoteDisplayClass newDispatchingFor:host.
       
   869         ] on:Screen deviceOpenErrorSignal do:[:ex|
   867             self warn:'Could not connect to display: ''' , host , '''.'.
   870             self warn:'Could not connect to display: ''' , host , '''.'.
   868             ^ self
   871             ^ self
   869         ].
   872         ].
   870         aSetupBlock value:remoteDisplay.
   873         aSetupBlock value:remoteDisplay.
   871         Screen currentScreenQuerySignal 
   874         Screen currentScreenQuerySignal 
  1306 !AbstractLauncherApplication methodsFor:'user actions - windows'!
  1309 !AbstractLauncherApplication methodsFor:'user actions - windows'!
  1307 
  1310 
  1308 askForAnotherDisplay
  1311 askForAnotherDisplay
  1309     "ask for some other display"
  1312     "ask for some other display"
  1310 
  1313 
  1311     |host anotherDisplay|
  1314     |displayName|
  1312 
  1315 
  1313     host := Dialog request:'Display:' initialAnswer:(Screen default displayName).
  1316     displayName := Dialog request:'Display:' initialAnswer:(Screen default displayName).
  1314     host size == 0 ifTrue:[^ nil].
  1317     displayName size == 0 ifTrue:[^ nil].
  1315 
  1318 
  1316     anotherDisplay := XWorkstation newDispatchingFor:host.
  1319     ^ XWorkstation newDispatchingFor:displayName.
  1317     anotherDisplay isNil ifTrue:[
       
  1318         self warn:'Could not connect to remote display'.
       
  1319         ^ nil
       
  1320     ].
       
  1321 
       
  1322     ^ anotherDisplay
       
  1323 !
  1320 !
  1324 
  1321 
  1325 deIconifyAllWindows
  1322 deIconifyAllWindows
  1326     |setOfViews currentScreen|
  1323     |setOfViews currentScreen|
  1327 
  1324 
  1456 migrateAllWindows
  1453 migrateAllWindows
  1457     "migrate all views to some other display"
  1454     "migrate all views to some other display"
  1458 
  1455 
  1459     |anotherDisplay toMigrate|
  1456     |anotherDisplay toMigrate|
  1460 
  1457 
  1461     anotherDisplay := self askForAnotherDisplay.
  1458     [
  1462     anotherDisplay isNil ifTrue:[
  1459         anotherDisplay := self askForAnotherDisplay.
  1463         ^ self
  1460         anotherDisplay isNil ifTrue:[
       
  1461             ^ self.
       
  1462         ].
       
  1463     ] on:Screen deviceOpenErrorSignal do:[:ex|
       
  1464         ^ self warn:'cannot open display: ', ex parameter.
  1464     ].
  1465     ].
  1465 
  1466 
  1466     toMigrate := WindowGroup allInstances 
  1467     toMigrate := WindowGroup allInstances 
  1467         select:[:each | each device == Screen current
  1468         select:[:each | each graphicsDevice == Screen current
  1468                         and:[each topViews size > 0
  1469                         and:[each topViews size > 0
  1469                         and:[each isModal not]]
  1470                         and:[each isModal not]]
  1470                ].
  1471                ].
  1471     toMigrate do:[:eachGroup |
  1472     toMigrate do:[:eachGroup |
  1472         eachGroup migrateTo:anotherDisplay
  1473         eachGroup migrateTo:anotherDisplay
  1492     aWindow isTopView ifFalse:[
  1493     aWindow isTopView ifFalse:[
  1493         self information:'Cannto migrate this view'.
  1494         self information:'Cannto migrate this view'.
  1494         ^ self
  1495         ^ self
  1495     ].
  1496     ].
  1496 
  1497 
  1497     anotherDisplay := self askForAnotherDisplay.
  1498     [
  1498     anotherDisplay isNil ifTrue:[
  1499         anotherDisplay := self askForAnotherDisplay.
  1499         ^ self
  1500         anotherDisplay isNil ifTrue:[
       
  1501             ^ self.
       
  1502         ].
       
  1503     ] on:Screen deviceOpenErrorSignal do:[:ex|
       
  1504         ^ self warn:'cannot open display: ', ex parameter.
  1500     ].
  1505     ].
  1501 
  1506 
  1502     wg := aWindow windowGroup.
  1507     wg := aWindow windowGroup.
  1503     wg migrateTo:anotherDisplay.
  1508     wg migrateTo:anotherDisplay.
  1504 
  1509 
  6432 ! !
  6437 ! !
  6433 
  6438 
  6434 !AbstractLauncherApplication class methodsFor:'documentation'!
  6439 !AbstractLauncherApplication class methodsFor:'documentation'!
  6435 
  6440 
  6436 version
  6441 version
  6437     ^ '$Header: /cvs/stx/stx/libtool/AbstractLauncherApplication.st,v 1.195 2002-05-03 18:17:30 cg Exp $'
  6442     ^ '$Header: /cvs/stx/stx/libtool/AbstractLauncherApplication.st,v 1.196 2002-05-21 08:12:34 stefan Exp $'
  6438 ! !
  6443 ! !