Changeset 67573 in vbox
- Timestamp:
- Jun 23, 2017 8:59:10 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116327
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp
r67017 r67573 32 32 # include "UIWindowMenuManager.h" 33 33 # endif /* VBOX_WS_MAC */ 34 # include "UIMessageCenter.h"35 34 # include "VBoxGlobal.h" 36 35 … … 69 68 , m_pButtonBox(0) 70 69 { 71 }72 73 void QIManagerDialog::closeEvent(QCloseEvent *pEvent)74 {75 /* Ignore the event itself: */76 pEvent->ignore();77 /* But tell the listener to close us: */78 emit sigClose();79 70 } 80 71 … … 100 91 resize(proposedSize); 101 92 102 /* Prepare dialog: */ 103 prepareDialog(); 93 /* Configure: */ 94 configure(); 95 104 96 /* Prepare central-widget: */ 105 97 prepareCentralWidget(); … … 110 102 prepareToolBar(); 111 103 #endif 104 105 /* Finalize: */ 106 finalize(); 112 107 113 108 /* Center according requested widget: */ … … 129 124 centralWidget()->layout()->setSpacing(10); 130 125 131 /* Prepare widget: */ 132 prepareWidget(); 126 /* Configure central-widget: */ 127 configureCentralWidget(); 128 133 129 /* Prepare button-box: */ 134 130 prepareButtonBox(); … … 144 140 { 145 141 /* Configure button-box: */ 146 m_pButtonBox->setStandardButtons(QDialogButtonBox:: Help |QDialogButtonBox::Close);142 m_pButtonBox->setStandardButtons(QDialogButtonBox::Reset | QDialogButtonBox::Save | QDialogButtonBox::Close); 147 143 m_pButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape); 148 connect(m_pButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog())); 144 m_pButtonBox->button(QDialogButtonBox::Reset)->hide(); 145 m_pButtonBox->button(QDialogButtonBox::Save)->hide(); 146 m_pButtonBox->button(QDialogButtonBox::Reset)->setEnabled(false); 147 m_pButtonBox->button(QDialogButtonBox::Save)->setEnabled(false); 149 148 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &QIManagerDialog::sigClose); 149 150 /* Configure button-box: */ 151 configureButtonBox(); 150 152 151 153 /* Add into layout: */ … … 192 194 } 193 195 196 void QIManagerDialog::closeEvent(QCloseEvent *pEvent) 197 { 198 /* Ignore the event itself: */ 199 pEvent->ignore(); 200 /* But tell the listener to close us: */ 201 emit sigClose(); 202 } 203 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.h
r67075 r67573 80 80 /** @name Prepare/cleanup cascade. 81 81 * @{ */ 82 /** Prepares dialog. */ 83 virtual void prepareDialog() {} 84 /** Prepares widget. */ 85 virtual void prepareWidget() {} 82 /** Prepares all. 83 * @note Normally you no need to reimplement it. */ 84 void prepare(); 85 /** Configures all. 86 * @note Injected into prepare(), reimplement to configure all there. */ 87 virtual void configure() {} 88 /** Prepares central-widget. 89 * @note Injected into prepare(), normally you no need to reimplement it. */ 90 void prepareCentralWidget(); 91 /** Configures central-widget. 92 * @note Injected into prepareCentralWidget(), reimplement to configure central-widget there. */ 93 virtual void configureCentralWidget() {} 94 /** Prepares button-box. 95 * @note Injected into prepareCentralWidget(), normally you no need to reimplement it. */ 96 void prepareButtonBox(); 97 /** Configures button-box. 98 * @note Injected into prepareButtonBox(), reimplement to configure button-box there. */ 99 virtual void configureButtonBox() {} 100 /** Prepares menu-bar. 101 * @note Injected into prepare(), normally you no need to reimplement it. */ 102 void prepareMenuBar(); 103 #ifdef VBOX_WS_MAC 104 /** Prepares toolbar. 105 * @note Injected into prepare(), normally you no need to reimplement it. */ 106 void prepareToolBar(); 107 #endif 108 /** Performs final preparations. 109 * @note Injected into prepare(), reimplement to postprocess all there. */ 110 virtual void finalize() {} 111 112 /** Cleanup menu-bar. 113 * @note Injected into cleanup(), normally you no need to reimplement it. */ 114 void cleanupMenuBar(); 115 /** Cleanups all. 116 * @note Normally you no need to reimplement it. */ 117 void cleanup(); 86 118 /** @} */ 87 119 … … 96 128 void setWidgetToolbar(UIToolBar *pWidgetToolbar) { m_pWidgetToolbar = pWidgetToolbar; } 97 129 #endif 130 131 /** Returns the widget. */ 132 virtual QWidget *widget() { return m_pWidget; } 133 /** Returns the button-box instance. */ 134 QIDialogButtonBox *buttonBox() { return m_pButtonBox; } 98 135 /** @} */ 99 136 … … 105 142 106 143 private: 107 108 /** @name Prepare/cleanup cascade.109 * @{ */110 /** Prepares all. */111 void prepare();112 /** Prepares central-widget. */113 void prepareCentralWidget();114 /** Prepares button-box. */115 void prepareButtonBox();116 /** Prepares menu-bar. */117 void prepareMenuBar();118 #ifdef VBOX_WS_MAC119 /** Prepares toolbar. */120 void prepareToolBar();121 #endif122 123 /** Cleanup menu-bar. */124 void cleanupMenuBar();125 /** Cleanups all. */126 void cleanup();127 /** @} */128 144 129 145 /** @name General stuff. -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp
r67452 r67573 1049 1049 } 1050 1050 1051 void UIHostNetworkManager:: prepareDialog()1051 void UIHostNetworkManager::configure() 1052 1052 { 1053 1053 /* Apply window icons: */ 1054 1054 setWindowIcon(UIIconPool::iconSetFull(":/host_iface_manager_32px.png", ":/host_iface_manager_16px.png")); 1055 1056 /* Apply language settings: */ 1057 retranslateUi(); 1058 } 1059 1060 void UIHostNetworkManager::prepareWidget() 1055 } 1056 1057 void UIHostNetworkManager::configureCentralWidget() 1061 1058 { 1062 1059 /* Create widget: */ … … 1075 1072 } 1076 1073 1074 void UIHostNetworkManager::finalize() 1075 { 1076 /* Apply language settings: */ 1077 retranslateUi(); 1078 } 1079 1080 UIHostNetworkManagerWidget *UIHostNetworkManager::widget() 1081 { 1082 return qobject_cast<UIHostNetworkManagerWidget*>(QIManagerDialog::widget()); 1083 } 1084 -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.h
r67251 r67573 197 197 /** @name Prepare/cleanup cascade. 198 198 * @{ */ 199 /** Prepares dialog. */ 200 void prepareDialog(); 201 /** Prepares widget. */ 202 void prepareWidget(); 199 /** Configures all. */ 200 virtual void configure() /* override */; 201 /** Configures central-widget. */ 202 virtual void configureCentralWidget() /* override */; 203 /** Perform final preparations. */ 204 virtual void finalize() /* override */; 205 /** @} */ 206 207 /** @name Widget stuff. 208 * @{ */ 209 /** Returns the widget. */ 210 virtual UIHostNetworkManagerWidget *widget() /* override */; 203 211 /** @} */ 204 212 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r67250 r67573 2299 2299 } 2300 2300 2301 void UIMediumManager:: prepareDialog()2301 void UIMediumManager::configure() 2302 2302 { 2303 2303 /* Apply window icons: */ 2304 2304 setWindowIcon(UIIconPool::iconSetFull(":/diskimage_32px.png", ":/diskimage_16px.png")); 2305 2306 /* Apply language settings: */ 2307 retranslateUi(); 2308 } 2309 2310 void UIMediumManager::prepareWidget() 2305 } 2306 2307 void UIMediumManager::configureCentralWidget() 2311 2308 { 2312 2309 /* Create widget: */ … … 2325 2322 } 2326 2323 2324 void UIMediumManager::finalize() 2325 { 2326 /* Apply language settings: */ 2327 retranslateUi(); 2328 } 2329 2330 UIMediumManagerWidget *UIMediumManager::widget() 2331 { 2332 return qobject_cast<UIMediumManagerWidget*>(QIManagerDialog::widget()); 2333 } 2334 2327 2335 #include "UIMediumManager.moc" 2328 2336 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r67250 r67573 357 357 /** @name Prepare/cleanup cascade. 358 358 * @{ */ 359 /** Prepares dialog. */ 360 void prepareDialog(); 361 /** Prepares widget. */ 362 void prepareWidget(); 359 /** Configures all. */ 360 virtual void configure() /* override */; 361 /** Configures central-widget. */ 362 virtual void configureCentralWidget() /* override */; 363 /** Perform final preparations. */ 364 virtual void finalize() /* override */; 365 /** @} */ 366 367 /** @name Widget stuff. 368 * @{ */ 369 /** Returns the widget. */ 370 virtual UIMediumManagerWidget *widget() /* override */; 363 371 /** @} */ 364 372
Note:
See TracChangeset
for help on using the changeset viewer.