Changeset 40245 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 24, 2012 11:54:42 AM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.cpp
r40146 r40245 31 31 : QIWithRetranslateUI<QWizard>(pParent) 32 32 { 33 #if 0 // This is VERY important change, have to discuss first! 34 /* Qt have a bug-o-feature which silently fallbacks complex-wizard-style 35 * to more simple in case it failed to initialize that complex-wizard-style. 36 * Further wizard's look-n-feel may partially corresponds to both: 37 * complex-wizard-style and falled-back-one, we have to be sure which we are using. */ 38 setWizardStyle(wizardStyle()); 39 #endif 40 33 41 #ifdef Q_WS_MAC 34 42 /* I'm really not sure why there shouldn't be any default button on Mac OS … … 63 71 } 64 72 65 void QIWizard::resizeToGoldenRatio(double dRatio) 66 { 73 void QIWizard::resizeToGoldenRatio(UIWizardType wizardType) 74 { 75 /* Get corresponding ratio: */ 76 double dRatio = ratioForWizardType(wizardType); 77 67 78 /* Use some small (!) initial QIRichTextLabel width: */ 68 79 int iInitialLabelWidth = 200; … … 120 131 void QIWizard::assignWatermark(const QString &strWatermark) 121 132 { 122 if (wizardStyle() != QWizard::AeroStyle) 133 if (wizardStyle() != QWizard::AeroStyle 134 # ifdef Q_WS_WIN 135 /* There is a Qt bug about Windows7 do NOT match conditions for 'aero' wizard-style, 136 * so its silently fallbacks to 'modern' one without any notification, 137 * so QWizard::wizardStyle() returns QWizard::ModernStyle, while using aero, at least partially. */ 138 && QSysInfo::windowsVersion() != QSysInfo::WV_WINDOWS7 139 # endif /* Q_WS_WIN */ 140 ) 123 141 m_strWatermarkName = strWatermark; 124 142 } … … 129 147 } 130 148 #endif 149 150 void QIWizard::showEvent(QShowEvent *pShowEvent) 151 { 152 /* Resize to minimum possible size: */ 153 resize(0, 0); 154 155 /* Call to base-class: */ 156 QWizard::showEvent(pShowEvent); 157 } 131 158 132 159 void QIWizard::configurePage(QIWizardPage *pPage) … … 191 218 /* Resize it to minimum size: */ 192 219 resize(QSize(0, 0)); 220 } 221 222 double QIWizard::ratioForWizardType(UIWizardType wizardType) 223 { 224 /* Default value: */ 225 double dRatio = 1.6; 226 227 #ifdef Q_WS_WIN 228 switch (wizardStyle()) 229 { 230 case QWizard::ClassicStyle: 231 case QWizard::ModernStyle: 232 /* There is a Qt bug about Windows7 do NOT match conditions for 'aero' wizard-style, 233 * so its silently fallbacks to 'modern' one without any notification, 234 * so QWizard::wizardStyle() returns QWizard::ModernStyle, while using aero, at least partially. */ 235 if (QSysInfo::windowsVersion() != QSysInfo::WV_WINDOWS7) 236 { 237 dRatio = 2; 238 break; 239 } 240 case QWizard::AeroStyle: 241 dRatio = 2.2; 242 break; 243 default: 244 break; 245 } 246 #endif /* Q_WS_WIN */ 247 248 switch (wizardType) 249 { 250 /* New VM wizard much wider than others, fixing: */ 251 case UIWizardType_NewVM: 252 dRatio -= 0.5; 253 break; 254 /* New VD wizard much taller than others, fixing: */ 255 case UIWizardType_NewVD: 256 dRatio += 0.3; 257 break; 258 default: 259 break; 260 } 261 262 /* Return final result: */ 263 return dRatio; 193 264 } 194 265 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h
r40146 r40245 41 41 protected: 42 42 43 /* Wizard type: */ 44 enum UIWizardType 45 { 46 UIWizardType_NewVM, 47 UIWizardType_CloneVM, 48 UIWizardType_ExportAppliance, 49 UIWizardType_ImportAppliance, 50 UIWizardType_FirstRun, 51 UIWizardType_NewVD 52 }; 53 43 54 /* Page related methods: */ 44 55 int addPage(QIWizardPage *pPage); … … 49 60 50 61 /* Adjusting stuff: */ 51 void resizeToGoldenRatio( double dRatio = 1.6);62 void resizeToGoldenRatio(UIWizardType wizardType); 52 63 53 64 /* Design stuff: */ … … 58 69 #endif 59 70 71 /* Show event: */ 72 void showEvent(QShowEvent *pShowEvent); 73 60 74 private: 61 75 … … 63 77 void configurePage(QIWizardPage *pPage); 64 78 void resizeAccordingLabelWidth(int iLabelWidth); 79 double ratioForWizardType(UIWizardType wizardType); 65 80 #ifndef Q_WS_MAC 66 81 int proposedWatermarkHeight(); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.ui
r38384 r40245 50 50 <item> 51 51 <widget class="QWidget" name="m_pWarningWidget" native="true"> 52 <property name="visible"> 53 <bool>false</bool> 54 </property> 52 55 <property name="sizePolicy"> 53 <sizepolicy hsizetype="Preferred" vsizetype=" Maximum">56 <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> 54 57 <horstretch>0</horstretch> 55 58 <verstretch>0</verstretch> … … 72 75 <size> 73 76 <width>16777215</width> 74 <height> 107</height>77 <height>50</height> 75 78 </size> 76 79 </property> -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.cpp
r40142 r40245 61 61 62 62 /* Resize wizard to 'golden ratio': */ 63 resizeToGoldenRatio( );63 resizeToGoldenRatio(UIWizardType_CloneVM); 64 64 } 65 65 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp
r40146 r40245 77 77 78 78 /* Resize to 'golden ratio' */ 79 resizeToGoldenRatio( 1.8);79 resizeToGoldenRatio(UIWizardType_ExportAppliance); 80 80 81 81 /* Setup connections */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp
r40142 r40245 58 58 59 59 /* Resize to 'golden ratio' */ 60 resizeToGoldenRatio( );60 resizeToGoldenRatio(UIWizardType_FirstRun); 61 61 } 62 62 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.cpp
r40146 r40245 132 132 133 133 /* Resize to 'golden ratio' */ 134 resizeToGoldenRatio( 1.8);134 resizeToGoldenRatio(UIWizardType_ImportAppliance); 135 135 136 136 /* Configure 'Restore Defaults' button */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp
r40146 r40245 218 218 219 219 /* Resize wizard to 'golden ratio': */ 220 resizeToGoldenRatio( 1.8);220 resizeToGoldenRatio(UIWizardType_NewVD); 221 221 } 222 222 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r40156 r40245 163 163 164 164 /* Resize to 'golden ratio' */ 165 resizeToGoldenRatio( 1.2);165 resizeToGoldenRatio(UIWizardType_NewVM); 166 166 } 167 167
Note:
See TracChangeset
for help on using the changeset viewer.