• R/O
  • HTTP
  • SSH
  • HTTPS

dialektos: Commit

dialektos


Commit MetaInfo

Revisionb939112b23d7479994b2848ee0d8c1c606004148 (tree)
Time2010-03-02 22:45:27
AuthorAiwota Programmer <aiwotaprog@tett...>
CommiterAiwota Programmer

Log Message

Add a menu item 'CloseH': Close and remove History.

Change Summary

Incremental Difference

--- a/src/history_data.cxx
+++ b/src/history_data.cxx
@@ -112,6 +112,10 @@ void Data::push(const Item::UriType& uri, const Item::NameType& name) {
112112 map_[uri] = item;
113113 }
114114
115+void Data::erase(const Item::UriType& uri) {
116+ map_.erase(uri);
117+}
118+
115119 std::vector<Item> Data::get_recent() const {
116120 std::vector<Item> order;
117121 order.reserve(map_.size());
--- a/src/history_data.hxx
+++ b/src/history_data.hxx
@@ -45,6 +45,7 @@ public:
4545 void to_xml(const boost::filesystem::path& xml) const;
4646
4747 void push(const Item::UriType& uri, const Item::NameType& name);
48+ void erase(const Item::UriType& uri);
4849
4950 std::vector<Item> get_recent() const;
5051
--- a/src/thread_window.cxx
+++ b/src/thread_window.cxx
@@ -58,16 +58,26 @@ ThreadWindow::ThreadWindow(std::auto_ptr<bbs_detail::Base> bbs) :
5858 action_group_->add(
5959 Gtk::Action::create("FileBoard", Gtk::Stock::GO_UP, "Show _Board"),
6060 sigc::mem_fun(*this, &ThreadWindow::on_action_file_board));
61+ action_group_->add(
62+ Gtk::Action::create(
63+ "FileCloseRemoveHistory", Gtk::Stock::CLEAR, "CloseH",
64+ "Close and Remove from History"),
65+ sigc::mem_fun(*this,
66+ &ThreadWindow::on_action_file_close_remove_history));
6167
6268 Glib::ustring ui =
6369 "<ui>"
6470 " <menubar name='MenuBar'>"
6571 " <menu action='MenuFile'>"
6672 " <menuitem action='FileDelete'/>"
73+ " <menuitem action='FileCloseRemoveHistory'/>"
6774 " <separator/>"
6875 " <menuitem action='FileBoard'/>"
6976 " </menu>"
7077 " </menubar>"
78+ " <toolbar name='ToolBar'>"
79+ " <toolitem action='FileCloseRemoveHistory'/>"
80+ " </toolbar>"
7181 "</ui>";
7282
7383 ui_manager_->add_ui_from_string(ui);
@@ -179,6 +189,14 @@ void ThreadWindow::on_action_file_board() {
179189 uri_opener::open(bbs_->get_board_uri());
180190 }
181191
192+void ThreadWindow::on_action_file_close_remove_history() {
193+ histories.erase(bbs_->get_thread_uri());
194+
195+ std::vector<ApplicationWindow*> closes;
196+ closes.push_back(this);
197+ close_windows(closes);
198+}
199+
182200 void ThreadWindow::on_http_get_end(bool success) {
183201 // const std::string uri = http_getter_->get_uri();
184202 // const http::Header request_header = http_getter_->get_request_header();
--- a/src/thread_window.hxx
+++ b/src/thread_window.hxx
@@ -55,6 +55,7 @@ protected:
5555 virtual void on_action_edit_copy();
5656 void on_action_file_delete();
5757 void on_action_file_board();
58+ void on_action_file_close_remove_history();
5859 private:
5960 void initialize_text_view();
6061 virtual bool is_same(const bbs_detail::Base& bbs) const;
Show on old repository browser