Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a Sharing Portal #49

Open
Suzie97 opened this issue Jan 27, 2022 · 3 comments
Open

Implement a Sharing Portal #49

Suzie97 opened this issue Jan 27, 2022 · 3 comments

Comments

@Suzie97
Copy link

Suzie97 commented Jan 27, 2022

Problem

This was discussed over email with @marbetschar.

I'm explaining this using an example. Lets say someone is reading an article on some app, say Communique and wants to save that article as a reminder in elementary Tasks. Currently, there is no way for Communique to save a reminder to Tasks. The user will have to manually open Tasks and create the task themselves and save it to a project.

Other apps can also benefit from this functionality.

Proposal

Implement some sort of Sharing Portal which is capable of receiving different types of information and forwarding that to the respective responsible apps.

Prior Art (Optional)

macOS

Screenshot 2022-01-28 at 01 01 44

iOS

IMG_CFD5020DB546-1

@tintou
Copy link
Member

tintou commented Jun 17, 2022

Just writing my thought:
I think that it might be desirable to have an API similar to copy/paste support and not have everything file-based

@Marukesu
Copy link
Contributor

I believe the best place to discuss this is in flatpak/xdg-desktop-portal#12, an cross-desktop portal means that applications won't need to check if it's running inside elementary to use it.

I think that it might be desirable to have an API similar to copy/paste support and not have everything file-based

@tintou, you say the Vala/C API or D-Bus API? For the DBus API, what i had in mind was something like the OpenURI Portal:

o org.freedesktop.portal.elementary.Share.ShareURI (s parent_window,
                                                    s uri,
                                                    a{sv} options)

o org.freedesktop.portal.elementary.Share.ShareFile (s parent_window,
                                                     h fd,
                                                     a{sv} options)

and a new method in the AppChooser portal:

(ua{sv}) org.freedesktop.impl.portal.AppChooser.ChooseAction (o handle,
                                                              s app_id,
                                                              s parent_window,
                                                              aa{sv} choices,
                                                              a{sv} options)

then applications would implement an io.elementary.Share D-Bus interface that would have only one method:

aa{sv} io.elementary.Share.ListActions (s mime_type)`

the actions would be activated via the org.freedesktop.Application.ActivateAction method, applications would declare support using the Implements key and supported mimes in the io.elementary.Share group in they .desktop file, Like the upstream proposal. In case of upstreaming, instead of a new portal, it can be new methods to the OpenURI portal itself.

For the Vala/C API, we cloud implement it in an helper object:

[DBus (name = "io.elementary.Share")]
public sealed class Granite.Share : Object {
    public uint register_action (string action_name, string mime, string title, Icon? icon);
    public void unregister_action (uint id);
}

and/or undeprecate the Granite.Application class, and add helpers:

[DBus (name = "io.elementary.Share")]
public class Granite.Application : Gtk.Application {
    public void export_action (string action_name, string mime, string title, Icon? icon);
    public void unexport_action (string action_name);
}

batch register/export and unregister/unexport methods could be provided if needed.

@danirabbit
Copy link
Member

Just wanted to note in addition to the design discussion on the Granite ActionSheet issue that this is a pretty convenient and smart feature that would be nice. Generating a QR code for any URL passed into the sharing portal: https://mastodon.social/@sil/111353440431438250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants