Changeset View
Changeset View
Standalone View
Standalone View
src/backtracewidget.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 123 | { | |||
---|---|---|---|---|---|
137 | ui.m_extraDetailsLabel->setVisible(false); | 137 | ui.m_extraDetailsLabel->setVisible(false); | ||
138 | ui.m_extraDetailsLabel->clear(); | 138 | ui.m_extraDetailsLabel->clear(); | ||
139 | 139 | | |||
140 | ui.m_installDebugButton->setVisible(false); | 140 | ui.m_installDebugButton->setVisible(false); | ||
141 | ui.m_reloadBacktraceButton->setEnabled(false); | 141 | ui.m_reloadBacktraceButton->setEnabled(false); | ||
142 | 142 | | |||
143 | ui.m_copyButton->setEnabled(false); | 143 | ui.m_copyButton->setEnabled(false); | ||
144 | ui.m_saveButton->setEnabled(false); | 144 | ui.m_saveButton->setEnabled(false); | ||
145 | | ||||
146 | adjustWindowSize(); | | |||
147 | } | | |||
148 | | ||||
149 | void BacktraceWidget::adjustWindowSize() | | |||
150 | { | | |||
151 | // We substantially change label content in-place so the window might need | | |||
152 | // resizing to fit everything again. This should get called whenever label | | |||
153 | // content is changed. | | |||
154 | // We'll only increase our size but never shrink it. Shrinking would almost | | |||
155 | // always screw with user expectation (e.g. button position or manually | | |||
156 | // resized window). | | |||
157 | // https://bugs.kde.org/show_bug.cgi?id=406748 | | |||
158 | // https://bugs.kde.org/show_bug.cgi?id=337319 | | |||
159 | const auto hint = window()->sizeHint(); | | |||
160 | const auto size = window()->size(); | | |||
161 | if (hint.width() > size.width() || hint.height() > size.height()) { | | |||
162 | window()->adjustSize(); | | |||
163 | } | | |||
164 | } | 145 | } | ||
165 | 146 | | |||
166 | //Force backtrace generation | 147 | //Force backtrace generation | ||
167 | void BacktraceWidget::regenerateBacktrace() | 148 | void BacktraceWidget::regenerateBacktrace() | ||
168 | { | 149 | { | ||
169 | setAsLoading(); | 150 | setAsLoading(); | ||
170 | 151 | | |||
171 | if (!DrKonqi::debuggerManager()->debuggerIsRunning()) { | 152 | if (!DrKonqi::debuggerManager()->debuggerIsRunning()) { | ||
Show All 34 Lines | 180 | { | |||
206 | ui.m_statusWidget->setIdle(i18nc("@info:status", "The crash information could not be fetched.")); | 187 | ui.m_statusWidget->setIdle(i18nc("@info:status", "The crash information could not be fetched.")); | ||
207 | ui.m_extraDetailsLabel->setVisible(true); | 188 | ui.m_extraDetailsLabel->setVisible(true); | ||
208 | ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "Another debugging process is attached to " | 189 | ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "Another debugging process is attached to " | ||
209 | "the crashed application. Therefore, the DrKonqi debugger cannot " | 190 | "the crashed application. Therefore, the DrKonqi debugger cannot " | ||
210 | "fetch the backtrace. Please close the other debugger and " | 191 | "fetch the backtrace. Please close the other debugger and " | ||
211 | "click <interface>Reload</interface>.")); | 192 | "click <interface>Reload</interface>.")); | ||
212 | ui.m_installDebugButton->setVisible(false); | 193 | ui.m_installDebugButton->setVisible(false); | ||
213 | ui.m_reloadBacktraceButton->setEnabled(true); | 194 | ui.m_reloadBacktraceButton->setEnabled(true); | ||
214 | | ||||
215 | adjustWindowSize(); | | |||
216 | } | 195 | } | ||
217 | 196 | | |||
218 | void BacktraceWidget::loadData() | 197 | void BacktraceWidget::loadData() | ||
219 | { | 198 | { | ||
220 | //Load the backtrace data from the generator | 199 | //Load the backtrace data from the generator | ||
221 | m_backtraceRatingWidget->setState(m_btGenerator->state()); | 200 | m_backtraceRatingWidget->setState(m_btGenerator->state()); | ||
222 | 201 | | |||
223 | if (m_btGenerator->state() == BacktraceGenerator::Loaded) { | 202 | if (m_btGenerator->state() == BacktraceGenerator::Loaded) { | ||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 295 | } else if (m_btGenerator->state() == BacktraceGenerator::FailedToStart) { | |||
327 | ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "<strong>You need to first install the debugger " | 306 | ui.m_extraDetailsLabel->setText(xi18nc("@info/rich", "<strong>You need to first install the debugger " | ||
328 | "application (%1) then click the <interface>Reload" | 307 | "application (%1) then click the <interface>Reload" | ||
329 | "</interface> button.</strong>", | 308 | "</interface> button.</strong>", | ||
330 | m_btGenerator->debugger().name())); | 309 | m_btGenerator->debugger().name())); | ||
331 | } | 310 | } | ||
332 | 311 | | |||
333 | ui.m_reloadBacktraceButton->setEnabled(true); | 312 | ui.m_reloadBacktraceButton->setEnabled(true); | ||
334 | 313 | | |||
335 | adjustWindowSize(); | | |||
336 | | ||||
337 | emit stateChanged(); | 314 | emit stateChanged(); | ||
338 | } | 315 | } | ||
339 | 316 | | |||
340 | void BacktraceWidget::backtraceNewLine(const QString & line) | 317 | void BacktraceWidget::backtraceNewLine(const QString & line) | ||
341 | { | 318 | { | ||
342 | //While loading the backtrace (unparsed) a new line was sent from the debugger, append it | 319 | //While loading the backtrace (unparsed) a new line was sent from the debugger, append it | ||
343 | ui.m_backtraceEdit->append(line.trimmed()); | 320 | ui.m_backtraceEdit->append(line.trimmed()); | ||
344 | } | 321 | } | ||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |