VirtualBox

Changeset 108655 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 20, 2025 3:02:10 PM (4 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168068
Message:

FE/Qt: bugref:10814: VBox Manager: Move cloud machine state change handling from Machine tools widget to Global one.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
4 edited

Legend:

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

    r108645 r108655  
    205205}
    206206
     207void UIGlobalToolsWidget::sltHandleCloudMachineStateChange(const QUuid &uId)
     208{
     209    /* Acquire current item: */
     210    UIVirtualMachineItem *pItem = machineToolsWidget()->currentItem();
     211    const bool fCurrentItemIsOk = machineToolsWidget()->isItemAccessible(pItem);
     212
     213    /* If current item is Ok: */
     214    if (fCurrentItemIsOk)
     215    {
     216        /* If Error-pane is chosen currently => switch to tool currently chosen in tools-menu: */
     217        if (toolPaneMachine()->currentTool() == UIToolType_Error)
     218            machineToolsWidget()->switchToolTo(toolMenu()->toolsType(UIToolClass_Machine));
     219
     220        /* If we still have same item selected: */
     221        if (pItem && pItem->id() == uId)
     222        {
     223            /* Propagate current items to update the Details-pane: */
     224            toolPaneMachine()->setItems(machineToolsWidget()->currentItems());
     225        }
     226    }
     227    else
     228    {
     229        /* Make sure Error pane raised: */
     230        if (toolPaneMachine()->currentTool() != UIToolType_Error)
     231            toolPaneMachine()->openTool(UIToolType_Error);
     232
     233        /* If we still have same item selected: */
     234        if (pItem && pItem->id() == uId)
     235        {
     236            /* Propagate current items to update the Details-pane (in any case): */
     237            toolPaneMachine()->setItems(machineToolsWidget()->currentItems());
     238            /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
     239            toolPaneMachine()->setErrorDetails(pItem->accessError());
     240        }
     241    }
     242
     243    /* Pass the signal further: */
     244    emit sigCloudMachineStateChange(uId);
     245}
     246
    207247void UIGlobalToolsWidget::sltHandleGlobalToolMenuUpdate()
    208248{
     
    370410    connect(chooser(), &UIChooser::sigCloudProfileStateChange,
    371411            this, &UIGlobalToolsWidget::sltHandleCloudProfileStateChange);
     412    connect(chooser(), &UIChooser::sigCloudMachineStateChange,
     413            this, &UIGlobalToolsWidget::sltHandleCloudMachineStateChange);
    372414
    373415    /* Tools-menu connections: */
     
    416458    disconnect(chooser(), &UIChooser::sigCloudProfileStateChange,
    417459               this, &UIGlobalToolsWidget::sltHandleCloudProfileStateChange);
     460    disconnect(chooser(), &UIChooser::sigCloudMachineStateChange,
     461               this, &UIGlobalToolsWidget::sltHandleCloudMachineStateChange);
    418462
    419463    /* Tools-menu connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIGlobalToolsWidget.h

    r108561 r108655  
    6565    /** @} */
    6666
     67    /** @name Chooser pane stuff.
     68      * @{ */
     69        /** Notifies about state change for cloud machine with certain @a uId. */
     70        void sigCloudMachineStateChange(const QUuid &uId);
     71    /** @} */
     72
    6773public:
    6874
     
    134140        void sltHandleCloudProfileStateChange(const QString &strProviderShortName,
    135141                                              const QString &strProfileName);
     142
     143        /** Handles state change for cloud machine with certain @a uId. */
     144        void sltHandleCloudMachineStateChange(const QUuid &uId);
    136145    /** @} */
    137146
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineToolsWidget.cpp

    r108645 r108655  
    298298}
    299299
    300 void UIMachineToolsWidget::sltHandleCloudMachineStateChange(const QUuid &uId)
    301 {
    302     /* Acquire current item: */
    303     UIVirtualMachineItem *pItem = currentItem();
    304     const bool fCurrentItemIsOk = isItemAccessible(pItem);
    305 
    306     /* If current item is Ok: */
    307     if (fCurrentItemIsOk)
    308     {
    309         /* If Error-pane is chosen currently => switch to tool currently chosen in tools-menu: */
    310         if (toolPane()->currentTool() == UIToolType_Error)
    311             switchToolTo(toolMenu()->toolsType(UIToolClass_Machine));
    312 
    313         /* If we still have same item selected: */
    314         if (pItem && pItem->id() == uId)
    315         {
    316             /* Propagate current items to update the Details-pane: */
    317             toolPane()->setItems(currentItems());
    318         }
    319     }
    320     else
    321     {
    322         /* Make sure Error pane raised: */
    323         if (toolPane()->currentTool() != UIToolType_Error)
    324             toolPane()->openTool(UIToolType_Error);
    325 
    326         /* If we still have same item selected: */
    327         if (pItem && pItem->id() == uId)
    328         {
    329             /* Propagate current items to update the Details-pane (in any case): */
    330             toolPane()->setItems(currentItems());
    331             /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
    332             toolPane()->setErrorDetails(pItem->accessError());
    333         }
    334     }
    335 
    336     /* Pass the signal further: */
    337     emit sigCloudMachineStateChange(uId);
    338 }
    339 
    340300void UIMachineToolsWidget::sltHandleToolMenuUpdate(UIVirtualMachineItem *pItem)
    341301{
     
    497457    connect(chooser(), &UIChooser::sigToolMenuRequested,
    498458            this, &UIMachineToolsWidget::sltHandleToolMenuRequested);
    499     connect(chooser(), &UIChooser::sigCloudMachineStateChange,
    500             this, &UIMachineToolsWidget::sltHandleCloudMachineStateChange);
    501459    connect(chooser(), &UIChooser::sigToggleStarted,
    502460            toolPane(), &UIToolPane::sigToggleStarted);
     
    552510    disconnect(chooser(), &UIChooser::sigToolMenuRequested,
    553511               this, &UIMachineToolsWidget::sltHandleToolMenuRequested);
    554     disconnect(chooser(), &UIChooser::sigCloudMachineStateChange,
    555                this, &UIMachineToolsWidget::sltHandleCloudMachineStateChange);
    556512    disconnect(chooser(), &UIChooser::sigToggleStarted,
    557513               toolPane(), &UIToolPane::sigToggleStarted);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIMachineToolsWidget.h

    r108550 r108655  
    7171        /** Notifies about Chooser-pane selection change. */
    7272        void sigChooserPaneSelectionChange();
    73 
    74         /** Notifies about state change for cloud machine with certain @a uId. */
    75         void sigCloudMachineStateChange(const QUuid &uId);
    7673    /** @} */
    7774
     
    188185        /** Handles signal about Chooser-pane selection invalidated. */
    189186        void sltHandleChooserPaneSelectionInvalidated();
    190 
    191         /** Handles state change for cloud machine with certain @a uId. */
    192         void sltHandleCloudMachineStateChange(const QUuid &uId);
    193187    /** @} */
    194188
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette