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 43 support #359

Closed
yochananmarqos opened this issue Sep 3, 2022 · 11 comments
Closed

Nautilus 43 support #359

yochananmarqos opened this issue Sep 3, 2022 · 11 comments

Comments

@yochananmarqos
Copy link

yochananmarqos commented Sep 3, 2022

There are many changes with nautilus-python 4.0 and current Nautilus extensions will not work. See the 4.0.alpha release notes for details about adopting the changes. GNOME 43 will be released in few weeks.

EDIT: See https://gnome.pages.gitlab.gnome.org/nautilus-python/nautilus-python-migrating-to-4.html

@Forage
Copy link

Forage commented Sep 6, 2022

Debian went ahead and disabled building the extension all together because of it: https://tracker.debian.org/media/packages/r/rabbitvcs/changelog-0.18-4

@CloCkWeRX
Copy link
Member

Patches welcome for this.

@philippun1
Copy link
Collaborator

philippun1 commented Sep 11, 2022

If I update the MenuProvider API, and update depdency from Gtk3.0 to Gtk4.0, the following error happens:
Traceback (most recent call last): File "/home/phil/.local/share/nautilus-python/extensions/rabber.py", line 38, in <module> import rabbitvcs.ui.property_page File "/home/phil/.local/lib/python3.10/site-packages/rabbitvcs/ui/property_page.py", line 8, in <module> import rabbitvcs.ui.widget File "/home/phil/.local/lib/python3.10/site-packages/rabbitvcs/ui/widget.py", line 1048, in <module> class Clickable(object): File "/home/phil/.local/lib/python3.10/site-packages/rabbitvcs/ui/widget.py", line 1059, in Clickable _2BUTTON_PRESS = Gdk.EventType._2BUTTON_PRESS AttributeError: type object 'EventType' has no attribute '_2BUTTON_PRESS'. Did you mean: 'BUTTON_PRESS'?
Since widget.py is included basically everywhere else, the UI has to be converted to Gtk4 before the nautilus extension could work again with Nautilus 43?

I made a draft PR: #360

@philippun1
Copy link
Collaborator

Ok, migrating to gtk4 will be a lot of work... I made a workaround, which works again with Nautilus 43 (icons not working yet): #361
@CloCkWeRX would this be a viable solution? I had to duplicate some of the sources.

@yochananmarqos
Copy link
Author

@philippun1 I just tried your #360 PR applied on top of the latest commit a9b4922. The menus and icons work in Nautilus 43.0. However, the Settings won't open:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/rabbitvcs/ui/settings.py", line 420, in <module>
    window = Settings(options.base_dir)
  File "/usr/lib/python3.10/site-packages/rabbitvcs/ui/settings.py", line 82, in __init__
    self.get_widget("enable_attributes").set_active(
AttributeError: 'Settings' object has no attribute 'get_widget'

It also does not work with Nemo 5.4.3. Probably because it does not use Gtk4 yet.

Traceback (most recent call last):
  File "/usr/share/nemo-python/extensions/RabbitVCS.py", line 91, in <module>
    from rabbitvcs.util.contextmenu import MenuBuilder, MainContextMenu, SEPARATOR, ContextMenuConditions
  File "/usr/lib/python3.10/site-packages/rabbitvcs/util/contextmenu.py", line 33, in <module>
    from .contextmenuitems import *
  File "/usr/lib/python3.10/site-packages/rabbitvcs/util/contextmenuitems.py", line 29, in <module>
    gi.require_version("Gtk", "4.0")
  File "/usr/lib/python3.10/site-packages/gi/__init__.py", line 117, in require_version
    raise ValueError('Namespace %s is already loaded with version %s' %
ValueError: Namespace Gtk is already loaded with version 3.0

@philippun1
Copy link
Collaborator

@yochananmarqos #361 is a quick hack workaround to get it working again with Nautilus 43, which basically duplicates some code to get the Nautilus plugin work with Gtk4 and all the dialogs to work with Gtk3.
#360 is a work in progress of a complete migration to Gtk4, which is not functional right now.

So if you want a somehow working state, you have to use #361. I am currently using this branch and it works so far. But I only tested it with Nautilus 43 on Ubuntu 22.10.

@yochananmarqos
Copy link
Author

@philippun1 Thanks, forgot to try #361. It's working well so far.

@sta2m
Copy link

sta2m commented Oct 8, 2022

Hi,

Updating my debian distro today and lost RabbitVCS in Nautilus 43. I see #361 but doesn't work here.
Any help ?

Thanks ;)

@sta2m
Copy link

sta2m commented Oct 8, 2022

Ok, it's working. Need to do a

sudo cp -R /usr/lib/python3/dist-packages/rabbitvcs/ /usr/local/lib/python3.10/dist-packages

@yochananmarqos
Copy link
Author

@sta2m That should not be necessary. System packages should never be in /usr/local/.

@sta2m
Copy link

sta2m commented Oct 9, 2022

IThx for reply.

I don't know why, but this is the only way I found to got RabbitVCS Ok.

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

No branches or pull requests

5 participants