oliver / gedit-file-search

Gedit plugin to search a text in all files in a directory
https://oliver.github.io/gedit-file-search/
43 stars 11 forks source link

doesn't work with gedit 3 #13

Closed medovina closed 10 years ago

medovina commented 13 years ago

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.)

jpfleury commented 13 years ago

The script pygi-convert.sh can help. The page Python Plugin How To for gedit 3 too.

medovina commented 13 years ago

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.

medovina commented 13 years ago

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:

  1. I didn't touch the translations in the locale subdirectory. I don't know much about how translations work with Glade and Python, so I'll leave this to others who know more. The port works fine in English at least.
  2. I didn't port from GConf to GSettings, but it would make sense to do that soon.

I recommend pulling these changes into a gedit-3 branch in the main gedit-file-search repository.

oliver commented 13 years ago

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"?

medovina commented 13 years ago

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.

medovina commented 12 years ago

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.

jpfleury commented 12 years ago

@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:

  1. In 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.
  2. After a search, the title of the tab on the bottom panel is always "gtk-find" instead of the words used for the search.
  3. After a search, there's no longer context menu when I click right on results on the bottom panel. With gedit 2, there was a context menu allowing to copy, collapse, extend.
  4. I no longer see a "Search files..." item on the context menu when I click right on the File Browser on the side pane.

Regards.

jpfleury commented 12 years ago

@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.
oliver commented 10 years ago

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.

oliver commented 10 years ago

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/