Browse Source

Merge pull request #175 from milleniumbug/find_buttons

added gui buttons for finding/replacing
merge-requests/365/head
Ole Christian Eidheim 10 years ago
parent
commit
563d1e7e9c
  1. 17
      src/window.cc

17
src/window.cc

@ -876,7 +876,22 @@ void Window::search_and_replace_entry() {
replace_entry_it->signal_changed().connect([this, replace_entry_it](){ replace_entry_it->signal_changed().connect([this, replace_entry_it](){
last_replace=replace_entry_it->get_text(); last_replace=replace_entry_it->get_text();
}); });
EntryBox::get().buttons.emplace_back("", [this](){
if(notebook.get_current_page()!=-1)
notebook.get_current_view()->search_backward();
});
EntryBox::get().buttons.back().set_tooltip_text("Find previous\n\nShortcut: press Shift+Enter in the search field");
EntryBox::get().buttons.emplace_back("", [this, replace_entry_it](){
if(notebook.get_current_page()!=-1) {
notebook.get_current_view()->replace_forward(replace_entry_it->get_text());
}
});
EntryBox::get().buttons.back().set_tooltip_text("Replace current selection\n\nShortcut: press Enter in the replacement field");
EntryBox::get().buttons.emplace_back("", [this](){
if(notebook.get_current_page()!=-1)
notebook.get_current_view()->search_forward();
});
EntryBox::get().buttons.back().set_tooltip_text("Find next\n\nShortcut: press Enter in the search field");
EntryBox::get().buttons.emplace_back("Replace all", [this, replace_entry_it](){ EntryBox::get().buttons.emplace_back("Replace all", [this, replace_entry_it](){
if(notebook.get_current_page()!=-1) if(notebook.get_current_page()!=-1)
notebook.get_current_view()->replace_all(replace_entry_it->get_text()); notebook.get_current_view()->replace_all(replace_entry_it->get_text());

Loading…
Cancel
Save