OSDN Git Service

Open url command in ThreadPopup is implemented.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Sun, 19 Apr 2009 04:41:03 +0000 (13:41 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Sun, 19 Apr 2009 04:41:03 +0000 (13:41 +0900)
src/FukuiNoNamari/thread_popup.py
src/FukuiNoNamari/thread_window.py

index 4156246..e03add5 100644 (file)
@@ -6,14 +6,20 @@ import urlparse
 import copy
 import thread_view
 
-class ThreadPopup:
+class ThreadPopup(gobject.GObject):
     '''
     classdocs
     '''
 
+    __gsignals__ = {
+        "uri-clicked-event":
+        (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (object, object,))
+        }
+
     _INTERVAL = 100
 
     def __init__(self, bbs_type):
+        gobject.GObject.__init__(self)        
         self._thread_view_list = []
         self._bbs_type = bbs_type
         self._timer_started = False
@@ -111,6 +117,7 @@ class ThreadPopup:
         popupwin = gtk.Window(gtk.WINDOW_POPUP)
         popupwin.move(abs_x, abs_y)
         view = thread_view.ThreadView()
+        view.connect("uri-clicked-event", self.on_threadview_uri_clicked)
         self.push_thread_view(view)
         for layout in self._thread_view_list[0].res_layout_list:
             if layout.resnum == num:
@@ -143,4 +150,5 @@ class ThreadPopup:
         if self._is_thread_view_top(threadview):
             return True
 
-
+    def on_threadview_uri_clicked(self, widget, uri):
+        self.emit("uri-clicked-event", widget, uri)
index cce975f..2610b18 100644 (file)
@@ -154,6 +154,9 @@ class WinWrap(winwrapbase.WinWrapBase):
         self.window.set_focus(self.threadview.drawingarea)
 
         self.threadview.connect("uri-clicked-event", self.on_threadview_uri_clicked)
+        self.threadpopup.connect(
+            "uri-clicked-event",
+            lambda widget, threadview, uri: self.on_threadview_uri_clicked(threadview, uri))
 
         self.statusbar_context_id = self.statusbar.get_context_id(
             "Thread Window Status")