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

Nautilus Shell Extension: separator and submenu #6921

Closed
wants to merge 1 commit into from
Closed

Conversation

ogoffart
Copy link
Contributor

@ogoffart ogoffart commented Dec 7, 2018

This is just a WIP RFC, before doing it on other plugins.

This is an extension to the protocol to get separator and submenu

The protocol looks like this:

GET_MENU_ITEMS:BEGIN
MENU_ITEM:SHARE:d:Share…
SUBMENU_BEGIN::Private Links
MENU_ITEM:COPY_PRIVATE_LINK::Copy
MENU_ITEM:OPEN_PRIVATE_LINK::Open in browser
SUBMENU_END:
SEPARATOR:
MENU_ICON:/usr/share/icons/hicolor/32x32/apps/owncloud.png
MENU_ITEM:DOWNLOAD_VIRTUAL_FILE::Download
GET_MENU_ITEMS:END

It adds a few command:
SEPARATOR is self explanatory.
MENU_ICON will allow to set an icon to the next item
SUBMENU_BEGIN:<flags>:<text> will add a submenu, and all following items are
int this submenu. the submenu ends with SUBMENU_END
It is possible to have submenu within submenu.

I also wanted to add checkable or checked flags, but it does not seem that nautilus supports that.
Actually, even the icon does not work (i don't see it in my nautilus although the API allows it)

This is an extension to the protocol to get separator and submenu

The protocol looks like this:

```
GET_MENU_ITEMS:BEGIN
MENU_ITEM:SHARE:d:Share…
SUBMENU_BEGIN::Private Links
MENU_ITEM:COPY_PRIVATE_LINK::Copy
MENU_ITEM:OPEN_PRIVATE_LINK::Open in browser
SUBMENU_END:
SEPARATOR:
MENU_ICON:/usr/share/icons/hicolor/32x32/apps/owncloud.png
MENU_ITEM:DOWNLOAD_VIRTUAL_FILE::Download
GET_MENU_ITEMS:END
```

It adds a fiew command:
`SEPARATOR` is self explanatory.
`MENU_ICON` will allow to set an icon to the next item
`SUBMENU_BEGIN:<flags>:<text>` will add a submenu, and all following items are
int this submenu. the submenu ends with `SUBMENU_END`
It is possible to have submenu within submenu.
Copy link
Contributor

@ckamm ckamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me. I agree about not adding "checked" to the socket api if not all platforms support it.

@ogoffart
Copy link
Contributor Author

ogoffart commented Jan 2, 2019

I agree about not adding "checked" to the socket api if not all platforms support it.

We could still add it.
On nautilus, and other platform that do not support checkboxes in menu, we could simply add the ☐ and ☑ character in front of the item names.

@TheOneRing
Copy link
Member

I'd suggest to use the json based api for new features and send icons as payload instead of a file link, with the icons being located in the qrc the file path approach only works on linux.

@TheOneRing TheOneRing closed this Apr 14, 2021
@TheOneRing TheOneRing deleted the socketapi branch April 30, 2021 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants