[72772] users/ryandesign/PCLauncher/PCLauncher.applescript

ryandesign at macports.org ryandesign at macports.org
Tue Oct 26 01:46:15 PDT 2010


Revision: 72772
          http://trac.macports.org/changeset/72772
Author:   ryandesign at macports.org
Date:     2010-10-26 01:46:12 -0700 (Tue, 26 Oct 2010)
Log Message:
-----------
Wait a few seconds after launching PlasmaClient before closing the launcher

Modified Paths:
--------------
    users/ryandesign/PCLauncher/PCLauncher.applescript

Modified: users/ryandesign/PCLauncher/PCLauncher.applescript
===================================================================
--- users/ryandesign/PCLauncher/PCLauncher.applescript	2010-10-26 08:07:39 UTC (rev 72771)
+++ users/ryandesign/PCLauncher/PCLauncher.applescript	2010-10-26 08:46:12 UTC (rev 72772)
@@ -28,6 +28,7 @@
 property kTaskWaitForAuthentication : 1
 property kTaskWaitForSecureFilesToDownload : 2
 property kTaskWaitForSecureFilesToExtract : 3
+property kTaskWaitForPlasmaClientToLaunch : 4
 
 -- Current task
 property gTask : kTaskIdle
@@ -36,6 +37,7 @@
 property gStatusFile : ""
 property gSecureFilesDirectory : ""
 property gProgressMax : 0
+property gStartTime : 0
 property gPid : 0
 
 on will finish launching theObject
@@ -78,6 +80,8 @@
 		waitForSecureFilesToDownload()
 	else if gTask is kTaskWaitForSecureFilesToExtract then
 		waitForSecureFilesToExtract()
+	else if gTask is kTaskWaitForPlasmaClientToLaunch then
+		waitForPlasmaClientToLaunch()
 	end if
 	return 1
 end idle
@@ -254,7 +258,7 @@
 end moveSecureFilesIntoDataDir
 
 on startGame()
-	set gTask to kTaskIdle
+	showProgressPanel("Launching PlasmaClient…")
 	
 	tell window "Login Window"
 		set theUsername to contents of text field "Username Field"
@@ -268,9 +272,19 @@
 		deleteFile(item i of theLogFiles)
 	end repeat
 	
-	quit
+	set gStartTime to (current date)
+	set gTask to kTaskWaitForPlasmaClientToLaunch
 end startGame
 
+on waitForPlasmaClientToLaunch()
+	set currentTime to (current date)
+	set elapsedSeconds to (currentTime - gStartTime)
+	if elapsedSeconds < 5 then return
+	
+	hideProgressPanel()
+	quit
+end waitForPlasmaClientToLaunch
+
 on makeTempFile()
 	return (do shell script "mktemp /tmp/PCLauncher.XXXXXXXX")
 end makeTempFile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101026/0d96d110/attachment.html>


More information about the macports-changes mailing list