From 180eca0b22536dd1cdc8a18ece854e0d5f5b2f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 26 Jan 2012 14:35:41 +0000 Subject: [PATCH] Enable headless mode for meshinfo plugin git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13519 383ad7c9-94d9-4d36-a494-682f7c89f535 --- MeshObjectInfoPlugin.cc | 30 ++++++++++++++++++------------ MeshObjectInfoPlugin.hh | 2 ++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/MeshObjectInfoPlugin.cc b/MeshObjectInfoPlugin.cc index 3afebc5..ac12dc7 100644 --- a/MeshObjectInfoPlugin.cc +++ b/MeshObjectInfoPlugin.cc @@ -70,13 +70,16 @@ //== IMPLEMENTATION ========================================================== void InfoMeshObjectPlugin::initializePlugin() { - infoBar_ = new InfoBar(); - // Create info dialog - info_ = new InfoDialog(); + if ( OpenFlipper::Options::gui()) { + infoBar_ = new InfoBar(); - // Set default pick mode in dialog box - info_->pickMode->setCurrentIndex(0); // PICK_FACES + // Create info dialog + info_ = new InfoDialog(); + + // Set default pick mode in dialog box + info_->pickMode->setCurrentIndex(0); // PICK_FACES + } } /// initialize the plugin @@ -85,8 +88,10 @@ void InfoMeshObjectPlugin::pluginsInitialized() { //set the slot descriptions setDescriptions(); - emit addWidgetToStatusbar(infoBar_); - infoBar_->hideCounts(); + if ( OpenFlipper::Options::gui()) { + emit addWidgetToStatusbar(infoBar_); + infoBar_->hideCounts(); + } } @@ -740,16 +745,16 @@ bool InfoMeshObjectPlugin::getEdgeLengths(int _id, double &min, double &max, dou void InfoMeshObjectPlugin::slotObjectUpdated( int /*_identifier*/ , const UpdateType& _type){ + if ( !infoBar_ ) { + return; + } + if ( (PluginFunctions::objectCount() == 1) || (PluginFunctions::targetCount() == 1) ){ // This block is only interesting for topology changes if ( ! _type.contains(UPDATE_TOPOLOGY) ) { return; } - - if ( !infoBar_ ) { - return; - } bool found = false; @@ -806,7 +811,8 @@ void InfoMeshObjectPlugin::slotObjectSelectionChanged( int _identifier ){ //------------------------------------------------------------------------------ void InfoMeshObjectPlugin::slotAllCleared(){ - infoBar_->hideCounts(); + if ( infoBar_ ) + infoBar_->hideCounts(); } Q_EXPORT_PLUGIN2( InfoMeshObjectPlugin , InfoMeshObjectPlugin ); diff --git a/MeshObjectInfoPlugin.hh b/MeshObjectInfoPlugin.hh index 0f45fe0..389d211 100644 --- a/MeshObjectInfoPlugin.hh +++ b/MeshObjectInfoPlugin.hh @@ -102,6 +102,8 @@ class InfoMeshObjectPlugin : public QObject, BaseInterface, InformationInterface void slotObjectSelectionChanged( int _identifier ); void slotAllCleared(); + void noguiSupported( ) {} ; + // InformationInterface void slotInformationRequested(const QPoint _clickedPoint, DataType _type); DataType supportedDataTypes(); -- GitLab