VirtualBox

Changeset 17125 in vbox for trunk


Ignore:
Timestamp:
Feb 25, 2009 1:02:54 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 3627: Shorten error dialogs: 1 - human readable part of API error moved to GUI warning text into the last paragraph, 2 - message dialog made non fixed in height only when details are shown.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/QIMessageBox.cpp

    r17108 r17125  
    217217    /* Now resize window to minimum possible size */
    218218    window()->resize (window()->minimumSizeHint());
     219
     220    /* Check if we have to make dialog fixed in height */
     221    bool makeFixedHeight = true;
     222    foreach (QIArrowButton *button, mButtonsList)
     223    {
     224        if (button->isExpanded())
     225        {
     226            makeFixedHeight = false;
     227            break;
     228        }
     229    }
     230    if (makeFixedHeight)
     231        window()->setMaximumHeight (window()->minimumSizeHint().height());
     232    else
     233        window()->setMaximumHeight (QWIDGETSIZE_MAX);
    219234}
    220235
     
    345360    mDetailsText = new QTextEdit();
    346361    {
    347         /* calculate the minimum size dynamically, approx. for 40 chars and
    348          * 6 lines */
     362        /* Calculate the minimum size dynamically, approx.
     363         * for 40 chars, 4 lines & 2 <table> margins */
    349364        QFontMetrics fm = mDetailsText->fontMetrics();
    350         mDetailsText->setMinimumSize (40 * fm.width ('m'), fm.lineSpacing() * 6);
     365        mDetailsText->setMinimumSize (fm.width ('m') * 40,
     366                                      fm.lineSpacing() * 4 + 4 * 2);
    351367    }
    352368    mDetailsText->setReadOnly (true);
     
    513529void QIMessageBox::setDetailsText (const QString &aText)
    514530{
    515     mDetailsText->setText (aText);
     531    QStringList parts (aText.split ("<!--EOM-->"));
     532    mTextLabel->setText (mTextLabel->text() + parts [0]);
     533    mDetailsText->setText (parts [1]);
    516534}
    517535
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r17084 r17125  
    23162316                                                HRESULT aWrapperRC /* = S_OK */)
    23172317{
     2318    /* Compose complex details string with internal <!--EOM--> delimiter to
     2319     * make it possible to split string into info & details parts which will
     2320     * be used separately in QIMessageBox */
    23182321    QString formatted;
    23192322
    23202323    if (!aInfo.text().isEmpty())
    2321         formatted += QString ("<table bgcolor=#FFFFFF border=0 cellspacing=0 "
    2322                               "cellpadding=0 width=100%>"
    2323                               "<tr><td><p>%1.</p></td></tr>"
    2324                               "</table><p></p>")
    2325                               .arg (VBoxGlobal::highlight (aInfo.text()));
     2324        formatted += QString ("<p>%1</p><!--EOM-->").arg (aInfo.text());
    23262325
    23272326    formatted += "<table bgcolor=#EEEEEE border=0 cellspacing=0 "
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