1 // Copyright (C) 2006-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "SchemaProcItem.hxx"
22 #include "QtGuiContext.hxx"
23 #include "Resource.hxx"
26 #include "YacsTrace.hxx"
29 using namespace YACS::ENGINE;
30 using namespace YACS::HMI;
33 SchemaProcItem::SchemaProcItem(SchemaItem *parent, QString label, Subject* subject)
34 : SchemaComposedNodeItem(parent, label, subject)
36 DEBTRACE("SchemaProcItem::SchemaProcItem");
39 SchemaProcItem::~SchemaProcItem()
41 DEBTRACE("SchemaProcItem::~SchemaProcItem");
44 void SchemaProcItem::popupMenu(QWidget *caller, const QPoint &globalPos)
47 m.popupMenu(caller, globalPos);
50 void SchemaProcItem::setExecState(int execState)
52 DEBTRACE("SchemaProcItem::setExecState " << execState);
53 _execState = execState;
58 case YACS::NOTYETINITIALIZED: sc = YACS::HMI::Resource::NOTYETINITIALIZED; stateDef = "Not Yet Initialized"; break;
59 case YACS::INITIALISED: sc = YACS::HMI::Resource::INITIALISED ; stateDef = "Initialized"; break;
60 case YACS::RUNNING: sc = YACS::HMI::Resource::RUNNING ; stateDef = "Running"; break;
61 case YACS::WAITINGTASKS: sc = YACS::HMI::Resource::WAITINGTASKS ; stateDef = "Waiting Tasks"; break;
62 case YACS::PAUSED: sc = YACS::HMI::Resource::PAUSED ; stateDef = "Paused"; break;
63 case YACS::FINISHED: sc = YACS::HMI::Resource::FINISHED ; stateDef = "Finished"; break;
64 case YACS::STOPPED: sc = YACS::HMI::Resource::STOPPED ; stateDef = "Stopped"; break;
65 default: sc = YACS::HMI::Resource::UNKNOWN ; stateDef = "Unknown Status";
67 _itemData.replace(YState, stateDef);
68 _itemForeground.replace(YState, Qt::darkBlue);
69 _itemBackground.replace(YState, sc);
72 QVariant SchemaProcItem::editionToolTip(int column) const
74 QString val = QString("Edition: ") + _itemData.value(0).toString();
75 QString val1 = _itemData.value(2).toString();
76 QString val2 = QtGuiContext::getQtCurrent()->getFileName();
77 if (!val1.isEmpty()) val += QString(" | ") + val1;
78 if (!val2.isEmpty()) val += QString(" | ") + val2;
82 QVariant SchemaProcItem::runToolTip(int column) const
84 QString val = QString("Execution: ") + _itemData.value(0).toString();
85 QString val1 = _itemData.value(2).toString();
86 QString val2 = QtGuiContext::getQtCurrent()->getFileName();
87 if (!val1.isEmpty()) val += QString(" | ") + val1;
88 if (!val2.isEmpty()) val += QString(" | ") + val2;
92 QVariant SchemaProcItem::editionWhatsThis(int column) const
94 return "<p>To edit the schema properties, select the schema and use the input panel. <a href=\"modification.html#property-page-for-schema\">More...</a></p>";