WIP: bugfixed tech controller, more refactoring

Resolved the dependencies between MainWindow, TechController
and MacroController somewhat more.

* The macro controller now listens to the tech controller
  for the active technology
* The tech controller has more responsibility now
* Some functionality has been taken out of the MainWindow
  and put into the controller's implementation
This commit is contained in:
Matthias Koefferlein
2017-04-15 17:51:04 +02:00
parent 5b422440a1
commit e6f696b8dc
14 changed files with 335 additions and 244 deletions
+7 -4
View File
@@ -1123,14 +1123,17 @@ AbstractMenu::find_item (const std::string &path)
return std::make_pair ((AbstractMenuItem *) 0, m_root.children.end ());
}
} else if (extr.test ("begin")) {
return std::make_pair (parent, parent->children.begin ());
} else if (extr.test ("end")) {
return std::make_pair (parent, parent->children.end ());
} else {
std::string n;
extr.read (n, ".+");
if (n == "begin") {
return std::make_pair (parent, parent->children.begin ());
} else if (n == "end") {
return std::make_pair (parent, parent->children.end ());
}
std::string name (parent->name ());
if (! name.empty ()) {
name += ".";
+1 -1
View File
@@ -197,7 +197,7 @@ PluginDeclaration::init_menu ()
m_mouse_mode_action.qaction ()->setData (QVariant (id ()));
menu.insert_item ("edit_menu.mode_menu.end", name, m_mouse_mode_action);
menu.insert_item ("@toolbar.end", name, m_mouse_mode_action);
menu.insert_item ("@toolbar.end_modes", name, m_mouse_mode_action);
gtf::action_connect (m_mouse_mode_action.qaction (), SIGNAL (triggered ()), this, SLOT (mode_triggered ()));
+6
View File
@@ -184,6 +184,12 @@ Technologies::end_updates ()
}
}
void
Technologies::end_updates_no_event ()
{
m_in_update = false;
m_changed = false;
}
bool
Technologies::has_technology (const std::string &name) const
+8
View File
@@ -149,6 +149,14 @@ public:
*/
void end_updates ();
/**
* @brief Ends a bulk operation
* This version does not send an technologies_changed event but just cancels the bulk
* operation. begin_updates/end_updates_no_event is essentially equivalent to blocking
* signals.
*/
void end_updates_no_event ();
/**
* @brief Checks, if a technology with the given name exists
*/