[gedit] snippets: add the iter property to the message bus.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] snippets: add the iter property to the message bus.
- Date: Mon, 10 Oct 2011 11:10:42 +0000 (UTC)
commit 6718dea9024b1c03c95eec905fb4e18001c1aba4
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Oct 10 13:09:45 2011 +0200
snippets: add the iter property to the message bus.
This was fixed in pygobject so we can add this feature back.
plugins/snippets/snippets/windowactivatable.py | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/plugins/snippets/snippets/windowactivatable.py b/plugins/snippets/snippets/windowactivatable.py
index ead09d4..15bf993 100644
--- a/plugins/snippets/snippets/windowactivatable.py
+++ b/plugins/snippets/snippets/windowactivatable.py
@@ -28,8 +28,7 @@ from signals import Signals
class Activate(Gedit.Message):
view = GObject.property(type=Gedit.View)
-# FIXME: fix as soon as fix lands in pygobject
-# iter = GObject.property(type=Gtk.TextIter)
+ iter = GObject.property(type=Gtk.TextIter)
trigger = GObject.property(type=str)
class WindowActivatable(GObject.Object, Gedit.WindowActivatable, Signals):
@@ -114,11 +113,10 @@ class WindowActivatable(GObject.Object, Gedit.WindowActivatable, Signals):
if not controller:
return
- # TODO: fix me as soon as the property fix lands in pygobject
- #iter = message.props.iter
+ iter = message.props.iter
- #if not iter:
- iter = view.get_buffer().get_iter_at_mark(view.get_buffer().get_insert())
+ if not iter:
+ iter = view.get_buffer().get_iter_at_mark(view.get_buffer().get_insert())
controller.run_snippet_trigger(message.props.trigger, (iter, iter))
def on_message_parse_and_activate(self, bus, message, userdata):
@@ -132,11 +130,10 @@ class WindowActivatable(GObject.Object, Gedit.WindowActivatable, Signals):
if not controller:
return
- # TODO: fix me as soon as the property fix lands in pygobject
- #iter = message.props.iter
+ iter = message.props.iter
- #if not iter:
- iter = view.get_buffer().get_iter_at_mark(view.get_buffer().get_insert())
+ if not iter:
+ iter = view.get_buffer().get_iter_at_mark(view.get_buffer().get_insert())
controller.parse_and_run_snippet(message.props.trigger, iter)
def insert_menu(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]