Changeset 92638 in vbox
- Timestamp:
- Nov 30, 2021 7:20:00 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r92492 r92638 295 295 case UIToolType_Logs: 296 296 case UIToolType_VMActivity: 297 case UIToolType_FileManager: 297 298 return true; 298 299 default: -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r92633 r92638 113 113 114 114 UIFileManager::UIFileManager(EmbedTo enmEmbedding, UIActionPool *pActionPool, 115 const CMachine &comMachine, QWidget *pParent, bool fShowToolbar /* = true */)115 const CMachine &comMachine, QWidget *pParent, bool fShowToolbar) 116 116 : QIWithRetranslateUI<QWidget>(pParent) 117 117 , m_comMachine(comMachine) … … 583 583 bool UIFileManager::openSession(const QString& strUserName, const QString& strPassword) 584 584 { 585 AssertReturn(!m_comMachine.isNull(), false); 585 586 m_comSession = uiCommon().openSession(m_comMachine.GetId(), KLockType_Shared); 586 587 AssertReturn(!m_comSession.isNull(), false); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h
r92633 r92638 94 94 95 95 UIFileManager(EmbedTo enmEmbedding, UIActionPool *pActionPool, 96 const CMachine &comMachine, QWidget *pParent, bool fShowToolbar = true);96 const CMachine &comMachine, QWidget *pParent, bool fShowToolbar); 97 97 ~UIFileManager(); 98 98 QMenu *menu() const; -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp
r92630 r92638 36 36 *********************************************************************************************************************************/ 37 37 38 UIFileManagerDialogFactory::UIFileManagerDialogFactory(UIActionPool *pActionPool, 39 const CMachine &comMachine, 40 const QString &strMachineName) 38 UIFileManagerDialogFactory::UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine) 41 39 : m_pActionPool(pActionPool) 42 40 , m_comMachine(comMachine) 43 , m_strMachineName(strMachineName)44 41 { 45 42 } … … 54 51 void UIFileManagerDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) 55 52 { 56 pDialog = new UIFileManagerDialog(pCenterWidget, m_pActionPool, m_comMachine , m_strMachineName);53 pDialog = new UIFileManagerDialog(pCenterWidget, m_pActionPool, m_comMachine); 57 54 } 58 55 … … 63 60 64 61 UIFileManagerDialog::UIFileManagerDialog(QWidget *pCenterWidget, 65 UIActionPool *pActionPool, 66 const CMachine &comMachine, 67 const QString &strMachineName) 62 UIActionPool *pActionPool, 63 const CMachine &comMachine) 68 64 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 69 65 , m_pActionPool(pActionPool) 70 66 , m_comMachine(comMachine) 71 , m_strMachineName(strMachineName)72 67 { 73 68 } … … 82 77 void UIFileManagerDialog::retranslateUi() 83 78 { 84 /* Translate window title: */ 85 setWindowTitle(UIFileManager::tr("%1 - File Manager").arg(m_strMachineName)); 79 if (!m_comMachine.isNull()) 80 setWindowTitle(UIFileManager::tr("%1 - File Manager").arg(m_comMachine.GetName())); 81 else 82 setWindowTitle(UIFileManager::tr("File Manager")); 86 83 87 84 /* Retranslate button box buttons: */ … … 113 110 /* Create widget: */ 114 111 UIFileManager *pWidget = new UIFileManager(EmbedTo_Dialog, m_pActionPool, 115 m_comMachine, this);112 m_comMachine, this, true); 116 113 117 114 if (pWidget) -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.h
r92630 r92638 46 46 public: 47 47 48 UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine , const QString &strMachineName);48 UIFileManagerDialogFactory(UIActionPool *pActionPool, const CMachine &comMachine); 49 49 UIFileManagerDialogFactory(); 50 50 … … 57 57 UIActionPool *m_pActionPool; 58 58 CMachine m_comMachine; 59 QString m_strMachineName;60 59 }; 61 60 … … 71 70 * @param pActionPool Passes the action-pool reference. 72 71 * @param comMachine Passes the machine reference. */ 73 UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine , const QString &strMachineName);72 UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine); 74 73 ~UIFileManagerDialog(); 75 74 … … 112 111 UIActionPool *m_pActionPool; 113 112 CMachine m_comMachine; 114 QString m_strMachineName;115 113 }; 116 114 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r92633 r92638 218 218 { 219 219 if (!m_items.isEmpty()) 220 {221 220 m_pPaneFileManager = new UIFileManager(EmbedTo_Stack, m_pActionPool, 222 221 uiCommon().virtualBox().FindMachine(m_items[0]->id().toString()), 223 222 0, false /* fShowToolbar */); 224 AssertPtrReturnVoid(m_pPaneFileManager); 225 #ifndef VBOX_WS_MAC 226 const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4; 227 m_pPaneFileManager->setContentsMargins(iMargin, 0, iMargin, 0); 228 #endif 229 /* Configure pane: */ 230 m_pPaneFileManager->setProperty("ToolType", QVariant::fromValue(UIToolType_FileManager)); 231 //m_pPaneFileManager->setSelectedVMListItems(m_items); 232 /* Add into layout: */ 233 m_pLayout->addWidget(m_pPaneFileManager); 234 m_pLayout->setCurrentWidget(m_pPaneFileManager); 235 } 223 else 224 m_pPaneFileManager = new UIFileManager(EmbedTo_Stack, m_pActionPool, CMachine(), 225 0, false /* fShowToolbar */); 226 AssertPtrReturnVoid(m_pPaneFileManager); 227 #ifndef VBOX_WS_MAC 228 const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4; 229 m_pPaneFileManager->setContentsMargins(iMargin, 0, iMargin, 0); 230 #endif 231 /* Configure pane: */ 232 m_pPaneFileManager->setProperty("ToolType", QVariant::fromValue(UIToolType_FileManager)); 233 //m_pPaneFileManager->setSelectedVMListItems(m_items); 234 /* Add into layout: */ 235 m_pLayout->addWidget(m_pPaneFileManager); 236 m_pLayout->setCurrentWidget(m_pPaneFileManager); 236 237 break; 237 238 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r92487 r92638 742 742 break; 743 743 case UIToolType_VMActivity: 744 break;744 case UIToolType_FileManager: 745 745 default: 746 746 break; … … 3044 3044 m_pWidget->currentMachineTool() == UIToolType_VMActivity; 3045 3045 actionPool()->action(UIActionIndex_M_Activity)->setVisible(fPerformanceMenuShown); 3046 /* Determine whether File Manager menu item should be visible: */ 3047 const bool fFileManagerMenuShown = (fMachineMenuShown || fGroupMenuShown) && 3048 m_pWidget->currentMachineTool() == UIToolType_FileManager; 3049 actionPool()->action(UIActionIndex_M_FileManager)->setVisible(fFileManagerMenuShown); 3046 3050 3047 3051 /* Hide action shortcuts: */ … … 3221 3225 break; 3222 3226 } 3227 case UIToolType_FileManager: 3228 { 3229 actionPool()->action(UIActionIndexMN_M_Group_M_Tools_T_FileManager)->setChecked(true); 3230 actionPool()->action(UIActionIndexMN_M_Machine_M_Tools_T_FileManager)->setChecked(true); 3231 break; 3232 } 3223 3233 default: 3224 3234 break; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r92487 r92638 463 463 case UIToolType_Logs: pItem->reconfigure(tr("Logs")); break; 464 464 case UIToolType_VMActivity: pItem->reconfigure(tr("Activity")); break; 465 case UIToolType_FileManager: pItem->reconfigure(tr("File Manager")); break; 465 466 default: break; 466 467 } … … 539 540 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_VMActivity, QString(), 540 541 UIIconPool::iconSet(":/performance_monitor_24px.png", ":/performance_monitor_disabled_24px.png")); 542 543 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_FileManager, QString(), 544 UIIconPool::iconSet(":/file_manager_24px.png", ":/file_manager_disabled_24px.png")); 541 545 } 542 546 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r92630 r92638 1781 1781 1782 1782 QIManagerDialog *pFileManagerDialog; 1783 UIFileManagerDialogFactory dialogFactory(actionPool(), machine() , machine().GetName());1783 UIFileManagerDialogFactory dialogFactory(actionPool(), machine()); 1784 1784 dialogFactory.prepare(pFileManagerDialog, activeMachineWindow()); 1785 1785 if (pFileManagerDialog)
Note:
See TracChangeset
for help on using the changeset viewer.