Difference between revisions of "Features/GTK3/Porting/GetBooks"
Line 18: | Line 18: | ||
I [http://lists.sugarlabs.org/archive/sugar-devel/2012-June/037996.html ask to the Sugar Developers mailing list] about how to do this and they told me that I should change the ''bundle_id''. In fact, we have to change the '''bundle_id''' and the '''name''' from the ''activity/activity.info'' file. I used: | I [http://lists.sugarlabs.org/archive/sugar-devel/2012-June/037996.html ask to the Sugar Developers mailing list] about how to do this and they told me that I should change the ''bundle_id''. In fact, we have to change the '''bundle_id''' and the '''name''' from the ''activity/activity.info'' file. I used: | ||
− | name = Get Books | + | name = Get Books Gtk3 |
bundle_id = git.GetBooksActivity | bundle_id = git.GetBooksActivity | ||
+ | |||
+ | After this, you should run the ''build'' and ''dev'' setup commands: | ||
+ | |||
+ | cd get-books | ||
+ | python setup.py dev | ||
+ | python setup.py build | ||
+ | |||
+ | Now, you will see two Get Books activities: one called just "Get Books" and another one called "Get Books Gtk3". | ||
== Script to list all the enumeration == | == Script to list all the enumeration == |
Revision as of 21:31, 12 June 2012
This page is being performed while I'm porting Get Books Activity to Gtk3.
There is a ticket with some useful information that I'm using on the porting and to keep tracking this port. Besides, this wiki page will be useful to write some code snippets about what are the difficulties that I'm having on the port and maybe can be useful for someone else.
Steps that you should follow to Port an Activity to Gtk3
- . Read the Sugar Official Wiki
- . Read the specific Sugar Wiki Page that talks about how to porting. Please, follow those steps and if you have a suggestion about the process you can contact with us and let us know.
- . Comment on IRC about the Activity that you are going to Port (#sugar on irc.freenode.net)
- . Run this script that will convert automatically things as much as it can. This is to avoid some stressful manually conversions that a "simple script" can do using sed :)
Tips and Tricks
Create a "new" activity from the git version
It's really useful to keep the "original" version of the Activity that we are porting to know how it was working before the port. Sometimes you find an strange behaviour on the ported version of the activity and you think that you don't touch that part of the code or that the change shouldn't affect it. In these cases it's good to run the "original" version and test how it worked before the port.
I ask to the Sugar Developers mailing list about how to do this and they told me that I should change the bundle_id. In fact, we have to change the bundle_id and the name from the activity/activity.info file. I used:
name = Get Books Gtk3 bundle_id = git.GetBooksActivity
After this, you should run the build and dev setup commands:
cd get-books python setup.py dev python setup.py build
Now, you will see two Get Books activities: one called just "Get Books" and another one called "Get Books Gtk3".
Script to list all the enumeration
There is an script that list all the Gtk methods and it's useful to know the new name and from where it comes from. For example:
[humitos@michifus get-books]$ python pygi-enumerate.py | grep get_selection Gtk.AccelLabel.get_selection_bounds() (instance method) Gtk.Editable.get_selection_bounds() (instance method) Gtk.Entry.get_selection_bounds() (instance method) Gtk.IconView.get_selection_mode() (instance method) Gtk.Label.get_selection_bounds() (instance method) Gtk.SelectionData.get_selection() (instance method) Gtk.SpinButton.get_selection_bounds() (instance method) Gtk.TextBuffer.get_selection_bound() (instance method) Gtk.TextBuffer.get_selection_bounds() (instance method) Gtk.TreeView.get_selection() (instance method) [humitos@michifus get-books]$
References / Useful links
- Guide you should follow: http://wiki.sugarlabs.org/go/Features/GTK3/Porting
- PyGtk documentation
- Reference Manual