After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724173 - Can't build against gedit 3.11/3.12
Can't build against gedit 3.11/3.12
Status: RESOLVED WONTFIX
Product: valencia
Classification: Other
Component: general
0.5.0
Other Linux
: High normal
: ---
Assigned To: Valencia Maintainers
Valencia Maintainers
gnome[unmaintained]
: 722797 724188 744501 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-02-11 19:37 UTC by Jim Nelson
Modified: 2018-08-19 09:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Update Valencia to the lastest API changes. (25.12 KB, patch)
2014-09-08 17:14 UTC, Georges Basile Stavracas Neto
none Details | Review
Makes Valencia to work on GEdit 3.14.x (1.93 KB, patch)
2015-02-14 12:36 UTC, Kyrylo V. Polezhaiev
none Details | Review
Prevent valencia from crash when saving documents (1.33 KB, patch)
2015-02-21 12:12 UTC, Kyrylo V. Polezhaiev
committed Details | Review

Description Jim Nelson 2014-02-11 19:37:33 UTC
It was recently reported that gedit 3.11/3.12 changes the plugin API.  This most likely affects Valencia.  However, I can't currently test which changes need to be made (if any) because the Vala bindings haven't been updated yet (bug #724172).

It's possible that once the bindings are fixed there is no work to be done on Valencia, but I'll leave this open until we know for certain.
Comment 1 Jim Nelson 2014-02-11 23:17:50 UTC
*** Bug 724188 has been marked as a duplicate of this bug. ***
Comment 2 Jim Nelson 2014-02-17 23:45:50 UTC
It appears the bindings problem has been resolved, so need to examine changes and consider next steps.
Comment 3 Jim Nelson 2014-02-18 20:15:57 UTC
It appears there are at least two changes that have to be made for Valencia to be compatible with gedit 3.12:

* GeditPanel has been replaced by GtkStack.  Making this change is largely mechanical, as Valencia's use of GeditPanel was merely to add widgets to the container.

* GtkUIManager has been deprecated and is no longer available in gedit.  This is a larger problem.  Valencia used UIManager to merge its menu items into gedit's menu bar.  However, not only is UIManager now gone, but there's no menu bar.

It appears Valencia's only options for presenting menu items is in gedit's new gear menu.  I believe this can be achieved via GeditAppActivateable.extend_menu().

The first change is largely a matter of changing symbol names.  I've pushed those changes to wip/gedit-3.12

The second will take a bit more work.  It's also possible other problems lie ahead I'm not seeing at the moment.  I don't believe we're going to have time to get this in for the 0.6 release.
Comment 4 Jim Nelson 2014-02-18 20:42:12 UTC
*** Bug 722797 has been marked as a duplicate of this bug. ***
Comment 5 Jim Nelson 2014-02-18 20:45:38 UTC
Fixing this will also (probably) remove all the deprecation warnings (bug #724148).
Comment 6 Michel Alexandre Salim 2014-02-23 17:07:20 UTC
Good thing the F21 release that will ship Gedit >= 3.12 does not have a release date yet - I'd hate for Valencia to have to skip a release.

Seems like it's as good a time as any to get involved in Valencia development - I am completely swamped for the next couple of weeks, but after that, how much effort do you estimate the menu change would take?
Comment 7 Jim Nelson 2014-02-24 20:05:12 UTC
I believe the bulk of the work is (a) migrating the GtkActions to GActions and (b) inserting them into the right place(s) in gedit's gear menu.  There might be an argument against inserting all of them into the menu, but without the presence of some UI element, the only way to access them is via an accelerator and would therefore be undiscoverable to the user.

It looks like gedit has placed section names into their gear menu.  My assumption is that the plugin is supposed to insert its menu items into the appropriate section.  I haven't thought much about where the menu items should go or how they're structured.  As a first stab, I would just make a "Valencia" menu item and make all the menu items children of that.

Just this change wouldn't take terribly long.  Because the compile fails at this point, I don't know if there's other work involved.
Comment 8 Jim Nelson 2014-03-03 23:41:01 UTC
Ignacio Casal Quinteiro posted a couple of links to the gedit mailing list that offer clues on how to port plugins to the new API: https://mail.gnome.org/archives/gedit-list/2014-February/msg00010.html
Comment 9 Georges Basile Stavracas Neto 2014-09-08 17:14:01 UTC
Created attachment 285664 [details] [review]
Update Valencia to the lastest API changes.

This should work, though I didn't tested it too much.
Comment 10 Georges Basile Stavracas Neto 2014-09-09 12:24:13 UTC
Explaining the patch:

- A new class 'AppInstance' was created to insert the menu items. This class is instanced only once.

- Every Gedit.Window has GLib.Actions. The menus are disabled automagically when the action is disabled.

- Since we don't have the Gtk.MenuItem:"activate" signal anymore, I've used a combination of Gedit.Window:"active-tab-changed" & Gtk.Widget:"focus-in-event" to update the GLib.Actions (i.e. the Valencia menu). AFAICT it works as expected.

I sincerely hope it's enough.
Comment 11 Michel Alexandre Salim 2014-11-26 08:06:06 UTC
(In reply to comment #10)
> Explaining the patch:
> 
Hi Georges,

Awesome, I've been meaning to fix this myself to ship with the upcoming Fedora 21 but haven't got the chance yet. Will try this on my Fedora testbed.

Jim, any chance this could get merged if it works? ps the wip/gedit-3-12 branch seems to be neglected, perhaps it could be synced to master and this patch dropped there.
Comment 12 Michel Alexandre Salim 2014-11-26 17:51:17 UTC
Fedora 21 is shipping next month with Vala 0.26.1 and Gedit 3.14.1; this is the error I get when compiling with the patch. Will try and debug.

# make LIBVALA=libvala-0.26
valac  -X --shared -X -fPIC --pkg gedit --pkg gee-0.8 --pkg gtk+-3.0 --pkg gtksourceview-3.0 --pkg libpeas-1.0 --pkg libvala-0.26 --pkg vte-2.90 autocomplete.vala browser.vala expression.vala gtk_util.vala parser.vala program.vala scanner.vala settings.vala util.vala valencia.vala -o libvalencia.so
valencia.vala:888.9-888.22: error: The type name `Gedit.Encoding' could not be found
        Gedit.Encoding encoding = null;
        ^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Makefile:58: recipe for target 'libvalencia.so' failed
make: *** [libvalencia.so] Error 1
Comment 13 Michel Alexandre Salim 2014-11-26 18:07:11 UTC
Removed back in July in gedit:

commit 67504bbadac4fb85830d66603d9efd715ec75e25
Author: Sébastien Wilmet <swilmet@gnome.org>
Date:   Tue Jul 1 15:07:31 2014 +0200

    Remove GeditEncoding
    
    Use GtkSourceEncoding instead. The functions are exactly the same.
Comment 14 Jim Nelson 2014-12-03 01:39:59 UTC
Because Georges patch was based off master, I've created a second branch with it applied: wip/724173-gedit.

I'm working off of F21, so I additionally patched that branch to use vte-291, as vte-290 is no longer available on F21.  I also patched Gedit.Encoding -> Gtk.SourceEncoding, although the lines in question seem suspect to me:

Gtk.SourceEncoding encoding = null;
tab = window.create_tab_from_location(File.new_for_path(filename), encoding, 0, 0, false, true);

No matter -- this isn't the place to optimize or fix what's not broken.

I'm now hitting this compile error:

valencia.vala:837.17-837.25: error: The name 'do_save' does not exist in the context of 'Gedit.Document'
    d.do_save(0);

Reading the latest docs, it looks like saving a gedit document now requires create a GtkSourceFile and a GtkSourceFileSaver:

https://developer.gnome.org/gedit/stable/gedit-gedit-document.html#gedit-document-get-file

So, a little farther but another brick wall.  I can't spend much more time now pushing forward on it, so patches welcome.
Comment 15 Georges Basile Stavracas Neto 2014-12-03 01:43:10 UTC
I'll update the patches as soon as I can. I can only guarantee free time to work on it after Dec 19, so don't expect the patch before this date. If anyone else updates it, however, it would be very nice.
Comment 16 Jim Nelson 2015-02-13 23:46:38 UTC
*** Bug 744501 has been marked as a duplicate of this bug. ***
Comment 17 Kyrylo V. Polezhaiev 2015-02-14 00:15:34 UTC
Hello, fellows.

It looks we can use gedit_commands_save_document() or gedit_commands_save_document_async() to save documents on build.
Comment 18 Kyrylo V. Polezhaiev 2015-02-14 00:23:07 UTC
It seems there is no fork_command_full in vte 2.91
Comment 19 Kyrylo V. Polezhaiev 2015-02-14 00:27:31 UTC
spaw_sync replaces it, however.
Comment 20 Kyrylo V. Polezhaiev 2015-02-14 12:35:07 UTC
Okay, looks like Valencia works on gedit-3.14.3.
However, there is one issue to be resolved gedit-side.
Comment 21 Kyrylo V. Polezhaiev 2015-02-14 12:36:37 UTC
Created attachment 296823 [details] [review]
Makes Valencia to work on GEdit 3.14.x
Comment 22 Kyrylo V. Polezhaiev 2015-02-14 12:54:49 UTC
It seems we have some problems handling "saved" signal.
Comment 23 Jim Nelson 2015-02-17 23:43:48 UTC
See also bug #744505.
Comment 24 Jim Nelson 2015-02-18 01:10:06 UTC
(In reply to Kyrylo V. Polezhaiev from comment #21)
> Created attachment 296823 [details] [review] [review]

Pushed to wip/724173-gedit
Comment 25 Jim Nelson 2015-02-18 01:13:14 UTC
I removed the wip/gedit-3.12 branch, as it was no longer the working branch for this ticket (it's changes were better implemented in wip/724173-gedit) and I didn't want to confuse anyone out there.
Comment 26 Kyrylo V. Polezhaiev 2015-02-21 12:12:40 UTC
Created attachment 297488 [details] [review]
Prevent valencia from crash when saving documents

GError has been removed from Gedit.Document's "saved" signal, so we need to tweak our callbacks a bit:
Comment 27 Jim Nelson 2015-02-24 23:47:35 UTC
Ok, I pushed that to wip/724173-gedit

Regarding the #include problem, we should consider simply taking the most recent gedit VAPI, manually editing it with the necessary changes, and adding it to the Valencia project.  That is probably faster than waiting for the updated VAPI to be released (which also means Valencia can only be built against that version of gedit and not earlier ones).
Comment 28 Kyrylo V. Polezhaiev 2015-02-25 00:02:44 UTC
The simplest workaround is to add gedit-notebook.h header and don't touch VAPI.
It seems gedit team already solved header problem by splitting header into private and public part, soon they will update VAPI.
Comment 29 Kyrylo V. Polezhaiev 2015-03-17 16:42:30 UTC
Can you please mark my attachment?
Comment 30 Jim Nelson 2015-03-18 20:26:40 UTC
Review of attachment 297488 [details] [review]:

Pushed to wip/724173-gedit, commit 0e2a877
Comment 31 André Klapper 2018-08-19 09:14:36 UTC
Valencia is not under active development anymore and saw its last non-cosmetic code changes in 2014. Its codebase has been archived:
https://gitlab.gnome.org/Archive/valencia/commits/master

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Please feel free to reopen this ticket (or rather transfer the project
to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the
responsibility for active development again.