VirtualBox

Changeset 91216 in vbox


Ignore:
Timestamp:
Sep 10, 2021 7:18:04 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Moving License Viewer messages from UIMessageCenter to UINotificationCenter; A bit of refactoring for UIMessageCenter DnD stuff as well.

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

Legend:

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

    r82968 r91216  
    2727#include "VBoxLicenseViewer.h"
    2828#include "UIMessageCenter.h"
     29#include "UINotificationCenter.h"
    2930
    3031
     
    111112    else
    112113    {
    113         msgCenter().cannotOpenLicenseFile(strLicenseFileName, this);
     114        UINotificationMessage::cannotOpenLicenseFile(strLicenseFileName);
    114115        return QDialog::Rejected;
    115116    }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r91132 r91216  
    6969#include "UIVisoCreator.h"
    7070#include "UIWizardNewVD.h"
    71 #include "VBoxLicenseViewer.h"
    7271#ifdef VBOX_WS_MAC
    7372# include "UIMachineWindowFullscreen.h"
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r91180 r91216  
    20092009}
    20102010
     2011#ifdef VBOX_WITH_DRAG_AND_DROP
     2012void UIMessageCenter::cannotDropDataToGuest(const CDnDTarget &dndTarget, QWidget *pParent /* = 0 */) const
     2013{
     2014    error(pParent, MessageType_Error,
     2015          tr("Drag and drop operation from host to guest failed."),
     2016          UIErrorString::formatErrorInfo(dndTarget));
     2017}
     2018
     2019void UIMessageCenter::cannotDropDataToGuest(const CProgress &progress, QWidget *pParent /* = 0 */) const
     2020{
     2021    error(pParent, MessageType_Error,
     2022          tr("Drag and drop operation from host to guest failed."),
     2023          UIErrorString::formatErrorInfo(progress));
     2024}
     2025
     2026void UIMessageCenter::cannotDropDataToHost(const CDnDSource &dndSource, QWidget *pParent /* = 0 */) const
     2027{
     2028    error(pParent, MessageType_Error,
     2029          tr("Drag and drop operation from guest to host failed."),
     2030          UIErrorString::formatErrorInfo(dndSource));
     2031}
     2032
     2033void UIMessageCenter::cannotDropDataToHost(const CProgress &progress, QWidget *pParent /* = 0 */) const
     2034{
     2035    error(pParent, MessageType_Error,
     2036          tr("Drag and drop operation from guest to host failed."),
     2037          UIErrorString::formatErrorInfo(progress));
     2038}
     2039#endif /* VBOX_WITH_DRAG_AND_DROP */
     2040
    20112041bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /* = 0*/) const
    20122042{
     
    22782308          tr("An error has occured during unattended guest install setup."),
    22792309          UIErrorString::formatErrorInfo(comErrorInfo));
    2280 }
    2281 
    2282 #ifdef VBOX_WITH_DRAG_AND_DROP
    2283 void UIMessageCenter::cannotDropDataToGuest(const CDnDTarget &dndTarget, QWidget *pParent /* = 0 */) const
    2284 {
    2285     error(pParent, MessageType_Error,
    2286           tr("Drag and drop operation from host to guest failed."),
    2287           UIErrorString::formatErrorInfo(dndTarget));
    2288 }
    2289 
    2290 void UIMessageCenter::cannotDropDataToGuest(const CProgress &progress, QWidget *pParent /* = 0 */) const
    2291 {
    2292     error(pParent, MessageType_Error,
    2293           tr("Drag and drop operation from host to guest failed."),
    2294           UIErrorString::formatErrorInfo(progress));
    2295 }
    2296 
    2297 void UIMessageCenter::cannotCancelDropToGuest(const CDnDTarget &dndTarget, QWidget *pParent /* = 0 */) const
    2298 {
    2299     error(pParent, MessageType_Error,
    2300           tr("Unable to cancel host to guest drag and drop operation."),
    2301           UIErrorString::formatErrorInfo(dndTarget));
    2302 }
    2303 
    2304 void UIMessageCenter::cannotDropDataToHost(const CDnDSource &dndSource, QWidget *pParent /* = 0 */) const
    2305 {
    2306     error(pParent, MessageType_Error,
    2307           tr("Drag and drop operation from guest to host failed."),
    2308           UIErrorString::formatErrorInfo(dndSource));
    2309 }
    2310 
    2311 void UIMessageCenter::cannotDropDataToHost(const CProgress &progress, QWidget *pParent /* = 0 */) const
    2312 {
    2313     error(pParent, MessageType_Error,
    2314           tr("Drag and drop operation from guest to host failed."),
    2315           UIErrorString::formatErrorInfo(progress));
    2316 }
    2317 #endif /* VBOX_WITH_DRAG_AND_DROP */
    2318 
    2319 void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /* = 0*/) const
    2320 {
    2321     alert(pParent, MessageType_Error,
    2322           tr("Failed to open the license file <nobr><b>%1</b></nobr>. Check file permissions.")
    2323              .arg(strPath));
    23242310}
    23252311
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r91180 r91216  
    454454        bool cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const;
    455455        void cannotSwitchScreenInSeamless(quint64 uMinVRAM) const;
     456
     457#ifdef VBOX_WITH_DRAG_AND_DROP
     458        /// @todo move to notification-center as progress notification .. one day :)
     459        void cannotDropDataToGuest(const CDnDTarget &dndTarget, QWidget *pParent = 0) const;
     460        void cannotDropDataToGuest(const CProgress &progress, QWidget *pParent = 0) const;
     461        void cannotDropDataToHost(const CDnDSource &dndSource, QWidget *pParent = 0) const;
     462        void cannotDropDataToHost(const CProgress &progress, QWidget *pParent = 0) const;
     463#endif /* VBOX_WITH_DRAG_AND_DROP */
    456464    /** @} */
    457465
     
    490498    void cannotRunUnattendedGuestInstall(const CUnattended &comUnattendedInstall, QWidget *pParent = 0);
    491499
    492 #ifdef VBOX_WITH_DRAG_AND_DROP
    493     /* API: Drag and drop warnings: */
    494     void cannotDropDataToGuest(const CDnDTarget &dndTarget, QWidget *pParent = 0) const;
    495     void cannotDropDataToGuest(const CProgress &progress, QWidget *pParent = 0) const;
    496     void cannotCancelDropToGuest(const CDnDTarget &dndTarget, QWidget *pParent = 0) const;
    497     void cannotDropDataToHost(const CDnDSource &dndSource, QWidget *pParent = 0) const;
    498     void cannotDropDataToHost(const CProgress &progress, QWidget *pParent = 0) const;
    499 #endif /* VBOX_WITH_DRAG_AND_DROP */
    500 
    501     /* API: License-viewer warnings: */
    502     void cannotOpenLicenseFile(const QString &strPath, QWidget *pParent = 0) const;
    503 
    504500    /* API: File-dialog warnings: */
    505501    bool confirmOverridingFile(const QString &strPath, QWidget *pParent = 0) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r91180 r91216  
    210210        QApplication::translate("UIMessageCenter", "Failed to acquire cloud machine settings.") +
    211211        strErrorDetails);
     212}
     213
     214/* static */
     215void UINotificationMessage::cannotOpenLicenseFile(const QString &strPath)
     216{
     217    createMessage(
     218        QApplication::translate("UIMessageCenter", "Can't open license file ..."),
     219        QApplication::translate("UIMessageCenter", "Failed to open the license file <nobr><b>%1</b></nobr>. Check file "
     220                                                   "permissions.").arg(strPath));
    212221}
    213222
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r91180 r91216  
    128128          * @param  strErrorDetails  Brings the error details. */
    129129        static void cannotAcquireCloudMachineSettings(const QString &strErrorDetails);
     130
     131        /** Notifies about inability to open license file.
     132          * @param  strPath  Brings the license file path. */
     133        static void cannotOpenLicenseFile(const QString &strPath);
    130134
    131135        /** Notifies about public key path is empty. */
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