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())); }
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())); }
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); }
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); }
void ParamCompareDialog::loadParameterWithFile() { ui->loadButton->hide(); loadParameterFile(m_fileToCompare); }