X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGeometryGUI.cxx;h=7dd7a7eb3f25a0d966b386070f35fb1b5b88c8eb;hb=1be0dcd9a7556a9a0c6a1a81bdcf3c5bfbd3c202;hp=c15469deab97ae1287c57a9bbaf9297ba8b6d0b9;hpb=fb044eba690087ceb33185b914dd18418867ea4f;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index c15469dea..7dd7a7eb3 100755 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -88,7 +88,6 @@ #include -#include #include // External includes @@ -173,7 +172,7 @@ CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject) anObj = anORB->string_to_object(aValue.c_str()); } } catch(...) { - INFOS("ClientSObjectToObject - Unknown exception was occured!!!"); + INFOS("ClientSObjectToObject - Unknown exception has occurred!!!"); } return anObj._retn(); } @@ -231,7 +230,7 @@ GeometryGUI::GeometryGUI() : myTextTreeWdg = 0; myAnnotationMgr = 0; - connect( Material_ResourceMgr::resourceMgr(), SIGNAL( changed() ), this, SLOT( updateMaterials() ) ); + connect( Material_ResourceMgr::resourceMgr(), SIGNAL( changed() ), this, SLOT( updateMaterials() ), Qt::UniqueConnection ); Q_INIT_RESOURCE( GEOMGUI ); } @@ -624,7 +623,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam ) case GEOMOp::OpFace: // MENU BUILD - FACE case GEOMOp::OpShell: // MENU BUILD - SHELL case GEOMOp::OpSolid: // MENU BUILD - SOLID - case GEOMOp::OpCompound: // MENU BUILD - COMPUND + case GEOMOp::OpCompound: // MENU BUILD - COMPOUND libName = "BuildGUI"; break; case GEOMOp::OpFuse: // MENU BOOLEAN - FUSE @@ -1864,7 +1863,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) // end of GEOM plugins loading connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), - this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) ); + this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection ); // Reset actions accelerator keys action(GEOMOp::OpDelete)->setEnabled( true ); // Delete: Key_Delete @@ -1875,9 +1874,9 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) LightApp_SelectionMgr* sm = getApp()->selectionMgr(); - connect( sm, SIGNAL( currentSelectionChanged() ), this, SLOT( updateCreationInfo() )); - connect( sm, SIGNAL( currentSelectionChanged() ), this, SLOT( onAutoBringToFront() )); - connect( sm, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() )); + connect( sm, SIGNAL( currentSelectionChanged() ), this, SLOT( updateCreationInfo() ), Qt::UniqueConnection ); + connect( sm, SIGNAL( currentSelectionChanged() ), this, SLOT( onAutoBringToFront() ), Qt::UniqueConnection ); + connect( sm, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() ), Qt::UniqueConnection ); if ( !myCreationInfoWdg ) myCreationInfoWdg = new GEOMGUI_CreationInfoWdg( getApp() ); @@ -1914,7 +1913,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) QMenu* viewMenu = menuMgr()->findMenu( STD_Application::MenuViewId ); if ( viewMenu ) - connect( viewMenu, SIGNAL( aboutToShow() ), this, SLOT( onViewAboutToShow() ) ); + connect( viewMenu, SIGNAL( aboutToShow() ), this, SLOT( onViewAboutToShow() ), Qt::UniqueConnection ); // 0020836 (Basic vectors and origin) SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); @@ -1953,7 +1952,7 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study ) LightApp_SelectionMgr* selMrg = getApp()->selectionMgr(); disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateCreationInfo() )); - disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() )); + //disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() )); if ( myCreationInfoWdg ) { getApp()->removeDockWindow( myCreationInfoWdg->getWinID() ); myCreationInfoWdg = 0; @@ -2213,8 +2212,7 @@ void GeometryGUI::updateFieldColorScale() { if( SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ) ) { - GEOM_Displayer aDisplayer( aStudy ); - aDisplayer.UpdateColorScale(); + GEOM_Displayer( aStudy ).UpdateColorScale(); } } @@ -2268,7 +2266,11 @@ void GeometryGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& getApp()->selectionMgr()->selectedObjects( lst ); //Add submenu for predefined materials - bool isPredefMat = SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "predef_materials" ); + // RNV: '#23552: Unable to use the contextual menu of Object Browser window' issue: + // Temporary solution: do not show 'Materials' submenu forcibly + //bool isPredefMat = SUIT_Session::session()->resourceMgr()->booleanValue( "Geometry", "predef_materials" ); + bool isPredefMat = false; + if ( ( client == "OCCViewer" || client == "VTKViewer" ) && lst.Extent() > 0 ) { QtxPopupMgr* mgr = popupMgr(); //get parrent for submenu @@ -2388,8 +2390,9 @@ void GeometryGUI::createPreferences() int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup, LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" ); - addPreference( tr( "PREF_PREDEF_MATERIALS" ), genGroup, - LightApp_Preferences::Bool, "Geometry", "predef_materials" ); + // RNV: Temporary hide this preference, because of the '#23552: Unable to use the contextual menu of Object Browser window' issue + //addPreference( tr( "PREF_PREDEF_MATERIALS" ), genGroup, + // LightApp_Preferences::Bool, "Geometry", "predef_materials" ); int material = addPreference( tr( "PREF_MATERIAL" ), genGroup, LightApp_Preferences::Selector, @@ -2817,11 +2820,9 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par param == QString("scalar_bar_height") || param == QString("scalar_bar_text_height") || param == QString("scalar_bar_nb_intervals")) { - if( SalomeApp_Study* aStudy = dynamic_cast( getApp()->activeStudy() ) ) + if( /*SalomeApp_Study* aStudy = */dynamic_cast( getApp()->activeStudy() ) ) { - GEOM_Displayer aDisplayer( aStudy ); - bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); - aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); + updateFieldColorScale(); } } else if ( param == QString("dimensions_color") || @@ -2980,7 +2981,7 @@ void GeometryGUI::storeVisualParameters (int savePoint) _PTR(SObject) obj( studyDS->FindObjectID( o_it.key().toLatin1().data() ) ); if ( !obj || !(aProps.count() > 0)) continue; - // entry is "encoded" = it does NOT contain component adress, since it is a + // entry is "encoded" = it does NOT contain component address, since it is a // subject to change on next component loading std::string entry = ip->encodeEntry(o_it.key().toLatin1().data(), componentName); @@ -3154,7 +3155,7 @@ void GeometryGUI::restoreVisualParameters (int savePoint) for (std::vector::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt) { - // entry is a normal entry - it should be "decoded" (setting base adress of component) + // entry is a normal entry - it should be "decoded" (setting base address of component) QString entry (ip->decodeEntry(*entIt).c_str()); // Check that the entry corresponds to a real object in the Study