OSDN Git Service

Fix toolbutton signal handler. set title. update after submitting.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Wed, 30 Aug 2006 18:02:33 +0000 (03:02 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Wed, 30 Aug 2006 18:02:33 +0000 (03:02 +0900)
src/Hage1/submit_window.py
src/data/submit_window.glade

index b39b272..0be215d 100644 (file)
@@ -30,6 +30,8 @@ import time
 from BbsType import bbs_type_judge_uri
 from BbsType import bbs_type_exception
 from HTMLParserEx import HTMLParserEx
+import datfile
+import uri_opener
 
 GLADE_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                          "..", "data")
@@ -118,6 +120,11 @@ class WinWrap:
 
         self.widget_tree.signal_autoconnect(sigdic)
 
+        title = datfile.get_title_from_dat(
+            self.bbs_type.bbs_type, self.bbs_type.board, self.bbs_type.thread)
+        if title:
+            self.window.set_title(title)
+
     def on_close_activate(self, widget):
         self.window.destroy()
 
@@ -179,7 +186,12 @@ class WinWrap:
         window.show_all()
 
         if p.complete:
-            gobject.timeout_add(2 * 1000, window.destroy)
+
+            def on_timeout(widget):
+                widget.destroy()
+                uri_opener.open_uri(self.bbs_type.get_thread_uri(), True)
+
+            gobject.timeout_add(2 * 1000, on_timeout, window)
 
     def on_button_submit_clicked(self, widget, inputs=None):
         widget.get_toplevel().destroy()
index a2c6ac4..be57543 100644 (file)
                  <property name="visible_horizontal">True</property>
                  <property name="visible_vertical">True</property>
                  <property name="is_important">False</property>
-                 <signal name="clicked" handler="on_toolbutton_submit_clicked" last_modification_time="Fri, 25 Aug 2006 21:49:39 GMT"/>
+                 <signal name="clicked" handler="on_submit_activate" last_modification_time="Wed, 30 Aug 2006 17:59:32 GMT"/>
                </widget>
                <packing>
                  <property name="expand">False</property>