Implemented #426 (feature request: group techs)

The tech group is a new XML tag "<group>...</group>".
This tag is editable in the tech "general" page as "Group".
If non-empty, a submenu will be created in the tech selector
menu for all techs with the same group.
This commit is contained in:
Matthias Koefferlein
2019-11-22 23:23:11 +01:00
parent 595075a88a
commit 4fe5a96596
8 changed files with 213 additions and 131 deletions
+1 -7
View File
@@ -135,13 +135,7 @@ NewLayoutPropertiesDialog::exec_dialog (std::string &technology, std::string &ce
unsigned int technology_index = 0;
for (db::Technologies::const_iterator t = db::Technologies::instance ()->begin (); t != db::Technologies::instance ()->end (); ++t, ++technology_index) {
std::string d = t->name ();
if (! d.empty () && ! t->description ().empty ()) {
d += " - ";
}
d += t->description ();
mp_ui->tech_cbx->addItem (tl::to_qstring (d));
mp_ui->tech_cbx->addItem (tl::to_qstring (t->get_display_string ()));
if (t->name () == technology) {
mp_ui->tech_cbx->setCurrentIndex (technology_index);
}
@@ -192,13 +192,7 @@ BEGIN_PROTECTED
unsigned int technology_index = 0;
for (db::Technologies::const_iterator t = db::Technologies::instance ()->begin (); t != db::Technologies::instance ()->end (); ++t, ++technology_index) {
std::string d = t->name ();
if (! d.empty () && ! t->description ().empty ()) {
d += " - ";
}
d += t->description ();
tech_cbx->addItem (tl::to_qstring (d));
tech_cbx->addItem (tl::to_qstring (t->get_display_string ()));
if (t->name () == m_handles [index]->tech_name ()) {
tech_cbx->setCurrentIndex (technology_index);
}