You Are Here:

Community: Developer Discussion Boards

#1 Old How to add icons to a stand alone Python application ("py2sis" -generated app) - 2005-02-16, 12:05

Join Date: Sep 2003
Posts: 209
Location: Finland
otsov
Offline
Regular Contributor
“py2sis” does not currently offer the possibility to add icons to the SIS-files it generates. Nevertheless, you can achieve this at least in two different ways:

Option 1:

1. Generate a stand alone installation “.sis” from your script (e.g. "foobar.py") with “py2sis” tool and install this application to your device

2. See e.g. the instructions at http://www.newlc.com/article.php3?id_article=197 and generate an “.aif” file for your stand-alone installation. Notice especially that the UID given as a command line parameter to “py2sis” and in the “.rss” file need to match. Also the “.aif” filename needs to match with your application.

3. Move the “.aif” file to the device and to the folder where you have installed the application in Step 1. (e.g. in “C:\”-drive the folder is “C:\System\Apps\foobar”). In order to achieve this you probably need a file browser in your device.

Option 2:

1. Generate a stand-alone installation “.sis” from your script with “py2sis” tool with the undocumented switch “--leavetemp”. This leaves the temporary files added to the generated “.sis” in your “py2sis” tool folder in a new subfolder “temp”, e.g. “C:\Nokia\Tools\Python_for_Series_60\py2sis\temp”.

2. Create the “.aif” file for your application and add this file to the created “temp” folder (see the link in Step 2. in the Option 1).

3. Add a line to the end of “.pkg” file under the "temp" folder specifying the “.aif” file, e.g.:

"foobar.aif" -"!:\system\apps\foobar\foobar.aif"

4. Run “makesis” with the modified “.pkg” file:

makesis foobar.pkg

5. Install the created “.sis” file to your device.
Reply With Quote

#2 Old Re: How to add icons to a stand alone Python application ("py2sis" -generated app) - 2006-01-31, 10:17

Join Date: Jan 2006
Posts: 67
slitchfield
Offline
Regular Contributor
Just to confirm that option 2 works really well for making icons applying to standalone Python applications. It's a bit of a workaround and fiddly, but it gets there in the end.

Steve
Reply With Quote

#3 Old Re: How to add icons to a stand alone Python application ("py2sis" -generated app) - 2006-02-01, 07:52

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
There's an easier way for this in UNIX-like systems. Python-to-SIS, the next generation has a support for application icons. It takes the icon in Symbian MBM format and generates the AIF file automatically.

http://www.nbl.fi/jussi.ylanen/py2sisng.html
Reply With Quote

#4 Old Re: How to add icons to a stand alone Python application ("py2sis" -generated app) - 2006-05-25, 01:51

Join Date: May 2006
Posts: 74
chetbox's Avatar
chetbox
Offline
Regular Contributor
Is there an easy way to convert bitmaps to .mbm files on UNIX-based systems.

I had a look on the Gimp, but it doesn't seem to directly support .mbm files.
Reply With Quote

#5 Old Re: How to add icons to a stand alone Python application ("py2sis" -generated app) - 2006-05-25, 19:32

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by chetbox
Is there an easy way to convert bitmaps to .mbm files on UNIX-based systems.
I don't know about easy, but the original bmconv from Symbian is available in source form: http://symbianos.org/download/bmconv_1.1.0-2.tar.gz

I had to modify it a little, as it sometimes generated invalid MBMs. Patch included:

Code:
diff -rC3 bmconv-1.1.0-2_orig/src/pbmcomp.cpp bmconv-1.1.0-2/src/pbmcomp.cpp
*** bmconv-1.1.0-2_orig/src/pbmcomp.cpp	Mon Jan  5 02:23:39 2004
--- bmconv-1.1.0-2/src/pbmcomp.cpp	Thu Sep 29 17:05:45 2005
***************
*** 376,382 ****
--- 376,387 ----
  	int dataSize = aPbm->iBitmapSize - sizeof(SEpocBitmapHeader);
  
  	WriteBuf32((char*)(aPbm),sizeof(SEpocBitmapHeader));
+ #if 0
  	WriteBuf16(((char*)(aPbm)) + sizeof(SEpocBitmapHeader),dataSize);
+ #else
+ 	// WriteBuf16() cannot handle odd number of bytes (2005-09-28 by JY)
+ 	iDestFile.write(((char*)(aPbm)) + sizeof(SEpocBitmapHeader),dataSize);
+ #endif
  
  	return NoError;
  	}
Using bmconv is covered in other Forum Nokia Discussion boards. Icon MBMs should contain a 42x29 icon (12- or 16-bit color), a 42x29 mask (1-bit monochrome), a 44x44 icon (12- or 16-bit color) and a 44x44 mask (1-bit monochrome), in that order.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia