X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgenericgui%2FSchemaProcItem.cxx;h=ec4f0256d95597d7ef65cb7ed1ff4e6d7d13c2c1;hb=884c24e399ddcf623cee5d6d7136a06255b6f3f0;hp=b61583f7563b591f21db0d9652ceb24996bbfcc4;hpb=f4c10bf1781a76534bb1fa293aef541aef56148b;p=modules%2Fyacs.git diff --git a/src/genericgui/SchemaProcItem.cxx b/src/genericgui/SchemaProcItem.cxx index b61583f75..ec4f0256d 100644 --- a/src/genericgui/SchemaProcItem.cxx +++ b/src/genericgui/SchemaProcItem.cxx @@ -1,24 +1,26 @@ -// Copyright (C) 2006-2008 CEA/DEN, EDF R&D +// Copyright (C) 2006-2014 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. +// 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. +// 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 +// 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "SchemaProcItem.hxx" #include "Menus.hxx" #include "QtGuiContext.hxx" +#include "Resource.hxx" //#define _DEVDEBUG_ #include "YacsTrace.hxx" @@ -53,16 +55,41 @@ void SchemaProcItem::setExecState(int execState) QColor sc; switch (_execState) { - case YACS::NOTYETINITIALIZED: sc.setHsv( 45, 50, 255); stateDef = "Not Yet Initialized"; break; - case YACS::INITIALISED: sc.setHsv( 90, 50, 255); stateDef = "Initialized"; break; - case YACS::RUNNING: sc.setHsv(135, 50, 255); stateDef = "Running"; break; - case YACS::WAITINGTASKS: sc.setHsv(180, 50, 255); stateDef = "Waiting Tasks"; break; - case YACS::PAUSED: sc.setHsv(225, 50, 255); stateDef = "Paused"; break; - case YACS::FINISHED: sc.setHsv(270, 50, 255); stateDef = "Finished"; break; - case YACS::STOPPED: sc.setHsv(315, 50, 255); stateDef = "Stopped"; break; - default: sc.setHsv(360, 50, 255); stateDef = "Unknown Status"; + case YACS::NOTYETINITIALIZED: sc = YACS::HMI::Resource::NOTYETINITIALIZED; stateDef = "Not Yet Initialized"; break; + case YACS::INITIALISED: sc = YACS::HMI::Resource::INITIALISED ; stateDef = "Initialized"; break; + case YACS::RUNNING: sc = YACS::HMI::Resource::RUNNING ; stateDef = "Running"; break; + case YACS::WAITINGTASKS: sc = YACS::HMI::Resource::WAITINGTASKS ; stateDef = "Waiting Tasks"; break; + case YACS::PAUSED: sc = YACS::HMI::Resource::PAUSED ; stateDef = "Paused"; break; + case YACS::FINISHED: sc = YACS::HMI::Resource::FINISHED ; stateDef = "Finished"; break; + case YACS::STOPPED: sc = YACS::HMI::Resource::STOPPED ; stateDef = "Stopped"; break; + default: sc = YACS::HMI::Resource::UNKNOWN ; stateDef = "Unknown Status"; } _itemData.replace(YState, stateDef); _itemForeground.replace(YState, Qt::darkBlue); _itemBackground.replace(YState, sc); } + +QVariant SchemaProcItem::editionToolTip(int column) const +{ + QString val = QString("Edition: ") + _itemData.value(0).toString(); + QString val1 = _itemData.value(2).toString(); + QString val2 = QtGuiContext::getQtCurrent()->getFileName(); + if (!val1.isEmpty()) val += QString(" | ") + val1; + if (!val2.isEmpty()) val += QString(" | ") + val2; + return val; +} + +QVariant SchemaProcItem::runToolTip(int column) const +{ + QString val = QString("Execution: ") + _itemData.value(0).toString(); + QString val1 = _itemData.value(2).toString(); + QString val2 = QtGuiContext::getQtCurrent()->getFileName(); + if (!val1.isEmpty()) val += QString(" | ") + val1; + if (!val2.isEmpty()) val += QString(" | ") + val2; + return val; +} + +QVariant SchemaProcItem::editionWhatsThis(int column) const +{ + return "
To edit the schema properties, select the schema and use the input panel. More...
"; +}