Changeset 85111 in vbox
- Timestamp:
- Jul 8, 2020 3:41:24 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 8 edited
-
Makefile.kmk (modified) (1 diff)
-
src/globals/UIActionPoolManager.cpp (modified) (7 diffs)
-
src/globals/UIActionPoolManager.h (modified) (3 diffs)
-
src/globals/UIMessageCenter.cpp (modified) (1 diff)
-
src/globals/UIMessageCenter.h (modified) (1 diff)
-
src/manager/UIVirtualBoxManager.cpp (modified) (9 diffs)
-
src/manager/UIVirtualBoxManager.h (modified) (1 diff)
-
src/manager/chooser/UIChooserModel.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r85064 r85111 926 926 src/cloud/profilemanager/UICloudProfileManager.cpp \ 927 927 src/hostnetwork/UIHostNetworkManager.cpp \ 928 src/manager/UIVirtualBoxManager.cpp \ 928 929 src/manager/UIWelcomePane.cpp \ 929 930 src/manager/chooser/UIChooserAbstractModel.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r85080 r85111 1303 1303 1304 1304 1305 /** Menu action extension, used as 'Console' menu class. */ 1306 class UIActionMenuSelectorConsole : public UIActionMenu 1307 { 1308 Q_OBJECT; 1309 1310 public: 1311 1312 /** Constructs action passing @a pParent to the base-class. */ 1313 UIActionMenuSelectorConsole(UIActionPool *pParent) 1314 : UIActionMenu(pParent, ":/host_iface_edit_16px.png") /// @todo replace with proper icon 1315 {} 1316 1317 protected: 1318 1319 /** Handles translation event. */ 1320 virtual void retranslateUi() /* override */ 1321 { 1322 setName(QApplication::translate("UIActionPool", "C&onsole")); 1323 } 1324 }; 1325 1326 /** Simple action extension, used as 'Perform Create Console Connection' action class. */ 1327 class UIActionSimpleSelectorConsolePerformCreateConnection : public UIActionSimple 1328 { 1329 Q_OBJECT; 1330 1331 public: 1332 1333 /** Constructs action passing @a pParent to the base-class. */ 1334 UIActionSimpleSelectorConsolePerformCreateConnection(UIActionPool *pParent) 1335 : UIActionSimple(pParent, ":/host_iface_add_16px.png", ":/host_iface_add_disabled_16px.png") /// @todo replace with proper icon 1336 {} 1337 1338 protected: 1339 1340 /** Returns shortcut extra-data ID. */ 1341 virtual QString shortcutExtraDataID() const /* override */ 1342 { 1343 return QString("CreateConsoleConnection"); 1344 } 1345 1346 /** Handles translation event. */ 1347 virtual void retranslateUi() /* override */ 1348 { 1349 setName(QApplication::translate("UIActionPool", "&Create Connection")); 1350 setStatusTip(QApplication::translate("UIActionPool", "Create console connection to be able to use ssh/vnc clients")); 1351 } 1352 }; 1353 1354 /** Simple action extension, used as 'Perform Delete Console Connection' action class. */ 1355 class UIActionSimpleSelectorConsolePerformDeleteConnection : public UIActionSimple 1356 { 1357 Q_OBJECT; 1358 1359 public: 1360 1361 /** Constructs action passing @a pParent to the base-class. */ 1362 UIActionSimpleSelectorConsolePerformDeleteConnection(UIActionPool *pParent) 1363 : UIActionSimple(pParent, ":/host_iface_remove_16px.png", ":/host_iface_remove_disabled_16px.png") /// @todo replace with proper icon 1364 {} 1365 1366 protected: 1367 1368 /** Returns shortcut extra-data ID. */ 1369 virtual QString shortcutExtraDataID() const /* override */ 1370 { 1371 return QString("DeleteConsoleConnection"); 1372 } 1373 1374 /** Handles translation event. */ 1375 virtual void retranslateUi() /* override */ 1376 { 1377 setName(QApplication::translate("UIActionPool", "&Delete Connection")); 1378 setStatusTip(QApplication::translate("UIActionPool", "Delete console connection to disconnect ssh/vnc clients")); 1379 } 1380 }; 1381 1382 1305 1383 /** Menu action extension, used as 'Close' menu class. */ 1306 1384 class UIActionMenuSelectorClose : public UIActionMenu … … 2946 3024 m_pool[UIActionIndexST_M_Group_T_Pause] = new UIActionToggleSelectorCommonPauseAndResume(this); 2947 3025 m_pool[UIActionIndexST_M_Group_S_Reset] = new UIActionSimpleSelectorCommonPerformReset(this); 3026 m_pool[UIActionIndexST_M_Group_M_Console] = new UIActionMenuSelectorConsole(this); 3027 m_pool[UIActionIndexST_M_Group_M_Console_S_CreateConnection] = new UIActionSimpleSelectorConsolePerformCreateConnection(this); 3028 m_pool[UIActionIndexST_M_Group_M_Console_S_DeleteConnection] = new UIActionSimpleSelectorConsolePerformDeleteConnection(this); 2948 3029 m_pool[UIActionIndexST_M_Group_M_Close] = new UIActionMenuSelectorClose(this); 2949 3030 m_pool[UIActionIndexST_M_Group_M_Close_S_Detach] = new UIActionSimpleSelectorClosePerformDetach(this); … … 2979 3060 m_pool[UIActionIndexST_M_Machine_T_Pause] = new UIActionToggleSelectorCommonPauseAndResume(this); 2980 3061 m_pool[UIActionIndexST_M_Machine_S_Reset] = new UIActionSimpleSelectorCommonPerformReset(this); 3062 m_pool[UIActionIndexST_M_Machine_M_Console] = new UIActionMenuSelectorConsole(this); 3063 m_pool[UIActionIndexST_M_Machine_M_Console_S_CreateConnection] = new UIActionSimpleSelectorConsolePerformCreateConnection(this); 3064 m_pool[UIActionIndexST_M_Machine_M_Console_S_DeleteConnection] = new UIActionSimpleSelectorConsolePerformDeleteConnection(this); 2981 3065 m_pool[UIActionIndexST_M_Machine_M_Close] = new UIActionMenuSelectorClose(this); 2982 3066 m_pool[UIActionIndexST_M_Machine_M_Close_S_Detach] = new UIActionSimpleSelectorClosePerformDetach(this); … … 3067 3151 m_menuUpdateHandlers[UIActionIndexST_M_Group_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuGroupStartOrShow; 3068 3152 m_menuUpdateHandlers[UIActionIndexST_M_Machine_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuMachineStartOrShow; 3153 m_menuUpdateHandlers[UIActionIndexST_M_Group_M_Console].ptfm = &UIActionPoolManager::updateMenuGroupConsole; 3154 m_menuUpdateHandlers[UIActionIndexST_M_Machine_M_Console].ptfm = &UIActionPoolManager::updateMenuMachineConsole; 3069 3155 m_menuUpdateHandlers[UIActionIndexST_M_Group_M_Close].ptfm = &UIActionPoolManager::updateMenuGroupClose; 3070 3156 m_menuUpdateHandlers[UIActionIndexST_M_Machine_M_Close].ptfm = &UIActionPoolManager::updateMenuMachineClose; … … 3366 3452 } 3367 3453 3454 void UIActionPoolManager::updateMenuGroupConsole() 3455 { 3456 /* Get corresponding menu: */ 3457 UIMenu *pMenu = action(UIActionIndexST_M_Group_M_Console)->menu(); 3458 AssertPtrReturnVoid(pMenu); 3459 /* Clear contents: */ 3460 pMenu->clear(); 3461 3462 /* Populate 'Group' / 'Console' menu: */ 3463 pMenu->addAction(action(UIActionIndexST_M_Group_M_Console_S_CreateConnection)); 3464 pMenu->addAction(action(UIActionIndexST_M_Group_M_Console_S_DeleteConnection)); 3465 3466 /* Mark menu as valid: */ 3467 m_invalidations.remove(UIActionIndexST_M_Group_M_Console); 3468 } 3469 3470 void UIActionPoolManager::updateMenuMachineConsole() 3471 { 3472 /* Get corresponding menu: */ 3473 UIMenu *pMenu = action(UIActionIndexST_M_Machine_M_Console)->menu(); 3474 AssertPtrReturnVoid(pMenu); 3475 /* Clear contents: */ 3476 pMenu->clear(); 3477 3478 /* Populate 'Machine' / 'Console' menu: */ 3479 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Console_S_CreateConnection)); 3480 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection)); 3481 3482 /* Mark menu as valid: */ 3483 m_invalidations.remove(UIActionIndexST_M_Machine_M_Console); 3484 } 3485 3368 3486 void UIActionPoolManager::updateMenuGroupClose() 3369 3487 { … … 3682 3800 << action(UIActionIndexST_M_Group_M_StartOrShow_S_StartHeadless) 3683 3801 << action(UIActionIndexST_M_Group_M_StartOrShow_S_StartDetachable) 3802 << action(UIActionIndexST_M_Group_M_Console_S_CreateConnection) 3803 << action(UIActionIndexST_M_Group_M_Console_S_DeleteConnection) 3684 3804 // << action(UIActionIndexST_M_Group_M_Close_S_Detach) 3685 3805 << action(UIActionIndexST_M_Group_M_Close_S_SaveState) … … 3714 3834 << action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless) 3715 3835 << action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartDetachable) 3836 << action(UIActionIndexST_M_Machine_M_Console_S_CreateConnection) 3837 << action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection) 3716 3838 // << action(UIActionIndexST_M_Machine_M_Close_S_Detach) 3717 3839 << action(UIActionIndexST_M_Machine_M_Close_S_SaveState) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r84558 r85111 70 70 UIActionIndexST_M_Group_T_Pause, 71 71 UIActionIndexST_M_Group_S_Reset, 72 UIActionIndexST_M_Group_M_Console, 73 UIActionIndexST_M_Group_M_Console_S_CreateConnection, 74 UIActionIndexST_M_Group_M_Console_S_DeleteConnection, 72 75 UIActionIndexST_M_Group_M_Close, 73 76 UIActionIndexST_M_Group_M_Close_S_Detach, … … 103 106 UIActionIndexST_M_Machine_T_Pause, 104 107 UIActionIndexST_M_Machine_S_Reset, 108 UIActionIndexST_M_Machine_M_Console, 109 UIActionIndexST_M_Machine_M_Console_S_CreateConnection, 110 UIActionIndexST_M_Machine_M_Console_S_DeleteConnection, 105 111 UIActionIndexST_M_Machine_M_Close, 106 112 UIActionIndexST_M_Machine_M_Close_S_Detach, … … 214 220 /** Updates 'Machine' / 'Start or Show' menu. */ 215 221 void updateMenuMachineStartOrShow(); 222 /** Updates 'Group' / 'Console' menu. */ 223 void updateMenuGroupConsole(); 224 /** Updates 'Machine' / 'Console' menu. */ 225 void updateMenuMachineConsole(); 216 226 /** Updates 'Group' / 'Close' menu. */ 217 227 void updateMenuGroupClose(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r85039 r85111 1032 1032 .arg(strMachineName), 1033 1033 UIErrorString::formatErrorInfo(progress)); 1034 } 1035 1036 void UIMessageCenter::cannotOpenPublicKeyFile(const QString &strPath, QWidget *pParent /* = 0 */) const 1037 { 1038 alert(pParent, MessageType_Error, 1039 tr("Failed to open the public key file <nobr><b>%1</b></nobr>. Check file permissions.") 1040 .arg(strPath)); 1041 } 1042 1043 void UIMessageCenter::cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */) 1044 { 1045 error(pParent, MessageType_Error, 1046 tr("Failed to create console connection for cloud machine <b>%1</b>.") 1047 .arg(CCloudMachine(comMachine).GetName()), 1048 UIErrorString::formatErrorInfo(comMachine)); 1049 } 1050 1051 void UIMessageCenter::cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */) 1052 { 1053 error(pParent, MessageType_Error, 1054 tr("Failed to create console connection for cloud machine <b>%1</b>.") 1055 .arg(strMachineName), 1056 UIErrorString::formatErrorInfo(comProgress)); 1057 } 1058 1059 void UIMessageCenter::cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */) 1060 { 1061 error(pParent, MessageType_Error, 1062 tr("Failed to delete console connection for cloud machine <b>%1</b>.") 1063 .arg(CCloudMachine(comMachine).GetName()), 1064 UIErrorString::formatErrorInfo(comMachine)); 1065 } 1066 1067 void UIMessageCenter::cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */) 1068 { 1069 error(pParent, MessageType_Error, 1070 tr("Failed to delete console connection for cloud machine <b>%1</b>.") 1071 .arg(strMachineName), 1072 UIErrorString::formatErrorInfo(comProgress)); 1034 1073 } 1035 1074 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r85039 r85111 304 304 void cannotMoveMachine(const CMachine &machine, QWidget *pParent = 0) const; 305 305 void cannotMoveMachine(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const; 306 void cannotOpenPublicKeyFile(const QString &strPath, QWidget *pParent = 0) const; 307 void cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent = 0); 308 void cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0); 309 void cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent = 0); 310 void cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0); 306 311 307 312 /* API: Snapshot warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85080 r85111 17 17 18 18 /* Qt includes: */ 19 #include <QFile> 19 20 #include <QMenuBar> 21 #include <QPushButton> 20 22 #include <QStandardPaths> 21 23 #include <QStatusBar> 22 //# include <QToolButton>24 #include <QTextEdit> 23 25 24 26 /* GUI includes: */ … … 88 90 89 91 92 /** QDialog extension used to ask for a public key for console connection needs. */ 93 class UIAcquirePublicKeyDialog : public QDialog 94 { 95 Q_OBJECT; 96 97 public: 98 99 /** Constructs dialog passing @a pParent to the base-class. */ 100 UIAcquirePublicKeyDialog(QWidget *pParent = 0); 101 102 /** Return public key. */ 103 QString publicKey() const; 104 105 private slots: 106 107 /** Handles abstract @a pButton click. */ 108 void sltHandleButtonClicked(QAbstractButton *pButton); 109 /** Handles Open button click. */ 110 void sltHandleOpenButtonClick(); 111 112 /** Performs revalidation. */ 113 void sltRevalidate(); 114 115 private: 116 117 /** Prepares all. */ 118 void prepare(); 119 120 /** Holds the text-editor instance. */ 121 QTextEdit *m_pTextEditor; 122 /** Holds the button-box instance. */ 123 QIDialogButtonBox *m_pButtonBox; 124 }; 125 126 127 /********************************************************************************************************************************* 128 * Class UIAcquirePublicKeyDialog implementation. * 129 *********************************************************************************************************************************/ 130 131 UIAcquirePublicKeyDialog::UIAcquirePublicKeyDialog(QWidget *pParent /* = 0 */) 132 : QDialog(pParent) 133 , m_pTextEditor(0) 134 , m_pButtonBox(0) 135 { 136 prepare(); 137 sltRevalidate(); 138 } 139 140 QString UIAcquirePublicKeyDialog::publicKey() const 141 { 142 return m_pTextEditor->toPlainText(); 143 } 144 145 void UIAcquirePublicKeyDialog::sltHandleButtonClicked(QAbstractButton *pButton) 146 { 147 const QDialogButtonBox::StandardButton enmStandardButton = m_pButtonBox->standardButton(pButton); 148 switch (enmStandardButton) 149 { 150 case QDialogButtonBox::Ok: return accept(); 151 case QDialogButtonBox::Cancel: return reject(); 152 case QDialogButtonBox::Open: return sltHandleOpenButtonClick(); 153 default: break; 154 } 155 } 156 157 void UIAcquirePublicKeyDialog::sltHandleOpenButtonClick() 158 { 159 CVirtualBox comVBox = uiCommon().virtualBox(); 160 const QString strFileName = QIFileDialog::getOpenFileName(comVBox.GetHomeFolder(), QString(), 161 this, tr("Choose a public key file")); 162 if (!strFileName.isEmpty()) 163 { 164 QFile file(strFileName); 165 if (file.open(QIODevice::ReadOnly)) 166 m_pTextEditor->setPlainText(file.readAll()); 167 else 168 msgCenter().cannotOpenPublicKeyFile(strFileName); 169 } 170 } 171 172 void UIAcquirePublicKeyDialog::sltRevalidate() 173 { 174 m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!m_pTextEditor->toPlainText().isEmpty()); 175 } 176 177 void UIAcquirePublicKeyDialog::prepare() 178 { 179 /* Prepare layout: */ 180 QVBoxLayout *pLayout = new QVBoxLayout(this); 181 if (pLayout) 182 { 183 /* Prepare text-editor: */ 184 m_pTextEditor = new QTextEdit(this); 185 if (m_pTextEditor) 186 { 187 connect(m_pTextEditor, &QTextEdit::textChanged, this, &UIAcquirePublicKeyDialog::sltRevalidate); 188 pLayout->addWidget(m_pTextEditor); 189 } 190 191 /* Prepare button-box: */ 192 m_pButtonBox = new QIDialogButtonBox(this); 193 if (m_pButtonBox) 194 { 195 m_pButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Open); 196 connect(m_pButtonBox, &QIDialogButtonBox::clicked, this, &UIAcquirePublicKeyDialog::sltHandleButtonClicked); 197 pLayout->addWidget(m_pButtonBox); 198 } 199 } 200 } 201 202 203 /********************************************************************************************************************************* 204 * Class UIVirtualBoxManager implementation. * 205 *********************************************************************************************************************************/ 206 90 207 /* static */ 91 208 UIVirtualBoxManager *UIVirtualBoxManager::s_pInstance = 0; … … 864 981 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 865 982 performStartOrShowVirtualMachines(items, UICommon::LaunchMode_Separate); 983 } 984 985 void UIVirtualBoxManager::sltPerformCreateConsoleConnection() 986 { 987 /* Get selected items: */ 988 QList<UIVirtualMachineItem*> items = currentItems(); 989 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 990 991 /* Create input dialog to pass public key to newly created console connection: */ 992 QPointer<UIAcquirePublicKeyDialog> pDialog = new UIAcquirePublicKeyDialog(this); 993 if (pDialog) 994 { 995 if (pDialog->exec() == QDialog::Accepted) 996 { 997 foreach (UIVirtualMachineItem *pItem, items) 998 { 999 /* Make sure the item exists and is of cloud type: */ 1000 AssertPtrReturnVoid(pItem); 1001 UIVirtualMachineItemCloud *pCloudItem = pItem->toCloud(); 1002 if (!pCloudItem) 1003 continue; 1004 1005 /* Acquire current machine: */ 1006 CCloudMachine comMachine = pCloudItem->machine(); 1007 1008 /* Acquire machine name: */ 1009 QString strName; 1010 if (!cloudMachineName(comMachine, strName)) 1011 continue; 1012 1013 /* Prepare "create console connection" progress: */ 1014 CProgress comProgress = comMachine.CreateConsoleConnection(pDialog->publicKey()); 1015 if (!comMachine.isOk()) 1016 { 1017 msgCenter().cannotCreateConsoleConnection(comMachine); 1018 continue; 1019 } 1020 1021 /* Show "create console connection" progress: */ 1022 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_media_delete_90px.png", 0, 0); /// @todo use proper icon 1023 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 1024 { 1025 msgCenter().cannotCreateConsoleConnection(comProgress, strName); 1026 continue; 1027 } 1028 } 1029 } 1030 delete pDialog; 1031 } 1032 } 1033 1034 void UIVirtualBoxManager::sltPerformDeleteConsoleConnection() 1035 { 1036 /* Get selected items: */ 1037 QList<UIVirtualMachineItem*> items = currentItems(); 1038 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1039 1040 foreach (UIVirtualMachineItem *pItem, items) 1041 { 1042 /* Make sure the item exists and is of cloud type: */ 1043 AssertPtrReturnVoid(pItem); 1044 UIVirtualMachineItemCloud *pCloudItem = pItem->toCloud(); 1045 if (!pCloudItem) 1046 continue; 1047 1048 /* Acquire current machine: */ 1049 CCloudMachine comMachine = pCloudItem->machine(); 1050 1051 /* Acquire machine name: */ 1052 QString strName; 1053 if (!cloudMachineName(comMachine, strName)) 1054 continue; 1055 1056 /* Prepare "delete console connection" progress: */ 1057 CProgress comProgress = comMachine.DeleteConsoleConnection(); 1058 if (!comMachine.isOk()) 1059 { 1060 msgCenter().cannotDeleteConsoleConnection(comMachine); 1061 continue; 1062 } 1063 1064 /* Show "delete console connection" progress: */ 1065 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_media_delete_90px.png", 0, 0); /// @todo use proper icon 1066 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 1067 { 1068 msgCenter().cannotDeleteConsoleConnection(comProgress, strName); 1069 continue; 1070 } 1071 } 866 1072 } 867 1073 … … 1702 1908 this, &UIVirtualBoxManager::sltPerformStartMachineDetachable); 1703 1909 1910 /* 'Group/Console' menu connections: */ 1911 connect(actionPool()->action(UIActionIndexST_M_Group_M_Console_S_CreateConnection), &UIAction::triggered, 1912 this, &UIVirtualBoxManager::sltPerformCreateConsoleConnection); 1913 connect(actionPool()->action(UIActionIndexST_M_Group_M_Console_S_DeleteConnection), &UIAction::triggered, 1914 this, &UIVirtualBoxManager::sltPerformDeleteConsoleConnection); 1915 1916 /* 'Machine/Console' menu connections: */ 1917 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CreateConnection), &UIAction::triggered, 1918 this, &UIVirtualBoxManager::sltPerformCreateConsoleConnection); 1919 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection), &UIAction::triggered, 1920 this, &UIVirtualBoxManager::sltPerformDeleteConsoleConnection); 1921 1704 1922 /* 'Group/Close' menu connections: */ 1705 1923 connect(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach), &UIAction::triggered, … … 2016 2234 pMenu->addSeparator(); 2017 2235 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow)); 2236 pMenu->addMenu(actionPool()->action(UIActionIndexST_M_Group_M_Console)->menu()); 2018 2237 pMenu->addMenu(actionPool()->action(UIActionIndexST_M_Group_M_Close)->menu()); 2019 2238 pMenu->addSeparator(); … … 2072 2291 pMenu->addSeparator(); 2073 2292 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)); 2293 pMenu->addMenu(actionPool()->action(UIActionIndexST_M_Machine_M_Console)->menu()); 2074 2294 pMenu->addMenu(actionPool()->action(UIActionIndexST_M_Machine_M_Close)->menu()); 2075 2295 pMenu->addSeparator(); … … 2248 2468 actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless, items)); 2249 2469 actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow_S_StartDetachable)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_StartOrShow_S_StartDetachable, items)); 2470 2471 /* Enable/disable group-console actions: */ 2472 actionPool()->action(UIActionIndexST_M_Group_M_Console)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Console, items)); 2473 actionPool()->action(UIActionIndexST_M_Group_M_Console_S_CreateConnection)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Console_S_CreateConnection, items)); 2474 actionPool()->action(UIActionIndexST_M_Group_M_Console_S_DeleteConnection)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Console_S_DeleteConnection, items)); 2475 2476 /* Enable/disable machine-console actions: */ 2477 actionPool()->action(UIActionIndexST_M_Machine_M_Console)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console, items)); 2478 actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_CreateConnection)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_CreateConnection, items)); 2479 actionPool()->action(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Console_S_DeleteConnection, items)); 2250 2480 2251 2481 /* Enable/disable group-close actions: */ … … 2512 2742 return isAtLeastOneItemSupportsShortcuts(items); 2513 2743 } 2744 case UIActionIndexST_M_Group_M_Console: 2745 case UIActionIndexST_M_Group_M_Console_S_CreateConnection: 2746 case UIActionIndexST_M_Group_M_Console_S_DeleteConnection: 2747 case UIActionIndexST_M_Machine_M_Console: 2748 case UIActionIndexST_M_Machine_M_Console_S_CreateConnection: 2749 case UIActionIndexST_M_Machine_M_Console_S_DeleteConnection: 2750 { 2751 return isAtLeastOneItemStarted(items); 2752 } 2514 2753 case UIActionIndexST_M_Group_M_Close: 2515 2754 case UIActionIndexST_M_Machine_M_Close: … … 2719 2958 return false; 2720 2959 } 2960 2961 2962 #include "UIVirtualBoxManager.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r85080 r85111 237 237 /** Handles call to start machine in detachable mode. */ 238 238 void sltPerformStartMachineDetachable(); 239 240 /** Handles call to create console connection. */ 241 void sltPerformCreateConsoleConnection(); 242 /** Handles call to delete console connection. */ 243 void sltPerformDeleteConsoleConnection(); 239 244 240 245 /** Handles call to discard machine state. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r85080 r85111 1348 1348 pMenuGroup->addSeparator(); 1349 1349 pMenuGroup->addAction(actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow)); 1350 pMenuGroup->addMenu(actionPool()->action(UIActionIndexST_M_Group_M_Console)->menu()); 1350 1351 pMenuGroup->addMenu(actionPool()->action(UIActionIndexST_M_Group_M_Close)->menu()); 1351 1352 pMenuGroup->addSeparator(); … … 1364 1365 pMenuMachine->addSeparator(); 1365 1366 pMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)); 1367 pMenuMachine->addMenu(actionPool()->action(UIActionIndexST_M_Machine_M_Console)->menu()); 1366 1368 pMenuMachine->addMenu(actionPool()->action(UIActionIndexST_M_Machine_M_Close)->menu()); 1367 1369 pMenuMachine->addSeparator();
Note:
See TracChangeset
for help on using the changeset viewer.

