}
}
+/*!
+ \brief. Show ParaView python trace.
+*/
void PVGUI_Module::onShowTrace()
{
if (!myTraceWindow) {
myTraceWindow->activateWindow();
}
+
+/*!
+ \brief. Re-initialize ParaView python trace.
+*/
+void PVGUI_Module::onRestartTrace()
+{
+ PyInterp_Dispatcher* aDispatcher = PyInterp_Dispatcher::Get();
+ if ( !aDispatcher->IsBusy() ) {
+ pqPythonManager* manager = qobject_cast<pqPythonManager*>
+ ( pqApplicationCore::instance()->manager( "PYTHON_MANAGER" ) );
+ if ( manager ) {
+ pqPythonDialog* pyDiag = manager->pythonShellDialog();
+ if ( pyDiag ) {
+ pqPythonShell* shell = pyDiag->shell();
+ if ( shell ) {
+ QString script = "from paraview import smtrace\n";
+ script += "smtrace.stop_trace()\n";
+ script += "smtrace.start_trace()\n";
+ shell->executeScript(script);
+ }
+ }
+ }
+ }
+}
+
/*!
\brief Show ParaView view.
*/
OutputWindowId,
PythonShellId,
ShowTraceId,
+ RestartTraceId,
// Menu "Help"
AboutParaViewId,
void onStartProgress();
void onEndProgress();
void onShowTrace();
+ void onRestartTrace();
void onNewParaViewWindow();
connect(anAction, SIGNAL(triggered()), this, SLOT(onShowTrace()));
registerAction(ShowTraceId, anAction);
+ //Show Trace
+ anAction = new QAction(tr("MEN_RESTART_TRACE"), this);
+ anAction->setToolTip(tr("TOP_RESTART_TRACE"));
+ anAction->setStatusTip(tr("STB_RESTART_TRACE"));
+ connect(anAction, SIGNAL(triggered()), this, SLOT(onRestartTrace()));
+ registerAction(RestartTraceId, anAction);
+
// --- Menu "Help"
// About
createMenu( PythonShellId, aToolsMnu );
createMenu( separator(), aToolsMnu );
createMenu( ShowTraceId, aToolsMnu );
+ createMenu( RestartTraceId, aToolsMnu );
// --- Menu "Help"
<source>STB_SHOW_TRACE</source>
<translation>Show Trace</translation>
</message>
+ <message>
+ <source>MEN_RESTART_TRACE</source>
+ <translation>Re-initialize Trace</translation>
+ </message>
+ <message>
+ <source>TOP_RESTART_TRACE</source>
+ <translation>Re-initialize Trace</translation>
+ </message>
+ <message>
+ <source>STB_RESTART_TRACE</source>
+ <translation>Re-initialize Trace</translation>
+ </message>
</context>
<context>
<name>PVGUI_ViewManager</name>