OSDN Git Service

Enable to get dictionaries in the data store.
[fukui-no-namari/fukui-no-namari.git] / src / FukuiNoNamari / board_window.py
index 2e5eef6..e5dae3f 100644 (file)
@@ -87,7 +87,7 @@ class WinWrap(winwrapbase.WinWrapBase, board_data.BoardData):
         self.treeview.set_fixed_height_mode(True)
 
         # menu plugins
-        board_plugins.load(self.treeview, self.menu_edit)
+        board_plugins.load(self.widget_tree)
 
         self.restore()
         self.window.show()
@@ -104,7 +104,6 @@ class WinWrap(winwrapbase.WinWrapBase, board_data.BoardData):
         self.filterbar = self.widget_tree.get_widget(
             "bonobodockitem_filterbar")
         self.entry_filterbar = self.widget_tree.get_widget("entry_filterbar")
-        self.menu_edit = self.widget_tree.get_widget("menu_edit").get_submenu()
 
     def set_status(self, text):
         self.statusbar.set_status(text)
@@ -125,14 +124,13 @@ class WinWrap(winwrapbase.WinWrapBase, board_data.BoardData):
         if not iter:
             return
 
-        thread = model.get_value(iter, ThreadListModel.column_names.index("id"))
-        title = model.get_value(
-            iter, ThreadListModel.column_names.index("title"))
+        dic = model.get_dict(iter)
+        thread = dic["id"]
+        title = dic["title"]
         print thread + ':"' + title + '"', "activated"
 
-        res = model.get_value(iter, ThreadListModel.column_names.index("res"))
-        lineCount = model.get_value(
-            iter, ThreadListModel.column_names.index("lineCount"))
+        res = dic["res"]
+        lineCount = dic["lineCount"]
 
         update = res > lineCount
 
@@ -346,8 +344,7 @@ class WinWrap(winwrapbase.WinWrapBase, board_data.BoardData):
         model, iter = selection.get_selected()
         if not iter:
             return
-        thread = model.get_value(
-            iter, ThreadListModel.column_names.index("id"))
+        thread = model.get_dict(iter)["id"]
         
         bbs_type_for_thread = self.bbs_type.clone_with_thread(thread)