Gobby::TitleBar::TitleBar(Gtk::Window& window, const Folder& folder): m_window(window), m_folder(folder), m_current_view(NULL) { folder.signal_document_removed().connect( sigc::mem_fun(*this, &TitleBar::on_document_removed)); folder.signal_document_changed().connect( sigc::mem_fun(*this, &TitleBar::on_document_changed)); on_document_changed(folder.get_current_document()); }
std::auto_ptr<Gobby::FindDialog> Gobby::FindDialog::create(Gtk::Window& parent, const Folder& folder, StatusBar& status_bar) { Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_resource( "/de/0x539/gobby/ui/find-dialog.ui"); FindDialog* dialog_ptr; builder->get_widget_derived("FindDialog", dialog_ptr); std::auto_ptr<FindDialog> dialog(dialog_ptr); dialog->set_transient_for(parent); dialog->m_folder = &folder; dialog->m_status_bar = &status_bar; folder.signal_document_changed().connect( sigc::mem_fun(*dialog, &FindDialog::on_document_changed)); // For initial sensitivity: dialog->on_document_changed(folder.get_current_document()); return dialog; }