VirtualBox

Changeset 75673 in vbox


Ignore:
Timestamp:
Nov 22, 2018 3:56:42 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Show some warning text in guest file pane when a guest session is not avaible

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

Legend:

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

    r75662 r75673  
    148148
    149149    QCheckBox *m_pAskNextTimeCheckBox;
    150     QLabel    *m_pQuestionLabel;
     150    QILabel   *m_pQuestionLabel;
    151151
    152152};
     
    636636    QVBoxLayout *pLayout = new QVBoxLayout(this);
    637637
    638     m_pQuestionLabel = new QLabel;
     638    m_pQuestionLabel = new QILabel;
    639639    if (m_pQuestionLabel)
    640640    {
     
    691691    , m_pMainLayout(0)
    692692    , m_pLocationComboBox(0)
     693    , m_pWarningLabel(0)
    693694{
    694695    prepareObjects();
     
    782783
    783784    }
     785    m_pWarningLabel = new QILabel(this);
     786    if (m_pWarningLabel)
     787    {
     788        m_pMainLayout->addWidget(m_pWarningLabel, 2, 0, 5, 5);
     789        m_pWarningLabel->setStyleSheet("font: 24pt;");
     790        m_pWarningLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
     791    }
     792    m_pWarningLabel->setVisible(!isEnabled());
     793    m_pView->setVisible(isEnabled());
     794
    784795    m_pSearchLineEdit = new QILineEdit;
    785796    if (m_pSearchLineEdit)
     
    12581269        m_pRootItem->setData(UIGuestControlFileManager::tr("Permissions"), UIGuestControlFileModelColumn_Permissions);
    12591270    }
     1271    if (m_pWarningLabel)
     1272        m_pWarningLabel->setText(UIGuestControlFileManager::tr("No Guest Session"));
    12601273}
    12611274
     
    14001413}
    14011414
     1415bool UIGuestControlFileTable::event(QEvent *pEvent)
     1416{
     1417    if (pEvent->type() == QEvent::EnabledChange)
     1418    {
     1419        m_pWarningLabel->setVisible(!isEnabled());
     1420        m_pView->setVisible(isEnabled());
     1421    }
     1422    return QIWithRetranslateUI<QWidget>::event(pEvent);
     1423}
     1424
     1425
    14021426QString UIGuestControlFileTable::fileTypeString(FileObjectType type)
    14031427{
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileTable.h

    r75643 r75673  
    307307    virtual void     prepareToolbar() = 0;
    308308    virtual void     createFileViewContextMenu(const QWidget *pWidget, const QPoint &point) = 0;
     309    virtual bool     event(QEvent *pEvent) /* override */;
    309310    QString          fileTypeString(FileObjectType type);
    310311    /* @p item index is item location in model not in 'proxy' model */
     
    378379    QStringList      m_copyCutBuffer;
    379380    QILineEdit      *m_pSearchLineEdit;
    380     friend class    UIGuestControlFileModel;
     381    QILabel         *m_pWarningLabel;
     382    friend class     UIGuestControlFileModel;
    381383};
    382384
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