Changeset 100071 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 5, 2023 2:54:10 PM (20 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r98103 r100071 2546 2546 setStatusTip(QApplication::translate("UIActionPool", "Reset the VISO content.")); 2547 2547 setToolTip(QApplication::translate("UIActionPool", "Reset the VISO content.") 2548 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2549 } 2550 }; 2551 2552 class UIActionMenuVISOCreatorOpen : public UIActionSimple 2553 { 2554 Q_OBJECT; 2555 2556 public: 2557 /** Constructs action passing @a pParent to the base-class. */ 2558 UIActionMenuVISOCreatorOpen(UIActionPool *pParent) 2559 : UIActionSimple(pParent, 2560 ":/cd_remove_16px.png", ":/cd_16px.png") 2561 { 2562 setShortcutContext(Qt::WidgetWithChildrenShortcut); 2563 } 2564 2565 protected: 2566 2567 /** Returns shortcut extra-data ID. */ 2568 virtual QString shortcutExtraDataID() const RT_OVERRIDE 2569 { 2570 return QString("VISOOpen"); 2571 } 2572 2573 /** Handles translation event. */ 2574 virtual void retranslateUi() RT_OVERRIDE 2575 { 2576 setName(QApplication::translate("UIActionPool", "Open")); 2577 setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator")); 2578 setStatusTip(QApplication::translate("UIActionPool", "Open the VISO content.")); 2579 setToolTip(QApplication::translate("UIActionPool", "Open the VISO content.") 2548 2580 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2549 2581 } … … 3204 3236 m_pool[UIActionIndex_M_VISOCreator_Rename] = new UIActionMenuVISOCreatorRename(this); 3205 3237 m_pool[UIActionIndex_M_VISOCreator_Reset] = new UIActionMenuVISOCreatorReset(this); 3238 m_pool[UIActionIndex_M_VISOCreator_Open] = new UIActionMenuVISOCreatorOpen(this); 3206 3239 3207 3240 /* Medium Selector actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r99469 r100071 158 158 UIActionIndex_M_VISOCreator_Rename, 159 159 UIActionIndex_M_VISOCreator_Reset, 160 UIActionIndex_M_VISOCreator_Open, 160 161 161 162 /* Medium selector actions : */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp
r98103 r100071 607 607 } 608 608 609 void UIVisoContentBrowser::parseVisoFileContent(const QString &strFileName) 610 { 611 Q_UNUSED(strFileName); 612 } 613 609 614 QModelIndex UIVisoContentBrowser::convertIndexToTableIndex(const QModelIndex &index) 610 615 { -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h
r98103 r100071 70 70 void setVisoName(const QString &strName); 71 71 virtual bool tableViewHasSelection() const final override; 72 void parseVisoFileContent(const QString &strFileName); 72 73 73 74 public slots: -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r99946 r100071 33 33 34 34 /* GUI includes: */ 35 #include "QIDialogButtonBox.h" 36 #include "QIFileDialog.h" 37 #include "QIToolBar.h" 35 38 #include "UIActionPool.h" 36 #include " QIDialogButtonBox.h"39 #include "UICommon.h" 37 40 #include "UIDesktopWidgetWatchdog.h" 38 41 #include "UIExtraDataManager.h" 39 42 #include "UIIconPool.h" 40 43 #include "UIModalWindowManager.h" 41 #include "QIToolBar.h"42 44 #include "UIVisoHostBrowser.h" 43 45 #include "UIVisoCreator.h" … … 45 47 #include "UIVisoCreatorOptionsPanel.h" 46 48 #include "UIVisoContentBrowser.h" 47 #include "UICommon.h"48 49 #ifdef VBOX_WS_MAC 49 50 # include "VBoxUtils-darwin.h" … … 69 70 , m_pRenameAction(0) 70 71 , m_pResetAction(0) 72 , m_pOpenAction(0) 71 73 , m_pMainLayout(0) 72 74 , m_pHostBrowser(0) … … 227 229 228 230 menu.exec(pContextMenuRequester->mapToGlobal(point)); 231 } 232 233 void UIVisoCreatorWidget::sltHandleOpenAction() 234 { 235 QString strFileName = QIFileDialog::getOpenFileName(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD), 236 "Viso files (*.viso)", this, UIVisoCreatorWidget::tr("Select a viso file to load")); 237 if (!strFileName.isEmpty() && m_pVISOContentBrowser) 238 m_pVISOContentBrowser->parseVisoFileContent(strFileName); 229 239 } 230 240 … … 366 376 connect(m_pRenameAction, &QAction::triggered, 367 377 m_pVISOContentBrowser,&UIVisoContentBrowser::sltHandleItemRenameAction); 378 if (m_pOpenAction) 379 connect(m_pOpenAction, &QAction::triggered, 380 this, &UIVisoCreatorWidget::sltHandleOpenAction); 368 381 } 369 382 … … 376 389 m_pActionOptions = m_pActionPool->action(UIActionIndex_M_VISOCreator_ToggleOptionsPanel); 377 390 391 m_pOpenAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_Open); 378 392 m_pAddAction = m_pActionPool->action(UIActionIndex_M_VISOCreator_Add); 379 393 if (m_pAddAction && m_pHostBrowser) … … 402 416 m_pMainMenu->addAction(m_pActionOptions); 403 417 m_pMainMenu->addSeparator(); 404 m_pMainMenu->addAction(m_pAddAction); 405 m_pMainMenu->addAction(m_pRemoveAction); 406 m_pMainMenu->addAction(m_pCreateNewDirectoryAction); 407 m_pMainMenu->addAction(m_pResetAction); 418 if (m_pAddAction) 419 m_pMainMenu->addAction(m_pAddAction); 420 if (m_pOpenAction) 421 m_pMainMenu->addAction(m_pOpenAction); 422 if (m_pRemoveAction) 423 m_pMainMenu->addAction(m_pRemoveAction); 424 if (m_pCreateNewDirectoryAction) 425 m_pMainMenu->addAction(m_pCreateNewDirectoryAction); 426 if (m_pResetAction) 427 m_pMainMenu->addAction(m_pResetAction); 408 428 } 409 429 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r98103 r100071 121 121 void sltHandleContentBrowserTableSelectionChanged(bool fIsSelectionEmpty); 122 122 void sltHandleShowContextMenu(const QWidget *pContextMenuRequester, const QPoint &point); 123 void sltHandleOpenAction(); 123 124 124 125 private: … … 174 175 QAction *m_pRenameAction; 175 176 QAction *m_pResetAction; 177 QAction *m_pOpenAction; 176 178 /** @} */ 177 179
Note:
See TracChangeset
for help on using the changeset viewer.