From 5b6d51910119b7ccde78eb3a433d1b24d60f7978 Mon Sep 17 00:00:00 2001 From: dhood Date: Fri, 6 Apr 2018 10:41:57 -0700 Subject: [PATCH] Various fixups --- src/rviz/CMakeLists.txt | 2 +- src/rviz/preferences_dialog.cpp | 16 ++-------------- src/rviz/preferences_dialog.h | 26 ++++++-------------------- src/rviz/visualization_frame.cpp | 2 +- src/rviz/visualization_frame.h | 2 +- 5 files changed, 11 insertions(+), 37 deletions(-) diff --git a/src/rviz/CMakeLists.txt b/src/rviz/CMakeLists.txt index 1b9fef8778..efa8d6dd5e 100644 --- a/src/rviz/CMakeLists.txt +++ b/src/rviz/CMakeLists.txt @@ -47,7 +47,6 @@ add_library(${PROJECT_NAME} message_filter_display.h mesh_loader.cpp new_object_dialog.cpp - preferences_dialog.cpp add_display_dialog.cpp ogre_helpers/apply_visibility_bits.cpp ogre_helpers/arrow.cpp @@ -72,6 +71,7 @@ add_library(${PROJECT_NAME} panel.cpp panel_dock_widget.cpp panel_factory.cpp + preferences_dialog.cpp properties/bool_property.cpp properties/color_editor.cpp properties/color_property.cpp diff --git a/src/rviz/preferences_dialog.cpp b/src/rviz/preferences_dialog.cpp index 93ecc99e84..318511fede 100644 --- a/src/rviz/preferences_dialog.cpp +++ b/src/rviz/preferences_dialog.cpp @@ -27,36 +27,24 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include - -#include - -#include -#include - #include -#include -#include -#include #include -#include #include #include #include #include "preferences_dialog.h" -#include "rviz/load_resource.h" #include "rviz/preferences.h" namespace rviz { PreferencesDialog::PreferencesDialog( Factory* factory, - Preferences *preferences, + Preferences* preferences_output, QWidget* parent) : QDialog( parent ) , factory_( factory ) -, preferences_( preferences) +, preferences_( preferences_output ) { //***** Layout diff --git a/src/rviz/preferences_dialog.h b/src/rviz/preferences_dialog.h index 8242b0d780..ebc86ac4fd 100644 --- a/src/rviz/preferences_dialog.h +++ b/src/rviz/preferences_dialog.h @@ -34,12 +34,8 @@ #include "rviz/factory.h" -class QTreeWidget; -class QTreeWidgetItem; -class QTextBrowser; -class QLineEdit; +class QCheckBox; class QDialogButtonBox; -class QLabel; namespace rviz { @@ -50,23 +46,13 @@ class PreferencesDialog : public QDialog { Q_OBJECT public: - /** Dialog for choosing a new object to load with a pluginlib ClassLoader. + /** Dialog for setting preferences. * - * @param disallowed_display_names set of display names to prevent - * the user from using. - * - * @param disallowed_class_lookup_names set of class lookup names to - * prevent the user from selecting. Names found in the class loader - * which are in this list will appear disabled. - * - * @param lookup_name_output Pointer to a string where dialog will - * put the class lookup name chosen. - * - * @param display_name_output Pointer to a string where dialog will - * put the display name entered, or NULL (default) if display - * name entry field should not be shown. */ + * @param preferences_output Pointer to Preferences struct where + * preferences chosen by the user will be put. + */ PreferencesDialog( Factory* factory, - Preferences* preferences, + Preferences* preferences_output, QWidget* parent = 0 ); virtual QSize sizeHint () const; diff --git a/src/rviz/visualization_frame.cpp b/src/rviz/visualization_frame.cpp index 0802511487..b73f493a86 100644 --- a/src/rviz/visualization_frame.cpp +++ b/src/rviz/visualization_frame.cpp @@ -945,7 +945,7 @@ bool VisualizationFrame::prepareToExit() savePersistentSettings(); - if( isWindowModified() && preferences_->prompt_save_on_exit) + if( isWindowModified() && preferences_->prompt_save_on_exit ) { QMessageBox box( this ); box.setText( "There are unsaved changes." ); diff --git a/src/rviz/visualization_frame.h b/src/rviz/visualization_frame.h index a3fa91dc4b..25b9910e90 100644 --- a/src/rviz/visualization_frame.h +++ b/src/rviz/visualization_frame.h @@ -182,9 +182,9 @@ protected Q_SLOTS: void onRecentConfigSelected(); void onHelpWiki(); void onHelpAbout(); - void openPreferencesDialog(); void openNewPanelDialog(); void openNewToolDialog(); + void openPreferencesDialog(); void showHelpPanel(); /** @brief Remove a the tool whose name is given by remove_tool_menu_action->text(). */