MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / enable

Method enable

source/MRViewer/MRStatePlugin.cpp:59–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59bool StateBasePlugin::enable( bool on )
60{
61 bool res = false;
62 if ( on && !isEnabled_ )
63 {
64 if ( onEnable_() )
65 {
66 isEnabled_ = true;
67 dialogIsOpen_ = true;
68 onPluginEnable_(); // virtual call from IPluginCloseCheck
69 res = true;
70 }
71 }
72 else if ( !on && isEnabled_ )
73 {
74 if ( onDisable_() )
75 {
76 isEnabled_ = false;
77 dialogIsOpen_ = false;
78 onPluginDisable_(); // virtual call from IPluginCloseCheck
79 res = true;
80 }
81 else if ( !dialogIsOpen_ )
82 {
83 dialogIsOpen_ = true; // we are here after setting `dialogIsOpen_ = false` followed by `onDisable_() = false`
84 }
85 }
86 if ( res )
87 {
88 if ( auto ribbonMenu = RibbonMenu::instance() )
89 ribbonMenu->updateItemStatus( name() );
90 }
91 return res;
92}
93
94bool StateBasePlugin::dialogIsOpen() const
95{

Callers

nothing calls this directly

Calls 3

instanceFunction · 0.85
updateItemStatusMethod · 0.80
nameFunction · 0.50

Tested by

no test coverage detected