]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #514: add 'Cursor for specific operations' section into preferences of HYDRO...
authormkr <mkr@opencascade.com>
Thu, 14 May 2015 07:03:48 +0000 (10:03 +0300)
committermkr <mkr@opencascade.com>
Thu, 14 May 2015 07:03:48 +0000 (10:03 +0300)
23 files changed:
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Module.h
src/HYDROGUI/resources/HYDROGUI_images.ts
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDROGUI/resources/LightApp.xml
src/HYDROGUI/resources/icon_cursor_1.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_10.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_11.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_12.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_13.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_14.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_15.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_16.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_17.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_18.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_2.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_3.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_4.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_5.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_6.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_7.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_8.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_cursor_9.png [new file with mode: 0644]

index e0f4f8c8cb236158b8a3d832ec24e858e784d8c3..a9690cdb396f1195c7c6646afcf839c207c3f82a 100644 (file)
@@ -83,6 +83,7 @@
 #include <SUIT_Study.h>
 #include <SUIT_ViewManager.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
 
 #include <SVTK_ViewManager.h>
 #include <SVTK_ViewModel.h>
@@ -706,6 +707,30 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
     theMenu->addAction( action( EditLocalCSId ) );
 }
 
+void HYDROGUI_Module::createPreferences()
+{
+  int genTab = addPreference( tr( "PREF_TAB_GENERAL" ) );
+  int CursorGroup = addPreference( tr( "PREF_GROUP_CURSOR" ), genTab );
+
+  int typeOfCursor = addPreference( tr( "PREF_TYPE_OF_CURSOR" ), CursorGroup,
+                                    LightApp_Preferences::Selector, "preferences", "type_of_cursor" );
+
+  // Set property cursor type
+  QList<QVariant> aCursorTypeIndicesList;
+  QList<QVariant> aCursorTypeIconsList;
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  for ( int i = CT_ArrowCursor; i < CT_User; i++ ) {
+    QString icoFile = QString( "ICON_CURSOR_%1" ).arg( i+1 );
+    QPixmap pixmap = resMgr->loadPixmap( "HYDRO", tr( qPrintable( icoFile ) ) );
+    aCursorTypeIndicesList << i;
+    aCursorTypeIconsList << pixmap;
+  }
+
+  setPreferenceProperty( typeOfCursor, "indexes", aCursorTypeIndicesList );
+  setPreferenceProperty( typeOfCursor, "icons",   aCursorTypeIconsList );
+}
+
 void HYDROGUI_Module::update( const int flags )
 {
   if( !isUpdateEnabled() )
index b0dbd20c91bf83caeb17c2630b1619e9fe1394b2..6aa6f6da2dd5692b097f792513705ce84286fe8e 100644 (file)
@@ -57,6 +57,29 @@ class HYDROGUI_Module : public LightApp_Module
 
   enum CustomEvent { NewViewEvent = QEvent::User + 100 };
 
+  enum CursorType
+  {
+    CT_ArrowCursor = 0,
+    CT_UpArrowCursor,
+    CT_CrossCursor,
+    CT_IBeamCursor,
+    CT_WaitCursor,
+    CT_BusyCursor,
+    CT_ForbiddenCursor,
+    CT_PointingHandCursor,
+    CT_WhatsThisCursor,
+    CT_SizeVerCursor,
+    CT_SizeHorCursor,
+    CT_SizeBDiagCursor,
+    CT_SizeFDiagCursor,
+    CT_SizeAllCursor,
+    CT_SplitVCursor,
+    CT_SplitHCursor,
+    CT_OpenHandCursor,
+    CT_ClosedHandCursor,
+    CT_User
+  };
+
 public:
   
   enum ViewManagerRole
@@ -101,6 +124,7 @@ public:
   virtual void                    viewManagers( QStringList& ) const;
 
   virtual void                    contextMenuPopup( const QString&, QMenu*, QString& );
+  virtual void                    createPreferences();
 
   virtual void                    update( const int );
   virtual void                    updateCommandsStatus();
index dbbf4380ba300b0b39783a8abcba871a218bb22b..ef3bea3e474674c5c6e0bff0cd5de19696e4d615 100644 (file)
       <translation>icon_profile_interpolate_image.png</translation>
     </message>
 
+    <!-- Cursors icons -->
+    <message>
+      <source>ICON_CURSOR_1</source>
+      <translation>icon_cursor_1.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_2</source>
+      <translation>icon_cursor_2.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_3</source>
+      <translation>icon_cursor_3.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_4</source>
+      <translation>icon_cursor_4.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_5</source>
+      <translation>icon_cursor_5.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_6</source>
+      <translation>icon_cursor_6.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_7</source>
+      <translation>icon_cursor_7.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_8</source>
+      <translation>icon_cursor_8.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_9</source>
+      <translation>icon_cursor_9.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_10</source>
+      <translation>icon_cursor_10.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_11</source>
+      <translation>icon_cursor_11.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_12</source>
+      <translation>icon_cursor_12.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_13</source>
+      <translation>icon_cursor_13.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_14</source>
+      <translation>icon_cursor_14.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_15</source>
+      <translation>icon_cursor_15.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_16</source>
+      <translation>icon_cursor_16.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_17</source>
+      <translation>icon_cursor_17.png</translation>
+    </message>
+    <message>
+      <source>ICON_CURSOR_18</source>
+      <translation>icon_cursor_18.png</translation>
+    </message>
+
   </context>
 </TS>
index 58c93cdeccaed923a6999be83eeece96086bb9e2..862778450422773bd8e51b45537fdec8a21282cc 100644 (file)
@@ -225,6 +225,18 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <source>STREAM_PROFILES</source>
       <translation>Profiles</translation>
     </message>
+    <message>
+      <source>PREF_TAB_GENERAL</source>
+      <translation>General</translation>
+    </message>
+    <message>
+      <source>PREF_GROUP_CURSOR</source>
+      <translation>Cursor for edition operations</translation>
+    </message>
+    <message>
+      <source>PREF_TYPE_OF_CURSOR</source>
+      <translation>Type</translation>
+    </message>
   </context>
 
   <context>
index 7f1052e3186ec63ba47c66af2e5d3264aceccb61..2b595df6a21192b08f92c1a99d6f36ff5306c7fe 100644 (file)
@@ -41,4 +41,7 @@
     <parameter value="${HYDRO_ROOT_DIR}/share/salome/resources/hydro" name="HYDROGUI" />
     <parameter value="${GEOM_ROOT_DIR}/share/salome/resources/geom" name="GEOM"/>
   </section>
+  <section name="preferences" >
+    <parameter name="type_of_cursor" value="2"/>
+  </section>
 </document>
diff --git a/src/HYDROGUI/resources/icon_cursor_1.png b/src/HYDROGUI/resources/icon_cursor_1.png
new file mode 100644 (file)
index 0000000..a69ef4e
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_1.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_10.png b/src/HYDROGUI/resources/icon_cursor_10.png
new file mode 100644 (file)
index 0000000..1edbab2
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_10.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_11.png b/src/HYDROGUI/resources/icon_cursor_11.png
new file mode 100644 (file)
index 0000000..a9f40cb
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_11.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_12.png b/src/HYDROGUI/resources/icon_cursor_12.png
new file mode 100644 (file)
index 0000000..f37d7b9
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_12.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_13.png b/src/HYDROGUI/resources/icon_cursor_13.png
new file mode 100644 (file)
index 0000000..3b127a0
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_13.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_14.png b/src/HYDROGUI/resources/icon_cursor_14.png
new file mode 100644 (file)
index 0000000..69f13eb
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_14.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_15.png b/src/HYDROGUI/resources/icon_cursor_15.png
new file mode 100644 (file)
index 0000000..1beda25
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_15.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_16.png b/src/HYDROGUI/resources/icon_cursor_16.png
new file mode 100644 (file)
index 0000000..a5667e3
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_16.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_17.png b/src/HYDROGUI/resources/icon_cursor_17.png
new file mode 100644 (file)
index 0000000..9181c85
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_17.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_18.png b/src/HYDROGUI/resources/icon_cursor_18.png
new file mode 100644 (file)
index 0000000..b78dd1d
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_18.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_2.png b/src/HYDROGUI/resources/icon_cursor_2.png
new file mode 100644 (file)
index 0000000..d3e70ef
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_2.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_3.png b/src/HYDROGUI/resources/icon_cursor_3.png
new file mode 100644 (file)
index 0000000..fe38e74
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_3.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_4.png b/src/HYDROGUI/resources/icon_cursor_4.png
new file mode 100644 (file)
index 0000000..097fc5f
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_4.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_5.png b/src/HYDROGUI/resources/icon_cursor_5.png
new file mode 100644 (file)
index 0000000..69056c4
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_5.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_6.png b/src/HYDROGUI/resources/icon_cursor_6.png
new file mode 100644 (file)
index 0000000..53717e4
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_6.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_7.png b/src/HYDROGUI/resources/icon_cursor_7.png
new file mode 100644 (file)
index 0000000..2b08c4e
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_7.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_8.png b/src/HYDROGUI/resources/icon_cursor_8.png
new file mode 100644 (file)
index 0000000..d2004ae
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_8.png differ
diff --git a/src/HYDROGUI/resources/icon_cursor_9.png b/src/HYDROGUI/resources/icon_cursor_9.png
new file mode 100644 (file)
index 0000000..b47601c
Binary files /dev/null and b/src/HYDROGUI/resources/icon_cursor_9.png differ