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

Method updateMenu

src/openms_gui/source/VISUAL/APPLICATIONS/TOPPASBase.cpp:1067–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1065 }
1066
1067 void TOPPASBase::updateMenu()
1068 {
1069 TOPPASWidget* tw = activeSubWindow_();
1070 TOPPASScene* ts = nullptr;
1071 if (tw)
1072 {
1073 ts = tw->getScene();
1074 }
1075
1076 QList<QAction*> actions = this->findChildren<QAction*>("");
1077 for (int i = 0; i < actions.count(); ++i)
1078 {
1079 QString text = actions[i]->text();
1080
1081 if (text == "&Run (F5)")
1082 {
1083 bool show = false;
1084 if (ts && !(ts->isPipelineRunning()))
1085 {
1086 show = true;
1087 }
1088 actions[i]->setEnabled(show);
1089 }
1090 else if (text == "&Abort")
1091 {
1092 bool show = false;
1093 if (ts && ts->isPipelineRunning())
1094 {
1095 show = true;
1096 }
1097 actions[i]->setEnabled(show);
1098 }
1099 else if (text == "&Include")
1100 {
1101 bool show = ts;
1102 actions[i]->setEnabled(show);
1103 }
1104 else if (text == "&Load resource file")
1105 {
1106 bool show = ts;
1107 actions[i]->setEnabled(show);
1108 }
1109 else if (text == "Save &resource file")
1110 {
1111 bool show = ts;
1112 actions[i]->setEnabled(show);
1113 }
1114 else if (text == "&Save")
1115 {
1116 bool show = ts && ts->wasChanged();
1117 actions[i]->setEnabled(show);
1118 }
1119 else if (text == "Refresh &parameters")
1120 {
1121 bool show = ts && !(ts->isPipelineRunning());
1122 actions[i]->setEnabled(show);
1123 }
1124 }

Callers 2

showSpectrumAsNew1DMethod · 0.45
showSpectrumAsNew1DMethod · 0.45

Calls 7

getSceneMethod · 0.80
countMethod · 0.80
isPipelineRunningMethod · 0.80
wasChangedMethod · 0.80
setTabTextMethod · 0.80
QStringClass · 0.50
sizeMethod · 0.45

Tested by 1

showSpectrumAsNew1DMethod · 0.36