| 78 | |
| 79 | |
| 80 | void BreakpointDetails::setItem(Breakpoint *breakpoint) |
| 81 | { |
| 82 | Q_D(BreakpointDetails); |
| 83 | |
| 84 | d->currentBreakpoint = breakpoint; |
| 85 | |
| 86 | if (!breakpoint) { |
| 87 | d->status->hide(); |
| 88 | d->hits->hide(); |
| 89 | d->ignore->setEnabled(false); |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | d->ignore->setValue(breakpoint->ignoreHits()); |
| 94 | |
| 95 | if (breakpoint->state() == Breakpoint::NotStartedState) { |
| 96 | d->status->hide(); |
| 97 | d->hits->hide(); |
| 98 | d->ignore->setEnabled(true); |
| 99 | return; |
| 100 | } |
| 101 | |
| 102 | d->status->show(); |
| 103 | d->hits->show(); |
| 104 | d->ignore->setEnabled(true); |
| 105 | |
| 106 | if (breakpoint->errorText().isEmpty()) { |
| 107 | switch (breakpoint->state()) { |
| 108 | case Breakpoint::NotStartedState: |
| 109 | Q_ASSERT(0); |
| 110 | break; |
| 111 | case Breakpoint::PendingState: |
| 112 | d->status->setText(i18n("Breakpoint is <a href=\"pending\">pending</a>")); |
| 113 | break; |
| 114 | case Breakpoint::DirtyState: |
| 115 | d->status->setText(i18n("Breakpoint is <a href=\"dirty\">dirty</a>")); |
| 116 | break; |
| 117 | case Breakpoint::CleanState: |
| 118 | d->status->setText(i18n("Breakpoint is active")); |
| 119 | break; |
| 120 | } |
| 121 | |
| 122 | if (breakpoint->hitCount() == -1) |
| 123 | d->hits->clear(); |
| 124 | else if (breakpoint->hitCount()) |
| 125 | d->hits->setText(i18np("Hit %1 time", "Hit %1 times", breakpoint->hitCount())); |
| 126 | else |
| 127 | d->hits->setText(i18n("Not hit yet")); |
| 128 | } else { |
| 129 | d->status->setText(i18n("Breakpoint has errors")); |
| 130 | d->hits->setText(breakpoint->errorText()); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void BreakpointDetails::showExplanation(const QString& link) |
| 135 | { |