Changeset 76826 in vbox
- Timestamp:
- Jan 15, 2019 6:19:10 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r76825 r76826 2629 2629 } 2630 2630 2631 QUuid VBoxGlobal::createVisoMediumWithVisoCreator(QWidget *pParent, const QString &str Folder)2631 QUuid VBoxGlobal::createVisoMediumWithVisoCreator(QWidget *pParent, const QString &strMachineName, const QString &strFolder) 2632 2632 { 2633 2633 2634 2634 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 2635 QPointer<UIVisoCreator> pVisoCreator = new UIVisoCreator(pDialogParent );2635 QPointer<UIVisoCreator> pVisoCreator = new UIVisoCreator(pDialogParent, strMachineName); 2636 2636 2637 2637 if (!pVisoCreator) … … 2639 2639 windowManager().registerNewParent(pVisoCreator, pDialogParent); 2640 2640 2641 if (pVisoCreator->exec ute(true, false))2641 if (pVisoCreator->exec(false /* not application modal */)) 2642 2642 { 2643 2643 QStringList files = pVisoCreator->entryList(); … … 2957 2957 uMediumID = openMediumWithFileOpenDialog(target.mediumType, windowManager().mainWindowShown(), strMachineFolder); 2958 2958 else if(target.type == UIMediumTarget::UIMediumTargetType_CreateAdHocVISO) 2959 uMediumID = createVisoMediumWithVisoCreator(windowManager().mainWindowShown(), strMachineFolder);2959 uMediumID = createVisoMediumWithVisoCreator(windowManager().mainWindowShown(), comConstMachine.GetName(), strMachineFolder); 2960 2960 2961 2961 else if(target.type == UIMediumTarget::UIMediumTargetType_CreateFloppyDisk) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r76825 r76826 505 505 /** Creates a VISO by using the VISO creator dialog. 506 506 * @param pParent Brings the dialog parent. 507 * @param strMachineName Passes the name of the machine, 507 508 * @param strFolder Brings the folder to save the VISO file. */ 508 QUuid createVisoMediumWithVisoCreator(QWidget *pParent, const QString &str Folder);509 QUuid createVisoMediumWithVisoCreator(QWidget *pParent, const QString &strMachineName, const QString &strFolder); 509 510 510 511 /** Creates and shows a dialog thru which user can create a new floppy disk a VISO using the file-open dialog. -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoBrowserBase.cpp
r76762 r76826 29 29 #include "UIToolBar.h" 30 30 31 UIVisoBrowserBase::UIVisoBrowserBase(QWidget *pParent )32 : Q Widget(pParent)31 UIVisoBrowserBase::UIVisoBrowserBase(QWidget *pParent /* = 0 */, QMenu *pMenu /*= 0*/) 32 : QIWithRetranslateUI<QWidget>(pParent) 33 33 , m_pTreeView(0) 34 34 , m_pTitleLabel(0) … … 36 36 , m_pRightContainerLayout(0) 37 37 , m_pVerticalToolBar(0) 38 , m_pMenu(pMenu) 38 39 , m_pMainLayout(0) 39 40 , m_pHorizontalSplitter(0) -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoBrowserBase.h
r76762 r76826 26 26 #include <QWidget> 27 27 28 /* GUI includes: */ 29 #include "QIWithRetranslateUI.h" 30 28 31 /* Forward declarations: */ 29 32 class QItemSelection; 30 33 class QGridLayout; 31 34 class QLabel; 35 class QMenu; 32 36 class QSplitter; 33 37 class QVBoxLayout; … … 36 40 class UIToolBar; 37 41 38 class UIVisoBrowserBase : public Q Widget42 class UIVisoBrowserBase : public QIWithRetranslateUI<QWidget> 39 43 { 40 44 Q_OBJECT; 41 45 42 46 public: 43 44 UIVisoBrowserBase(QWidget *pParent = 0); 47 /** @p pMenu is the pointer to the menu related to this browser widget. 48 * any member actions will be added to this menu. */ 49 UIVisoBrowserBase(QWidget *pParent = 0, QMenu *pMenu = 0); 45 50 ~UIVisoBrowserBase(); 46 51 virtual void showHideHiddenObjects(bool bShow) = 0; … … 66 71 QGridLayout *m_pRightContainerLayout; 67 72 UIToolBar *m_pVerticalToolBar; 68 73 QMenu *m_pMenu; 69 74 private: 70 75 QGridLayout *m_pMainLayout; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp
r76768 r76826 27 27 #include <QLabel> 28 28 #include <QListView> 29 #include <QMenu> 29 30 #include <QMimeData> 30 31 #include <QSplitter> … … 154 155 *********************************************************************************************************************************/ 155 156 156 UIVisoContentBrowser::UIVisoContentBrowser(QWidget *pParent )157 : QIWithRetranslateUI<UIVisoBrowserBase>(pParent)157 UIVisoContentBrowser::UIVisoContentBrowser(QWidget *pParent, QMenu *pMenu /* = 0 */) 158 : UIVisoBrowserBase(pParent, pMenu) 158 159 , m_pTableView(0) 159 160 , m_pModel(0) … … 248 249 m_pTitleLabel->setText(QApplication::translate("UIVisoCreator", "VISO content")); 249 250 if (m_pRemoveAction) 251 { 250 252 m_pRemoveAction->setToolTip(QApplication::translate("UIVisoCreator", "Remove selected file objects from VISO")); 253 m_pRemoveAction->setText(QApplication::translate("UIVisoCreator", "Remove")); 254 } 251 255 if (m_pNewDirectoryAction) 256 { 252 257 m_pNewDirectoryAction->setToolTip(QApplication::translate("UIVisoCreator", "Create a new directory under the current location")); 258 m_pNewDirectoryAction->setText(QApplication::translate("UIVisoCreator", "New Directory")); 259 } 253 260 if (m_pResetAction) 261 { 254 262 m_pResetAction->setToolTip(QApplication::translate("UIVisoCreator", "Reset ISO content.")); 263 m_pResetAction->setText(QApplication::translate("UIVisoCreator", "Reset")); 264 } 255 265 if (m_pRenameAction) 256 266 m_pRenameAction->setToolTip(QApplication::translate("UIVisoCreator", "Rename the selected object")); … … 451 461 ":/file_manager_delete_disabled_24px.png", ":/file_manager_delete_disabled_16px.png")); 452 462 m_pRemoveAction->setEnabled(false); 463 if (m_pMenu) 464 m_pMenu->addAction(m_pRemoveAction); 453 465 } 454 466 … … 460 472 ":/file_manager_new_directory_disabled_24px.png", ":/file_manager_new_directory_disabled_16px.png")); 461 473 m_pNewDirectoryAction->setEnabled(true); 474 if (m_pMenu) 475 m_pMenu->addAction(m_pNewDirectoryAction); 462 476 } 463 477 … … 479 493 m_pResetAction->setIcon(UIIconPool::iconSet(":/cd_remove_16px.png", ":/cd_remove_disabled_16px.png")); 480 494 m_pResetAction->setEnabled(true); 495 if (m_pMenu) 496 m_pMenu->addAction(m_pResetAction); 481 497 } 482 498 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h
r76768 r76826 30 30 31 31 /* GUI includes: */ 32 #include "QIWithRetranslateUI.h"33 32 #include "UIVisoBrowserBase.h" 34 33 … … 45 44 class UIVisoContentTableView; 46 45 47 class SHARED_LIBRARY_STUFF UIVisoContentBrowser : public QIWithRetranslateUI<UIVisoBrowserBase>46 class SHARED_LIBRARY_STUFF UIVisoContentBrowser : public UIVisoBrowserBase 48 47 { 49 48 Q_OBJECT; … … 51 50 public: 52 51 53 UIVisoContentBrowser(QWidget *pParent = 0 );52 UIVisoContentBrowser(QWidget *pParent = 0, QMenu *pMenu = 0); 54 53 ~UIVisoContentBrowser(); 55 54 /** Adds file objests from the host file system. @p pathList consists of list of paths to there objects. */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r76768 r76826 17 17 18 18 /* Qt includes: */ 19 #include <Q VBoxLayout>19 #include <QMenuBar> 20 20 #include <QPushButton> 21 21 #include <QSplitter> 22 22 #include <QStyle> 23 #include <QVBoxLayout> 23 24 24 25 /* GUI includes: */ … … 33 34 34 35 35 UIVisoCreator::UIVisoCreator(QWidget *pParent /* =0 */ )36 : QIWithRetranslateUI<QI Dialog>(pParent)36 UIVisoCreator::UIVisoCreator(QWidget *pParent /* =0 */, const QString& strMachineName /* = QString() */) 37 : QIWithRetranslateUI<QIMainDialog>(pParent) 37 38 , m_pMainLayout(0) 38 39 , m_pVerticalSplitter(0) … … 43 44 , m_pActionConfiguration(0) 44 45 , m_pActionOptions(0) 45 { 46 46 , m_pCentralWidget(0) 47 , m_pMainMenu(0) 48 , m_pHostBrowserMenu(0) 49 , m_pVisoContentBrowserMenu(0) 50 , m_strMachineName(strMachineName) 51 { 47 52 prepareActions(); 48 53 prepareObjects(); … … 73 78 void UIVisoCreator::retranslateUi() 74 79 { 80 setWindowTitle(QString("%1 - %2").arg(m_strMachineName).arg(tr("VISO Creator"))); 75 81 if (m_pActionConfiguration) 76 82 { … … 85 91 m_pActionOptions->setStatusTip(tr("Manage Dialog Options")); 86 92 } 93 if (m_pMainMenu) 94 m_pMainMenu->setTitle(tr("Main Menu")); 95 if (m_pHostBrowserMenu) 96 m_pHostBrowserMenu->setTitle(tr("Host Browser")); 97 if (m_pVisoContentBrowserMenu) 98 m_pVisoContentBrowserMenu->setTitle(tr("VISO Browser")); 87 99 } 88 100 … … 123 135 void UIVisoCreator::prepareObjects() 124 136 { 137 m_pCentralWidget = new QWidget; 138 if (!m_pCentralWidget) 139 return; 140 setCentralWidget(m_pCentralWidget); 141 125 142 m_pMainLayout = new QVBoxLayout; 143 m_pCentralWidget->setLayout(m_pMainLayout); 126 144 if (!m_pMainLayout) 127 145 return; 128 146 147 QMenuBar *pMenuBar = new QMenuBar; 148 149 setMenuBar(pMenuBar); 150 if (pMenuBar) 151 { 152 m_pMainMenu = pMenuBar->addMenu(tr("Main Menu")); 153 if (m_pActionConfiguration) 154 m_pMainMenu->addAction(m_pActionConfiguration); 155 if (m_pActionOptions) 156 m_pMainMenu->addAction(m_pActionOptions); 157 m_pHostBrowserMenu = m_pMainMenu->addMenu(tr("Host Browser")); 158 m_pVisoContentBrowserMenu = m_pMainMenu->addMenu(tr("VISO Browser")); 159 } 129 160 m_pToolBar = new UIToolBar(parentWidget()); 130 161 if (m_pToolBar) … … 151 182 m_pVerticalSplitter->setHandleWidth(1); 152 183 153 m_pHostBrowser = new UIVisoHostBrowser ;184 m_pHostBrowser = new UIVisoHostBrowser(0 /* parent */, m_pHostBrowserMenu); 154 185 if (m_pHostBrowser) 155 186 { … … 158 189 this, &UIVisoCreator::sltHandleAddObjectsToViso); 159 190 } 160 m_pVisoBrowser = new UIVisoContentBrowser ;191 m_pVisoBrowser = new UIVisoContentBrowser(0 /* parent */, m_pVisoContentBrowserMenu); 161 192 if (m_pVisoBrowser) 162 193 { … … 172 203 } 173 204 retranslateUi(); 174 setLayout(m_pMainLayout);175 205 } 176 206 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r76768 r76826 31 31 32 32 /* GUI includes: */ 33 #include "QI Dialog.h"33 #include "QIMainDialog.h" 34 34 #include "QIWithRetranslateUI.h" 35 35 #include "UIVisoCreatorDefs.h" … … 37 37 /* Forward declarations: */ 38 38 class QItemSelection; 39 class QMenu; 40 class QSplitter; 39 41 class QVBoxLayout; 40 class QSplitter;41 42 class QIDialogButtonBox; 42 43 class UIActionPool; … … 45 46 class UIVisoContentBrowser; 46 47 47 class SHARED_LIBRARY_STUFF UIVisoCreator : public QIWithRetranslateUI<QI Dialog>48 class SHARED_LIBRARY_STUFF UIVisoCreator : public QIWithRetranslateUI<QIMainDialog> 48 49 { 49 50 Q_OBJECT; … … 51 52 public: 52 53 53 UIVisoCreator(QWidget *pParent = 0 );54 UIVisoCreator(QWidget *pParent = 0, const QString& strMachineName = QString()); 54 55 ~UIVisoCreator(); 55 56 QStringList entryList() const; … … 93 94 VisoOptions m_visoOptions; 94 95 BrowserOptions m_browserOptions; 95 96 QWidget *m_pCentralWidget; 97 QMenu *m_pMainMenu; 98 QMenu *m_pHostBrowserMenu; 99 QMenu *m_pVisoContentBrowserMenu; 100 QString m_strMachineName; 96 101 }; 97 102 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoHostBrowser.cpp
r76762 r76826 24 24 #include <QLabel> 25 25 #include <QListView> 26 #include <QMenu> 26 27 #include <QMimeData> 27 28 #include <QTableView> … … 115 116 *********************************************************************************************************************************/ 116 117 117 UIVisoHostBrowser::UIVisoHostBrowser(QWidget *pParent )118 : QIWithRetranslateUI<UIVisoBrowserBase>(pParent)118 UIVisoHostBrowser::UIVisoHostBrowser(QWidget *pParent /* = 0 */, QMenu *pMenu /* = 0 */) 119 : UIVisoBrowserBase(pParent, pMenu) 119 120 , m_pTreeModel(0) 120 121 , m_pTableModel(0) … … 135 136 m_pTitleLabel->setText(QApplication::translate("UIVisoCreator", "Host file system")); 136 137 if (m_pAddAction) 138 { 137 139 m_pAddAction->setToolTip(QApplication::translate("UIVisoCreator", "Add selected file objects to ISO")); 140 m_pAddAction->setText(QApplication::translate("UIVisoCreator", "Add")); 141 } 138 142 } 139 143 … … 202 206 ":/file_manager_copy_to_guest_disabled_24px.png", 203 207 ":/file_manager_copy_to_guest_disabled_16px.png")); 204 208 m_pAddAction->setText(QApplication::translate("UIVisoCreator", "Add")); 205 209 m_pAddAction->setEnabled(false); 210 if (m_pMenu) 211 m_pMenu->addAction(m_pAddAction); 206 212 } 207 213 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoHostBrowser.h
r76762 r76826 27 27 28 28 /* GUI includes: */ 29 #include "QIWithRetranslateUI.h"30 29 #include "UIVisoBrowserBase.h" 31 30 … … 34 33 class UIVisoHostBrowserModel; 35 34 36 /** A QWidget extension. */ 37 class SHARED_LIBRARY_STUFF UIVisoHostBrowser : public QIWithRetranslateUI<UIVisoBrowserBase> 35 class SHARED_LIBRARY_STUFF UIVisoHostBrowser : public UIVisoBrowserBase 38 36 { 39 37 Q_OBJECT; … … 45 43 public: 46 44 47 UIVisoHostBrowser(QWidget *pParent = 0 );45 UIVisoHostBrowser(QWidget *pParent = 0, QMenu *pMenu = 0); 48 46 ~UIVisoHostBrowser(); 49 47 virtual void showHideHiddenObjects(bool bShow) /* override */;
Note:
See TracChangeset
for help on using the changeset viewer.