VirtualBox

Ignore:
Timestamp:
Feb 24, 2012 11:54:42 AM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 6073: Switch VirtualBox wizards into new QIRichTextLabel: Windows cumulative patch.

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  
    3131    : QIWithRetranslateUI<QWizard>(pParent)
    3232{
     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
    3341#ifdef Q_WS_MAC
    3442    /* I'm really not sure why there shouldn't be any default button on Mac OS
     
    6371}
    6472
    65 void QIWizard::resizeToGoldenRatio(double dRatio)
    66 {
     73void QIWizard::resizeToGoldenRatio(UIWizardType wizardType)
     74{
     75    /* Get corresponding ratio: */
     76    double dRatio = ratioForWizardType(wizardType);
     77
    6778    /* Use some small (!) initial QIRichTextLabel width: */
    6879    int iInitialLabelWidth = 200;
     
    120131void QIWizard::assignWatermark(const QString &strWatermark)
    121132{
    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        )
    123141        m_strWatermarkName = strWatermark;
    124142}
     
    129147}
    130148#endif
     149
     150void 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}
    131158
    132159void QIWizard::configurePage(QIWizardPage *pPage)
     
    191218    /* Resize it to minimum size: */
    192219    resize(QSize(0, 0));
     220}
     221
     222double 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;
    193264}
    194265
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h

    r40146 r40245  
    4141protected:
    4242
     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
    4354    /* Page related methods: */
    4455    int addPage(QIWizardPage *pPage);
     
    4960
    5061    /* Adjusting stuff: */
    51     void resizeToGoldenRatio(double dRatio = 1.6);
     62    void resizeToGoldenRatio(UIWizardType wizardType);
    5263
    5364    /* Design stuff: */
     
    5869#endif
    5970
     71    /* Show event: */
     72    void showEvent(QShowEvent *pShowEvent);
     73
    6074private:
    6175
     
    6377    void configurePage(QIWizardPage *pPage);
    6478    void resizeAccordingLabelWidth(int iLabelWidth);
     79    double ratioForWizardType(UIWizardType wizardType);
    6580#ifndef Q_WS_MAC
    6681    int proposedWatermarkHeight();
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.ui

    r38384 r40245  
    5050   <item>
    5151    <widget class="QWidget" name="m_pWarningWidget" native="true">
     52     <property name="visible">
     53      <bool>false</bool>
     54     </property>
    5255     <property name="sizePolicy">
    53       <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
     56      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
    5457       <horstretch>0</horstretch>
    5558       <verstretch>0</verstretch>
     
    7275         <size>
    7376          <width>16777215</width>
    74           <height>107</height>
     77          <height>50</height>
    7578         </size>
    7679        </property>
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UICloneVMWizard.cpp

    r40142 r40245  
    6161
    6262    /* Resize wizard to 'golden ratio': */
    63     resizeToGoldenRatio();
     63    resizeToGoldenRatio(UIWizardType_CloneVM);
    6464}
    6565
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp

    r40146 r40245  
    7777
    7878    /* Resize to 'golden ratio' */
    79     resizeToGoldenRatio(1.8);
     79    resizeToGoldenRatio(UIWizardType_ExportAppliance);
    8080
    8181    /* Setup connections */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp

    r40142 r40245  
    5858
    5959    /* Resize to 'golden ratio' */
    60     resizeToGoldenRatio();
     60    resizeToGoldenRatio(UIWizardType_FirstRun);
    6161}
    6262
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIImportApplianceWzd.cpp

    r40146 r40245  
    132132
    133133    /* Resize to 'golden ratio' */
    134     resizeToGoldenRatio(1.8);
     134    resizeToGoldenRatio(UIWizardType_ImportAppliance);
    135135
    136136    /* Configure 'Restore Defaults' button */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp

    r40146 r40245  
    218218
    219219    /* Resize wizard to 'golden ratio': */
    220     resizeToGoldenRatio(1.8);
     220    resizeToGoldenRatio(UIWizardType_NewVD);
    221221}
    222222
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r40156 r40245  
    163163
    164164    /* Resize to 'golden ratio' */
    165     resizeToGoldenRatio(1.2);
     165    resizeToGoldenRatio(UIWizardType_NewVM);
    166166}
    167167
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette