示例#1
0
Boolean launchServer (OSType serverid) {
	
	/*
	if the application whose creator id is serverid is running, return true.
	
	if not, we look for the application and try to launch it. we wait until it's 
	actually running and ready to receive Apple Events.
	*/
	
	FSSpec fs;
	
	if (appRunning (serverid))
		return (true);
		
	if (!findApp (serverid, &fs))
		return (false);
		
	if (!launchApp (&fs))
		return (false);
		
	while (!appRunning (serverid)) {
		
		EventRecord ev;
		
		EventAvail (everyEvent, &ev);
		} /*while*/
		
	return (true);
	} /*launchServer*/
示例#2
0
void SetApp::mouseReleaseEvent ( QMouseEvent * event )
{
    qDebug() <<"mr" ;

    //进入应用程序管理状态后,再次点击鼠标会崩溃
    //apptimer的释放问题
    if(appTimer != NULL && appTimer->isActive())
    {
        appTimer->stop();
        delete appTimer;
        appTimer = NULL;
    }

    if(appManagerStatus == true && readyRun == true)
    {

        qDebug() << "delete " << appName << "?";

        uninstallAppMessageBox();

    }
    else
    {
        if(readyRun == true)
        {


            qDebug() << "start up "<< appName;
            if (appStatus == 1)
            {
                qDebug() << "app is running!";
            }else{
                appProcess = new QProcess();
                appProcess->start(appFullPath);
                appProcess->setWorkingDirectory(appWorkingDirectory);
                connect(appProcess,SIGNAL(started()),this,SLOT(appRunning()));
                connect(appProcess,SIGNAL(finished(int)),this,SLOT(appExiting()));
                connect(appProcess,SIGNAL(destroyed()),this,SLOT(appClear()));
                connect(appProcess,SIGNAL(error(QProcess::ProcessError)),this,SLOT(appError()));
                qDebug() << appProcess;

            }
        }
    }