VirtualBox

Changeset 70699 in vbox


Ignore:
Timestamp:
Jan 23, 2018 10:05:42 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt bugref:9072 Logviewer MacOS fix part-1

Location:
trunk/src/VBox/Frontends/VirtualBox/src/logviewer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp

    r70676 r70699  
    182182    if (!mainLayout())
    183183        return;
    184 
     184   
    185185    /* Create search-editor: */
    186186    m_pSearchEditor = new UISearchField(0 /* parent */);
     
    192192        mainLayout()->addWidget(m_pSearchEditor);
    193193    }
    194 
     194   
    195195    /* Create search-label: */
    196196    m_pSearchLabel = new QLabel;
     
    311311void UIVMLogViewerSearchPanel::retranslateUi()
    312312{
    313     m_pSearchLabel->setText(QString("%1 ").arg(UIVMLogViewerWidget::tr("&Find")));
    314     m_pSearchEditor->setToolTip(UIVMLogViewerWidget::tr("Enter a search string here"));
    315 
    316     m_pNextPrevButtons->setToolTip(0, UIVMLogViewerWidget::tr("Search for the previous occurrence of the string"));
    317     m_pNextPrevButtons->setToolTip(1, UIVMLogViewerWidget::tr("Search for the next occurrence of the string"));
    318 
    319     m_pCaseSensitiveCheckBox->setText(UIVMLogViewerWidget::tr("C&ase Sensitive"));
    320     m_pCaseSensitiveCheckBox->setToolTip(UIVMLogViewerWidget::tr("Perform case sensitive search (when checked)"));
    321 
    322     m_pMatchWholeWordCheckBox->setText(UIVMLogViewerWidget::tr("Ma&tch Whole Word"));
    323     m_pMatchWholeWordCheckBox->setToolTip(UIVMLogViewerWidget::tr("Search matches only complete words when checked"));
    324 
    325     m_pHighlightAllCheckBox->setText(UIVMLogViewerWidget::tr("&Highlight All"));
    326     m_pHighlightAllCheckBox->setToolTip(UIVMLogViewerWidget::tr("All occurence of the search text are highlighted"));
    327 
     313    if (m_pSearchLabel)
     314        m_pSearchLabel->setText(QString("%1 ").arg(UIVMLogViewerWidget::tr("&Find")));
     315
     316    if (m_pSearchEditor)
     317        m_pSearchEditor->setToolTip(UIVMLogViewerWidget::tr("Enter a search string here"));
     318
     319    if (m_pNextPrevButtons)
     320    {
     321        m_pNextPrevButtons->setToolTip(0, UIVMLogViewerWidget::tr("Search for the previous occurrence of the string"));
     322        m_pNextPrevButtons->setToolTip(1, UIVMLogViewerWidget::tr("Search for the next occurrence of the string"));
     323    }
     324   
     325    if (m_pCaseSensitiveCheckBox)
     326    {
     327        m_pCaseSensitiveCheckBox->setText(UIVMLogViewerWidget::tr("C&ase Sensitive"));
     328        m_pCaseSensitiveCheckBox->setToolTip(UIVMLogViewerWidget::tr("Perform case sensitive search (when checked)"));
     329    }
     330   
     331    if (m_pMatchWholeWordCheckBox)
     332    {
     333        m_pMatchWholeWordCheckBox->setText(UIVMLogViewerWidget::tr("Ma&tch Whole Word"));
     334        m_pMatchWholeWordCheckBox->setToolTip(UIVMLogViewerWidget::tr("Search matches only complete words when checked"));
     335    }
     336   
     337    if (m_pHighlightAllCheckBox)
     338    {
     339        m_pHighlightAllCheckBox->setText(UIVMLogViewerWidget::tr("&Highlight All"));
     340        m_pHighlightAllCheckBox->setToolTip(UIVMLogViewerWidget::tr("All occurence of the search text are highlighted"));
     341    }
     342   
    328343    if (m_iMatchCount == 0)
    329344        m_pInfoLabel->setText(UIVMLogViewerWidget::tr("String not found"));
     
    424439    /* Call to base-class: */
    425440    UIVMLogViewerPanel::showEvent(pEvent);
    426     /* Set focus on search-editor: */
    427     m_pSearchEditor->setFocus();
    428     /* Select all the text: */
    429     m_pSearchEditor->selectAll();
     441    if(m_pSearchEditor)
     442    {
     443        /* Set focus on search-editor: */
     444        m_pSearchEditor->setFocus();
     445        /* Select all the text: */
     446        m_pSearchEditor->selectAll();
     447    }
    430448}
    431449
     
    438456    if (!pDocument)
    439457        return;
    440 
     458    if(!m_pSearchEditor)
     459        return;
     460   
    441461    const QString &searchString = m_pSearchEditor->text();
    442462    if (searchString.isEmpty())
     
    558578void UIVMLogViewerSearchPanel::configureInfoLabels()
    559579{
     580    if (!m_pSearchEditor || !m_pWarningIcon || !m_pInfoLabel)
     581        return;
     582   
    560583    /* If no match has been found, mark the search editor: */
    561584    if (m_iMatchCount == 0)
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.h

    r70664 r70699  
    2929class QHBoxLayout;
    3030class QLabel;
    31 class UIMiniCancelButton;
    3231class UIRoundRectSegmentedButton;
    3332class UISearchField;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette