Changeset View
Changeset View
Standalone View
Standalone View
debug_console.cpp
Show First 20 Lines • Show All 453 Lines • ▼ Show 20 Line(s) | 451 | { | |||
---|---|---|---|---|---|
454 | text.append(tableHeaderRow(i18nc("A swipe gesture got cancelled", "Swipe cancelled"))); | 454 | text.append(tableHeaderRow(i18nc("A swipe gesture got cancelled", "Swipe cancelled"))); | ||
455 | text.append(timestampRow(time)); | 455 | text.append(timestampRow(time)); | ||
456 | text.append(s_tableEnd); | 456 | text.append(s_tableEnd); | ||
457 | 457 | | |||
458 | m_textEdit->insertHtml(text); | 458 | m_textEdit->insertHtml(text); | ||
459 | m_textEdit->ensureCursorVisible(); | 459 | m_textEdit->ensureCursorVisible(); | ||
460 | } | 460 | } | ||
461 | 461 | | |||
462 | void DebugConsoleFilter::switchEvent(SwitchEvent *event) | ||||
463 | { | ||||
464 | QString text = s_hr; | ||||
465 | text.append(s_tableStart); | ||||
466 | text.append(tableHeaderRow(i18nc("A hardware switch (e.g. notebook lid) got toggled", "Switch toggled"))); | ||||
467 | text.append(timestampRow(event->timestamp())); | ||||
468 | if (event->timestampMicroseconds() != 0) { | ||||
469 | text.append(timestampRowUsec(event->timestampMicroseconds())); | ||||
470 | } | ||||
471 | #if HAVE_INPUT | ||||
472 | text.append(deviceRow(event->device())); | ||||
473 | QString switchName; | ||||
474 | if (event->device()->isLidSwitch()) { | ||||
475 | switchName = i18nc("Name of a hardware switch", "Notebook lid"); | ||||
476 | } else if (event->device()->isTabletModeSwitch()) { | ||||
477 | switchName = i18nc("Name of a hardware switch", "Tablet mode"); | ||||
478 | } | ||||
479 | text.append(tableRow(i18nc("A hardware switch", "Switch"), switchName)); | ||||
480 | #endif | ||||
481 | QString switchState; | ||||
482 | switch (event->state()) { | ||||
483 | case SwitchEvent::State::Off: | ||||
484 | switchState = i18nc("The hardware switch got turned off", "Off"); | ||||
485 | break; | ||||
486 | case SwitchEvent::State::On: | ||||
487 | switchState = i18nc("The hardware switch got turned on", "On"); | ||||
488 | break; | ||||
489 | default: | ||||
490 | Q_UNREACHABLE(); | ||||
491 | } | ||||
492 | text.append(tableRow(i18nc("State of a hardware switch (on/off)", "State"), switchState)); | ||||
493 | text.append(s_tableEnd); | ||||
494 | | ||||
495 | m_textEdit->insertHtml(text); | ||||
496 | m_textEdit->ensureCursorVisible(); | ||||
497 | } | ||||
498 | | ||||
462 | DebugConsole::DebugConsole() | 499 | DebugConsole::DebugConsole() | ||
463 | : QWidget() | 500 | : QWidget() | ||
464 | , m_ui(new Ui::DebugConsole) | 501 | , m_ui(new Ui::DebugConsole) | ||
465 | { | 502 | { | ||
466 | setAttribute(Qt::WA_ShowWithoutActivating); | 503 | setAttribute(Qt::WA_ShowWithoutActivating); | ||
467 | m_ui->setupUi(this); | 504 | m_ui->setupUi(this); | ||
468 | m_ui->windowsView->setItemDelegate(new DebugConsoleDelegate(this)); | 505 | m_ui->windowsView->setItemDelegate(new DebugConsoleDelegate(this)); | ||
469 | m_ui->windowsView->setModel(new DebugConsoleModel(this)); | 506 | m_ui->windowsView->setModel(new DebugConsoleModel(this)); | ||
▲ Show 20 Lines • Show All 1040 Lines • Show Last 20 Lines |