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

Method updateToolBar

src/openms_gui/source/VISUAL/APPLICATIONS/TOPPViewBase.cpp:1198–1274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196 }
1197
1198 void TOPPViewBase::updateToolBar()
1199 {
1200 tool_bar_1d_->hide();
1201 tool_bar_2d_peak_->hide();
1202 tool_bar_2d_feat_->hide();
1203 tool_bar_2d_cons_->hide();
1204 tool_bar_2d_ident_->hide();
1205
1206 PlotWidget* w = getActivePlotWidget();
1207
1208 if (w)
1209 {
1210 // set intensity mode
1211 if (intensity_button_group_->button(w->canvas()->getIntensityMode()))
1212 {
1213 intensity_button_group_->button(w->canvas()->getIntensityMode())->setChecked(true);
1214 }
1215 else
1216 {
1217 log_->appendNewHeader(LogWindow::LogState::CRITICAL, OPENMS_PRETTY_FUNCTION, "Button for intensity mode does not exist");
1218 }
1219 }
1220
1221 // 1D
1222 Plot1DWidget* w1 = getActive1DWidget();
1223 if (w1)
1224 {
1225 // draw mode
1226 draw_group_1d_->button(w1->canvas()->getDrawMode())->setChecked(true);
1227
1228 // show/hide toolbars and buttons
1229 tool_bar_1d_->show();
1230 }
1231
1232 // 2D
1233 Plot2DWidget* w2 = getActive2DWidget();
1234 if (w2)
1235 {
1236 // check if there is a layer before requesting data from it
1237 if (w2->canvas()->getLayerCount() > 0)
1238 {
1239 // peak draw modes
1240 if (w2->canvas()->getCurrentLayer().type == LayerDataBase::DT_PEAK)
1241 {
1242 dm_precursors_2d_->setChecked(w2->canvas()->getLayerFlag(LayerDataBase::P_PRECURSORS));
1243 tool_bar_2d_peak_->show();
1244 }
1245 // feature draw modes
1246 else if (w2->canvas()->getCurrentLayer().type == LayerDataBase::DT_FEATURE)
1247 {
1248 dm_hulls_2d_->setChecked(w2->canvas()->getLayerFlag(LayerDataBase::F_HULLS));
1249 dm_hull_2d_->setChecked(w2->canvas()->getLayerFlag(LayerDataBase::F_HULL));
1250 dm_unassigned_2d_->setChecked(w2->canvas()->getLayerFlag(LayerDataBase::F_UNASSIGNED));
1251 dm_label_2d_->setChecked(w2->canvas()->getCurrentLayer().label != LayerDataBase::L_NONE);
1252 tool_bar_2d_feat_->show();
1253 }
1254 // consensus feature draw modes
1255 else if (w2->canvas()->getCurrentLayer().type == LayerDataBase::DT_CONSENSUS)

Callers

nothing calls this directly

Calls 5

appendNewHeaderMethod · 0.80
getDrawModeMethod · 0.80
showMethod · 0.80
getLayerCountMethod · 0.80
getCurrentLayerMethod · 0.80

Tested by

no test coverage detected