add synchronization with "Dependency Tree" view

This commit is contained in:
mpa 2014-06-24 10:07:59 +04:00
parent 4805532bcf
commit adfe6b226a
7 changed files with 34 additions and 6 deletions

View File

@ -31,6 +31,7 @@ INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/src/OBJECT ${PROJECT_SOURCE_DIR}/src/OBJECT
${PROJECT_SOURCE_DIR}/src/GEOMUtils ${PROJECT_SOURCE_DIR}/src/GEOMUtils
${PROJECT_SOURCE_DIR}/src/GEOMClient ${PROJECT_SOURCE_DIR}/src/GEOMClient
${PROJECT_SOURCE_DIR}/src/GEOMToolsGUI
${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR}/idl
) )

View File

@ -31,6 +31,7 @@
// GEOM includes // GEOM includes
#include <GEOM_Displayer.h> #include <GEOM_Displayer.h>
#include <GEOMToolsGUI_ReduceStudyDlg.h>
// QT includes // QT includes
#include <QMenu> #include <QMenu>
@ -112,6 +113,18 @@ void DependencyTree_ViewModel::onShowOnlySelected()
} }
} }
//=================================================================================
// function : onReduceStudy()
// purpose : slot for showing dialog box "Reduce Study"
//=================================================================================
void DependencyTree_ViewModel::onReduceStudy()
{
DependencyTree_View* viewPort = dynamic_cast<DependencyTree_View*>( getActiveViewPort() );
QDialog* dlg = new GEOMToolsGUI_ReduceStudyDlg( viewPort );
if( dlg != NULL )
dlg->show();
}
//================================================================================= //=================================================================================
// function : contextMenuPopup() // function : contextMenuPopup()
// purpose : process calling of context menu popup // purpose : process calling of context menu popup
@ -127,7 +140,9 @@ void DependencyTree_ViewModel::contextMenuPopup( QMenu* theMenu )
theMenu->clear(); theMenu->clear();
theMenu->addAction( tr( "MEN_DISPLAY" ), this, SLOT( onShowSelected() ) ); theMenu->addAction( tr( "MEN_DISPLAY" ), this, SLOT( onShowSelected() ) );
theMenu->addAction( tr( "MEN_DISPLAY_ONLY" ), this, SLOT( onShowOnlySelected() ) ); theMenu->addAction( tr( "MEN_DISPLAY_ONLY" ), this, SLOT( onShowOnlySelected() ) );
theMenu->addAction( tr( "REBUILD_THE_TREE"), viewPort, SLOT( onRebuildModel() ) ); theMenu->addAction( tr( "MEN_REBUILD_THE_TREE"), viewPort, SLOT( onRebuildModel() ) );
theMenu->addSeparator();
theMenu->addAction( tr( "MEN_REDUCE_STUDY" ), this, SLOT( onReduceStudy() ) );
} }
} }
} }

View File

@ -39,6 +39,7 @@ private slots:
void onShowSelected(); void onShowSelected();
void onShowOnlySelected(); void onShowOnlySelected();
void onReduceStudy();
}; };

View File

@ -33,8 +33,12 @@
</message> </message>
<name>DependencyTree_ViewModel</name> <name>DependencyTree_ViewModel</name>
<message> <message>
<source>REBUILD_THE_TREE</source> <source>MEN_REBUILD_THE_TREE</source>
<translation>Rebuild the tree</translation> <translation>Rebuild the tree</translation>
</message> </message>
<message>
<source>MEN_REDUCE_STUDY</source>
<translation>Reduce study</translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -33,8 +33,12 @@
</message> </message>
<name>DependencyTree_ViewModel</name> <name>DependencyTree_ViewModel</name>
<message> <message>
<source>REBUILD_THE_TREE</source> <source>MEN_REBUILD_THE_TREE</source>
<translation type="unfinished">Rebuild the tree</translation> <translation type="unfinished">Rebuild the tree</translation>
</message> </message>
<message>
<source>MEN_REDUCE_STUDY</source>
<translation type="unfinished">Reduce study</translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -33,8 +33,12 @@
</message> </message>
<name>DependencyTree_ViewModel</name> <name>DependencyTree_ViewModel</name>
<message> <message>
<source>REBUILD_THE_TREE</source> <source>MEN_REBUILD_THE_TREE</source>
<translation type="unfinished">Rebuild the tree</translation> <translation type="unfinished">Rebuild the tree</translation>
</message> </message>
<message>
<source>MEN_REDUCE_STUDY</source>
<translation type="unfinished">Reduce study</translation>
</message>
</context> </context>
</TS> </TS>

View File

@ -904,7 +904,6 @@ void GEOMToolsGUI::OnShowDependencyTree()
void GEOMToolsGUI::OnReduceStudy() void GEOMToolsGUI::OnReduceStudy()
{ {
QDialog* dlg = new GEOMToolsGUI_ReduceStudyDlg( SUIT_Session::session()->activeApplication()->desktop() ); QDialog* dlg = new GEOMToolsGUI_ReduceStudyDlg( SUIT_Session::session()->activeApplication()->desktop() );
if ( dlg != NULL ) if( dlg != NULL )
dlg->show(); dlg->show();
} }