From 40c3df5f6bc31316438733182b58652a78925868 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 9 Jun 2008 06:16:42 +0000 Subject: [PATCH] ID 0019877: EDF VISU : No warning for delete actions in Visu module --- src/VISUGUI/VISU_msg_en.po | 7 +++++++ src/VISUGUI/VisuGUI.cxx | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index d34fd121..087b4d9b 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -67,6 +67,10 @@ msgstr "Can't create actor for this presentation" msgid "ERR_CANT_CREATE_ANIMATION" msgstr "Can't create animation for these fields:\n number of time stamps or number of components is not the same!" +msgid "VISU_REALLY_DELETE" +msgstr "Do you really want to delete this %1 object(s): %2" + + # Preferences for VISU module (VisuGUI.cxx) msgid "VISU_SCALAR_BAR" @@ -237,6 +241,9 @@ msgstr "Use Shading" msgid "VISU_DISP_ONLY" msgstr "Display only on creation" +msgid "VISU_FLOATING_POINT_PRECISION" +msgstr "Floating Point Precision" + msgid "VISU_AUTOMATIC_FIT_ALL" msgstr "Automatic Fit All" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index ffd912f4..bd362c51 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1283,9 +1283,12 @@ VisuGUI if (nbSelected < 1) return; std::vector anEntries (nbSelected); + QString aNameList; Handle(SALOME_InteractiveObject) anIO; for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) { anIO = it.Value(); + aNameList.append("\n - "); + aNameList.append(anIO->getName()); if (anIO->hasEntry()) { if (IsRemovable(anIO->getEntry(), this)) anEntries[i++] = anIO->getEntry(); @@ -1299,6 +1302,13 @@ VisuGUI QObject::tr("BUT_OK")); } + if ( SUIT_MessageBox::warn2( GetDesktop(this), + QObject::tr( "WRN_VISU" ), + QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ), + QObject::tr( "BUT_YES" ), + QObject::tr( "BUT_NO" ), 1, 0, 0 ) != 1 ) + return; + // There is a transaction _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder(); aStudyBuilder->NewCommand(); @@ -3461,6 +3471,13 @@ void VisuGUI::createPreferences() setPreferenceProperty( scalar_def_represent, "strings", modes1 ); setPreferenceProperty( scalar_def_represent, "indexes", indices1 ); addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" ); + + int point_precision = addPreference( tr( "VISU_FLOATING_POINT_PRECISION" ), representGr, + LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" ); + setPreferenceProperty( point_precision, "min", 1 ); + setPreferenceProperty( point_precision, "max", 16 ); + setPreferenceProperty( point_precision, "step", 1 ); + addPreference( "", representGr, LightApp_Preferences::Space ); addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" ); -- 2.39.2