Exemple #1
0
MainWindow::MainWindow(Controller *c) :
    QMainWindow(0),
    ui(new Ui::MainWindow)
{
    controller = c;

    ui->setupUi(this);

    // Controller -> Main window
    connect(controller, &Controller::signalDataReceived,
            this, &MainWindow::processResponse);
    connect(controller, &Controller::signalStatusChange,
            this, &MainWindow::processStatus);
    connect(controller, &Controller::signalDisplayThermalImage,
            this, &MainWindow::processThermalImage);

    SetupDialog dlg;
    if (dlg.exec() == QDialog::Accepted) {
        controller->connectPort(dlg.getSelectedSerialPort());
        ui->statusBar->showMessage("Status: Connecting...");
    } else {
        exit(0);
    }

    ui->thermalImage->setStyleSheet("QLabel { background-color : black; }");
    ui->thermalImage->setMouseTracking(true);
    ui->thermalImage->installEventFilter(this);

    ui->thermalScale->setPixmap(QPixmap::fromImage(getScale()).scaled(ui->thermalScale->size(),
                                                                 Qt::KeepAspectRatio,
                                                                 Qt::FastTransformation));
}
Exemple #2
0
void Game::start(){
	SetupDialog setup;
	if(setup.exec()) {
		start(setup.hostAddress(),8200);
	}

}
Exemple #3
0
void MainWidget::MainWidgetSetup()
{
    SetupDialog *setup = new SetupDialog(this);
    setup->show();
    connect(setup,SIGNAL(TimeToRefresh(int)),this,SLOT(MainWidgetSetRefreshTime(int)));
    connect(setup,SIGNAL(SliderToRefresh(int)),this,SLOT(SetOpacity(int)));
    connect(setup,SIGNAL(DefaultPosition()),this,SLOT(SetDefaultPosition()));
}
Exemple #4
0
int main(int argc, char **argv)
{
	QApplication app(argc, argv);

	SetupDialog win;
	win.show();

	return app.exec();
}
Exemple #5
0
void GeneralSecurity::apply(ICQUser*)
{
    pClient->HideIp = chkHiddenIP->isChecked();
    pClient->BypassAuth = chkBypassAuth->isChecked();
    pClient->RejectMessage = chkRejectMsg->isChecked();
    pClient->RejectURL = chkRejectURL->isChecked();
    pClient->RejectWeb = chkRejectWeb->isChecked();
    pClient->RejectEmail = chkRejectEmail->isChecked();
    pClient->RejectOther = chkRejectOther->isChecked();
    pClient->setRejectFilter(edtFilter->text().local8Bit());
    edtFilter->setText(QString::fromLocal8Bit(pClient->RejectFilter.c_str()));
    if (grpDirect->selected())
        pClient->DirectMode = grpDirect->id(grpDirect->selected());
    if (pClient->isLogged())
        pClient->setStatus(pClient->owner->uStatus);
    pClient->setSecurityInfo(chkAuth->isChecked(), chkWeb->isChecked());
    QString err;
    QWidget *errWidget = NULL;
    if (edtCurrent->text().isEmpty()){
        if (!edtPasswd1->text().isEmpty() || !edtPasswd2->text().isEmpty() ||
                (chkSave->isChecked() != pSplash->SavePassword) ||
                (chkNoShow->isChecked() != pSplash->NoShowLogin)){
            err = i18n("Input current password");
            errWidget = edtCurrent;
        }
    }else if (edtPasswd1->text() != edtPasswd2->text()){
        err = i18n("Confirm password does not match");
        errWidget = edtPasswd2;
    }else{
        string s = ICQClient::cryptPassword(edtCurrent->text().local8Bit());
        if (strcmp(s.c_str(), pClient->EncryptedPassword.c_str())){
            err = i18n("Invalid password");
            errWidget = edtCurrent;
        }
    }
    if (!err.isEmpty()){
        tabWnd->setCurrentPage(3);
        SetupDialog *setup = static_cast<SetupDialog*>(topLevelWidget());
        setup->raiseWidget(SETUP_GENERAL_SEC);
        setup->applyOk = false;
        BalloonMsg::message(err, errWidget, true);
        return;
    }
    if (!edtPasswd1->text().isEmpty())
        pClient->setPassword(edtPasswd1->text().local8Bit());
    pSplash->SavePassword = chkSave->isChecked();
    pSplash->NoShowLogin = chkNoShow->isChecked();
    pSplash->save();
}
int CoreApplication::initialize()
{
    parseArgs();

    QSettings settings;
    if(!settings.value("application/wizardDone", false).toBool())
    {
        // Show the first time setup dialog
        SetupDialog wizard;
        connect(&wizard, SIGNAL(registerMachine(QString,QString,QString,QString,QString,QString))
                , &_taskManager, SLOT(registerMachine(QString,QString,QString,QString,QString,QString)));
        connect(&_taskManager, SIGNAL(registerMachineStatus(TaskStatus,QString)) , &wizard
                ,SLOT(registerMachineStatus(TaskStatus, QString)));
        connect(&_taskManager, SIGNAL(idle(bool)), &wizard, SLOT(updateLoadingAnimation(bool)), Qt::QueuedConnection);

        if(QDialog::Rejected == wizard.exec())
        {
            quit(); // if we're running in the loop
            return FAILURE; // if called from main
        }
    }
void MainWindow::on_actionNew_triggered()
{
    SetupDialog dialog;
    dialog.setModal(true);
    if(dialog.exec() != dialog.Accepted)
        return;
    int port = dialog.getPort();
    int xSize = dialog.xSize();
    int ySize = dialog.ySize();
    Server *tmpState = new Server(port, xSize, ySize);

    line = new Line(tmpState);
    rect = new Rect(tmpState);
    freeHand = new FreeHand(tmpState);
    text = new Text(tmpState);
    ellips = new Ellips(tmpState);
    fill = new Fill(tmpState);
    erasor = new Eraser(tmpState);

    ui->canvas->setActiveState(tmpState);
    ui->canvas->setActiveTool(fill);
    text->setState(tmpState);
    delete state;
    state = tmpState;
}
MainWindow::MainWindow(QWidget * parent):
    QMainWindow(parent), ui(new Ui::MainWindow)
{
	ui->setupUi(this);

    SetupDialog dialog;
    dialog.setModal(true);
    if(dialog.exec() != dialog.Accepted)
        exit(0);
    int port = dialog.getPort();
    if(dialog.isServer() && dialog.newFile()) {
        QString fileName = QFileDialog::getOpenFileName(this,
                                                            "Save Image",                                 // Caption
                                                            "",                                           // Default selection
                                                             "Images (*.png *.jpg);;XML files (*.xml);;All files (*)"); // Filter
            QImage image;
            image.load(fileName);
            state = new Server(port, image.width(), image.height());
            state->draw(&image);
    } else if(dialog.isServer()) {
        int xSize = dialog.xSize();
        int ySize = dialog.ySize();
        state = new Server(port, xSize, ySize);
    } else {
        QHostAddress host = QHostAddress(dialog.hostName());
        cout << "We're a client with the host address: ";
        cout << dialog.hostName().toStdString() << endl;
        state = new Client(host, port);
    }

    ui->statusBar->showMessage(state->getStatus());
    line = new Line(state);
    rect = new Rect(state);
    freeHand = new FreeHand(state);
    text = new Text(state);
    ellips = new Ellips(state);
    fill = new Fill(state);
    erasor = new Eraser(state);
    paste = new Paste(state);

    ui->canvas->setActiveState(state);
    ui->canvas->setActiveTool(freeHand);
    text->setState(state);

    connect(ui->colorPanel, SIGNAL(colorInPanelChanged(QColor)), this, SLOT(colorChanged(QColor)));
//    connect(ui->canvas, SIGNAL(mouseMovedTo(QString)), ui->statusBar, SLOT(showMessage(QString)));
    connect(state, SIGNAL(statusChanged()), this, SLOT(updateStatus()));
    ui->canvas->setMinimumSize(QSize(state->getImage()->width(), state->getImage()->height()));
}