//----------------------------------------------------------------------------- //! Reimplemented //----------------------------------------------------------------------------- void tNASVirtualHead::keyPressEvent( QKeyEvent* pEvent ) { // Restart inactivity timer. m_CloseOnUserInactivityTimer->start(); switch( pEvent->key() ) { case Key::Left: if ( pEvent->isAutoRepeat() == false ) { OnBackClicked(); pEvent->accept(); } break; case Key::Right: case Key::Enter: case Key::Rotary: if ( pEvent->isAutoRepeat() == false ) { if ( m_pListWidget->count() > 0 ) { HandleItemActivated( m_pListWidget->currentItem() ); pEvent->accept(); } } break; case Key::Exit: // Close the dialog indicating the user initiated the action. accept(); break; default: tDialog::keyPressEvent( pEvent ); break; } }
HacServer::HacServer(QObject *parent) : QObject(parent) { qDebug() << "HacServer::HacServer"; // init qws server server = QWSServer::instance(); QScreen *screen = QScreen::instance(); server->setMaxWindowRect(QRect(WINDOW_X, WINDOW_Y, WINDOW_W, WINDOW_H)); // init status bar statusBar = new StatusBar; connect(statusBar, SIGNAL(homeClicked()), this, SLOT(OnHomeClicked())); connect(statusBar, SIGNAL(backClicked()), this, SLOT(OnBackClicked())); connect(statusBar, SIGNAL(clockClicked()), this, SLOT(OnClockClicked())); statusBar->setGeometry(STATUSBAR_X, STATUSBAR_Y, STATUSBAR_W, STATUSBAR_H); statusBar->show(); // init auto start applications QProcess *myApp = new QProcess; myApp->setProcessChannelMode(QProcess::ForwardedChannels); myApp->start(APP_HAC01_BIN); myApp->waitForStarted(); }
//----------------------------------------------------------------------------- //! //----------------------------------------------------------------------------- void tNASVirtualHead::CreateActions() { QList<tAction*> skList; if( m_ShowButtons == true ) { // Action to step back in menu. // Default to disabled. It will be enabled at an appropriate time by SetIsRoot(). m_pBackAct = new tAction( tr( "Back", "SonicHub/FUSION-Link virtual head - Navigate Back" ), this ); m_pBackAct->setEnabled( false ); Connect( m_pBackAct, SIGNAL(triggered()), this, SLOT(OnBackClicked()) ); // Action to step back to root menu. // Default to disabled. It will be enabled at an appropriate time by SetIsRoot(). m_pRootAct = new tAction( tr( "Root", "SonicHub/FUSION-Link virtual head - open the root directory of the device" ), this ); m_pRootAct->setEnabled( false ); Connect( m_pRootAct, SIGNAL( triggered() ), this, SLOT( GoBackToRoot() ) ); skList.append( m_pBackAct ); skList.append( m_pRootAct ); } bool hasClose = false; if ( HasTitleCloseButton() == false ) { // Close softkey // close the dialog, use reject from client, accept from user m_pCloseAct = new tAction( tr( "Close", "SonicHub/FUSION-Link virtual head - Close the dialog" ), this ); Connect( m_pCloseAct, SIGNAL(triggered()), this, SLOT(accept()) ); skList.append( m_pCloseAct ); // Close goes to the back hasClose = true; } setSoftKeys( skList, /*lastKeyFixedAtEnd*/hasClose ); }