void StatusBar::setupConnections() { SysStatus & sys_status = SysStatus::instance(); connect(&sys_status, SIGNAL(batterySignal(int, int)), this, SLOT(onBatterySignal(int, int))); connect(&sys_status, SIGNAL(aboutToSuspend()), this, SLOT(onAboutToSuspend())); connect(&sys_status, SIGNAL(lowBatterySignal()), this, SLOT(onLowBatterySignal())); connect(&sys_status, SIGNAL(wakeup()), this, SLOT(onWakeup())); connect(&sys_status, SIGNAL(aboutToShutdown()), this, SLOT(onAboutToShutdown())); connect(&sys_status, SIGNAL(sdioChangedSignal(bool)), this, SLOT(onWifiDeviceChanged(bool))); connect(&sys_status, SIGNAL(stylusChanged(bool)), this, SLOT(onStylusChanged(bool))); connect(&sys_status, SIGNAL(connectToPC(bool)), this, SLOT(onConnectToPC(bool))); connect(&sys_status, SIGNAL(volumeUpPressed()), this, SLOT(onVolumeButtonsPressed())); connect(&sys_status, SIGNAL(volumeDownPressed()), this, SLOT(onVolumeButtonsPressed())); connect(&sys_status, SIGNAL(report3GNetwork(const int, const int, const int)), this, SLOT(onReport3GNetwork(const int, const int, const int))); connect(&sys_status, SIGNAL(pppConnectionChanged(const QString &, int)), this, SLOT(onPppConnectionChanged(const QString &, int))); // connect configure keyboard signal connect(&sys_status, SIGNAL(configKeyboard()), this, SLOT(onConfigKeyboard())); }
bool DjvuApplication::open( const QString &path_name ) { main_window_.attachModel(&model_); main_window_.show(); DjVuView *view = down_cast<DjVuView*>(main_window_.activateView(DJVU_VIEW)); // connect the signals with view connect( view, SIGNAL(rotateScreen()), this, SLOT(onRotateScreen()) ); connect( view, SIGNAL(testSuspend()), this, SLOT(onSuspend()) ); connect( view, SIGNAL(testWakeUp()), this, SLOT(onWakeUp()) ); // connect the signals with sys_state_ SysStatus & sys_status = SysStatus::instance(); connect( &sys_status, SIGNAL( mountTreeSignal( bool, const QString & ) ), this, SLOT( onMountTreeSignal( bool, const QString &) ) ); connect( &sys_status, SIGNAL( sdCardChangedSignal( bool ) ), this, SLOT( onSDChangedSignal( bool ) ) ); connect( &sys_status, SIGNAL( aboutToShutdown() ), this, SLOT( onAboutToShutDown() ) ); connect( &sys_status, SIGNAL( wakeup() ), this, SLOT( onWakeUp() ) ); #ifdef Q_WS_QWS connect(qApp->desktop(), SIGNAL(resized(int)), this, SLOT(onScreenSizeChanged(int)), Qt::QueuedConnection); #endif view->attachModel(&model_); bool ret = model_.open(path_name); if ( !ret ) { if ( sys::SysStatus::instance().isSystemBusy() ) { // if loading fails, set busy to be false sys::SysStatus::instance().setSystemBusy( false ); } view->deattachModel(); } return ret; }