← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 188: Changes in the icon loading, in preparation for the linux zip and windows packages.

 

------------------------------------------------------------
revno: 188
committer: Eduardo César <xcesar@xxxxxxxxx>
branch nick: cdd
timestamp: Fri 2012-07-20 06:43:45 -0300
message:
  Changes in the icon loading, in preparation for the linux zip and windows packages.
added:
  src/__main__.py@
  src/setup_single_exe.py
modified:
  src/cdd.py
  src/cdg_cdd.wxg
  src/cdg_main.py


--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk

Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== added symlink 'src/__main__.py'
=== target is u'cdd.py'
=== modified file 'src/cdd.py'
--- src/cdd.py	2012-07-20 00:25:17 +0000
+++ src/cdd.py	2012-07-20 09:43:45 +0000
@@ -3,7 +3,11 @@
 # cdd.py - CCD editor for MLHIM.
 # (c) 2012 - Timothy w.Cook & Contributors. (see: credits)
 
+import sys
 import gettext
+import pkgutil
+import StringIO
+
 import wx
 from wx.lib.wordwrap import wordwrap
 
@@ -93,12 +97,16 @@
         # Status bar
         self.statusbar = self.CreateStatusBar(1, 0)
 
-
         # begin MainFrame set properties
         self.SetTitle(_("Constraint Definition Designer (aka.CCD Editor)"))
-        _icon = wx.EmptyIcon()
-        _icon.CopyFromBitmap(wx.Bitmap("icons/logo.png", wx.BITMAP_TYPE_ANY))
-        self.SetIcon(_icon)
+        if sys.platform == 'linux2':
+            logo_str = pkgutil.get_data(__name__, 'icons/logo.png')
+            stio = StringIO.StringIO(logo_str)
+            image = wx.ImageFromStream(stio)
+            bitmap = wx.BitmapFromImage(image)
+            icon = wx.IconFromBitmap(bitmap)
+            self.SetIcon(icon)
+
         self.SetSize((800, 600))
         self.SetBackgroundColour(wx.Colour(228, 228, 228))
         font = wx.SystemSettings_GetFont(wx.SYS_SYSTEM_FONT)

=== modified file 'src/cdg_cdd.wxg'
--- src/cdg_cdd.wxg	2012-07-20 09:32:05 +0000
+++ src/cdg_cdd.wxg	2012-07-20 09:43:45 +0000
@@ -1,11 +1,10 @@
 <?xml version="1.0"?>
-<!-- generated by wxGlade 0.6.4 on Fri Jul 20 02:02:23 2012 -->
+<!-- generated by wxGlade 0.6.4 on Fri Jul 20 03:05:53 2012 -->
 
 <application path="cdg_main.py" name="" class="" option="0" language="python" top_window="frame_principal" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.8" is_template="0" indent_amount="4" indent_symbol="space" source_extension=".cpp" header_extension=".h">
     <object class="MainDialog" name="dialog_principal" base="EditDialog">
         <style>wxDEFAULT_DIALOG_STYLE</style>
         <title>Metadata</title>
-        <centered>1</centered>
         <size>800, 470</size>
         <object class="wxBoxSizer" name="sizer_vertical" base="EditBoxSizer">
             <orient>wxHORIZONTAL</orient>

=== modified file 'src/cdg_main.py'
--- src/cdg_main.py	2012-07-20 09:32:05 +0000
+++ src/cdg_main.py	2012-07-20 09:43:45 +0000
@@ -133,7 +133,6 @@
         sizer_vertical.Add((20, 20), 0, 0, 0)
         self.SetSizer(sizer_vertical)
         self.Layout()
-        self.Centre()
         # end wxGlade
 
 

=== added file 'src/setup_single_exe.py'
--- src/setup_single_exe.py	1970-01-01 00:00:00 +0000
+++ src/setup_single_exe.py	2012-07-20 09:43:45 +0000
@@ -0,0 +1,11 @@
+from distutils.core import setup
+import py2exe, sys, os
+
+sys.argv.append('py2exe')
+
+setup(
+    options = {'py2exe': {'bundle_files': 1}},
+    windows = [{'script': "cdd.py"}],
+    zipfile = None,
+)
+