VirtualBox

Ignore:
Timestamp:
Jul 23, 2020 6:56:39 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9722: \VirtualBox Manager: Separate actions for cloud console Windows commands.

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

Legend:

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

    r85434 r85445  
    14221422
    14231423    /** Constructs action passing @a pParent to the base-class. */
    1424     UIActionSimpleSelectorConsolePerformCopyCommand(UIActionPool *pParent, bool fSerial)
     1424    UIActionSimpleSelectorConsolePerformCopyCommand(UIActionPool *pParent, bool fSerial, bool fUnix)
    14251425        : UIActionSimple(pParent)
    14261426        , m_fSerial(fSerial)
     1427        , m_fUnix(fUnix)
    14271428    {
    14281429        if (m_fSerial)
     
    14491450        if (m_fSerial)
    14501451        {
    1451             setName(QApplication::translate("UIActionPool", "&Copy Command (serial)"));
     1452            if (m_fUnix)
     1453                setName(QApplication::translate("UIActionPool", "&Copy Command (serial) for Unix"));
     1454            else
     1455                setName(QApplication::translate("UIActionPool", "&Copy Command (serial) for Windows"));
    14521456            setStatusTip(QApplication::translate("UIActionPool", "Copy console command for serial connection"));
    14531457        }
    14541458        else
    14551459        {
    1456             setName(QApplication::translate("UIActionPool", "&Copy Command (VNC)"));
     1460            if (m_fUnix)
     1461                setName(QApplication::translate("UIActionPool", "&Copy Command (VNC) for Unix"));
     1462            else
     1463                setName(QApplication::translate("UIActionPool", "&Copy Command (VNC) for Windows"));
    14571464            setStatusTip(QApplication::translate("UIActionPool", "Copy console command for VNC connection"));
    14581465        }
     
    14631470    /** Holds whether this command is of serial type. */
    14641471    bool  m_fSerial;
     1472    /** Holds whether this command is for unix. */
     1473    bool  m_fUnix;
    14651474};
    14661475
     
    34583467    m_pool[UIActionIndexST_M_Machine_M_Console_S_CreateConnection] = new UIActionSimpleSelectorConsolePerformCreateConnection(this);
    34593468    m_pool[UIActionIndexST_M_Machine_M_Console_S_DeleteConnection] = new UIActionSimpleSelectorConsolePerformDeleteConnection(this);
    3460     m_pool[UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial] = new UIActionSimpleSelectorConsolePerformCopyCommand(this, true);
    3461     m_pool[UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC] = new UIActionSimpleSelectorConsolePerformCopyCommand(this, false);
     3469    m_pool[UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix] = new UIActionSimpleSelectorConsolePerformCopyCommand(this, true, true);
     3470    m_pool[UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows] = new UIActionSimpleSelectorConsolePerformCopyCommand(this, true, false);
     3471    m_pool[UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix] = new UIActionSimpleSelectorConsolePerformCopyCommand(this, false, true);
     3472    m_pool[UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows] = new UIActionSimpleSelectorConsolePerformCopyCommand(this, false, false);
    34623473    m_pool[UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications] = new UIActionSimpleSelectorConsolePerformConfigureApplications(this);
    34633474    m_pool[UIActionIndexST_M_Machine_M_Close] = new UIActionMenuSelectorClose(this);
     
    43184329                    << action(UIActionIndexST_M_Machine_M_Console_S_CreateConnection)
    43194330                    << action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection)
    4320                     << action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial)
    4321                     << action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC)
     4331                    << action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix)
     4332                    << action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows)
     4333                    << action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix)
     4334                    << action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows)
    43224335                    << action(UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications)
    43234336                    // << action(UIActionIndexST_M_Machine_M_Close_S_Detach)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r85434 r85445  
    111111    UIActionIndexST_M_Machine_M_Console_S_CreateConnection,
    112112    UIActionIndexST_M_Machine_M_Console_S_DeleteConnection,
    113     UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial,
    114     UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC,
     113    UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix,
     114    UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows,
     115    UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix,
     116    UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows,
    115117    UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications,
    116118    UIActionIndexST_M_Machine_M_Close,
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r85434 r85445  
    12741274}
    12751275
    1276 void UIVirtualBoxManager::sltPerformCopyCommandSerial()
     1276void UIVirtualBoxManager::sltPerformCopyCommandSerialUnix()
    12771277{
    12781278    /* Get current item: */
     
    12911291}
    12921292
    1293 void UIVirtualBoxManager::sltPerformCopyCommandVNC()
     1293void UIVirtualBoxManager::sltPerformCopyCommandSerialWindows()
    12941294{
    12951295    /* Get current item: */
     
    13021302    CCloudMachine comMachine = pCloudItem->machine();
    13031303
     1304    /* Put copied serial command to clipboard: */
     1305    QClipboard *pClipboard = QGuiApplication::clipboard();
     1306    AssertPtrReturnVoid(pClipboard);
     1307    pClipboard->setText(comMachine.GetSerialConsoleCommandWindows());
     1308}
     1309
     1310void UIVirtualBoxManager::sltPerformCopyCommandVNCUnix()
     1311{
     1312    /* Get current item: */
     1313    UIVirtualMachineItem *pItem = currentItem();
     1314    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
     1315    UIVirtualMachineItemCloud *pCloudItem = pItem->toCloud();
     1316    AssertPtrReturnVoid(pCloudItem);
     1317
     1318    /* Acquire cloud machine: */
     1319    CCloudMachine comMachine = pCloudItem->machine();
     1320
    13041321    /* Put copied VNC command to clipboard: */
    13051322    QClipboard *pClipboard = QGuiApplication::clipboard();
    13061323    AssertPtrReturnVoid(pClipboard);
    13071324    pClipboard->setText(comMachine.GetVNCConsoleCommand());
     1325}
     1326
     1327void UIVirtualBoxManager::sltPerformCopyCommandVNCWindows()
     1328{
     1329    /* Get current item: */
     1330    UIVirtualMachineItem *pItem = currentItem();
     1331    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
     1332    UIVirtualMachineItemCloud *pCloudItem = pItem->toCloud();
     1333    AssertPtrReturnVoid(pCloudItem);
     1334
     1335    /* Acquire cloud machine: */
     1336    CCloudMachine comMachine = pCloudItem->machine();
     1337
     1338    /* Put copied VNC command to clipboard: */
     1339    QClipboard *pClipboard = QGuiApplication::clipboard();
     1340    AssertPtrReturnVoid(pClipboard);
     1341    pClipboard->setText(comMachine.GetVNCConsoleCommandWindows());
    13081342}
    13091343
     
    21672201    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection), &UIAction::triggered,
    21682202            this, &UIVirtualBoxManager::sltPerformDeleteConsoleConnectionForMachine);
    2169     connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial), &UIAction::triggered,
    2170             this, &UIVirtualBoxManager::sltPerformCopyCommandSerial);
    2171     connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC), &UIAction::triggered,
    2172             this, &UIVirtualBoxManager::sltPerformCopyCommandVNC);
     2203    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix), &UIAction::triggered,
     2204            this, &UIVirtualBoxManager::sltPerformCopyCommandSerialUnix);
     2205    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows), &UIAction::triggered,
     2206            this, &UIVirtualBoxManager::sltPerformCopyCommandSerialWindows);
     2207    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix), &UIAction::triggered,
     2208            this, &UIVirtualBoxManager::sltPerformCopyCommandVNCUnix);
     2209    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows), &UIAction::triggered,
     2210            this, &UIVirtualBoxManager::sltPerformCopyCommandVNCWindows);
    21732211    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications), &UIAction::triggered,
    21742212            this, &UIVirtualBoxManager::sltOpenCloudConsoleManagerWindow);
     
    27112749
    27122750        /* Copy command to clipboard actions: */
    2713         pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial));
    2714         pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC));
     2751        pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix));
     2752        pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows));
     2753        pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix));
     2754        pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows));
    27152755        pMenu->addSeparator();
    27162756
     
    28802920    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CreateConnection)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CreateConnection, items));
    28812921    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection, items));
    2882     actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial, items));
    2883     actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC, items));
     2922    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix, items));
     2923    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows, items));
     2924    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix, items));
     2925    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows, items));
    28842926    actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications, items));
    28852927
     
    31603202        case UIActionIndexST_M_Machine_M_Console_S_CreateConnection:
    31613203        case UIActionIndexST_M_Machine_M_Console_S_DeleteConnection:
    3162         case UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerial:
    3163         case UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNC:
     3204        case UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialUnix:
     3205        case UIActionIndexST_M_Machine_M_Console_S_CopyCommandSerialWindows:
     3206        case UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCUnix:
     3207        case UIActionIndexST_M_Machine_M_Console_S_CopyCommandVNCWindows:
    31643208        case UIActionIndexST_M_Machine_M_Console_S_ConfigureApplications:
    31653209        {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r85425 r85445  
    253253        /** Handles call to copy console connection key fingerprint. */
    254254        void sltCopyConsoleConnectionFingerprint();
    255         /** Handles call to copy serial console command. */
    256         void sltPerformCopyCommandSerial();
    257         /** Handles call to copy VNC console command. */
    258         void sltPerformCopyCommandVNC();
     255        /** Handles call to copy serial console command for Unix. */
     256        void sltPerformCopyCommandSerialUnix();
     257        /** Handles call to copy serial console command for Windows. */
     258        void sltPerformCopyCommandSerialWindows();
     259        /** Handles call to copy VNC console command for Unix. */
     260        void sltPerformCopyCommandVNCUnix();
     261        /** Handles call to copy VNC console command for Windows. */
     262        void sltPerformCopyCommandVNCWindows();
    259263        /** Handles call to execute external application. */
    260264        void sltExecuteExternalApplication();
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