- Timestamp:
- Nov 8, 2021 2:46:28 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148112
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r92111 r92270 1752 1752 1753 1753 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 1754 UIVisoCreator *pVisoCreator = new UIVisoCreator(pDialogParent, strMachineName);1754 UIVisoCreatorDialog *pVisoCreator = new UIVisoCreatorDialog(pDialogParent, strMachineName); 1755 1755 1756 1756 if (!pVisoCreator) -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoConfigurationPanel.cpp
r82968 r92270 28 28 #include "UIVisoCreator.h" 29 29 30 UIVisoConfigurationPanel::UIVisoConfigurationPanel( UIVisoCreator *pCreator,QWidget *pParent /* =0 */)30 UIVisoConfigurationPanel::UIVisoConfigurationPanel(QWidget *pParent /* =0 */) 31 31 : UIDialogPanel(pParent) 32 , m_pCreator(pCreator)33 32 , m_pVisoNameLabel(0) 34 33 , m_pCustomOptionsLabel(0) … … 72 71 return; 73 72 74 /* Install creator's event-filter: */75 m_pCreator->installEventFilter(this);76 77 73 /* Name edit and and label: */ 78 74 m_pVisoNameLabel = new QILabel(QApplication::translate("UIVisoCreator", "VISO Name:")); … … 112 108 if (m_pDeleteButton) 113 109 connect(m_pDeleteButton, &QIToolButton::clicked, this, &UIVisoConfigurationPanel::sltHandleDeleteCurrentCustomOption); 114 }115 116 bool UIVisoConfigurationPanel::eventFilter(QObject *pObject, QEvent *pEvent)117 {118 /* Handle only events sent to creator only: */119 if (pObject != m_pCreator)120 return UIDialogPanel::eventFilter(pObject, pEvent);121 122 switch (pEvent->type())123 {124 case QEvent::KeyPress:125 {126 QKeyEvent *pKeyEvent = static_cast<QKeyEvent*>(pEvent);127 if (pKeyEvent->key() == Qt::Key_Return && m_pCustomOptionsComboBox && m_pCustomOptionsComboBox->hasFocus())128 addCustomVisoOption();129 return true;130 break;131 }132 default:133 break;134 }135 136 /* Call to base-class: */137 return UIDialogPanel::eventFilter(pObject, pEvent);138 110 } 139 111 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoConfigurationPanel.h
r82968 r92270 42 42 43 43 public: 44 UIVisoConfigurationPanel( UIVisoCreator *pCreator,QWidget *pParent = 0);44 UIVisoConfigurationPanel(QWidget *pParent = 0); 45 45 ~UIVisoConfigurationPanel(); 46 46 virtual QString panelName() const /* override */; … … 50 50 protected: 51 51 52 bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;53 52 void retranslateUi() /* override */; 54 53 … … 65 64 void emitCustomVisoOptions(); 66 65 67 /** Holds the parent creator reference. */68 UIVisoCreator *m_pCreator;69 70 66 QILabel *m_pVisoNameLabel; 71 67 QILabel *m_pCustomOptionsLabel; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r91328 r92270 39 39 #endif 40 40 41 UIVisoCreator ::UIVisoCreator(QWidget *pParent /* =0 */, const QString& strMachineName /* = QString() */)41 UIVisoCreatorDialog::UIVisoCreatorDialog(QWidget *pParent /* =0 */, const QString& strMachineName /* = QString() */) 42 42 : QIWithRetranslateUI<QIMainDialog>(pParent) 43 43 , m_pActionConfiguration(0) … … 69 69 } 70 70 71 QStringList UIVisoCreator ::entryList() const71 QStringList UIVisoCreatorDialog::entryList() const 72 72 { 73 73 if (!m_pVisoBrowser) … … 76 76 } 77 77 78 const QString &UIVisoCreator ::visoName() const78 const QString &UIVisoCreatorDialog::visoName() const 79 79 { 80 80 return m_visoOptions.m_strVisoName; 81 81 } 82 82 83 const QStringList &UIVisoCreator ::customOptions() const83 const QStringList &UIVisoCreatorDialog::customOptions() const 84 84 { 85 85 return m_visoOptions.m_customOptions; 86 86 } 87 87 88 QString UIVisoCreator ::currentPath() const88 QString UIVisoCreatorDialog::currentPath() const 89 89 { 90 90 if (!m_pHostBrowser) … … 93 93 } 94 94 95 void UIVisoCreator ::setCurrentPath(const QString &strPath)95 void UIVisoCreatorDialog::setCurrentPath(const QString &strPath) 96 96 { 97 97 if (!m_pHostBrowser) … … 100 100 } 101 101 102 void UIVisoCreator ::retranslateUi()102 void UIVisoCreatorDialog::retranslateUi() 103 103 { 104 104 if (!m_strMachineName.isEmpty()) … … 153 153 } 154 154 155 void UIVisoCreator ::sltHandleAddObjectsToViso(QStringList pathList)155 void UIVisoCreatorDialog::sltHandleAddObjectsToViso(QStringList pathList) 156 156 { 157 157 if (m_pVisoBrowser) … … 159 159 } 160 160 161 void UIVisoCreator ::sltPanelActionToggled(bool fChecked)161 void UIVisoCreatorDialog::sltPanelActionToggled(bool fChecked) 162 162 { 163 163 QAction *pSenderAction = qobject_cast<QAction*>(sender()); … … 180 180 } 181 181 182 void UIVisoCreator ::sltHandleVisoNameChanged(const QString &strVisoName)182 void UIVisoCreatorDialog::sltHandleVisoNameChanged(const QString &strVisoName) 183 183 { 184 184 if (m_visoOptions.m_strVisoName == strVisoName) … … 189 189 } 190 190 191 void UIVisoCreator ::sltHandleCustomVisoOptionsChanged(const QStringList &customVisoOptions)191 void UIVisoCreatorDialog::sltHandleCustomVisoOptionsChanged(const QStringList &customVisoOptions) 192 192 { 193 193 if (m_visoOptions.m_customOptions == customVisoOptions) … … 196 196 } 197 197 198 void UIVisoCreator ::sltHandleShowHiddenObjectsChange(bool fShow)198 void UIVisoCreatorDialog::sltHandleShowHiddenObjectsChange(bool fShow) 199 199 { 200 200 if (m_browserOptions.m_fShowHiddenObjects == fShow) … … 204 204 } 205 205 206 void UIVisoCreator ::sltHandleHidePanel(UIDialogPanel *pPanel)206 void UIVisoCreatorDialog::sltHandleHidePanel(UIDialogPanel *pPanel) 207 207 { 208 208 hidePanel(pPanel); 209 209 } 210 210 211 void UIVisoCreator ::sltHandleBrowserTreeViewVisibilityChanged(bool fVisible)211 void UIVisoCreatorDialog::sltHandleBrowserTreeViewVisibilityChanged(bool fVisible) 212 212 { 213 213 Q_UNUSED(fVisible); … … 215 215 } 216 216 217 void UIVisoCreator ::sltHandleHostBrowserTableSelectionChanged(bool fIsSelectionEmpty)217 void UIVisoCreatorDialog::sltHandleHostBrowserTableSelectionChanged(bool fIsSelectionEmpty) 218 218 { 219 219 if (m_pAddAction) … … 221 221 } 222 222 223 void UIVisoCreator ::sltHandleContentBrowserTableSelectionChanged(bool fIsSelectionEmpty)223 void UIVisoCreatorDialog::sltHandleContentBrowserTableSelectionChanged(bool fIsSelectionEmpty) 224 224 { 225 225 if (m_pRemoveAction) … … 227 227 } 228 228 229 void UIVisoCreator ::sltHandleShowContextMenu(const QWidget *pContextMenuRequester, const QPoint &point)229 void UIVisoCreatorDialog::sltHandleShowContextMenu(const QWidget *pContextMenuRequester, const QPoint &point) 230 230 { 231 231 if (!pContextMenuRequester) … … 248 248 } 249 249 250 void UIVisoCreator ::prepareWidgets()250 void UIVisoCreatorDialog::prepareWidgets() 251 251 { 252 252 m_pCentralWidget = new QWidget; … … 342 342 } 343 343 344 void UIVisoCreator ::prepareConnections()344 void UIVisoCreatorDialog::prepareConnections() 345 345 { 346 346 if (m_pHostBrowser) 347 347 { 348 348 connect(m_pHostBrowser, &UIVisoHostBrowser::sigAddObjectsToViso, 349 this, &UIVisoCreator ::sltHandleAddObjectsToViso);349 this, &UIVisoCreatorDialog::sltHandleAddObjectsToViso); 350 350 connect(m_pHostBrowser, &UIVisoHostBrowser::sigTreeViewVisibilityChanged, 351 this, &UIVisoCreator ::sltHandleBrowserTreeViewVisibilityChanged);351 this, &UIVisoCreatorDialog::sltHandleBrowserTreeViewVisibilityChanged); 352 352 connect(m_pHostBrowser, &UIVisoHostBrowser::sigTableSelectionChanged, 353 this, &UIVisoCreator ::sltHandleHostBrowserTableSelectionChanged);353 this, &UIVisoCreatorDialog::sltHandleHostBrowserTableSelectionChanged); 354 354 connect(m_pHostBrowser, &UIVisoHostBrowser::sigCreateFileTableViewContextMenu, 355 this, &UIVisoCreator ::sltHandleShowContextMenu);355 this, &UIVisoCreatorDialog::sltHandleShowContextMenu); 356 356 } 357 357 … … 359 359 { 360 360 connect(m_pVisoBrowser, &UIVisoContentBrowser::sigTableSelectionChanged, 361 this, &UIVisoCreator ::sltHandleContentBrowserTableSelectionChanged);361 this, &UIVisoCreatorDialog::sltHandleContentBrowserTableSelectionChanged); 362 362 connect(m_pVisoBrowser, &UIVisoContentBrowser::sigCreateFileTableViewContextMenu, 363 this, &UIVisoCreator ::sltHandleShowContextMenu);363 this, &UIVisoCreatorDialog::sltHandleShowContextMenu); 364 364 } 365 365 366 366 if (m_pButtonBox) 367 367 { 368 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIVisoCreator ::close);369 connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIVisoCreator ::accept);368 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIVisoCreatorDialog::close); 369 connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIVisoCreatorDialog::accept); 370 370 } 371 371 372 372 if (m_pActionConfiguration) 373 connect(m_pActionConfiguration, &QAction::triggered, this, &UIVisoCreator ::sltPanelActionToggled);373 connect(m_pActionConfiguration, &QAction::triggered, this, &UIVisoCreatorDialog::sltPanelActionToggled); 374 374 if (m_pActionOptions) 375 connect(m_pActionOptions, &QAction::triggered, this, &UIVisoCreator ::sltPanelActionToggled);375 connect(m_pActionOptions, &QAction::triggered, this, &UIVisoCreatorDialog::sltPanelActionToggled); 376 376 377 377 if (m_pConfigurationPanel) 378 378 { 379 379 connect(m_pConfigurationPanel, &UIVisoConfigurationPanel::sigVisoNameChanged, 380 this, &UIVisoCreator ::sltHandleVisoNameChanged);380 this, &UIVisoCreatorDialog::sltHandleVisoNameChanged); 381 381 connect(m_pConfigurationPanel, &UIVisoConfigurationPanel::sigCustomVisoOptionsChanged, 382 this, &UIVisoCreator ::sltHandleCustomVisoOptionsChanged);382 this, &UIVisoCreatorDialog::sltHandleCustomVisoOptionsChanged); 383 383 connect(m_pConfigurationPanel, &UIVisoConfigurationPanel::sigHidePanel, 384 this, &UIVisoCreator ::sltHandleHidePanel);384 this, &UIVisoCreatorDialog::sltHandleHidePanel); 385 385 m_panelActionMap.insert(m_pConfigurationPanel, m_pActionConfiguration); 386 386 } … … 389 389 { 390 390 connect(m_pCreatorOptionsPanel, &UIVisoCreatorOptionsPanel::sigShowHiddenObjects, 391 this, &UIVisoCreator ::sltHandleShowHiddenObjectsChange);391 this, &UIVisoCreatorDialog::sltHandleShowHiddenObjectsChange); 392 392 connect(m_pCreatorOptionsPanel, &UIVisoCreatorOptionsPanel::sigHidePanel, 393 this, &UIVisoCreator ::sltHandleHidePanel);393 this, &UIVisoCreatorDialog::sltHandleHidePanel); 394 394 m_panelActionMap.insert(m_pCreatorOptionsPanel, m_pActionOptions); 395 395 } … … 413 413 } 414 414 415 void UIVisoCreator ::prepareActions()415 void UIVisoCreatorDialog::prepareActions() 416 416 { 417 417 m_pActionConfiguration = new QAction(this); … … 479 479 } 480 480 481 void UIVisoCreator ::populateMenuMainToolbar()481 void UIVisoCreatorDialog::populateMenuMainToolbar() 482 482 { 483 483 if (!m_pMainMenu || !m_pToolBar) … … 496 496 } 497 497 498 void UIVisoCreator ::hidePanel(UIDialogPanel* panel)498 void UIVisoCreatorDialog::hidePanel(UIDialogPanel* panel) 499 499 { 500 500 if (panel && panel->isVisible()) … … 510 510 } 511 511 512 void UIVisoCreator ::showPanel(UIDialogPanel* panel)512 void UIVisoCreatorDialog::showPanel(UIDialogPanel* panel) 513 513 { 514 514 if (panel && panel->isHidden()) … … 525 525 } 526 526 527 void UIVisoCreator ::manageEscapeShortCut()527 void UIVisoCreatorDialog::manageEscapeShortCut() 528 528 { 529 529 /* Take the escape key from m_pButtonBox and from the panels in case treeview(s) in … … 556 556 } 557 557 558 void UIVisoCreator ::prepareVerticalToolBar()558 void UIVisoCreatorDialog::prepareVerticalToolBar() 559 559 { 560 560 m_pVerticalToolBar = new QIToolBar; -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r86233 r92270 43 43 * for VISO file system. It has the main menu, main toolbar, and a vertical toolbar and corresponding 44 44 * actions. */ 45 class UIVisoCreator : public QIWithRetranslateUI<QIMainDialog>45 class UIVisoCreatorDialog : public QIWithRetranslateUI<QIMainDialog> 46 46 { 47 47 Q_OBJECT; … … 49 49 public: 50 50 51 UIVisoCreator (QWidget *pParent = 0, const QString& strMachineName = QString());51 UIVisoCreatorDialog(QWidget *pParent = 0, const QString& strMachineName = QString()); 52 52 /** Returns the content of the .viso file. Each element of the list corresponds to a line in the .viso file. */ 53 53 QStringList entryList() const;
Note:
See TracChangeset
for help on using the changeset viewer.