]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1427: set header of modal dialog box
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 21 Apr 2016 15:18:52 +0000 (18:18 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 21 Apr 2016 15:18:52 +0000 (18:18 +0300)
src/ModuleBase/ModuleBase_Dialog.cpp
src/ModuleBase/ModuleBase_WidgetFactory.h

index 0ac6a72b1e1866a45ef51bd4a0683ed1c98e4ede..67e3742809a5b87a471bec4410dccc6d0786c2b0 100644 (file)
@@ -11,6 +11,9 @@
 #include <ModelAPI_Events.h>
 #include <Events_Loop.h>
 
+#include <Config_WidgetAPI.h>
+#include <Config_Keywords.h>
+
 #include <QMainWindow>
 #include <QLayout>
 #include <QDialogButtonBox>
@@ -26,6 +29,9 @@ ModuleBase_Dialog::ModuleBase_Dialog(ModuleBase_IWorkshop* theParent, const QStr
                                      myActiveWidget(0)
 {
   ModuleBase_WidgetFactory aFactory(myDescription, myWorkshop);
+  std::string aTitle = aFactory.widgetAPI()->getProperty(FEATURE_TEXT);
+
+  setWindowTitle(aTitle.c_str());
 
   SessionPtr aMgr = ModelAPI_Session::get();
   std::shared_ptr<ModelAPI_Document> aDoc = aMgr->activeDocument();
index b8ae7b465c0c9ae16009842ec50153016a9344fc..8fddaa4dd69590f3cc7fe6c851f04db1d8165cab 100644 (file)
@@ -68,6 +68,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFactory
   /// \param theAttributeId an outpup parameter with  attribute
   void getGreedAttribute(std::string& theAttributeId);
 
+  /// Returns widget API from XML
+  const Config_WidgetAPI* widgetAPI() const { return myWidgetApi; }
+
 protected:
   /// check if ModuleBase_Widget has expandable widgets in getControls
   bool hasExpandingControls(QWidget* theParent);