sugarlabs / sugar-toolkit-gtk3

Sugar Learning Environment, Activity Toolkit, GTK 3.
GNU Lesser General Public License v2.1
21 stars 80 forks source link

Allow to run activities without Sugar shell. #315

Closed icarito closed 8 years ago

icarito commented 8 years ago

Try it outside Sugar. Go to an Activity directory and run 'sugar-activity'. Tested it with Terminal, Finance, Write, Browse, Memorize under XFCE4. Tested in Gnome under OLPC-OS. Also works from Sugar Terminal Activity. Does not affect regular Sugar operation.

icarito commented 8 years ago

Also tested running activities from GNOME under OLPC-OS.

icarito commented 8 years ago

Here's a feature page: https://wiki.sugarlabs.org/go/Features/FreeDesktop_integration

icarito commented 8 years ago

The intention is to support this experiment. Might even include in patch? https://github.com/icarito/sugar-launcher-applet

quozl commented 8 years ago

Reviewed c85738d. Like it.

Suggest packaged activities might also provide .desktop files.

Suggest sugar-activity might also accept path to unpacked bundle.

godiard commented 8 years ago

Very nice. A few suggestions:

leonardcj commented 8 years ago

It would be nice if the changes to the POT for sugar-toolkit-gtk3 could be incorporated in this pull request, please.

samdroid-apps commented 8 years ago

Hi @icarito, thanks for the patch.

An important consideration for this patch is code architecture. I think that right now, it is not a good architecture. It is hacking around things that the toolkit (and also activities) previosuly assumed were present; eg. compensating for the lack of gsettings.

I think that maybe we could do this better by having a "launcher script" that setup the environment for the activity (eg. ensure that the gsettings are set up properly), and then launch the activity as per the activity.info description. That script could be shipped with sugar, or sugar-toolkit-gtk3.

Maybe the script could look like: sugar-external-launch-activity /usr/sugar/activities/Browse.activity?

quozl commented 8 years ago

I'm fine with this level of hacking around things at this stage of feature development; none of the hacks should cause problems in this release. Architectural improvements can come later.

We already have sugar-launch so perhaps it could be adjusted to recognise that the process environment is not Sugar but some other desktop. That would let us use the same tool in multiple places.

samdroid-apps commented 8 years ago

What is the need to "handle the lack of gsettings"? If the user has installed sugar, won't they have the gsettings schemas installed and therefore available? This is what happened when I tested on my Fedora machine.

quozl commented 8 years ago

What is the need to "handle the lack of gsettings"?

org.sugarlabs.user may be either not set, or not available.

If the user has installed sugar, won't they have the gsettings schemas installed and therefore available?

Not if they have only installed the toolkit.

Not if the GSettings infrastructure is unavailable, as happens on some desktop environments that predate or are not subsets of Gnome.

icarito commented 8 years ago

Everybuddy thanks for your kind reviews. I think I've handled most everybuddy's concerns with the latest version of the patch. Of course more could be done. Looking forward.

samdroid-apps commented 8 years ago

Love it. Looking good.

Just 1 thing before the merge. Please move the import statements to the top of the file, with the other import statements.

icarito commented 8 years ago

Done!

icarito commented 8 years ago

I imagine sugar-toolkit-gtk3 might be uploaded to the python cheese shop :-)

icarito commented 8 years ago

Hi this decouples sugar-toolkit-gtk3 from the sugar-shell which might be a first step towards running under broadwayd (HTML5). @godiard @quozl are we good enough to merge? Thanks in advance!

icarito commented 8 years ago

Suggest packaged activities might also provide .desktop files.

Do you mean activities themselves should provide .desktop files? Perhaps we could provide a script activity_info2desktopfile.

quozl commented 8 years ago

@icarito,

samdroid-apps commented 8 years ago

Na, this stuff is all good. @quozl, feel free to do the merge in future. I will actually merge it this time.

icarito commented 8 years ago

@samdroid-apps moving imports to the top of the file broke GTK2 activities! I've provided #317 to fix it, or we could move the import to the conditional in this case.

icarito commented 8 years ago

(credit goes to @quozl for figuring the issue out!)

icarito commented 8 years ago

@leonardcj I had answered your concern by updating the commit message but I guess github doesn't email updated commit logs:

It would be nice if the changes to the POT for sugar-toolkit-gtk3 could be incorporated in this pull request, please.

  • There were no changes to POT files as part of this patch. Maybe it is worth translating low level command line tools, not sure. Currently they aren't, and changing that goes beyond the scope of this patch.
icarito commented 8 years ago

Please also review and merge the companion patch to sugar-toolkit: https://github.com/sugarlabs/sugar-toolkit/pull/3

Thanks in advance!