Changeset 100156 in vbox
- Timestamp:
- Jun 12, 2023 3:25:05 PM (18 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r100123 r100156 2292 2292 }; 2293 2293 2294 /** Toggle action extension, used to toggle 'VISO Creator options' panelin file manager. */2295 class UIActionMenuVISOCreatorToggle OptionsPanel: public UIActionToggle2296 { 2297 Q_OBJECT; 2298 2299 public: 2300 2301 /** Constructs action passing @a pParent to the base-class. */ 2302 UIActionMenuVISOCreatorToggle OptionsPanel(UIActionPool *pParent)2294 /** Toggle action extension, used to toggle 'VISO Creator settings' dialog in file manager. */ 2295 class UIActionMenuVISOCreatorToggleSettingsDialog : public UIActionToggle 2296 { 2297 Q_OBJECT; 2298 2299 public: 2300 2301 /** Constructs action passing @a pParent to the base-class. */ 2302 UIActionMenuVISOCreatorToggleSettingsDialog(UIActionPool *pParent) 2303 2303 : UIActionToggle(pParent) 2304 2304 { … … 2315 2315 virtual QString shortcutExtraDataID() const RT_OVERRIDE 2316 2316 { 2317 return QString("ToggleVISOCreator OptionsPanel");2317 return QString("ToggleVISOCreatorSettingsDialog"); 2318 2318 } 2319 2319 … … 2327 2327 virtual void retranslateUi() RT_OVERRIDE 2328 2328 { 2329 setName(QApplication::translate("UIActionPool", " Options"));2329 setName(QApplication::translate("UIActionPool", "Settings")); 2330 2330 setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator")); 2331 setStatusTip(QApplication::translate("UIActionPool", "Open panel for VISO Creator options"));2332 setToolTip(QApplication::translate("UIActionPool", "Open Options Panel")2331 setStatusTip(QApplication::translate("UIActionPool", "Open VISO Creator settings dialog")); 2332 setToolTip(QApplication::translate("UIActionPool", "Open Settings Dialog") 2333 2333 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2334 2334 } … … 3186 3186 /* Create VISO Creator actions: */ 3187 3187 m_pool[UIActionIndex_M_VISOCreator] = new UIActionMenuVISOCreator(this); 3188 m_pool[UIActionIndex_M_VISOCreator_Toggle OptionsPanel] = new UIActionMenuVISOCreatorToggleOptionsPanel(this);3188 m_pool[UIActionIndex_M_VISOCreator_ToggleSettingsDialog] = new UIActionMenuVISOCreatorToggleSettingsDialog(this); 3189 3189 m_pool[UIActionIndex_M_VISOCreator_Add] = new UIActionMenuVISOCreatorAdd(this); 3190 3190 m_pool[UIActionIndex_M_VISOCreator_Remove] = new UIActionMenuVISOCreatorRemove(this); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r100123 r100156 151 151 /* VISO Creator actions: */ 152 152 UIActionIndex_M_VISOCreator, 153 UIActionIndex_M_VISOCreator_Toggle OptionsPanel,153 UIActionIndex_M_VISOCreator_ToggleSettingsDialog, 154 154 UIActionIndex_M_VISOCreator_Add, 155 155 UIActionIndex_M_VISOCreator_Remove, -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r100155 r100156 223 223 bool fShowToolBar, const QString& strMachineName /* = QString() */) 224 224 : QIWithRetranslateUI<QWidget>(pParent) 225 , m_pAction Options(0)225 , m_pActionSettings(0) 226 226 , m_pAddAction(0) 227 227 , m_pRemoveAction(0) … … 299 299 { 300 300 Q_UNUSED(pEvent); 301 if (m_pSettingsWidget && m_pSettingsWidget->isVisible() != m_fShowSettingsDialog /*&& m_pOverlayWidget*/ && m_pOverlayBlurEffect)302 {303 QPixmap shot = m_pBrowserContainerWidget->grab();304 m_pOverlayWidget->setPixmap(shot);305 306 if (m_fShowSettingsDialog)307 m_pStackedLayout->setCurrentWidget(m_pOverlayWidget);308 else309 m_pStackedLayout->setCurrentWidget(m_pBrowserContainerWidget);310 311 m_pSettingsWidget->setVisible(m_fShowSettingsDialog);312 313 m_pOverlayBlurEffect->setEnabled(m_fShowSettingsDialog);314 m_pSettingsWidget->raise();315 if (m_fShowSettingsDialog)316 {317 int x = 0.5 * (m_pBrowserContainerWidget->width() - m_pSettingsWidget->width());318 int y = 0.5 * (m_pBrowserContainerWidget->height() - m_pSettingsWidget->height());319 m_pSettingsWidget->move(m_pBrowserContainerWidget->x() + x, m_pBrowserContainerWidget->y() + y);320 }321 }322 301 } 323 302 … … 328 307 } 329 308 330 void UIVisoCreatorWidget::slt PanelActionToggled(bool fChecked)309 void UIVisoCreatorWidget::sltSettingsActionToggled(bool fChecked) 331 310 { 332 311 m_fShowSettingsDialog = fChecked; 333 repaint(); 334 //update(); 312 toggleSettingsWidget(); 335 313 } 336 314 … … 505 483 } 506 484 507 if (m_pAction Options)508 connect(m_pAction Options, &QAction::triggered, this, &UIVisoCreatorWidget::sltPanelActionToggled);485 if (m_pActionSettings) 486 connect(m_pActionSettings, &QAction::triggered, this, &UIVisoCreatorWidget::sltSettingsActionToggled); 509 487 510 488 if (m_pSettingsWidget) … … 544 522 return; 545 523 546 m_pAction Options = m_pActionPool->action(UIActionIndex_M_VISOCreator_ToggleOptionsPanel);524 m_pActionSettings = m_pActionPool->action(UIActionIndex_M_VISOCreator_ToggleSettingsDialog); 547 525 548 526 m_pAddAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_Add); … … 564 542 if (m_pToolBar) 565 543 { 566 if (m_pAction Options)567 m_pToolBar->addAction(m_pAction Options);544 if (m_pActionSettings) 545 m_pToolBar->addAction(m_pActionSettings); 568 546 } 569 547 if (m_pMainMenu) 570 548 { 571 m_pMainMenu->addAction(m_pAction Options);549 m_pMainMenu->addAction(m_pActionSettings); 572 550 m_pMainMenu->addSeparator(); 573 551 if (m_pAddAction) … … 608 586 609 587 m_pVerticalToolBar->addWidget(bottomSpacerWidget); 588 } 589 } 590 591 void UIVisoCreatorWidget::toggleSettingsWidget() 592 { 593 if (m_pSettingsWidget && m_pSettingsWidget->isVisible() != m_fShowSettingsDialog /*&& m_pOverlayWidget*/ && m_pOverlayBlurEffect) 594 { 595 QPixmap shot = m_pBrowserContainerWidget->grab(); 596 m_pOverlayWidget->setPixmap(shot); 597 598 if (m_fShowSettingsDialog) 599 m_pStackedLayout->setCurrentWidget(m_pOverlayWidget); 600 else 601 m_pStackedLayout->setCurrentWidget(m_pBrowserContainerWidget); 602 603 m_pSettingsWidget->setVisible(m_fShowSettingsDialog); 604 605 m_pOverlayBlurEffect->setEnabled(m_fShowSettingsDialog); 606 m_pSettingsWidget->raise(); 607 if (m_fShowSettingsDialog) 608 { 609 int x = 0.5 * (m_pBrowserContainerWidget->width() - m_pSettingsWidget->width()); 610 int y = 0.5 * (m_pBrowserContainerWidget->height() - m_pSettingsWidget->height()); 611 m_pSettingsWidget->move(m_pBrowserContainerWidget->x() + x, m_pBrowserContainerWidget->y() + y); 612 } 610 613 } 611 614 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r100155 r100156 98 98 99 99 void sltAddObjectsToViso(QStringList pathList); 100 void slt PanelActionToggled(bool fChecked);100 void sltSettingsActionToggled(bool fChecked); 101 101 void sltVisoNameChanged(const QString& strVisoName); 102 102 void sltCustomVisoOptionsChanged(const QStringList &customVisoOptions); … … 134 134 * Leave out the vertical toolbar which is handled in prepareVerticalToolBar. */ 135 135 void populateMenuMainToolbar(); 136 /** Set the root index of the m_pTableModel to the current index of m_pTreeModel. */ 137 void setTableRootIndex(QModelIndex index = QModelIndex() ); 138 void setTreeCurrentIndex(QModelIndex index = QModelIndex() ); 139 136 137 void toggleSettingsWidget(); 140 138 /** @name Main toolbar (and main menu) actions 141 139 * @{ */ 142 QAction *m_pAction Options;140 QAction *m_pActionSettings; 143 141 /** @} */ 144 142
Note:
See TracChangeset
for help on using the changeset viewer.