X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetSwitch.cpp;h=98d08af2081e900159fc56fe76d39988384d6888;hb=bbf6e2c75c79cb80729eb85baecf4d1a17dd7ed8;hp=8cd931574f11f63c76ce57bfc12a96b68f64d3f2;hpb=ec6aaa4d8bd3609b04ea85683e1b1175b6632238;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp index 8cd931574..98d08af20 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp @@ -1,11 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -/* - * ModuleBase_WidgetSwitch.cpp - * - * Created on: Apr 16, 2014 - * Author: sbh - */ +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include #include @@ -18,10 +28,11 @@ #include #include -ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, const Config_WidgetAPI* theData, - const std::string& theParentId) -: ModuleBase_PagedContainer(theParent, theData, theParentId) +ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* theParent, + const Config_WidgetAPI* theData) +: ModuleBase_PagedContainer(theParent, theData) { + myRemeberChoice = false; QVBoxLayout* aMainLay = new QVBoxLayout(this); //aMainLay->setContentsMargins(2, 4, 2, 2); ModuleBase_Tools::adjustMargins(aMainLay); @@ -42,12 +53,15 @@ ModuleBase_WidgetSwitch::~ModuleBase_WidgetSwitch() int ModuleBase_WidgetSwitch::addPage(ModuleBase_PageBase* thePage, const QString& theName, - const QString& theCaseId) + const QString& theCaseId, + const QPixmap& theIcon, + const QString& theTooltip) { - int aSuperCount = ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId); - myCombo->addItem(theName); + int aSuperCount = + ModuleBase_PagedContainer::addPage(thePage, theName, theCaseId, theIcon, theTooltip); + myCombo->addItem(translate(theName.toStdString())); int aResultCount = myCombo->count(); - if (aResultCount == 1) + if (aResultCount == 2) myCombo->show(); QFrame* aFrame = dynamic_cast(thePage); aFrame->setFrameShape(QFrame::Box);