Closed medovina closed 10 years ago
The script pygi-convert.sh can help. The page Python Plugin How To for gedit 3 too.
Yes - those are good resources to know about. I've been working on porting gedit-file-to-search to gedit 3 - it's not completely trivial, but I hope to have something working in the next week.
I've now ported gedit-file-search to gedit 3. In the process, I ported from GTK 2 to GTK 3 and from PyGTK to PyGObject. I also ported from libgladeui to the newer GtkBuilder API. You can find the port in the gedit-3 branch of my gedit-file-search fork:
https://github.com/adam-yorba/gedit-file-search/tree/gedit-3
Caveats:
I recommend pulling these changes into a gedit-3 branch in the main gedit-file-search repository.
Thanks for the port!
Yes, pulling into a separate branch would be ok. However, I still need a RHEL5 compatible GTK2 version (probably for at least 2011 and possibly also for longer), and personally I won't need Gedit 3 support until 2012. So we would be maintaining these two branches for quite a while :-(
Do you think it's possible to create a single code base which supports both Gedit 2 and 3? Maybe some "import as..." trickery can be used for this, and the Glade->GTKBuilder conversion can be done by "make tgz"?
I think a single code base would be pretty awkward. There are lots of subtle and not-so-subtle differences between GTK 2/3, Gedit 2/3 and PyGTK/PyGObject. To have a single code base, there would need to be lots of ifdefs or other conditional checks strewn throughout the code, which would make it hard to read and even harder to maintain. I think that two different git branches is the easiest approach, even if they need to be maintained for a while - git makes this pretty easy. I've seen other GNOME projects use separate branches for GTK 2/3 as well.
I think that others will be interested in this gedit 3 port, so I added an entry to the gedit 3 plugin list (http://live.gnome.org/Gedit/Plugins) linking to this bug and to my gedit-file-search fork. As I mentioned above, it would be nice if you could merge this into a branch in the official gedit-file-search repository.
@adam-yorba: I tested your gedit-3 branch. I didn't find any issue tracker for your branch, so I list here the bugs I found:
Makefile
, occurrences of file-search.glade
should be replaced by file-search.ui
. Idem for file-search.gedit-plugin
, that should be replaced by file-search.plugin
.Regards.
@adam-yorba: I have another bug. I first filled a report on gedit bugtracker, but a developer wrote:
Well, probably that plugin is doing something wrong. I'd tell you to file a bug against that plugin. Closing as NOTGNOME then. Thanks for reporting.
So I report here:
On Edit > Preferences > Plugins, I enabled Embedded Terminal and External Tools. Sometimes, I have the following bugs:
I found that I have this error if I enabled the plugin Gedit File Search.
On a terminal, I have 2 tracebacks:
$ gedit
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
Traceback (most recent call last):
File "/usr/lib/gedit/plugins/terminal.py", line 251 in do_activate
self._panel = GeditTerminal()
File "/usr/lib/gedit/plugins/terminal.py", line 59 in __init__
self.reconfigure_vte()
File "/usr/lib/gedit/plugins/terminal.py", line 118 in reconfigure_vte
self.font_changed()
File "/usr/lib/gedit/plugins/terminal.py", line 112 in font_changed
font_desc = Pango.font_description_from_string(font)
File "/usr/lib/python2.7/dist-packages/gi/types.py", line 44 in function
return info.invoke(*args)
TypeError: must be a subtype of gi.Boxed
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
Traceback (most recent call last):
File "/usr/lib/gedit/plugins/externaltools/windowactivatable.py", line 205,
in do_activate
self._output_buffer = OutputPanel(self.plugin_info.get_data_dir(),
self.window)
File "/usr/lib/gedit/plugins/externaltools/outputpanel.py", line 67, in
__init__
self.font_changed()
File "/usr/lib/gedit/plugins/externaltools/outputpanel.py", line 107, in
font_changed
font_desc = Pango.font_description_from_string(font)
File "/usr/lib/python2.7/dist-packages/gi/types.py", line 44, in function
return info.invoke(*args)
TypeError: must be a subtype of gi.Boxed
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': gedit: undefined symbol: menu_proxy_module_load
(gedit:1013): Gtk-WARNING **: Failed to load type module: (null)
(gedit:1013): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
underallocate GtkComboBox's child GtkCellView 0xa67c2a0. Allocation is 302x24,
but minimum required size is 305x24.
(gedit:1013): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
underallocate GtkComboBox's child GtkCellView 0xa67c2a0. Allocation is 302x24,
but minimum required size is 305x24.
(gedit:1013): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to
underallocate GtkComboBox's child GtkCellView 0xa67c2a0. Allocation is 302x24,
but minimum required size is 305x24.
There is a branch at https://github.com/oliver/gedit-file-search/tree/gedit3 now, which contains the Gedit3 port by Adam (great work btw!) with additional fixes for the bugs you mentioned. It has been tested with Gedit 3.4.1 under Ubuntu 12.04. It will probably not work under newer Gedit versions which use Python3 instead of Python2.
This should be fixed with release 1.0 now - http://olivergerlich.wordpress.com/2013/09/10/gedit-file-search-plugin-1-0-available-now-for-gedit-3/
gedit-file-search won't currently work with gedit 3 (found in Fedora 15 and the upcoming Ubuntu Oneiric).
(If you're not ready to migrate the master branch to gedit 3, you could create a separate git branch for that.)