myEditor->setIsSync( on );
}
+/*!
+ \brief Get suppress output flag value.
+
+ \sa setIsSuppressOutput()
+ \return True if python console output is suppressed.
+*/
+bool PyConsole_Console::isSuppressOutput() const
+{
+ return myEditor->isSuppressOutput();
+}
+
+/*!
+ \brief Set suppress output flag value.
+
+ In case if suppress output flag is true, the python
+ console output suppressed.
+
+ \param on suppress output flag
+*/
+void PyConsole_Console::setIsSuppressOutput( const bool on )
+{
+ myEditor->setIsSuppressOutput(on);
+}
+
/*!
\brief Change the python console's font.
\param f new font
bool isSync() const;
void setIsSync( const bool );
+ bool isSuppressOutput() const;
+ void setIsSuppressOutput( const bool );
+
+
void exec( const QString& );
void execAndWait( const QString& );
void staticCallback( void* data, char* c )
{
- QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) );
+ if(!((PyConsole_Editor*)data)->isSuppressOutput())
+ QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c ) );
}
/*!
myInterp( 0 ),
myCmdInHistory( -1 ),
myEventLoop( 0 ),
- myIsSync( false )
+ myIsSync( false ),
+ myIsSuppressOutput(false)
{
QString fntSet( "" );
QFont aFont = SUIT_Tools::stringToFont( fntSet );
myIsSync = on;
}
+/*!
+ \brief Get suppress output flag value.
+
+ \sa setIsSuppressOutput()
+ \return True if python console output is suppressed.
+*/
+bool PyConsole_Editor::isSuppressOutput() const
+{
+ return myIsSuppressOutput;
+}
+
+/*!
+ \brief Set suppress output flag value.
+
+ In case if suppress output flag is true, the python
+ console output suppressed.
+
+ \param on suppress output flag
+*/
+void PyConsole_Editor::setIsSuppressOutput( const bool on )
+{
+ myIsSuppressOutput = on;
+}
+
/*!
\brief Put the string \a str to the python editor.
\param str string to be put in the command line of the editor
bool isSync() const;
void setIsSync( const bool );
+ bool isSuppressOutput() const;
+ void setIsSuppressOutput(const bool);
+
protected:
virtual void dropEvent( QDropEvent* event );
virtual void mouseReleaseEvent( QMouseEvent* event );
QString myBanner; //!< current banner
QStringList myQueue; //!< python commands queue
bool myIsSync; //!< synchronous mode flag
+ bool myIsSuppressOutput; //!< suppress output flag
};
#endif // PYCONSOLE_EDITOR_H
command += "\", ";
}
command += ") ";
+
+ //rnv: fix for bug 21947 WinTC5.1.4: Wrong error management of "Salome NoteBook"
+ bool oldSuppressValue = pyConsole->isSuppressOutput();
+ pyConsole->setIsSuppressOutput(true);
bool aResult = pyInterp->run(command.c_str());
+ pyConsole->setIsSuppressOutput(oldSuppressValue);
return !aResult;
}
command += "\",";
}
command += ")";
+
+ //rnv: fix for bug 21947 WinTC5.1.4: Wrong error management of "Salome NoteBook"
+ bool oldSuppressValue = pyConsole->isSuppressOutput();
+ pyConsole->setIsSuppressOutput(true);
bool aResult = pyInterp->run(command.c_str());
+ pyConsole->setIsSuppressOutput(oldSuppressValue);
+
return !aResult;
}
* Purpose : renumber row items
*/
//============================================================================
-void NoteBook_Table::RenamberRowItems(){
+void NoteBook_Table::RenamberRowItems() {
for(int i=0; i<myRows.size();i++){
myRows[i]->GetHeaderItem()->setText(QString::number(i+1));
}