VirtualBox

Changeset 91007 in vbox


Ignore:
Timestamp:
Aug 30, 2021 5:50:44 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Moving URL stuff related warnings from UIMessageCenter to UINotificationCenter; Cleanup UIMessageCenter a bit.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r91003 r91007  
    37243724    /* Acquire client result: */
    37253725    bool fResult = client.result();
    3726 
    37273726    if (!fResult)
    3728         msgCenter().cannotOpenURL(strUrl);
     3727        UINotificationMessage::cannotOpenURL(strUrl);
    37293728
    37303729    return fResult;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r90967 r91007  
    453453}
    454454
     455void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const
     456{
     457    alert(0, MessageType_Error,
     458          tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>"
     459             "<p>The language will be temporarily reset to the system default language. "
     460             "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the "
     461             "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>")
     462             .arg(strLangId).arg(strNlsPath));
     463}
     464
     465void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const
     466{
     467    alert(0, MessageType_Error,
     468          tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. "
     469             "<p>The language will be temporarily reset to English (built-in). "
     470             "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the "
     471             "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>")
     472             .arg(strLangFile));
     473}
     474
    455475void UIMessageCenter::cannotInitUserHome(const QString &strUserHome) const
    456476{
     
    494514}
    495515
    496 void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const
    497 {
    498     alert(0, MessageType_Error,
    499           tr("<p>Could not find a language file for the language <b>%1</b> in the directory <b><nobr>%2</nobr></b>.</p>"
    500              "<p>The language will be temporarily reset to the system default language. "
    501              "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the "
    502              "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>")
    503              .arg(strLangId).arg(strNlsPath));
    504 }
    505 
    506 void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const
    507 {
    508     alert(0, MessageType_Error,
    509           tr("<p>Could not load the language file <b><nobr>%1</nobr></b>. "
    510              "<p>The language will be temporarily reset to English (built-in). "
    511              "Please go to the <b>Preferences</b> window which you can open from the <b>File</b> menu of the "
    512              "VirtualBox Manager window, and select one of the existing languages on the <b>Language</b> page.</p>")
    513              .arg(strLangFile));
    514 }
    515 
    516516void UIMessageCenter::cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const
    517517{
     
    551551             .arg(strMachineName),
    552552          UIErrorString::formatErrorInfo(progress));
    553 }
    554 
    555 void UIMessageCenter::cannotGetMediaAccessibility(const UIMedium &medium) const
    556 {
    557     error(0, MessageType_Error,
    558           tr("Failed to access the disk image file <nobr><b>%1</b></nobr>.")
    559              .arg(medium.location()),
    560           UIErrorString::formatErrorInfo(medium.result()));
    561 }
    562 
    563 void UIMessageCenter::cannotOpenURL(const QString &strUrl) const
    564 {
    565     alert(0, MessageType_Error,
    566           tr("Failed to open <tt>%1</tt>. "
    567              "Make sure your desktop environment can properly handle URLs of this type.")
    568              .arg(strUrl));
    569553}
    570554
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r90933 r91007  
    250250        void cannotStartSelector() const;
    251251        void cannotStartRuntime() const;
     252
     253        void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const;
     254        void cannotLoadLanguage(const QString &strLangFile) const;
    252255    /** @} */
    253256
     
    261264
    262265    /* API: Global warnings: */
    263     void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const;
    264     void cannotLoadLanguage(const QString &strLangFile) const;
    265266    void cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const;
    266267    void cannotFindMachineById(const CVirtualBox &vbox, const QUuid &uId) const;
     
    268269    void cannotOpenSession(const CMachine &machine) const;
    269270    void cannotOpenSession(const CProgress &progress, const QString &strMachineName) const;
    270     void cannotGetMediaAccessibility(const UIMedium &medium) const;
    271     void cannotOpenURL(const QString &strUrl) const;
    272271    void cannotSetExtraData(const CVirtualBox &vbox, const QString &strKey, const QString &strValue);
    273272    void cannotSetExtraData(const CMachine &machine, const QString &strKey, const QString &strValue);
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90967 r91007  
    5656/* static */
    5757QMap<QString, QUuid> UINotificationMessage::m_messages = QMap<QString, QUuid>();
     58
     59/* static */
     60void UINotificationMessage::cannotOpenURL(const QString &strUrl)
     61{
     62    createMessage(
     63        QApplication::translate("UIMessageCenter", "Can't open URL ..."),
     64        QApplication::translate("UIMessageCenter", "Failed to open <tt>%1</tt>. "
     65                                                   "Make sure your desktop environment can properly handle URLs of this type.")
     66                                                   .arg(strUrl));
     67}
    5868
    5969/* static */
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90933 r91007  
    6161public:
    6262
     63    /** Notifies about inability to open @a strUrl. */
     64    static void cannotOpenURL(const QString &strUrl);
    6365    /** Notifies about inability to mount image.
    6466      * @param  strMachineName  Brings the machine name.
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