OSDN Git Service

Add clear button for fliterbar.
authorAiwota Programmer <aiwotaprog@tetteke.tk>
Thu, 14 Sep 2006 04:38:25 +0000 (13:38 +0900)
committerAiwota Programmer <aiwotaprog@tetteke.tk>
Fri, 15 Sep 2006 00:14:31 +0000 (09:14 +0900)
src/FukuiNoNamari/board_window.py
src/data/board_window.glade

index c6ca793..1dbd770 100644 (file)
@@ -121,6 +121,8 @@ class WinWrap(winwrapbase.WinWrapBase, board_data.BoardData):
                   "on_filter_activate": self.on_filter_activate,
                   "on_toolbutton_filterbar_close_clicked":
                   self.on_toolbutton_filterbar_close_clicked,
+                  "on_button_filterbar_clear_clicked":
+                  self.on_button_filterbar_clear_clicked,
                   "on_popup_menu_open_activate": self.on_open_thread}
         self.widget_tree.signal_autoconnect(sigdic)
 
@@ -177,6 +179,13 @@ class WinWrap(winwrapbase.WinWrapBase, board_data.BoardData):
     def on_toolbutton_filterbar_close_clicked(self, widget):
         self.filterbar.hide()
 
+    def on_button_filterbar_clear_clicked(self, widget):
+        self.entry_filterbar.set_text("")
+        model = self.treeview.get_model()
+        if model:
+            model.set_filter_func(None)
+            model.refilter()
+
     def updated_thread_highlight(self, column, cell, model, iter):
 
         def is_updated_thread():
index 81c77ec..38bb871 100644 (file)
                  <property name="fill">True</property>
                </packing>
              </child>
+
+             <child>
+               <widget class="GtkButton" id="button_filterbar_clear">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="label">gtk-clear</property>
+                 <property name="use_stock">True</property>
+                 <property name="relief">GTK_RELIEF_NONE</property>
+                 <property name="focus_on_click">False</property>
+                 <signal name="clicked" handler="on_button_filterbar_clear_clicked" last_modification_time="Thu, 14 Sep 2006 03:15:16 GMT"/>
+               </widget>
+               <packing>
+                 <property name="padding">5</property>
+                 <property name="expand">False</property>
+                 <property name="fill">False</property>
+               </packing>
+             </child>
            </widget>
          </child>
        </widget>