VirtualBox

Ignore:
Timestamp:
Apr 26, 2021 11:48:18 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144020
Message:

FE/Qt: bugref:9930. Some refactoring on UIVMLogPage's API

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

Legend:

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

    r88702 r88703  
    106106}
    107107
    108 void UIVMLogPage::setLogString(const QString &strLog)
    109 {
    110     m_strLog = strLog;
     108void UIVMLogPage::setLogContent(const QString &strLogContent, bool fError)
     109{
     110    if (!fError)
     111    {
     112        m_strLog = strLogContent;
     113        setTextEditText(strLogContent);
     114    }
     115    else
     116    {
     117        markForError();
     118        setTextEditTextAsHtml(strLogContent);
     119    }
    111120}
    112121
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.h

    r88702 r88703  
    6363    QTextDocument  *document();
    6464
     65    void setLogContent(const QString &strLogContent, bool fError);
    6566    /* Only to be called when log file is re-read. */
    66     void setLogString(const QString &strLog);
     67    // void setLogString(const QString &strLog);
    6768    const QString& logString() const;
    6869
    6970    void setLogFileName(const QString &strFileName);
    7071    const QString& logFileName() const;
    71 
    72     /** Set plaintextEdit's text. Note that the text we
    73      *  show currently might be different than
    74      *  m_strLog. For example during filtering. */
    75     void setTextEditText(const QString &strText);
    76     void setTextEditTextAsHtml(const QString &strText);
    7772
    7873    /** Marks the plain text edit When we dont have a log content. */
     
    134129    void deleteBookmark(LogBookmark bookmark);
    135130
     131    /** Set plaintextEdit's text. Note that the text we
     132     *  show currently might be different than
     133     *  m_strLog. For example during filtering. */
     134    void setTextEditText(const QString &strText);
     135    void setTextEditTextAsHtml(const QString &strText);
     136
    136137    QHBoxLayout    *m_pMainLayout;
    137138    UIVMLogViewerTextEdit *m_pTextEdit;
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r88702 r88703  
    929929        m_pTabWidget->insertTab(m_pTabWidget->count(), pLogPage, strTabTitle);
    930930
    931         /* Set text edit since we want to display this text: */
    932         if (!noLogsToShow)
    933         {
    934             pLogPage->setTextEditText(strLogContent);
    935             /* Set the log string of the UIVMLogPage: */
    936             pLogPage->setLogString(strLogContent);
    937         }
    938         /* In case there are some errors append the error text as html: */
    939         else
    940         {
    941             pLogPage->setTextEditTextAsHtml(strLogContent);
    942             pLogPage->markForError();
    943         }
     931        pLogPage->setLogContent(strLogContent, noLogsToShow);
    944932        pLogPage->setScrollBarMarkingsVector(m_pSearchPanel->matchLocationVector());
    945933    }
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