From b85263c3778d3287f6f8477136803385762c53e1 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Fri, 13 Jun 2014 15:24:24 +0000 Subject: [PATCH] disabled freenect camera when not available git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1362 f169173b-cf89-36c8-b27e-44dbe73f0c83 --- guilib/src/MainWindow.cpp | 3 +++ guilib/src/PreferencesDialog.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index ac769929..832fe335 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -284,6 +284,8 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) : selectSourceImageGrp->addAction(_ui->actionVideo); selectSourceImageGrp->addAction(_ui->actionOpenNI); selectSourceImageGrp->addAction(_ui->actionFreenect); + selectSourceImageGrp->addAction(_ui->actionOpenNI_CV); + selectSourceImageGrp->addAction(_ui->actionOpenNI_CV_ASUS); this->updateSelectSourceImageMenu(_preferencesDialog->getSourceImageType()); connect(_ui->actionImageFiles, SIGNAL(triggered()), this, SLOT(selectImages())); connect(_ui->actionVideo, SIGNAL(triggered()), this, SLOT(selectVideo())); @@ -293,6 +295,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) : this->updateSelectSourceRGBDMenu(_preferencesDialog->isSourceOpenniUsed(), _preferencesDialog->getSourceRGBD()); connect(_ui->actionOpenNI, SIGNAL(triggered()), this, SLOT(selectOpenni())); connect(_ui->actionFreenect, SIGNAL(triggered()), this, SLOT(selectFreenect())); + _ui->actionFreenect->setEnabled(CameraFreenect::available()); connect(_ui->actionOpenNI_CV, SIGNAL(triggered()), this, SLOT(selectOpenniCv())); connect(_ui->actionOpenNI_CV_ASUS, SIGNAL(triggered()), this, SLOT(selectOpenniCvAsus())); diff --git a/guilib/src/PreferencesDialog.cpp b/guilib/src/PreferencesDialog.cpp index 9b621100..c823c994 100644 --- a/guilib/src/PreferencesDialog.cpp +++ b/guilib/src/PreferencesDialog.cpp @@ -235,6 +235,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) : connect(_ui->groupBox_sourceOpenni, SIGNAL(toggled(bool)), this, SLOT(makeObsoleteSourcePanel())); connect(_ui->radioButton_opennipcl, SIGNAL(toggled(bool)), this, SLOT(makeObsoleteSourcePanel())); connect(_ui->radioButton_freenect, SIGNAL(toggled(bool)), this, SLOT(makeObsoleteSourcePanel())); + _ui->radioButton_freenect->setEnabled(CameraFreenect::available()); connect(_ui->radioButton_opennicv, SIGNAL(toggled(bool)), this, SLOT(makeObsoleteSourcePanel())); connect(_ui->radioButton_opennicvasus, SIGNAL(toggled(bool)), this, SLOT(makeObsoleteSourcePanel())); connect(_ui->lineEdit_openniDevice, SIGNAL(textChanged(const QString &)), this, SLOT(makeObsoleteSourcePanel()));