void ParamCompareDialog::initConnections()
{
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui->loadButton, SIGNAL(clicked()), this, SLOT(loadParameterFile()));
    connect(ui->continueButton, SIGNAL(clicked()), this, SLOT(saveNewParameters()));
    connect(ui->checkAllBox, SIGNAL(clicked()), this, SLOT(checkAll()));
}
Esempio n. 2
0
void ParamCompareDialog::showLoadFileDialog()
{
    ui->compareTableWidget->setRowCount(0);

    QDir parameterDir = QDir(QGC::parameterDirectory());

    if(!parameterDir.exists())
        parameterDir.mkdir(parameterDir.path());

    QFileDialog *fileDialog = new QFileDialog(this,"Load",QGC::parameterDirectory());
    QLOG_DEBUG() << "CREATED:" << fileDialog;
    fileDialog->setFileMode(QFileDialog::ExistingFile);
    fileDialog->setNameFilter("*.param *.txt");
    fileDialog->open(this, SLOT(loadParameterFile()));
    connect(fileDialog,SIGNAL(rejected()),SLOT(dialogRejected()));
}
Esempio n. 3
0
void ParamCompareDialog::loadParameterFile()
{
    QFileDialog *dialog = qobject_cast<QFileDialog*>(sender());
    if (!dialog) {
        return;
    }
    if (dialog->selectedFiles().size() == 0) {
        return;
    }
    QString filename = dialog->selectedFiles().at(0);
    if(filename.length() == 0) {
        return;
    }

    loadParameterFile(filename);
}
void ParamCompareDialog::loadParameterFile()
{
    ui->compareTableWidget->setRowCount(0);

    QDir parameterDir = QDir(QGC::parameterDirectory());

    if(!parameterDir.exists())
        parameterDir.mkdir(parameterDir.path());

    QString filename = QFileDialog::getOpenFileName(this,tr("Open File To Compare"),
                                                    QGC::parameterDirectory(), "*.param");

    if(filename.length() == 0) {
        return;
    }

    loadParameterFile(filename);
}
Esempio n. 5
0
void ParamCompareDialog::loadParameterFile()
{
    ui->compareTableWidget->setRowCount(0);

    QDir parameterDir = QDir(QGC::parameterDirectory());

    if(!parameterDir.exists())
        parameterDir.mkdir(parameterDir.path());

    QString filename = QFileDialog::getOpenFileName(this,tr("Open File To Compare"),
                                                    QGC::parameterDirectory(), "*.param");
    QApplication::processEvents(); // Helps clear dialog from screen

    if(filename.length() == 0) {
        return;
    }
    QApplication::processEvents(); // Helps clear dialog from screen

    loadParameterFile(filename);
}
Esempio n. 6
0
void ParamCompareDialog::loadParameterWithFile()
{
    ui->loadButton->hide();
    loadParameterFile(m_fileToCompare);
}