diff --git a/src/ant/ant/antPlugin.cc b/src/ant/ant/antPlugin.cc index 037ebfc3ed..c5c6b5ad12 100644 --- a/src/ant/ant/antPlugin.cc +++ b/src/ant/ant/antPlugin.cc @@ -45,24 +45,6 @@ namespace ant static PluginDeclaration *sp_instance = 0; -PluginDeclaration::PluginDeclaration () - : m_current_template (0), - m_current_template_updated (true), m_templates_updated (true) -{ - sp_instance = this; -} - -PluginDeclaration::~PluginDeclaration () -{ - sp_instance = 0; -} - -PluginDeclaration * -PluginDeclaration::instance () -{ - return sp_instance; -} - static std::vector make_standard_templates () { std::vector templates; @@ -92,6 +74,24 @@ static std::vector make_standard_templates () return templates; } +PluginDeclaration::PluginDeclaration () + : m_current_template (0), + m_current_template_updated (true), m_templates_updated (true) +{ + sp_instance = this; +} + +PluginDeclaration::~PluginDeclaration () +{ + sp_instance = 0; +} + +PluginDeclaration * +PluginDeclaration::instance () +{ + return sp_instance; +} + void PluginDeclaration::get_options (std::vector < std::pair > &options) const { @@ -281,25 +281,24 @@ PluginDeclaration::update_current_template () return; } - if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) { - - std::vector menu_entries = mp->menu ()->group ("ruler_mode_group"); - for (std::vector::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) { - lay::Action *action = mp->menu ()->action (*m); + std::vector menu_entries = mp->menu ()->group ("ruler_mode_group"); + for (std::vector::const_iterator m = menu_entries.begin (); m != menu_entries.end (); ++m) { + lay::Action *action = mp->menu ()->action (*m); + if (m_current_template >= 0 && m_current_template < int (m_templates.size ())) { action->set_title (m_templates [m_current_template].title ()); + } else { + action->set_title (std::string ()); } - - if (m_templates.size () > 1) { + } - tl::weak_collection::iterator it = m_actions.begin (); - int index = 0; - for (std::vector