void KUI_project::playSlot()
{
  qDebug() << "start playing";
  connect( this, SIGNAL( playVideo() ),  cameraVideo, SLOT( play() ) );
  connect( this, SIGNAL( playVideo() ), screenVideo, SLOT( play() ) );
  
  connect( cameraVideo, SIGNAL( finished() ), this, SLOT( stopSlot() ) );
  connect( screenVideo, SIGNAL( finished() ), this, SLOT( stopSlot() ) );
  
  playBar->updateInterface( Playing );
  
  timer = new QTimer();
  
  connect( timer, SIGNAL( timeout() ), playBar, SLOT( timeShift() ) );
  timer->start( 1000 );
     
  emit playVideo();
  
  qDebug() << "Video length: " << cameraVideo->totalTime()/1000;
  playBar->timeSlider->setMaximum( cameraVideo->totalTime() / 1000 );

}
int fullScreenWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGraphicsView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: pauseSlot(); break;
        case 1: resumeSlot(); break;
        case 2: stopSlot(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
Example #3
0
void ServiceManager::ProgramInit(QString chroot, QString IP)
{
    // Set any warden stuff
    wDir = chroot;
    wIP = IP;

    listServices->setColumnHidden(0, true);
    listServices->setColumnHidden(1, true);
    
    pushStart->setEnabled(FALSE);
    pushStop->setEnabled(FALSE);
    pushRestart->setEnabled(FALSE);
    pushEnableStartup->setEnabled(FALSE);
    pushDisableStartup->setEnabled(FALSE);
    
     // Connect the buttons
    connect( pushStart, SIGNAL( clicked() ), this, SLOT( startSlot() ) );
    connect( pushStop, SIGNAL( clicked() ), this, SLOT( stopSlot() ) );
    connect( pushRestart, SIGNAL( clicked() ), this, SLOT( restartSlot() ) );
    connect( pushEnableStartup, SIGNAL( clicked() ), this, SLOT( enableSlot() ) );
    connect( pushDisableStartup, SIGNAL( clicked() ), this, SLOT( disableSlot() ) );
    
    
    // Connect the list box
    connect( listServices, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT( listSelectionChanged() ) );
     
    // Start loading the various service files
    populateList();
    
    // Start checking the status of these services
    currentCheckRunningItem = new QTreeWidgetItemIterator(listServices);
    checkRunning();
    
    // Start checking if services are enabled
    checkEnabled();

    if ( ! wDir.isEmpty() )
      textTopLabel->setText(tr("Managing services for Warden IP:") + " " +  wIP);
}
void KUI_project::setupActions()
{
  
  KAction *action = new KAction(this);
  
  action->setIcon(KIcon("edit-delete"));
  action->setText(i18n("&Aim"));
  collection->addAction("aim", action);
  connect(action, SIGNAL(triggered(bool)), this, SLOT(aimSlot()));
  
  
  action = new KAction(this);
  action->setIcon(KIcon("media-record"));
  action->setText(i18n("&Record"));
  connect(action, SIGNAL(triggered(bool)), this, SLOT(recordSlot()));
  collection->addAction("record", action);
  
  
  action = new KAction(this);
  action->setIcon(KIcon("media-playback-start"));
  action->setText(i18n("&Play"));
  connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(playSlot()));
  collection->addAction("play",action);

  action = new KAction(this);
  action->setIcon(KIcon("media-playback-pause"));
  action->setText(i18n("&Pause"));
  connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(pauseSlot()));
  collection->addAction("pause",action);
    
  action = new KAction(this);
  action->setIcon(KIcon("media-playback-stop"));
  action->setText(i18n("&Stop"));
  connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(stopSlot()));
  collection->addAction("stop",action);
 
  action = new KAction(this);
  action->setIcon(KIcon("media-playback-start"));
  action->setText(i18n("&Play"));
  connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(playAfterPauseSlot()));
  collection->addAction("playAfterPause",action);
  
  action = new KAction(this);
  action->setIcon(KIcon("list-add"));
  action->setText(i18n("&Add"));
  connect(action, SIGNAL(triggered(bool)), this, SLOT(addSlot()));
  collection->addAction("add", action);
  
  action = new KAction(this);
  action->setIcon(KIcon("list-remove"));
  action->setText(i18n("&Remove"));
  connect(action, SIGNAL(triggered(bool)), this, SLOT(removeSlot()));
  collection->addAction("remove", action);
}