From: duplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Date: Thu, 30 Sep 2010 14:10:59 +0000 (+0000)
Subject: Restore the old rcc-based resource generation system.
X-Git-Tag: 2.6.0~16
X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e931d5fff100a2fdc7b79ccfee2fd2c93aafe7b0;p=bertos.git

Restore the old rcc-based resource generation system.
(the pyrcc4-based one seems to not work properly on Windows)



git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4385 38d2e660-2303-0410-9eaa-f027e97ec537
---

diff --git a/wizard/bertos.py b/wizard/bertos.py
index ebc91357..a404cb23 100755
--- a/wizard/bertos.py
+++ b/wizard/bertos.py
@@ -119,10 +119,21 @@ def main():
     app.settings = QSettings("Develer", "Bertos Configurator")
     # Development utility lines, to be removed for production
     datadir = DATA_DIR
-    qrc, bertos_rc = os.path.join(datadir, 'bertos.qrc'), os.path.join(datadir, 'bertos_rc.py')
-    if not (hasattr(sys, "frozen") and sys.frozen) and newer(qrc, bertos_rc):
-        os.system("pyrcc4 \"%s\" -o \"%s\"" %(qrc, bertos_rc))
-    import bertos_rc
+
+    # Something seems to not work, on Windows, using pyrcc4 with BeRTOS Wizard
+    # resources. So I'm restoring the old rcc-based resource generation
+    # system.
+    #
+    # qrc, bertos_rc = os.path.join(datadir, 'bertos.qrc'), os.path.join(datadir, 'bertos_rc.py')
+    # if not (hasattr(sys, "frozen") and sys.frozen) and newer(qrc, bertos_rc):
+    #     os.system("pyrcc4 \"%s\" -o \"%s\"" %(qrc, bertos_rc))
+    # import bertos_rc
+
+    qrc, rcc = os.path.join(datadir, 'bertos.qrc'), os.path.join(datadir, 'bertos.rcc') 
+    if not (hasattr(sys, "frozen") and sys.frozen) and newer(qrc, rcc): 
+        os.system("rcc -binary \"%s\" -o \"%s\"" %(qrc, rcc)) 
+    QResource.registerResource(rcc) 
+    
     if len(sys.argv) == 3 and sys.argv[1] == "--edit":
         editProject(os.path.abspath(sys.argv[2]))
     else: