Changeset 92352 in vbox
- Timestamp:
- Nov 11, 2021 10:18:36 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148203
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r90967 r92352 1738 1738 setShortcutScope(QApplication::translate("UIActionPool", "File Manager")); 1739 1739 setStatusTip(QApplication::translate("UIActionPool", "Open panel with file manager session")); 1740 setToolTip( QApplication::translate("UIActionPool", "Open Session Pane ")1740 setToolTip( QApplication::translate("UIActionPool", "Open Session Panel") 1741 1741 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 1742 1742 } … … 2199 2199 setStatusTip(QApplication::translate("UIActionPool", "Show the properties of currently selected file object(s)")); 2200 2200 setToolTip( QApplication::translate("UIActionPool", "Show Properties of Current Object(s)") 2201 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2202 } 2203 }; 2204 2205 /** Menu action extension, used as 'VISO Creator' menu class. */ 2206 class UIActionMenuVISOCreator : public UIActionMenu 2207 { 2208 Q_OBJECT; 2209 2210 public: 2211 2212 /** Constructs action passing @a pParent to the base-class. */ 2213 UIActionMenuVISOCreator(UIActionPool *pParent) 2214 : UIActionMenu(pParent) 2215 {} 2216 2217 protected: 2218 2219 /** Returns shortcut extra-data ID. */ 2220 virtual QString shortcutExtraDataID() const /* override */ 2221 { 2222 return QString("VISOCreatorMenu"); 2223 } 2224 2225 /** Handles translation event. */ 2226 virtual void retranslateUi() /* override */ 2227 { 2228 setName(QApplication::translate("UIActionPool", "VISO Creator")); 2229 } 2230 }; 2231 2232 /** Toggle action extension, used to toggle 'VISO Creator configuration' panel in file manager. */ 2233 class UIActionMenuVISOCreatorToggleConfigPanel : public UIActionToggle 2234 { 2235 Q_OBJECT; 2236 2237 public: 2238 2239 /** Constructs action passing @a pParent to the base-class. */ 2240 UIActionMenuVISOCreatorToggleConfigPanel(UIActionPool *pParent) 2241 : UIActionToggle(pParent) 2242 { 2243 setShortcutContext(Qt::WidgetWithChildrenShortcut); 2244 setIcon(UIIconPool::iconSetFull(":/file_manager_session_32px.png", ":/file_manager_session_16px.png", 2245 ":/file_manager_session_disabled_32px.png", ":/file_manager_session_disabled_16px.png")); 2246 } 2247 2248 protected: 2249 2250 /** Returns shortcut extra-data ID. */ 2251 virtual QString shortcutExtraDataID() const /* override */ 2252 { 2253 return QString("ToggleVISOCreatorConfigurationPanel"); 2254 } 2255 2256 /** Returns default shortcut. */ 2257 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 2258 { 2259 return QKeySequence(); 2260 } 2261 2262 /** Handles translation event. */ 2263 virtual void retranslateUi() /* override */ 2264 { 2265 setName(QApplication::translate("UIActionPool", "Configuration")); 2266 setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator")); 2267 setStatusTip(QApplication::translate("UIActionPool", "Open panel for VISO Creator configuration")); 2268 setToolTip( QApplication::translate("UIActionPool", "Open Configuration Panel") 2269 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2270 } 2271 }; 2272 2273 /** Toggle action extension, used to toggle 'VISO Creator options' panel in file manager. */ 2274 class UIActionMenuVISOCreatorToggleOptionsPanel : public UIActionToggle 2275 { 2276 Q_OBJECT; 2277 2278 public: 2279 2280 /** Constructs action passing @a pParent to the base-class. */ 2281 UIActionMenuVISOCreatorToggleOptionsPanel(UIActionPool *pParent) 2282 : UIActionToggle(pParent) 2283 { 2284 setShortcutContext(Qt::WidgetWithChildrenShortcut); 2285 setIcon(UIIconPool::iconSetFull(":/file_manager_session_32px.png", ":/file_manager_session_16px.png", 2286 ":/file_manager_session_disabled_32px.png", ":/file_manager_session_disabled_16px.png")); 2287 } 2288 2289 protected: 2290 2291 /** Returns shortcut extra-data ID. */ 2292 virtual QString shortcutExtraDataID() const /* override */ 2293 { 2294 return QString("ToggleVISOCreatorOptionsurationPanel"); 2295 } 2296 2297 /** Returns default shortcut. */ 2298 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 2299 { 2300 return QKeySequence(); 2301 } 2302 2303 /** Handles translation event. */ 2304 virtual void retranslateUi() /* override */ 2305 { 2306 setName(QApplication::translate("UIActionPool", "Configuration")); 2307 setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator")); 2308 setStatusTip(QApplication::translate("UIActionPool", "Open panel for VISO Creator options")); 2309 setToolTip( QApplication::translate("UIActionPool", "Open Options Panel") 2201 2310 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2202 2311 } … … 2582 2691 m_pool[UIActionIndex_M_FileManager_S_Guest_ShowProperties] = new UIActionMenuFileManagerShowProperties(this); 2583 2692 2693 /* Create VISO Creator actions: */ 2694 m_pool[UIActionIndex_M_VISOCreator] = new UIActionMenuVISOCreator(this); 2695 m_pool[UIActionIndex_M_VISOCreator_ToggleConfigPanel] = new UIActionMenuVISOCreatorToggleConfigPanel(this); 2696 m_pool[UIActionIndex_M_VISOCreator_ToggleOptionsPanel] = new UIActionMenuVISOCreatorToggleOptionsPanel(this); 2697 2584 2698 /* Prepare update-handlers for known menus: */ 2585 2699 #ifdef VBOX_WS_MAC … … 2959 3073 fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Refresh)) || fSeparator; 2960 3074 fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Reload)) || fSeparator; 2961 2962 3075 } 2963 3076 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r90490 r92352 138 138 UIActionIndex_M_FileManager_S_Guest_ShowProperties, 139 139 140 /* VISO Creator actions: */ 141 UIActionIndex_M_VISOCreator, 142 UIActionIndex_M_VISOCreator_ToggleConfigPanel, 143 UIActionIndex_M_VISOCreator_ToggleOptionsPanel, 144 140 145 /* Maximum index: */ 141 146 UIActionIndex_Max -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r92270 r92352 1752 1752 1753 1753 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 1754 UIVisoCreatorDialog *pVisoCreator = new UIVisoCreatorDialog(pDialogParent, strMachineName);1754 UIVisoCreatorDialog *pVisoCreator = 0;//new UIVisoCreatorDialog(pDialogParent, strMachineName); 1755 1755 1756 1756 if (!pVisoCreator) -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r92291 r92352 23 23 24 24 /* GUI includes: */ 25 #include "UIActionPool.h" 25 26 #include "QIDialogButtonBox.h" 26 27 #include "UIDesktopWidgetWatchdog.h" … … 44 45 *********************************************************************************************************************************/ 45 46 46 UIVisoCreatorWidget::UIVisoCreatorWidget( QWidget *pParent /* =0 */, const QString& strMachineName /* = QString() */)47 UIVisoCreatorWidget::UIVisoCreatorWidget(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName /* = QString() */) 47 48 : QIWithRetranslateUI<QWidget>(pParent) 48 49 , m_pActionConfiguration(0) … … 62 63 , m_pCreatorOptionsPanel(0) 63 64 , m_pConfigurationPanel(0) 65 , m_pActionPool(pActionPool) 64 66 { 65 67 m_visoOptions.m_strVisoName = !strMachineName.isEmpty() ? strMachineName : "ad-hoc"; … … 552 554 * UIVisoCreatorDialog implementation. * 553 555 *********************************************************************************************************************************/ 554 UIVisoCreatorDialog::UIVisoCreatorDialog( QWidget *pParent /* = 0 */, const QString& strMachineName /* = QString() */)556 UIVisoCreatorDialog::UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName /* = QString() */) 555 557 : QIWithRetranslateUI<QIMainDialog>(pParent) 556 558 , m_strMachineName(strMachineName) 557 559 , m_pVisoCreatorWidget(0) 558 560 , m_pButtonBox(0) 561 , m_pActionPool(pActionPool) 559 562 { 560 563 prepareWidgets(); … … 604 607 605 608 606 m_pVisoCreatorWidget = new UIVisoCreatorWidget( this, m_strMachineName);609 m_pVisoCreatorWidget = new UIVisoCreatorWidget(m_pActionPool, this, m_strMachineName); 607 610 if (m_pVisoCreatorWidget) 608 611 { -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r92289 r92352 29 29 #include "QIWithRetranslateUI.h" 30 30 31 31 32 /* Forward declarations: */ 32 33 class QMenu; … … 35 36 class UIDialogPanel; 36 37 class QIToolBar; 38 class UIActionPool; 37 39 class UIVisoHostBrowser; 38 40 class UIVisoContentBrowser; … … 49 51 public: 50 52 51 UIVisoCreatorWidget( QWidget *pParent = 0, const QString& strMachineName = QString());53 UIVisoCreatorWidget(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName = QString()); 52 54 /** Returns the content of the .viso file. Each element of the list corresponds to a line in the .viso file. */ 53 55 QStringList entryList() const; … … 66 68 protected: 67 69 68 virtual void retranslateUi() /* override */;70 virtual void retranslateUi() final override; 69 71 70 72 private slots: … … 149 151 QMap<UIDialogPanel*, QAction*> m_panelActionMap; 150 152 QList<UIDialogPanel*> m_visiblePanelsList; 153 QPointer<UIActionPool> m_pActionPool; 151 154 }; 152 155 … … 158 161 public: 159 162 160 UIVisoCreatorDialog( QWidget *pParent = 0, const QString& strMachineName = QString());163 UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName = QString()); 161 164 162 165 QStringList entryList() const; … … 174 177 UIVisoCreatorWidget *m_pVisoCreatorWidget; 175 178 QIDialogButtonBox *m_pButtonBox; 179 QPointer<UIActionPool> m_pActionPool; 176 180 }; 177 181 #endif /* !FEQT_INCLUDED_SRC_medium_viso_UIVisoCreator_h */
Note:
See TracChangeset
for help on using the changeset viewer.