+void BoardWindow::save_state() const{
+ BoardWindowState state;
+ state.width = get_width();
+ state.height = get_height();
+ state.menubar = menubar_->is_visible();
+ state.toolbar = toolbar_->is_visible();
+ state.statusbar = statusbar_.is_visible();
+
+ int order = 0;
+ BOOST_FOREACH(const Gtk::TreeViewColumn* kolumn, tree_view_.get_columns()) {
+ const view_column::Base* column =
+ dynamic_cast<const view_column::Base*>(kolumn);
+
+ assert(column);
+
+ BoardWindowState::ColumnInfo info;
+ info.width = column->get_width();
+ info.order = order;
+ state.columns[column->get_id()] = info;
+ ++order;
+
+ if (column->get_sort_indicator()) {
+ state.sort.column = column->get_id();
+ state.sort.ascendant = column->get_sort_order() == Gtk::SORT_ASCENDING;
+ }
+ }
+
+ state.to_xml(boost::filesystem::path(bbs_->get_board_state_path()));
+}
+
+void BoardWindow::inform_to_threads(
+ boost::unordered_map<std::string, ModelColumns>& buffer) const {
+ typedef boost::unordered_map<std::string, ModelColumns> MapType;
+ typedef MapType::const_iterator Iter;
+
+ BOOST_FOREACH(ApplicationWindow& window, windows) {
+ if (ThreadWindow* thread_window = dynamic_cast<ThreadWindow*>(&window)) {
+ const bbs_detail::Base& bbs = thread_window->get_bbs_detail();
+ if (!bbs.belongs_to(*bbs_)) continue;
+
+ const std::string thread = bbs.get_thread_id();
+ Iter it = buffer.find(thread);
+ int res = 0;
+ if (it != buffer.end())
+ res = model_column::field<model_column::ResNum>(it->second);
+ inform_to_thread(*thread_window, res);
+ }
+ }
+}
+
+void BoardWindow::inform_to_thread(ThreadWindow& window, int res_num) const {
+ window.on_informed_from_board(res_num);
+}
+
+