Changeset 88734 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 27, 2021 12:56:38 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144052
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/logviewer
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.cpp
r88728 r88734 328 328 return m_iLogFileId; 329 329 } 330 331 void UIVMLogPage::scrollToEnd() 332 { 333 if (m_pTextEdit) 334 m_pTextEdit->scrollToEnd(); 335 } -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.h
r88728 r88734 102 102 int logFileId() const; 103 103 104 void scrollToEnd(); 105 104 106 private slots: 105 107 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.cpp
r88728 r88734 266 266 void UIVMLogViewerFilterPanel::applyFilter() 267 267 { 268 filter(); 268 if (isVisible()) 269 filter(); 270 else 271 resetFiltering(); 269 272 retranslateUi(); 270 273 } … … 294 297 295 298 if (m_filterTermSet.empty()) 296 { 297 document->setPlainText(*originalLogString); 298 emit sigFilterApplied(true /* isOriginalLog */); 299 m_iFilteredLineCount = document->lineCount(); 300 return; 301 } 299 resetFiltering(); 302 300 303 301 /* Prepare filter-data: */ … … 325 323 326 324 emit sigFilterApplied(false /* isOriginalLog */); 327 } 328 329 void resetFiltering() 330 { 325 logPage->scrollToEnd(); 326 } 327 328 void UIVMLogViewerFilterPanel::resetFiltering() 329 { 330 UIVMLogPage *logPage = viewer()->currentLogPage(); 331 QTextDocument *document = textDocument(); 332 if (!logPage || !document) 333 return; 334 335 document->setPlainText(logPage->logString()); 336 m_iFilteredLineCount = document->lineCount(); 337 m_iUnfilteredLineCount = document->lineCount(); 338 logPage->scrollToEnd(); 331 339 } 332 340 … … 390 398 return; 391 399 m_filterTermSet.clear(); 392 applyFilter();400 resetFiltering(); 393 401 if (m_pFilterTermsLineEdit) 394 402 m_pFilterTermsLineEdit->clearAll(); … … 601 609 /* Set focus to combo-box: */ 602 610 m_pFilterComboBox->setFocus(); 611 applyFilter(); 612 } 613 614 void UIVMLogViewerFilterPanel::hideEvent(QHideEvent *pEvent) 615 { 616 UIVMLogViewerPanel::hideEvent(pEvent); 617 applyFilter(); 603 618 } 604 619 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerFilterPanel.h
r88728 r88734 73 73 bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */; 74 74 void showEvent(QShowEvent *pEvent) /* override */; 75 void hideEvent(QHideEvent *pEvent) /* override */; 75 76 76 77 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
r88707 r88734 415 415 void UIVMLogViewerSearchPanel::clearHighlighting() 416 416 { 417 // if (!viewer())418 // return;419 // QTextDocument* pDocument = textDocument();420 // if (pDocument)421 // pDocument->undo();422 423 417 QPlainTextEdit *pTextEdit = textEdit(); 424 418 if (pTextEdit) … … 430 424 { 431 425 clearHighlighting(); 432 // if (!pDocument)433 // return;434 // if (searchString.isEmpty())435 // return;436 437 // QTextCursor highlightCursor(pDocument);438 // QTextCharFormat colorFormat(highlightCursor.charFormat());439 // QTextCursor cursor(pDocument);440 // cursor.beginEditBlock();441 // colorFormat.setBackground(Qt::yellow);442 // for (int i = 0; i < m_matchedCursorPosition.size(); ++i)443 // {444 // highlightCursor.setPosition(m_matchedCursorPosition[i]);445 // highlightCursor.setPosition(m_matchedCursorPosition[i] + searchString.length(), QTextCursor::KeepAnchor);446 447 // if (!highlightCursor.isNull())448 // {449 // highlightCursor.mergeCharFormat(colorFormat);450 // }451 // }452 // cursor.endEditBlock();453 426 QPlainTextEdit *pTextEdit = textEdit(); 454 427 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.cpp
r82968 r88734 416 416 } 417 417 418 void UIVMLogViewerTextEdit::scrollToEnd() 419 { 420 moveCursor(QTextCursor::End); 421 ensureCursorVisible(); 422 } 423 418 424 int UIVMLogViewerTextEdit::visibleLineCount() 419 425 { -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerTextEdit.h
r82968 r88734 54 54 55 55 void scrollToLine(int lineNumber); 56 void scrollToEnd(); 56 57 void setBookmarkLineSet(const QSet<int>& lineSet); 57 58 void setShownTextIsFiltered(bool warning);
Note:
See TracChangeset
for help on using the changeset viewer.