MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / currentTabChanged

Method currentTabChanged

src/openms_gui/source/VISUAL/DataSelectionTabs.cpp:152–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 }
151
152 void DataSelectionTabs::currentTabChanged(int tab_index)
153 {
154 // set new behavior
155 switch (tab_index)
156 {
157 case SPECTRA_IDX:
158 idview_controller_->deactivateBehavior(); // finalize old behavior
159 diatab_controller_->deactivateBehavior();
160 spectraview_controller_->activateBehavior(); // initialize new behavior
161 break;
162 case IDENT_IDX:
163 spectraview_controller_->deactivateBehavior();
164 diatab_controller_->deactivateBehavior();
165 if (tv_->getActive2DWidget()) // currently, 2D window is open
166 {
167 idview_controller_->showSpectrumAsNew1D(0);
168 }
169 idview_controller_->activateBehavior();
170 break;
171 case DIAOSW_IDX:
172 idview_controller_->deactivateBehavior(); // finalize old behavior
173 spectraview_controller_->deactivateBehavior();
174 diatab_controller_->activateBehavior(); // initialize new behavior
175 break;
176 default:
177 std::cerr << "Error: tab_index " << tab_index << " is invalid\n";
178 throw Exception::NotImplemented(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION);
179 }
180 callUpdateEntries(); //TODO actually this is overkill. Why would you load the entire table again
181 // when you only switched tabs? The TabView should get notified when the layer data changes, so it only
182 // updates when necessary...
183 // The only thing that maybe needs to happen when switching tabs is to sync the index across the tables in the different tabs.
184 // which is the only reason why we need to actually use callUpdateEntries here.
185 // At least we reduced it to only updateEntries during tab switch, not EVERY update() [e.g. when resizing, refocussing...]
186 }
187
188 void DataSelectionTabs::showSpectrumAsNew1D(int index)
189 {

Callers 2

annotateWithIDMethod · 0.80
annotateWithOSWMethod · 0.80

Calls 4

getActive2DWidgetMethod · 0.80
deactivateBehaviorMethod · 0.45
activateBehaviorMethod · 0.45
showSpectrumAsNew1DMethod · 0.45

Tested by

no test coverage detected