#define VisuGUI_Prs3dTools_HeaderFile
#include "VisuGUI_Tools.h"
+#include "VisuGUI_DialogRunner.h"
+
+int runAndWait( QDialog* dlg, const bool modal )
+{
+ VisuGUI_DialogRunner r( dlg );
+ return r.run( modal );
+}
namespace VISU
{
class CutLines_i;
//---------------------------------------------------------------
- template<class TPrs3d_i, class TDlg>
+ template<class TPrs3d_i, class TDlg, int IsDlgModal >
void
EditPrs3d (SalomeApp_Module* theModule, VISU::Prs3d_i* thePrs3d)
{
if (aPrsObject) {
TDlg* aDlg = new TDlg (theModule);
aDlg->initFromPrsObject(aPrsObject);
- if (aDlg->exec()) {
+ if (runAndWait(aDlg,IsDlgModal)) {
if (!(aDlg->storeToPrsObject(aPrsObject))) {
delete aDlg;
return;
if(!aValue){
if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode
aDlg->initFromPrsObject(aPrs3d);
- if(IsDlgModal)
- if(aDlg->exec() && (aDlg->storeToPrsObject(aPrs3d))) {
+
+ if(runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
// Optionally, create table and curves for cut lines
QApplication::setOverrideCursor(Qt::waitCursor);
CreateCurves( theModule,
delete aDlg;
return false;
}
- else{
- aDlg->show();
- return true;
- }
}
}
PublishInView(theModule,aPrs3d);