Devel Digest, Vol 33, Issue 54
James Simmons
jim.simmons at walgreens.com
Tue Nov 18 17:42:46 EST 2008
Aleix,
I think the simplest thing to do might be to give your Activity a
Toolbar, and let the user click a button on the toolbar to open the File
Open dialog. That way your Activity maybe could work with more than one
file before the user exits it. So you could resume an existing Journal
entry, create a new entry, or select an entry using the dialog.
read_file gives the path to a copy of your file. It might not have a
.zip suffix (but in my own experience it generally does) but it is a
copy of your file. There are ways in Python to check if a given file is
a Zip file without knowing its file name.
It would help if we knew what your Activity does.
James Simmons
>Date: Tue, 18 Nov 2008 18:13:56 +0100
>From: "Aleix Palet" <aleix.palet at gmail.com>
>Subject: Differents behaviours of my application
>To: devel at lists.laptop.org
>Message-ID:
> <585c40560811180913r28eb4a54wf93393da2ba541f7 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi, I'm developing an application for sugar, and the problem is that I want
>different behaviours depending on the execution of my app:
>- when my app is opened through the icon of lower menu, I want a
>filechooser to appear, so I can choose which file to open.
>- when somebody downloads a .jclic.zip file, and clicks in the option resume
>with my app (I have made my app appear as an option to resume using mime
>_types), I don't want the filechooser, I want my app to open directly that
>file
>
>To do this, I've reading the wiki (which is a bit confusing) and I learned
>that I have to play with the read_file and write_file options. What I've
>done is what I write next (with the consequent problems):
>
>- in the init method of my app, I do the the acticity.Activity.__init__ and
>then I create the filechooser, I choose the file and then load, I guess i
>shouldn't do it like this, because when my app is executed through the
>read_file method, first this __init__ method is called, showing me the
>filechooser which I don't want!
>
>- another problem is that the read_file filename parameter, gives me the
>path of the journal file copy, which is not a .jclic,zip file, then is not
>the file that I want.
>
>So my questions are:
>
>- how to organize my code to get the behabiour that I want?
>- how to get the real path?
>
>And finally, I've got another problem which is not as important as the ones
>before, but if I get an asnwer I would really grateful. When I open the
>filechooser which is made with and wx.app, which it also has an wx.frame,
>then I choose the file, but I don't get the window closed and the execution
>returned to the main app. The window stays opened without showing anything
>(a grey window).
>
>Thank you for everything, maybe the questions are a bit basic, but as I
>said, is really hard to find some documentation in the olpc wiki. Bye!
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://lists.laptop.org/pipermail/devel/attachments/20081118/21820603/attachment-0001.htm
>
>
>
More information about the Devel
mailing list