ok, thank you.<br>i'll have a look at the examples and try to find an example close to my needs.<br><br>regards<br><br><div class="gmail_quote">2011/5/28 Walter Bender <span dir="ltr"><<a href="mailto:walter.bender@gmail.com">walter.bender@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br><div class="gmail_quote"><div class="im">On Sat, May 28, 2011 at 5:04 AM, laurent bernabe <span dir="ltr"><<a href="mailto:laurent.bernabe@gmail.com" target="_blank">laurent.bernabe@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Thank you for your answers.<br>But i am not sure i can do my task just with an ObjectChooser. And i need your advices for the strategy i should adopt :<br><ul><li>I want my application to "save a graph" by writing the coordinates in a text file => i am conviced that for this tasks, i should use the folder data of the activity</li>
<li>i want my application to "load a graph" from a previously recorded graph<br></li><li>but i also want the users to share other graphs each others : more precisely, for users who don't have internet access (or for later systems restores, maybe after a crash, for example) to be able to import files from a usb key</li>
</ul>So, what is the best strategy in order to do these tasks and remain conform to Sugar best practices ?<br></blockquote></div><div><br>In general, using the Journal for these sorts of tasks is best practice in Sugar. You can set a file path with your data associated with your activity's datastore instance. That file can contain anything you want. It is typical to have a method that overrides the builtin write_file method -- called whenever the activity is either removed from the foreground or the activity exits -- from which you save data.<br>
<br> def write_file(self, file_path):<br> ''' Write the project to the Journal. '''<br> ...<br><br>You can also set the mime type for this file, so as giving a hint as to what activities can subsequently open it.<br>
<br>Lots of examples of this out there.<br><br>-walter<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div class="im"><br>Regards<div>
<div></div>
<div><br><br><div class="gmail_quote">2011/5/27 Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Step 1: search wiki for ObjectChooser.<br>
Step 2: find <a href="http://wiki.sugarlabs.org/go/Activity_Team/Object_Chooser" target="_blank">http://wiki.sugarlabs.org/go/Activity_Team/Object_Chooser</a><br>
Step 3: there is no step 3<br>
<font color="#888888"><br>
- Bert -<br>
</font><div><div></div><div><br>
On 27.05.2011, at 17:49, laurent bernabe wrote:<br>
<br>
> Thank you.<br>
><br>
> I've been on Sugar Almanach page in order to find ObjectChooser class, but i did not manage.<br>
> (i've been here : <a href="http://wiki.sugarlabs.org/go/Development_Team/Almanac" target="_blank">http://wiki.sugarlabs.org/go/Development_Team/Almanac</a> )<br>
> Where should i look ?<br>
><br>
> Regards<br>
><br>
> 2011/5/27 Gonzalo Odiard <<a href="mailto:gonzalo@laptop.org" target="_blank">gonzalo@laptop.org</a>><br>
> If you use a FileChooserDialog, you don't have integration with the Journal.<br>
> You must use ObjectChooser.<br>
><br>
> Gonzalo<br>
><br>
> On Fri, May 27, 2011 at 11:56 AM, laurent bernabe <<a href="mailto:laurent.bernabe@gmail.com" target="_blank">laurent.bernabe@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> i would like to use the FileChooserDialog in my application, which the PyGTK reference says it can be used with PyGTK >= 2.4.<br>
> Therefore, i wonder whereas oldest OLPC has already a PyGTK >= 2.4 version.<br>
> So, is it all right ?<br>
><br>
> Regards<br>
</div></div></blockquote></div><br>
</div></div><br></div><div class="im">_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></div></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Walter Bender<br>Sugar Labs<br><a href="http://www.sugarlabs.org" target="_blank">http://www.sugarlabs.org</a><br><br>
</font></blockquote></div><br>