From 96681b8029919776f06a99f7bf9827257e036436 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Thu, 9 Jun 2011 12:51:13 +0000 Subject: [PATCH] Added a init() method in PreferencesDialog Fixed virtual method declarations in PreferencesDialogROS git-svn-id: http://rtabmap.googlecode.com/svn/branches/0.3/rtabmap@88 f169173b-cf89-36c8-b27e-44dbe73f0c83 --- guilib/include/rtabmap/gui/PreferencesDialog.h | 2 ++ guilib/src/MainWindow.cpp | 1 + guilib/src/PreferencesDialog.cpp | 16 +++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/guilib/include/rtabmap/gui/PreferencesDialog.h b/guilib/include/rtabmap/gui/PreferencesDialog.h index fdc09d3b..22dfd8e9 100644 --- a/guilib/include/rtabmap/gui/PreferencesDialog.h +++ b/guilib/include/rtabmap/gui/PreferencesDialog.h @@ -74,6 +74,8 @@ public: PreferencesDialog(QWidget * parent = 0); virtual ~PreferencesDialog(); + void init(); + void saveWindowGeometry(const QString & windowName, const QWidget * window); void loadWindowGeometry(const QString & windowName, QWidget * window); void saveMainWindowState(const QMainWindow * mainWindow); diff --git a/guilib/src/MainWindow.cpp b/guilib/src/MainWindow.cpp index d05539e2..3bc7d8e6 100644 --- a/guilib/src/MainWindow.cpp +++ b/guilib/src/MainWindow.cpp @@ -106,6 +106,7 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) : { _preferencesDialog = new PreferencesDialog(this); } + _preferencesDialog->init(); // Restore window geometry _preferencesDialog->loadMainWindowState(this); diff --git a/guilib/src/PreferencesDialog.cpp b/guilib/src/PreferencesDialog.cpp index f6beef4a..02ab646e 100644 --- a/guilib/src/PreferencesDialog.cpp +++ b/guilib/src/PreferencesDialog.cpp @@ -203,11 +203,6 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) : connect(_ui->treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(clicked(QModelIndex))); _ui->treeView->expandToDepth(1); - this->readSettings(); - this->writeSettings();// This will create the ini file if not exist - - this->loadWindowGeometry("PreferencesDialog", this); - _obsoletePanels = kPanelAll; _initialized = true; } @@ -217,6 +212,17 @@ PreferencesDialog::~PreferencesDialog() { delete _ui; } +void PreferencesDialog::init() +{ + this->readSettings(); + this->writeSettings();// This will create the ini file if not exist + + this->loadWindowGeometry("PreferencesDialog", this); + + _obsoletePanels = kPanelAll; + _initialized = true; +} + void PreferencesDialog::setupTreeView() { QFile modelFile(":/resources/PreferencesModel.txt");