std::list<openfluid::core::Unit*> DomainUnitRelationAddDialog::show()
{
  mp_TreeView->get_selection()->unselect_all();

  std::list<openfluid::core::Unit*> SelectedUnits;

  if (mp_Dialog->run() == Gtk::RESPONSE_OK)
  {
    Gtk::TreeSelection::ListHandle_Path Selecteds =
        mp_TreeView->get_selection()->get_selected_rows();

    for (Gtk::TreeSelection::ListHandle_Path::iterator it = Selecteds.begin(); it
        != Selecteds.end(); ++it)
    {
      std::string Class = mref_TreeModel->get_iter(*it)->get_value(
          m_Columns.m_Class);
      int Id = mref_TreeModel->get_iter(*it)->get_value(m_Columns.m_Id);

      if (Id)
        SelectedUnits.push_back(mp_CoreRepos->getUnit(Class, Id));
    }
  }

  mp_Dialog->hide();

  return SelectedUnits;
}
Пример #2
0
void DocumentProperties::onEditExtraField ()
{
	Gtk::TreeSelection::ListHandle_Path paths =
		extrafieldssel_->get_selected_rows ();

	if (paths.empty ()) {
		DEBUG ("Warning: DocumentProperties::onEditExtraField: none selected");
		return;
	} else if (paths.size () > 1) {
		DEBUG ("Warning: DocumentProperties::onEditExtraField: too many selected");
		return;
	}

	Gtk::TreePath path = (*paths.begin ());
	extrafieldsview_->set_cursor (path, *extrafieldsview_->get_column (1), true);

	updateSensitivity();
}
Пример #3
0
std::set<std::string> MapViewAddLayersDialog::show(
    const std::set<std::string>& AlreadyDisplayedLayersIds)
{
  update(AlreadyDisplayedLayersIds);

  std::set<std::string> SelectedLayersIds;

  if (mp_Dialog->run() == Gtk::RESPONSE_OK)
  {
    Gtk::TreeSelection::ListHandle_Path Selecteds =
        mp_TreeView->get_selection()->get_selected_rows();

    for (Gtk::TreeSelection::ListHandle_Path::iterator it = Selecteds.begin(); it
        != Selecteds.end(); ++it)
    {
      SelectedLayersIds.insert(mref_TreeModel->get_iter(*it)->get_value(
          m_Columns.m_Id));
    }
  }

  mp_Dialog->hide();

  return SelectedLayersIds;
}