VirtualBox

Changeset 102575 in vbox


Ignore:
Timestamp:
Dec 11, 2023 4:48:25 PM (14 months ago)
Author:
vboxsync
Message:

FE/Qt: VBox Manager: Remove Show Log Viewer dialog action; Only pane opened embedded way should be allowed.

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

Legend:

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

    r102268 r102575  
    12751275};
    12761276
    1277 /** Simple action extension, used as 'Show Machine Logs' action class. */
    1278 class UIActionSimpleManagerCommonShowMachineLogs : public UIActionSimple
    1279 {
    1280     Q_OBJECT;
    1281 
    1282 public:
    1283 
    1284     /** Constructs action passing @a pParent to the base-class. */
    1285     UIActionSimpleManagerCommonShowMachineLogs(UIActionPool *pParent)
    1286         : UIActionSimple(pParent,
    1287                          ":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
    1288                          ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png")
    1289     {
    1290         retranslateUi();
    1291     }
    1292 
    1293 protected:
    1294 
    1295     /** Returns shortcut extra-data ID. */
    1296     virtual QString shortcutExtraDataID() const RT_OVERRIDE
    1297     {
    1298         return QString("LogViewer");
    1299     }
    1300 
    1301     /** Returns default shortcut. */
    1302     virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
    1303     {
    1304         return QKeySequence("Ctrl+L");
    1305     }
    1306 
    1307     /** Handles translation event. */
    1308     virtual void retranslateUi() RT_OVERRIDE
    1309     {
    1310         setName(QApplication::translate("UIActionPool", "Show &Log..."));
    1311         setStatusTip(QApplication::translate("UIActionPool", "Show log files of selected virtual machines"));
    1312     }
    1313 };
    1314 
    13151277/** Simple action extension, used as 'Perform Refresh' action class. */
    13161278class UIActionSimpleManagerCommonPerformRefresh : public UIActionSimple
     
    19051867    {
    19061868        return QString("ToolsMachineLogViewer");
     1869    }
     1870
     1871    /** Returns default shortcut. */
     1872    virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
     1873    {
     1874        return QKeySequence("Ctrl+L");
    19071875    }
    19081876
     
    36623630    m_pool[UIActionIndexMN_M_Group_M_Tools_T_FileManager] = new UIActionToggleManagerToolsMachineShowFileManager(this);
    36633631    m_pool[UIActionIndexMN_M_Group_S_Discard] = new UIActionSimpleManagerCommonPerformDiscard(this);
    3664     m_pool[UIActionIndexMN_M_Group_S_ShowLogDialog] = new UIActionSimpleManagerCommonShowMachineLogs(this);
    3665     m_pool[UIActionIndexMN_M_Group_S_ShowLogDialog] = new UIActionSimpleManagerCommonShowMachineLogs(this);
    36663632    m_pool[UIActionIndexMN_M_Group_S_Refresh] = new UIActionSimpleManagerCommonPerformRefresh(this);
    36673633    m_pool[UIActionIndexMN_M_Group_S_ShowInFileManager] = new UIActionSimpleManagerCommonShowInFileManager(this);
     
    37093675    m_pool[UIActionIndexMN_M_Machine_M_Tools_T_FileManager] = new UIActionToggleManagerToolsMachineShowFileManager(this);
    37103676    m_pool[UIActionIndexMN_M_Machine_S_Discard] = new UIActionSimpleManagerCommonPerformDiscard(this);
    3711     m_pool[UIActionIndexMN_M_Machine_S_ShowLogDialog] = new UIActionSimpleManagerCommonShowMachineLogs(this);
    37123677    m_pool[UIActionIndexMN_M_Machine_S_Refresh] = new UIActionSimpleManagerCommonPerformRefresh(this);
    37133678    m_pool[UIActionIndexMN_M_Machine_S_ShowInFileManager] = new UIActionSimpleManagerCommonShowInFileManager(this);
     
    39653930                    // << action(UIActionIndexMN_M_Group_S_Detach)
    39663931                    << action(UIActionIndexMN_M_Group_S_Discard)
    3967                     << action(UIActionIndexMN_M_Group_S_ShowLogDialog)
    39683932                    << action(UIActionIndexMN_M_Group_S_Refresh)
    39693933                    << action(UIActionIndexMN_M_Group_S_ShowInFileManager)
     
    40013965                    // << action(UIActionIndexMN_M_Machine_S_Detach)
    40023966                    << action(UIActionIndexMN_M_Machine_S_Discard)
    4003                     << action(UIActionIndexMN_M_Machine_S_ShowLogDialog)
    40043967                    << action(UIActionIndexMN_M_Machine_S_Refresh)
    40053968                    << action(UIActionIndexMN_M_Machine_S_ShowInFileManager)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r102265 r102575  
    9696    UIActionIndexMN_M_Group_M_Tools_T_FileManager,
    9797    UIActionIndexMN_M_Group_S_Discard,
    98     UIActionIndexMN_M_Group_S_ShowLogDialog,
    9998    UIActionIndexMN_M_Group_S_Refresh,
    10099    UIActionIndexMN_M_Group_S_ShowInFileManager,
     
    142141    UIActionIndexMN_M_Machine_M_Tools_T_FileManager,
    143142    UIActionIndexMN_M_Machine_S_Discard,
    144     UIActionIndexMN_M_Machine_S_ShowLogDialog,
    145143    UIActionIndexMN_M_Machine_S_Refresh,
    146144    UIActionIndexMN_M_Machine_S_ShowInFileManager,
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r102574 r102575  
    588588    , m_fFirstMediumEnumerationHandled(false)
    589589    , m_pActionPool(0)
    590     , m_pLogViewerDialog(0)
    591590    , m_pWidget(0)
    592591    , m_iGeometrySaveTimerId(-1)
     
    950949    updateActionsVisibility();
    951950    updateActionsAppearance();
    952 
    953     /* Make sure separate dialog closed when corresponding tool opened: */
    954     switch (m_pWidget->toolsTypeMachine())
    955     {
    956         case UIToolType_Logs:
    957             sltCloseLogViewerWindow();
    958             break;
    959         default:
    960             break;
    961     }
    962951}
    963952
     
    10331022            case UIToolType_Cloud: UICloudProfileManagerFactory(m_pActionPool).prepare(m_managers[enmType], this); break;
    10341023            case UIToolType_CloudConsole: UICloudConsoleManagerFactory(m_pActionPool).prepare(m_managers[enmType], this); break;
     1024            case UIToolType_Logs:
     1025            {
     1026                /* Compose a list of selected machine IDs: */
     1027                QList<QUuid> machineIDs;
     1028                /* For each selected item: */
     1029                foreach (UIVirtualMachineItem *pItem, currentItems())
     1030                {
     1031                    /* Make sure current item is local one: */
     1032                    UIVirtualMachineItemLocal *pItemLocal = pItem->toLocal();
     1033                    if (!pItemLocal)
     1034                        continue;
     1035                    /* Append machine ID: */
     1036                    machineIDs << pItemLocal->id();
     1037                }
     1038                UIVMLogViewerDialogFactory(m_pActionPool, machineIDs).prepare(m_managers[enmType], this);
     1039                break;
     1040            }
    10351041            default: break;
    10361042        }
     
    10731079            case UIToolType_Cloud: UICloudProfileManagerFactory().cleanup(m_managers[enmType]); break;
    10741080            case UIToolType_CloudConsole: UICloudConsoleManagerFactory().cleanup(m_managers[enmType]); break;
     1081            case UIToolType_Logs: UIVMLogViewerDialogFactory().cleanup(m_managers[enmType]); break;
    10751082            default: break;
    10761083        }
     
    22112218}
    22122219
    2213 void UIVirtualBoxManager::sltOpenLogViewerWindow()
    2214 {
    2215     /* Get selected items: */
    2216     QList<UIVirtualMachineItem*> items = currentItems();
    2217     AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    2218 
    2219     /* First check if instance of widget opened the embedded way: */
    2220     if (m_pWidget->isMachineToolOpened(UIToolType_Logs))
    2221     {
    2222         m_pWidget->setToolsTypeMachine(UIToolType_Details);
    2223         m_pWidget->closeMachineTool(UIToolType_Logs);
    2224     }
    2225 
    2226     QList<QUuid> machineIDs;
    2227 
    2228     /* For each selected item: */
    2229     foreach (UIVirtualMachineItem *pItem, items)
    2230     {
    2231         /* Make sure current item is local one: */
    2232         UIVirtualMachineItemLocal *pItemLocal = pItem->toLocal();
    2233         if (!pItemLocal)
    2234             continue;
    2235 
    2236         /* Check if log could be show for the current item: */
    2237         if (!isActionEnabled(UIActionIndexMN_M_Group_S_ShowLogDialog, QList<UIVirtualMachineItem*>() << pItem))
    2238             continue;
    2239         machineIDs << pItem->id();
    2240     }
    2241 
    2242     if (machineIDs.isEmpty())
    2243         return;
    2244     if (!m_pLogViewerDialog)
    2245     {
    2246         UIVMLogViewerDialogFactory dialogFactory(actionPool(), machineIDs);
    2247         dialogFactory.prepare(m_pLogViewerDialog, this);
    2248         if (m_pLogViewerDialog)
    2249             connect(m_pLogViewerDialog, &QIManagerDialog::sigClose,
    2250                     this, &UIVirtualBoxManager::sltCloseLogViewerWindow);
    2251     }
    2252     AssertPtrReturnVoid(m_pLogViewerDialog);
    2253     m_pLogViewerDialog->show();
    2254     m_pLogViewerDialog->setWindowState(m_pLogViewerDialog->windowState() & ~Qt::WindowMinimized);
    2255     m_pLogViewerDialog->activateWindow();
    2256 }
    2257 
    2258 void UIVirtualBoxManager::sltCloseLogViewerWindow()
    2259 {
    2260     if (!m_pLogViewerDialog)
    2261         return;
    2262 
    2263     QIManagerDialog* pDialog = m_pLogViewerDialog;
    2264     m_pLogViewerDialog = 0;
    2265     pDialog->close();
    2266     UIVMLogViewerDialogFactory().cleanup(pDialog);
    2267 }
    2268 
    22692220void UIVirtualBoxManager::sltPerformRefreshMachine()
    22702221{
     
    25682519    connect(actionPool()->action(UIActionIndexMN_M_Group_S_Discard), &UIAction::triggered,
    25692520            this, &UIVirtualBoxManager::sltPerformDiscardMachineState);
    2570     connect(actionPool()->action(UIActionIndexMN_M_Group_S_ShowLogDialog), &UIAction::triggered,
    2571             this, &UIVirtualBoxManager::sltOpenLogViewerWindow);
    25722521    connect(actionPool()->action(UIActionIndexMN_M_Group_S_Refresh), &UIAction::triggered,
    25732522            this, &UIVirtualBoxManager::sltPerformRefreshMachine);
     
    26122561    connect(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard), &UIAction::triggered,
    26132562            this, &UIVirtualBoxManager::sltPerformDiscardMachineState);
    2614     connect(actionPool()->action(UIActionIndexMN_M_Machine_S_ShowLogDialog), &UIAction::triggered,
    2615             this, &UIVirtualBoxManager::sltOpenLogViewerWindow);
    26162563    connect(actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh), &UIAction::triggered,
    26172564            this, &UIVirtualBoxManager::sltPerformRefreshMachine);
     
    31403087        pMenu->addSeparator();
    31413088        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Discard));
    3142         pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_ShowLogDialog));
    31433089        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Refresh));
    31443090        pMenu->addSeparator();
     
    32063152        pMenu->addSeparator();
    32073153        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard));
    3208         pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_ShowLogDialog));
    32093154        pMenu->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh));
    32103155        pMenu->addSeparator();
     
    34993444    actionPool()->action(UIActionIndexMN_M_Group_S_Detach)->setEnabled(isActionEnabled(UIActionIndexMN_M_Group_S_Detach, items));
    35003445    actionPool()->action(UIActionIndexMN_M_Group_S_Discard)->setEnabled(isActionEnabled(UIActionIndexMN_M_Group_S_Discard, items));
    3501     actionPool()->action(UIActionIndexMN_M_Group_S_ShowLogDialog)->setEnabled(isActionEnabled(UIActionIndexMN_M_Group_S_ShowLogDialog, items));
    35023446    actionPool()->action(UIActionIndexMN_M_Group_S_Refresh)->setEnabled(isActionEnabled(UIActionIndexMN_M_Group_S_Refresh, items));
    35033447    actionPool()->action(UIActionIndexMN_M_Group_S_ShowInFileManager)->setEnabled(isActionEnabled(UIActionIndexMN_M_Group_S_ShowInFileManager, items));
     
    35193463    actionPool()->action(UIActionIndexMN_M_Machine_S_Detach)->setEnabled(isActionEnabled(UIActionIndexMN_M_Machine_S_Detach, items));
    35203464    actionPool()->action(UIActionIndexMN_M_Machine_S_Discard)->setEnabled(isActionEnabled(UIActionIndexMN_M_Machine_S_Discard, items));
    3521     actionPool()->action(UIActionIndexMN_M_Machine_S_ShowLogDialog)->setEnabled(isActionEnabled(UIActionIndexMN_M_Machine_S_ShowLogDialog, items));
    35223465    actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh)->setEnabled(isActionEnabled(UIActionIndexMN_M_Machine_S_Refresh, items));
    35233466    actionPool()->action(UIActionIndexMN_M_Machine_S_ShowInFileManager)->setEnabled(isActionEnabled(UIActionIndexMN_M_Machine_S_ShowInFileManager, items));
     
    37693712                     m_pWidget->isCurrentStateItemSelected());
    37703713        }
    3771         case UIActionIndexMN_M_Group_S_ShowLogDialog:
    3772         case UIActionIndexMN_M_Machine_S_ShowLogDialog:
    3773         {
    3774             return isItemsLocal(items) &&
    3775                    isAtLeastOneItemAccessible(items);
    3776         }
    37773714        case UIActionIndexMN_M_Group_T_Pause:
    37783715        case UIActionIndexMN_M_Machine_T_Pause:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r102139 r102575  
    319319        /** Handles call to show machine tool corresponding to passed @a pAction. */
    320320        void sltPerformShowMachineTool(QAction *pAction);
    321 
    322         /** Handles call to open machine Log Viewer window. */
    323         void sltOpenLogViewerWindow();
    324         /** Handles call to close machine Log Viewer window. */
    325         void sltCloseLogViewerWindow();
    326321
    327322        /** Handles call to refresh machine. */
     
    526521    QMap<WizardType, UINativeWizard*>  m_wizards;
    527522
    528     /** Holds the instance of UIVMLogViewerDialog. */
    529     QIManagerDialog *m_pLogViewerDialog;
    530 
    531523    /** Holds the central-widget instance. */
    532524    UIVirtualBoxManagerWidget *m_pWidget;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r102111 r102575  
    14871487        pMenuGroup->addSeparator();
    14881488        pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Discard));
    1489         pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_ShowLogDialog));
    14901489        pMenuGroup->addAction(actionPool()->action(UIActionIndexMN_M_Group_S_Refresh));
    14911490        pMenuGroup->addSeparator();
     
    15151514        pMenuMachine->addSeparator();
    15161515        pMenuMachine->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Discard));
    1517         pMenuMachine->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_ShowLogDialog));
    15181516        pMenuMachine->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Refresh));
    15191517        pMenuMachine->addSeparator();
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