----------------------------------------------------------------------------
| 243 | |
| 244 | //---------------------------------------------------------------------------- |
| 245 | void pqPythonMacroSupervisor::resetActions() |
| 246 | { |
| 247 | // Delete RUN |
| 248 | Q_FOREACH (QAction* action, this->Internal->RunActionMap.values()) |
| 249 | { |
| 250 | removeActionFromWidgets(action, this->Internal->RunWidgetContainers); |
| 251 | delete action; |
| 252 | } |
| 253 | this->Internal->RunActionMap.clear(); |
| 254 | // Delete EDIT |
| 255 | Q_FOREACH (QAction* action, this->Internal->EditActionMap.values()) |
| 256 | { |
| 257 | removeActionFromWidgets(action, this->Internal->EditWidgetContainers); |
| 258 | delete action; |
| 259 | } |
| 260 | this->Internal->EditActionMap.clear(); |
| 261 | // Delete DELETE |
| 262 | Q_FOREACH (QAction* action, this->Internal->DeleteActionMap.values()) |
| 263 | { |
| 264 | removeActionFromWidgets(action, this->Internal->DeleteWidgetContainers); |
| 265 | delete action; |
| 266 | } |
| 267 | this->Internal->DeleteActionMap.clear(); |
| 268 | |
| 269 | // Key is filename, value is macroname |
| 270 | QMap<QString, QString> macros = pqPythonMacroSupervisor::getStoredMacros(); |
| 271 | QMap<QString, QString>::const_iterator itr; |
| 272 | for (itr = macros.constBegin(); itr != macros.constEnd(); ++itr) |
| 273 | { |
| 274 | this->addMacro(itr.value(), itr.key()); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | //---------------------------------------------------------------------------- |
| 279 | void pqPythonMacroSupervisor::addMacro(const QString& fileName) |