Salome HOME
Issue 0020424: EDF 1069 GUI: How to add an icon in the GUI of a python module
authorvsr <vsr@opencascade.com>
Tue, 7 Jul 2009 15:21:33 +0000 (15:21 +0000)
committervsr <vsr@opencascade.com>
Tue, 7 Jul 2009 15:21:33 +0000 (15:21 +0000)
Introduce loadIcon() method to the SalomePyQt Python interface

resources/Makefile.am
resources/handshake.png [new file with mode: 0644]
resources/stop.png [new file with mode: 0644]
src/PYHELLOGUI/PYHELLOGUI.py
src/PYHELLOGUI/PYHELLO_icons.po

index 2faa12aac3d74f83f220a814524b348dec8c8b52..68af7730c6e58f5985fec77f0c602c1f35b996b0 100644 (file)
@@ -29,6 +29,8 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 dist_salomeres_DATA = \
        PYHELLO.png \
        ExecPYHELLO.png \
+       handshake.png \
+       stop.png \
        SalomeApp.xml
 
 nodist_salomeres_DATA = PYHELLOCatalog.xml
diff --git a/resources/handshake.png b/resources/handshake.png
new file mode 100644 (file)
index 0000000..e840a02
Binary files /dev/null and b/resources/handshake.png differ
diff --git a/resources/stop.png b/resources/stop.png
new file mode 100644 (file)
index 0000000..e896855
Binary files /dev/null and b/resources/stop.png differ
index 8572499e4092f4e5d699d0c17890ab59ce4edf34..42ef0c46bfda56643af43681b7dbb4f28204719d 100644 (file)
@@ -437,9 +437,11 @@ class MyDialog( QDialog ):
         
         hb1 = QHBox( self )
         bOk = QPushButton( "&OK", hb1 )
+        bOk.setIconSet( sgPyQt.loadIcon( 'PYHELLO', 'ICO_HANDSHAKE' ) )
         self.connect( bOk, SIGNAL( 'clicked()' ), self, SLOT( 'accept()' ) )
         dummy = QWidget( hb1 )
         bCancel = QPushButton( "&Cancel", hb1 )
+        bCancel.setIconSet( sgPyQt.loadIcon( 'PYHELLO', 'ICO_STOP' ) )
         self.connect( bCancel, SIGNAL( 'clicked()' ), self, SLOT( 'close()' ) )
         hb1.setStretchFactor( dummy, 10 )
         pass
index 780153f5d888921661b6320dfc2e1a21c712e716..fad9de6a4941cb90c802f4257904d06e89a177b4 100644 (file)
@@ -31,3 +31,8 @@ msgstr ""
 "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
+msgid "ICO_HANDSHAKE"
+msgstr "handshake.png"
+
+msgid "ICO_STOP"
+msgstr "stop.png"