示例#1
0
void gxRuntime::onDebugError( const char *t ){
	if( !debugger ) return;
	asyncEnd();
	if( !suspended ){
		forceSuspend();
	}
}
示例#2
0
void gxRuntime::onDebugInfo( const char *t ){
	if( !debugger ) return;
	Debugger *d=debugger;
	asyncEnd();
	if( !suspended ){
		forceSuspend();
	}
	d->debugMsg( t,false );
}
示例#3
0
/*!
  Constructs a QtopiaPowerManager instance.
  */
QtopiaPowerManager::QtopiaPowerManager() : m_powerConstraint(QtopiaApplication::Enable), m_dimLightEnabled(true), m_lightOffEnabled(true) {
    g_qtopiaPowerManager = this;
    if (!m_vso)
        m_vso = new QValueSpaceObject("/Hardware");
    setBacklight(-3); //forced on

    // Create the screen saver and the associated service.
#ifdef Q_WS_QWS
    QWSServer::setScreenSaver(this);
#endif
    (void)new QtopiaPowerManagerService( this, this );

    QtopiaPowerConstraintManager *tsmMonitor = new QtopiaPowerConstraintManager(this);
    connect( tsmMonitor, SIGNAL(forceSuspend()), this, SLOT(_forceSuspend()) );

    QObject::connect(&powerstatus, SIGNAL(wallStatusChanged(QPowerStatus::WallStatus)), this, SLOT(powerStatusChanged()));
    QObject::connect(&powerstatus, SIGNAL(batteryStatusChanged(QPowerStatus::BatteryStatus)), this, SLOT(powerStatusChanged()));
    QObject::connect(&powerstatus, SIGNAL(batteryChargingChanged(bool)), this, SLOT(powerStatusChanged()));
}
示例#4
0
/*!
  \reimp
  */
void QtopiaPowerConstraintManager::timerEvent(QTimerEvent *t)
{
#ifdef QTOPIA_MAX_SCREEN_DISABLE_TIME
    if ( timerId && (t->timerId() == timerId) ) {

        /*  Clean up    */
        killTimer(timerId);
        timerId = 0;
        currentMode = QtopiaApplication::Enable;
        if ( g_qtopiaPowerManager ) {
            g_qtopiaPowerManager->setConstraint
                ( (QtopiaApplication::PowerConstraint) currentMode );
        }

        // signal starts on a merry-go-round, which ends up in Desktop::togglePower()
        emit forceSuspend();
        // if we have apm we are asleep at this point, next line will be executed when we
        // awake from suspend.
        if ( QFile::exists( "/proc/apm" ) ) {
            QTime t;
            t = t.addSecs( timerValue() );
            QString str = tr("<qt>The running applications disabled power saving "
                             "for more than the allowed time (%1)."
                             "<br>The system was forced to suspend</qt>", "%1 = time span").arg( t.toString() );
            QMessageBox::information(0, tr("Forced suspend"), str);
        }

        // Reset all requests.
        for (int i = 0; i < 3; i++)
            sStatus[i].clear();

        updateAll();
    }
#else
    Q_UNUSED(t);
#endif
}
示例#5
0
bool gxRuntime::idle(){
	for(;;){
		MSG msg;
		if( suspended && run_flag ){
			GetMessage( &msg,0,0,0 );
		}else{
			if( !PeekMessage( &msg,0,0,0,PM_REMOVE ) ) return run_flag;
		}
		switch( msg.message ){
		case WM_STOP:
			if( !suspended ) forceSuspend();
			break;
		case WM_RUN:
			if( suspended ) forceResume();
			break;
		case WM_END:
			bbAttachDebugger( (debugger=0) );
			run_flag=false;
			break;
		default:
			DispatchMessage( &msg );
		}
	}
}
示例#6
0
/*!
  \internal
*/
void QtopiaPowerManager::_forceSuspend()
{
    qLog(PowerManagement) << "QtopiaPowerManager::forceSuspend()";
    forceSuspend();
}
示例#7
0
void gxRuntime::onDebugStop(){
	if( !suspended ) forceSuspend();
}