Example #1
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    SimonModel simon;
    //GameEngine engine(w,simon);

    w.show();

    QObject::connect(&w, SIGNAL(RedButtonPushed()), &simon, SLOT(RedPushed()));
    QObject::connect(&w, SIGNAL(BlueButtonPushed()), &simon, SLOT(BluePushed()));
    QObject::connect(&w, SIGNAL(StartButtonPushed()), &simon, SLOT(StartPushed()));
    QObject::connect(&simon, SIGNAL(Highlight(bool, int)), &w, SLOT(ButtonToHighlight(bool, int)));
    QObject::connect(&simon, SIGNAL(DisableStart()), &w, SLOT(disableStart()));
    QObject::connect(&simon, SIGNAL(playersTurn()), &w, SLOT(playersTurn()));
    QObject::connect(&simon, SIGNAL(computersTurn()), &w, SLOT(computersTurn()));
    QObject::connect(&simon, SIGNAL(HighlightDone()), &w, SLOT(HighlightDone()));
    QObject::connect(&simon,SIGNAL(updateStartTime(int)), &w, SLOT(updateStartTime(int)));
    QObject::connect(&simon, SIGNAL(updateProgress(int, int)), &w, SLOT(updateProgress(int, int)));
    QObject::connect(&simon, SIGNAL(wrongMove()), &w, SLOT(wrongMove()));
    QObject::connect(&w, SIGNAL(restart2()), &simon, SLOT(restartSlot()));
    QObject::connect(&simon, SIGNAL(restartSig()), &w, SLOT(restartForModel()));
    QObject::connect(&simon, SIGNAL(updateTextSig(QString)), &w, SLOT(updateText(QString)));
    return a.exec();
}
Example #2
0
OptionsView::OptionsView(QObject *parent) : QWidgetAction(parent)
{
    // Au départ le système est à l'arrêt
    _bEnPause = true;

    initComps();
    etatInitialComps();

    // Signaux
    QObject::connect(_startAction, SIGNAL(triggered()), this, SLOT(startPauseSlot()));
    QObject::connect(_restartAction, SIGNAL(triggered()), this, SLOT(restartSlot()));
    QObject::connect(_exercicesAction, SIGNAL(triggered()), this, SLOT(exercicesSlot()));
    QObject::connect(_astucesAction, SIGNAL(triggered()), this, SLOT(astuceSlot()));
    QObject::connect(_homeAction, SIGNAL(triggered()), this, SLOT(homeSlot()));

}
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);
}