VirtualBox

Changeset 6370 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 17, 2008 4:40:09 PM (17 years ago)
Author:
vboxsync
Message:

2292: Remove license display from .deb:

Fixed the issue where "was no possibility to accept the license dialog" if there is enough space to feat whole the license text without scrollbars. For example, in case of maximization and running on high resolution displays with little system font.

File:
1 edited

Legend:

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

    r6173 r6370  
    564564
    565565        mLicenseText->setTextFormat (Qt::RichText);
    566         mAgreeButton->setEnabled (false);
    567         mDisagreeButton->setEnabled (false);
    568566
    569567        connect (mLicenseText->verticalScrollBar(), SIGNAL (valueChanged (int)),
     
    581579        buttonLayout->addWidget (mDisagreeButton);
    582580
     581        mLicenseText->verticalScrollBar()->installEventFilter (this);
     582
    583583        resize (600, 450);
    584584    }
     
    607607    {
    608608        if (aValue == mLicenseText->verticalScrollBar()->maxValue())
    609         {
    610             mAgreeButton->setEnabled (true);
    611             mDisagreeButton->setEnabled (true);
    612         }
     609            unlockButtons();
     610    }
     611
     612    void unlockButtons()
     613    {
     614        mAgreeButton->setEnabled (true);
     615        mDisagreeButton->setEnabled (true);
    613616    }
    614617
    615618private:
     619
     620    void showEvent (QShowEvent *aEvent)
     621    {
     622        QDialog::showEvent (aEvent);
     623        bool isScrollBarHidden = mLicenseText->verticalScrollBar()->isHidden()
     624                                 && !(windowState() & WindowMinimized);
     625        mAgreeButton->setEnabled (isScrollBarHidden);
     626        mDisagreeButton->setEnabled (isScrollBarHidden);
     627    }
     628
     629    bool eventFilter (QObject *aObject, QEvent *aEvent)
     630    {
     631        switch (aEvent->type())
     632        {
     633            case QEvent::Hide:
     634                if (aObject == mLicenseText->verticalScrollBar() &&
     635                    (windowState() & WindowActive))
     636                    unlockButtons();
     637            default:
     638                break;
     639        }
     640        return QDialog::eventFilter (aObject, aEvent);
     641    }
    616642
    617643    QString       mFilePath;
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