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