VirtualBox

Ignore:
Timestamp:
Jul 23, 2021 11:26:26 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: First notification signature for notification-center, which means new files for future signatures; This one is about medium move progress which should now go to center instead of modal dialog.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r90290 r90300  
    846846        src/notificationcenter/UINotificationObject.h \
    847847        src/notificationcenter/UINotificationObjectItem.h \
     848        src/notificationcenter/UINotificationObjects.h \
    848849        src/notificationcenter/UINotificationProgressTask.h \
    849850        src/settings/UISettingsDialog.h \
     
    13961397        src/notificationcenter/UINotificationObject.cpp \
    13971398        src/notificationcenter/UINotificationObjectItem.cpp \
     1399        src/notificationcenter/UINotificationObjects.cpp \
    13981400        src/notificationcenter/UINotificationProgressTask.cpp \
    13991401        src/objects/UIRichTextString.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp

    r90270 r90300  
    2828#include "UIMediumItem.h"
    2929#include "UIMessageCenter.h"
     30#include "UINotificationCenter.h"
    3031
    3132/* COM includes: */
     
    7879        return false;
    7980
    80     /* Try to assign new medium location: */
    81     if (   comMedium.isOk()
    82         && strFileName != location())
    83     {
    84         /* Prepare move storage progress: */
    85         CProgress comProgress = comMedium.MoveTo(strFileName);
    86 
    87         /* Show error message if necessary: */
    88         if (!comMedium.isOk())
    89         {
    90             msgCenter().cannotMoveMediumStorage(comMedium, location(),
    91                                                 strFileName, treeWidget());
    92             /* Negative if failed: */
    93             return false;
    94         }
    95         else
    96         {
    97             /* Show move storage progress: */
    98             msgCenter().showModalProgressDialog(comProgress, tr("Moving medium ..."),
    99                                                 ":/progress_media_move_90px.png", treeWidget());
    100 
    101             /* Show error message if necessary: */
    102             if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
    103             {
    104                 msgCenter().cannotMoveMediumStorage(comProgress, location(),
    105                                                     strFileName, treeWidget());
    106                 /* Negative if failed: */
    107                 return false;
    108             }
    109         }
    110     }
    111 
    112     /* Recache item: */
    113     refreshAll();
     81    /* Assign new medium location: */
     82    UINotificationProgressMediumMove *pNotification = new UINotificationProgressMediumMove(comMedium,
     83                                                                                           location(),
     84                                                                                           strFileName);
     85    connect(pNotification, &UINotificationProgressMediumMove::sigProgressFinished,
     86            this, &UIMediumItem::sltHandleMoveProgressFinished);
     87    notificationCenter().append(pNotification);
    11488
    11589    /* Positive: */
     
    262236}
    263237
     238void UIMediumItem::sltHandleMoveProgressFinished()
     239{
     240    /* Recache item: */
     241    refreshAll();
     242}
     243
    264244void UIMediumItem::refresh()
    265245{
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.h

    r90270 r90300  
    119119    /** Returns default text. */
    120120    virtual QString defaultText() const /* override */;
     121
     122protected slots:
     123
     124    /** Handles medium move progress result. */
     125    void sltHandleMoveProgressFinished();
    121126
    122127private:
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h

    r90288 r90300  
    2828/* GUI includes: */
    2929#include "UILibraryDefs.h"
     30#include "UINotificationObjects.h"
    3031
    3132/* Forward declarations: */
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