gedit-markdown icon indicating copy to clipboard operation
gedit-markdown copied to clipboard

Support for gedit 3.14

Open nashamri opened this issue 9 years ago • 16 comments

The plugin doesn't work under gedit 3.14

Traceback (most recent call last):
  File "/home/nasser/.local/share/gedit/plugins/markdown-preview/__init__.py", line 113, in do_activate
    self.addMarkdownPreviewTab()
  File "/home/nasser/.local/share/gedit/plugins/markdown-preview/__init__.py", line 139, in addMarkdownPreviewTab
    panel.add_item(self.scrolledWindow, "MarkdownPreview", _("Markdown Preview"), image)
AttributeError: 'Stack' object has no attribute 'add_item'
Traceback (most recent call last):
  File "/home/nasser/.local/share/gedit/plugins/markdown-preview/__init__.py", line 128, in do_update_state
    self.actionGroup1.set_sensitive(self.window.get_active_document() != None)
AttributeError: 'MarkdownPreviewPlugin' object has no attribute 'actionGroup1'
Traceback (most recent call last):
  File "/home/nasser/.local/share/gedit/plugins/markdown-preview/__init__.py", line 128, in do_update_state
    self.actionGroup1.set_sensitive(self.window.get_active_document() != None)
AttributeError: 'MarkdownPreviewPlugin' object has no attribute 'actionGroup1'
Traceback (most recent call last):
  File "/home/nasser/.local/share/gedit/plugins/markdown-preview/__init__.py", line 128, in do_update_state
    self.actionGroup1.set_sensitive(self.window.get_active_document() != None)
AttributeError: 'MarkdownPreviewPlugin' object has no attribute 'actionGroup1'
Traceback (most recent call last):
  File "/home/nasser/.local/share/gedit/plugins/markdown-preview/__init__.py", line 128, in do_update_state
    self.actionGroup1.set_sensitive(self.window.get_active_document() != None)
AttributeError: 'MarkdownPreviewPlugin' object has no attribute 'actionGroup1'

nashamri avatar Oct 30 '14 12:10 nashamri

After looking around it seems that the GeditPanel was present in gedit 3.10.4 but not present in 3.12.2

nashamri avatar Oct 31 '14 19:10 nashamri

Can the markdown preview plugin be rewritten for gedit 3.14 ? Syntax highlighting is already there, but previow in side panel would be useful.

mashu avatar Nov 07 '14 12:11 mashu

Would love to see this!

fyksen avatar Dec 07 '14 23:12 fyksen

Yes, there's no point in a markdown plug-in if it doesn't have support for the last version of gedit. Would be great to have this fixed.

bbabel avatar Mar 12 '15 20:03 bbabel

I assume it won't work in the just released gedit 3.16... Just great!

bbabel avatar Mar 26 '15 20:03 bbabel

I've looked into this issue yesterday and I think i figured out the problem.

There are actually two things that need to be rewritten. The easy one is the side-panel. Since gedit 3.12 the panels are represented as GStack which just has slightly different methods of adding widgets, e.g. GStack.add_titled().

The second issue is about the menu entries. UIManager is deprecated since 3.10 and therefore Gedit.window has no method get_ui_manager() anymore. The new way of adding menu items is described here. In short: you need a class that implements Gedit.AppActivatable that can add menu items.

I will try to fix this issue and submit a pull request hopefully the next days.

nielsmde avatar Aug 24 '15 14:08 nielsmde

Hi ! I just tried last version on Gedit 3.14 (Debian Jessie distro), and it still not works. Did you solved the problem ? Thanks ;-)

ljoets avatar Nov 11 '15 11:11 ljoets

@nielsmde - thanks for the fix!

whbruce avatar Jan 05 '16 21:01 whbruce

Unfortunately, it still doesn't work with Gedit 3.18

Rat-S avatar Mar 06 '16 03:03 Rat-S

Which branch did you try out? Master or my patches version?

The pull request #9 for the fix is apparently still open. Hence,at the moment the fixed code is only available in this branch.

nielsmde avatar Mar 06 '16 14:03 nielsmde

@nielsmde. I used the version on your fork and wanted others to know it was there.

whbruce avatar Mar 07 '16 17:03 whbruce

That I got, my question was directed at @Rat-S, who wrote that it is still not working for him.

nielsmde avatar Mar 08 '16 13:03 nielsmde

@nielsmde I just tried your branch with gedit 3.18.3 (Fedora 23) -- unfortunately it does not work:

Traceback (most recent call last):
  File "/home/user/.local/share/gedit/plugins/markdown-preview/__init__.py", line 128, in do_update_state
    self.actionGroup1.set_sensitive(self.window.get_active_document() != None)
AttributeError: 'MarkdownPreviewPlugin' object has no attribute 'actionGroup1'

lahmann avatar Oct 21 '16 09:10 lahmann

@nielsmde Thanks your pull,it successfully work with my gedit 3.18

techping avatar Jan 09 '17 13:01 techping

thanks @nielsmde I just re-installed from your fork "https://github.com/nielsmde/gedit-markdown/archive/master.zip" and it works in my 3.18 too

iurisegtovich avatar Aug 16 '17 15:08 iurisegtovich

Please note my fork (based on @nielsmde's work): https://github.com/darkdragon-001/gedit-markdown/

Please test the latest release. Pull requests are always welcome!

darkdragon-001 avatar May 04 '20 14:05 darkdragon-001