Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / genericgui / SchemaProcItem.cxx
index b61583f7563b591f21db0d9652ceb24996bbfcc4..556a1fcb08e67a499b29c4fa01ac062ad443df92 100644 (file)
@@ -1,24 +1,26 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2012  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.
 //
-//  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 "<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>";
+}