From c6a525c1124736f7f00d756ef78fd0b7d666bfdd Mon Sep 17 00:00:00 2001 From: matlabbe Date: Mon, 23 Jun 2014 00:34:52 +0000 Subject: [PATCH] Added question about using odometry in database when selecting source from database git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1434 f169173b-cf89-36c8-b27e-44dbe73f0c83 --- guilib/src/PreferencesDialog.cpp | 37 +++++++++++++++++--------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/guilib/src/PreferencesDialog.cpp b/guilib/src/PreferencesDialog.cpp index 6ee7701c..de810fcc 100644 --- a/guilib/src/PreferencesDialog.cpp +++ b/guilib/src/PreferencesDialog.cpp @@ -1623,31 +1623,34 @@ void PreferencesDialog::selectSourceDatabase(bool user) { ULOGGER_DEBUG(""); - if(user) - { - // from user - _ui->groupBox_sourceDatabase->setChecked(true); - } - QString path = QFileDialog::getOpenFileName(this, tr("Select file"), _ui->source_database_lineEdit_path->text(), tr("RTAB-Map database files (*.db)")); QFile file(path); if(!path.isEmpty() && file.exists()) { + int r = QMessageBox::question(this, tr("Odometry in database..."), tr("Use odometry saved in database (if some saved)?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); + + if(user) + { + // from user + _ui->groupBox_sourceDatabase->setChecked(true); + } + + _ui->source_checkBox_ignoreOdometry->setChecked(r != QMessageBox::Yes); _ui->source_database_lineEdit_path->setText(path); _ui->source_spinBox_databaseStartPos->setValue(0); - } - if(user && _obsoletePanels) - { - _ui->groupBox_sourceImage->setChecked(false); - _ui->groupBox_sourceOpenni->setChecked(false); - if(validateForm()) + if(user && _obsoletePanels) { - this->writeSettings(); - } - else - { - this->readSettingsBegin(); + _ui->groupBox_sourceImage->setChecked(false); + _ui->groupBox_sourceOpenni->setChecked(false); + if(validateForm()) + { + this->writeSettings(); + } + else + { + this->readSettingsBegin(); + } } } }