コード例 #1
0
ファイル: MainWindow.cpp プロジェクト: polybox3d/polybox
MainWindow::MainWindow(Qt::WindowFlags window_flags, QWidget *parent) :
    QMainWindow(parent, window_flags),
    ui(new Ui::MainWindow)
{
    _dockLV = NULL;
    _dockCNC = NULL;
    _dockHost = NULL;
    mainwindow = this;
    ui->setupUi(this);
    ui->statusBar->addPermanentWidget( &_connectedLed);
    _statusMessage = new QLabel(this);
    ui->statusBar->addPermanentWidget( _statusMessage );

    _polybox = PolyboxModule::getInstance( this );
    connect(_polybox, SIGNAL(updateHardware()),this,SLOT(updateHardware()));

    this->setAttribute(Qt::WA_DeleteOnClose);
    //_polybox->connectToPrinter();


    _joypadActivated = false;
    _webcam = NULL;
    _dockLV = NULL;

    /**             ATU BUTTON              **/
    _atuON = !Polyplexer::isConnected();
    toggleATU();
    _atu = new ATUButton( 60, 30, _atuON, this );
    _atu->setGeometry( this->width()-_atu->width()-10,
                     ui->menuBar->height()+2,
                     _atu->width(), _atu->height());
    connect ( _atu, SIGNAL(released()), this, SLOT(toggleATU()));

    _atu->setEnabled( _atuON );

    changeStatePage( Start );
    
    setupLanguage();
    setupThemes();
    setupWebcamMenu();
    setupSerialMenu();

    MaintenanceChecker::check();
    _polyfabscan = PolyFabScanWindow::getInstance();
    _polyfabscan->setWindowFlags(Qt::NoDropShadowWindowHint| Qt::Window);
    //_polyfabscan->setAttribute(Qt::WA_DeleteOnClose);
}
コード例 #2
0
ファイル: mainwindow.cpp プロジェクト: TheMohni/Tulospalvelu
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    m_settings(),
    m_databaseOK(false),
    m_tuloksia(0),
    m_kilpailijoita(0),
    m_tuloksiaLabel(new QLabel(this)),
    m_serialStatus(new QLabel(this)),
    m_testEmitReader(0),
    m_serialEmitReader(new SerialEmitReaderWidget()),
    m_pikanappaimetForm(0),
    m_vuokraEmititForm(0),
    m_tulosnayttoForm(0)
{
    ui->setupUi(this);

    connect(m_serialEmitReader, SIGNAL(readEmit(QDateTime,QString,int,int,QList<RastiData>)),
            this, SLOT(handleReadEmit(QDateTime,QString,int,int,QList<RastiData>)));
    connect(m_serialEmitReader, SIGNAL(statusChanged(QString)),
            m_serialStatus, SLOT(setText(QString)));

    connect(ui->menuSarjaportti, SIGNAL(aboutToShow()),
            this, SLOT(setupSerialMenu()));

    connect(ui->menuSarjaportti, SIGNAL(triggered(QAction*)),
            this, SLOT(handleSerialMenu(QAction*)));

    connectDatabase();
    buildDatabase();

    if (!Tietokanta::checkVersion(MAJOR_VERSION)) {
        QString v = Tietokanta::getVersion();

        if (QMessageBox::question(this, _("Tulospalvelu - " VERSION),
                                  _("Tietokanta (%1) ei ole yhteensopiva. Haluatko jatkaa?")
                                  .arg(v),
                              QMessageBox::Yes | QMessageBox::No,
                              QMessageBox::No) != QMessageBox::Yes) {
            return;
        }
    }

    setupTapahtuma();

    setupShortcuts();
}