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 623359 - Port quickopen to libpeas
Port quickopen to libpeas
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on: 622584 623068
Blocks:
 
 
Reported: 2010-07-02 09:55 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2019-03-23 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quickopen v1 (23.75 KB, patch)
2010-07-02 09:55 UTC, Ignacio Casal Quinteiro (nacho)
reviewed Details | Review
quickopen v2 (23.75 KB, patch)
2010-07-08 09:11 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
quickopen v3 (32.45 KB, patch)
2010-07-08 09:13 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
patch (34.02 KB, patch)
2010-11-21 19:51 UTC, Paolo Borelli
none Details | Review
patch (34.46 KB, patch)
2010-11-21 22:26 UTC, Paolo Borelli
none Details | Review
patch (35.01 KB, patch)
2010-11-27 11:50 UTC, Paolo Borelli
none Details | Review

Description Ignacio Casal Quinteiro (nacho) 2010-07-02 09:55:01 UTC
Created attachment 165081 [details] [review]
quickopen v1

The patch attached is unfinished due to several bugs in gi and missing annotations.
Comment 1 Steve Frécinaux 2010-07-02 14:21:52 UTC
Review of attachment 165081 [details] [review]:

::: plugins/quickopen/quickopen/__init__.py
@@ +32,2 @@
+        def do_activate(self, window):
+                self._window = WindowHelper(window, self)

In libpeas, you should not need the window helper: the plugin *is* the window helper :-)

Maybe you should merge __init__.py and windowhelper.py

::: plugins/quickopen/quickopen/popup.py
@@ +25,3 @@
 from virtualdirs import VirtualDirectory
 
+class Popup(Gtk.Dialog):

You miss the __gtype_name__ definition. This sucks and should be fixed in pygobject

@@ +148,3 @@
+                        while True:
+                                try:
+                                        info = entries.next_file(None)

What if a GLib.Error happend while doing enumerate_children() ?

::: plugins/quickopen/quickopen/virtualdirs.py
@@ +55,3 @@
         def fill(self, screen):
+                #FIXME
+                return

This should be fixed ;-)

::: plugins/quickopen/quickopen/windowhelper.py
@@ +61,3 @@
         def _install_menu(self):
                 manager = self._window.get_ui_manager()
+                self._action_group = Gtk.ActionGroup()

How do you set the action group name? Not sure it's required though.
Comment 2 Ignacio Casal Quinteiro (nacho) 2010-07-02 14:40:48 UTC
(In reply to comment #1)
> Review of attachment 165081 [details] [review]:
> 
> ::: plugins/quickopen/quickopen/__init__.py
> @@ +32,2 @@
> +        def do_activate(self, window):
> +                self._window = WindowHelper(window, self)
> 
> In libpeas, you should not need the window helper: the plugin *is* the window
> helper :-)
> 
> Maybe you should merge __init__.py and windowhelper.py
Right.
> 
> ::: plugins/quickopen/quickopen/popup.py
> @@ +25,3 @@
>  from virtualdirs import VirtualDirectory
> 
> +class Popup(Gtk.Dialog):
> 
> You miss the __gtype_name__ definition. This sucks and should be fixed in
> pygobject
> 
> @@ +148,3 @@
> +                        while True:
> +                                try:
> +                                        info = entries.next_file(None)
> 
> What if a GLib.Error happend while doing enumerate_children() ?
Yeah I guess it should return.
> 
> ::: plugins/quickopen/quickopen/virtualdirs.py
> @@ +55,3 @@
>          def fill(self, screen):
> +                #FIXME
> +                return
> 
> This should be fixed ;-)
Yeah there are several fixmes in the code, that's because it is not possible to do with gi yet, or I wasn't able.
> 
> ::: plugins/quickopen/quickopen/windowhelper.py
> @@ +61,3 @@
>          def _install_menu(self):
>                  manager = self._window.get_ui_manager()
> +                self._action_group = Gtk.ActionGroup()
> 
> How do you set the action group name? Not sure it's required though.
gi doesn't allow to set a name
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-07-08 09:11:48 UTC
Created attachment 165461 [details] [review]
quickopen v2

Some more fixes, but still waiting for more bugs to be fixed.
Comment 4 Ignacio Casal Quinteiro (nacho) 2010-07-08 09:13:01 UTC
Created attachment 165462 [details] [review]
quickopen v3

wrong patch.
Comment 5 Paolo Borelli 2010-11-21 19:51:56 UTC
Created attachment 174978 [details] [review]
patch

Updated to fix a few issues with newer pygi versions etc, but still does not work
Comment 6 Paolo Borelli 2010-11-21 22:26:33 UTC
Created attachment 174998 [details] [review]
patch

more fixes. List is now populated and navigable, but crashes on close/select (pygobject crash?)
Comment 7 Paolo Borelli 2010-11-27 11:50:37 UTC
Created attachment 175350 [details] [review]
patch
Comment 8 jessevdk@gmail.com 2010-11-27 15:26:12 UTC
Review of attachment 175350 [details] [review]:

Minor comments below

::: plugins/quickopen/quickopen/popup.py
@@ +407,3 @@
                                 self._select_index(num - 1, hasctrl, hasshift)
                 else:
+                        print path.get_indices()

Remove debug statement

::: plugins/quickopen/quickopen/virtualdirs.py
@@ +57,3 @@
                 items.sort(lambda a, b: cmp(b.get_visited(), a.get_visited()))
 
+                for item in items[0:self._maxitems]:

This does not seem correct. It can happen that the first _maxitems items are not gedit items, and then you see nothing?
Comment 9 Paolo Borelli 2011-03-13 20:05:07 UTC
the plugin port was committed a while ago