| 177 | } |
| 178 | |
| 179 | void MacroTreeItem::UpdateRunning() |
| 180 | { |
| 181 | const QSignalBlocker blocker(_running); |
| 182 | |
| 183 | if (!_macro->IsGroup()) { |
| 184 | _running->setChecked(!_macro->Paused()); |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | const auto macros = GetGroupMacroEntries(_macro.get()); |
| 189 | bool allRunning = true; |
| 190 | bool allPaused = true; |
| 191 | for (const auto ¯o : macros) { |
| 192 | if (macro->Paused()) { |
| 193 | allRunning = false; |
| 194 | } else { |
| 195 | allPaused = false; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | if (allRunning) { |
| 200 | _running->setCheckState(Qt::Checked); |
| 201 | return; |
| 202 | } |
| 203 | |
| 204 | if (allPaused) { |
| 205 | _running->setCheckState(Qt::Unchecked); |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | _running->setCheckState(Qt::PartiallyChecked); |
| 210 | } |
| 211 | |
| 212 | void MacroTreeItem::HighlightIfExecuted() |
| 213 | { |
no test coverage detected