X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_PropertyPanel.cpp;h=c3d200d41ae5f130f517a4802598062eafcd772e;hb=be7d83df0061448606f62fcb370f59e2617557d1;hp=001224625b2a41b7a689b00a5e7491dd3ce71df1;hpb=2d8812a37a69beb9508879849782de6ed3f14e5e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 001224625..c3d200d41 100644 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> + /* * XGUI_PropertyPanel.cpp * @@ -6,7 +8,7 @@ */ #include -#include +//#include #include #include @@ -29,7 +31,7 @@ XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent) { this->setWindowTitle(tr("Property Panel")); QAction* aViewAct = this->toggleViewAction(); - this->setObjectName(XGUI::PROP_PANEL); + this->setObjectName(PROP_PANEL); setStyleSheet("::title { position: relative; padding-left: 5px; text-align: left center }"); QWidget* aContent = new QWidget(this); @@ -49,14 +51,14 @@ XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent) aBtnLay->addWidget(aBtn); aBtnLay->addStretch(1); aBtn = new QPushButton(QIcon(":pictures/button_ok.png"), "", aFrm); - aBtn->setObjectName(XGUI::PROP_PANEL_OK); + aBtn->setObjectName(PROP_PANEL_OK); aBtn->setToolTip(tr("Ok")); aBtn->setFlat(true); aBtnLay->addWidget(aBtn); aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm); aBtn->setToolTip(tr("Cancel")); - aBtn->setObjectName(XGUI::PROP_PANEL_CANCEL); + aBtn->setObjectName(PROP_PANEL_CANCEL); aBtn->setFlat(true); aBtn->setShortcut(QKeySequence(Qt::Key_Escape)); aBtnLay->addWidget(aBtn); @@ -77,6 +79,7 @@ void XGUI_PropertyPanel::cleanContent() myWidgets.clear(); qDeleteAll(myCustomWidget->children()); myActiveWidget = NULL; + setWindowTitle(tr("Property Panel")); } void XGUI_PropertyPanel::setModelWidgets(const QList& theWidgets) @@ -115,8 +118,8 @@ void XGUI_PropertyPanel::setModelWidgets(const QList& t if (!aControls.empty()) { QWidget* aLastControl = aControls.last(); - QPushButton* anOkBtn = findChild(XGUI::PROP_PANEL_OK); - QPushButton* aCancelBtn = findChild(XGUI::PROP_PANEL_CANCEL); + QPushButton* anOkBtn = findChild(PROP_PANEL_OK); + QPushButton* aCancelBtn = findChild(PROP_PANEL_CANCEL); setTabOrder(aLastControl, anOkBtn); setTabOrder(anOkBtn, aCancelBtn); @@ -195,7 +198,7 @@ void XGUI_PropertyPanel::activateNextWidget() void XGUI_PropertyPanel::setAcceptEnabled(bool isEnabled) { - QPushButton* anOkBtn = findChild(XGUI::PROP_PANEL_OK); + QPushButton* anOkBtn = findChild(PROP_PANEL_OK); anOkBtn->setEnabled(isEnabled); } @@ -218,3 +221,29 @@ void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget) else if (!isEditingMode()) emit noMoreWidgets(); } + +void XGUI_PropertyPanel::setOkEnabled(bool theEnabled) +{ + QPushButton* anOkBtn = findChild(PROP_PANEL_OK); + anOkBtn->setEnabled(theEnabled); +} + +bool XGUI_PropertyPanel::isOkEnabled() const +{ + QPushButton* anOkBtn = findChild(PROP_PANEL_OK); + return anOkBtn->isEnabled(); +} + +void XGUI_PropertyPanel::setCancelEnabled(bool theEnabled) +{ + QPushButton* anCancelBtn = findChild(PROP_PANEL_CANCEL); + anCancelBtn->setEnabled(theEnabled); +} + +bool XGUI_PropertyPanel::isCancelEnabled() const +{ + QPushButton* anCancelBtn = findChild(PROP_PANEL_CANCEL); + return anCancelBtn->isEnabled(); +} + +