VirtualBox

Ignore:
Timestamp:
Feb 6, 2012 12:38:39 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: Network Manager GUI: Mark host-names and other links in error-messages with bold.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp

    r39950 r40009  
    189189        m_pRetryButton->setHidden(false);
    190190
     191        /* Try to find all the links in the error-message,
     192         * replace them with %increment if present: */
     193        QString strErrorText(strError);
     194        QRegExp linkRegExp("[\\S]+[\\./][\\S]+");
     195        QStringList links;
     196        for (int i = 1; linkRegExp.indexIn(strErrorText) != -1; ++i)
     197        {
     198            links << linkRegExp.cap();
     199            strErrorText.replace(linkRegExp.cap(), QString("%%1").arg(i));
     200        }
     201        /* Return back all the links, just in bold: */
     202        if (!links.isEmpty())
     203            for (int i = 0; i < links.size(); ++i)
     204                strErrorText = strErrorText.arg(QString("<b>%1</b>").arg(links[i]));
     205
    191206        /* Show error label: */
    192         m_pErrorPane->setPlainText(UINetworkManager::tr("Error: %1.").arg(strError));
     207        m_pErrorPane->setText(UINetworkManager::tr("Error: %1.").arg(strErrorText));
    193208        m_pErrorPane->setMinimumHeight(m_pErrorPane->document()->size().toSize().height());
    194209    }
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