18 UUID get_selected()
override;
19 bool get_any_selected();
20 void set_show_none(
bool v);
21 void set_show_path(
bool v);
22 void add_context_menu_item(
const std::string &label, std::function<
void(
UUID)> cb,
23 std::function<
bool(
UUID)> cb_sensitive =
nullptr);
24 virtual void add_copy_name_context_menu_item(){};
25 virtual void search() = 0;
27 void clear_search_once();
28 virtual ObjectType get_type()
const
30 return ObjectType::INVALID;
32 void go_to(
const UUID &uu);
38 enum class PoolItemSource { LOCAL, INCLUDED, OVERRIDDEN, OVERRIDDEN_LOCAL, CACHED };
43 void construct(Gtk::Widget *search_box =
nullptr);
46 bool pools_included =
false;
47 bool show_none =
false;
48 bool show_path =
false;
49 Gtk::TreeViewColumn *path_column =
nullptr;
52 Gtk::TreeView *treeview =
nullptr;
53 Gtk::ScrolledWindow *scrolled_window =
nullptr;
55 Gtk::TreeViewColumn *append_column(
const std::string &name,
const Gtk::TreeModelColumnBase &column,
56 Pango::EllipsizeMode ellipsize = Pango::ELLIPSIZE_NONE);
57 Gtk::TreeViewColumn *append_column_with_item_source_cr(
const std::string &name,
58 const Gtk::TreeModelColumnBase &column,
59 Pango::EllipsizeMode ellipsize = Pango::ELLIPSIZE_NONE);
61 void install_column_tooltip(Gtk::TreeViewColumn &tvc,
const Gtk::TreeModelColumnBase &col);
63 Gtk::Entry *create_search_entry(
const std::string &label, Gtk::Widget *extra_widget =
nullptr);
64 class TagEntry *create_tag_entry(
const std::string &label, Gtk::Widget *extra_widget =
nullptr);
65 void add_search_widget(
const std::string &label, Gtk::Widget &w, Gtk::Widget *extra_widget =
nullptr);
67 virtual Glib::RefPtr<Gtk::ListStore> create_list_store() = 0;
68 virtual void create_columns() = 0;
69 virtual void add_sort_controller_columns() = 0;
70 virtual UUID uuid_from_row(
const Gtk::TreeModel::Row &row) = 0;
72 Glib::RefPtr<Gtk::ListStore> store;
73 std::unique_ptr<class SortController> sort_controller;
74 static const int mtime_column = -1;
76 void row_activated(
const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column);
77 void selection_changed();
79 void select_uuid(
const UUID &uu);
80 void scroll_to_selection();
82 Gtk::Menu context_menu;
83 Gtk::Menu header_context_menu;
84 std::set<Gtk::Entry *> search_entries;
85 std::set<TagEntry *> tag_entries;
87 PoolItemSource pool_item_source_from_db(
const SQLite::Query &q,
int idx_uu,
int idx_last_uu)
const;
88 PoolItemSource pool_item_source_from_db(
const UUID &uu,
const UUID &last_uu)
const;
90 void install_pool_item_source_tooltip();
91 virtual PoolItemSource pool_item_source_from_row(
const Gtk::TreeModel::Row &row);
92 bool searched_once =
false;
94 void set_busy(
bool busy);
95 void prepare_search();
98 Gtk::Box *status_box =
nullptr;
100 std::string get_tags_query(
const std::set<std::string> &tags)
const;
101 void bind_tags_query(
SQLite::Query &q,
const std::set<std::string> &tags)
const;
103 Gtk::Widget *create_pool_selector();
104 std::string get_pool_selector_query()
const;
107 Gtk::Widget *focus_widget =
nullptr;
110 Gtk::Grid *grid =
nullptr;
113 Gtk::Box *busy_box =
nullptr;
114 UUID selected_uuid_before_search;
116 Gtk::Label *status_label =
nullptr;
117 const std::string store_prefix;
118 std::optional<TreeViewStateStore> state_store;
120 std::vector<std::pair<Gtk::Widget *, std::function<bool(
UUID)>>> menu_item_sensitive_cbs;
123 bool pools_reloading =
false;
Definition tag_entry.hpp:9