23 #include <gui_utils/multi_interface_chooser_dialog.h>
26 #include <core/exception.h>
27 #include <core/exceptions/software.h>
28 #include <blackboard/blackboard.h>
29 #include <interface/interface_info.h>
79 const char* type_pattern,
80 const char* id_pattern,
82 const Glib::ustring& title)
85 parent, loaded_interfaces, title);
86 d->
init(blackboard, type_pattern, id_pattern);
102 const Glib::ustring& title)
106 __loaded_interfaces.insert(loaded_interfaces.begin(), loaded_interfaces.end());
107 Glib::RefPtr<Gtk::TreeSelection> treesel =
__treeview.get_selection();
109 __treeview.set_tooltip_text(
"Drag the rows to change the painting order.");
110 treesel->set_mode(Gtk::SELECTION_NONE);
125 MultiInterfaceChooserDialog::on_load_toggled(
const Glib::ustring& path)
127 Gtk::TreeModel::Row row = *
__model->get_iter(path);
136 const MultiInterfaceChooserDialog::Record&
141 this_nonconst->__record =
new Record();
161 Gtk::CellRendererToggle* renderer =
dynamic_cast<Gtk::CellRendererToggle*
>(
163 assert(renderer != NULL);
165 renderer->set_activatable(
true);
166 renderer->signal_toggled().connect(
167 sigc::mem_fun(*
this, &MultiInterfaceChooserDialog::on_load_toggled));
186 row[
record().
load] = __loaded_interfaces.find(std::make_pair(ii.
type(), ii.
id())) !=
187 __loaded_interfaces.end();
199 const Gtk::TreeNodeChildren children =
__model->children();
200 for (Gtk::TreeNodeChildren::const_iterator it = children.begin();
201 it != children.end(); ++it)
203 const Gtk::TreeRow& row = *it;
206 types_and_ids.push_back(pair);
210 return types_and_ids;
224 const Gtk::TreeNodeChildren children =
__model->children();
225 for (Gtk::TreeNodeChildren::const_iterator it = children.begin();
226 it != children.end(); ++it)
228 const Gtk::TreeRow& row = *it;
231 if (__loaded_interfaces.find(pair) == __loaded_interfaces.end())
233 types_and_ids.push_back(pair);
238 return types_and_ids;