- Timestamp:
- Jan 11, 2022 2:18:59 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.cpp
r93180 r93185 378 378 , m_comMachine(comMachine) 379 379 , m_pGuestSessionPanel(0) 380 , m_pWarningLabelContainer(0) 381 , m_pWarningLabel(0) 382 , m_pWarningIconLabel(0) 380 383 , m_fIsCurrent(false) 381 384 { … … 383 386 m_strTableName = m_comMachine.GetName(); 384 387 prepareToolbar(); 388 prepareWarningLabels(); 385 389 prepareGuestSessionPanel(); 386 390 prepareActionConnections(); … … 420 424 m_pLocationLabel->setText(UIFileManager::tr("Guest File System:")); 421 425 422 if (m_pWarningLabel )426 if (m_pWarningLabel && m_pWarningIconLabel) 423 427 { 424 428 QString strWarningText; … … 427 431 case State_InvalidMachineReference: 428 432 strWarningText = UIFileManager::tr("Machine reference is invalid."); 433 m_pWarningIconLabel->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical).pixmap(QSize(16, 16))); 429 434 break; 430 435 case State_MachineNotRunning: 431 436 strWarningText = UIFileManager::tr("File manager cannot work since the selected guest is not currenly running."); 437 m_pWarningIconLabel->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(16, 16))); 432 438 break; 433 439 case State_NoGuestAdditions: 434 440 strWarningText = UIFileManager::tr("File manager cannot work since the selected guest does not have the guest additions."); 441 m_pWarningIconLabel->setPixmap(QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(16, 16))); 435 442 break; 436 443 case State_SessionPossible: 444 strWarningText = UIFileManager::tr("Enter a valid user name and password to initiate the file manager."); 445 m_pWarningIconLabel->setPixmap(QApplication::style()->standardIcon(QStyle::SP_FileDialogInfoView).pixmap(QSize(16, 16))); 446 break; 437 447 default: 438 448 break; … … 440 450 m_pWarningLabel->setText(QString("<p>%1</p>").arg(strWarningText)); 441 451 } 442 452 if (m_pWarningIconLabel) 453 { 454 455 } 443 456 UIFileManagerTable::retranslateUi(); 444 457 } … … 1032 1045 m_pMainLayout->addWidget(m_pGuestSessionPanel, m_pMainLayout->rowCount(), 0, 1, m_pMainLayout->columnCount()); 1033 1046 m_pGuestSessionPanel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 1034 //sltHandleGuestSessionPanelShown();1035 1047 connect(m_pGuestSessionPanel, &UIGuestSessionCreateWidget::sigCreateSession, 1036 1048 this, &UIFileManagerGuestTable::sltCreateGuestSession); 1037 1049 connect(m_pGuestSessionPanel, &UIGuestSessionCreateWidget::sigCloseSession, 1038 1050 this, &UIFileManagerGuestTable::sltHandleCloseSessionRequest); 1039 // connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigHidePanel, 1040 // this, &UIFileManagerGuestTable::sltHandleGuestSessionPanelHidden); 1041 // connect(m_pGuestSessionPanel, &UIFileManagerGuestSessionPanel::sigShowPanel, 1042 // this, &UIFileManagerGuestTable::sltHandleGuestSessionPanelShown); 1051 } 1052 } 1053 } 1054 1055 void UIFileManagerGuestTable::prepareWarningLabels() 1056 { 1057 if (m_pMainLayout) 1058 { 1059 m_pWarningLabelContainer = new QWidget(this); 1060 QHBoxLayout *pContainerLayout = new QHBoxLayout(m_pWarningLabelContainer); 1061 m_pWarningLabelContainer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 1062 m_pMainLayout->addWidget(m_pWarningLabelContainer, m_pMainLayout->rowCount(), 0, 1, m_pMainLayout->columnCount()); 1063 1064 m_pWarningIconLabel = new QILabel(this); 1065 if (m_pWarningIconLabel) 1066 { 1067 pContainerLayout->addWidget(m_pWarningIconLabel); 1068 m_pWarningIconLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); 1069 } 1070 m_pWarningLabel = new QILabel(this); 1071 if (m_pWarningLabel) 1072 { 1073 pContainerLayout->addWidget(m_pWarningLabel); 1074 m_pWarningLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); 1075 m_pWarningLabel->setVisible(false); 1043 1076 } 1044 1077 } -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerGuestTable.h
r93180 r93185 135 135 void cleanupConsoleListener(); 136 136 void prepareGuestSessionPanel(); 137 void prepareWarningLabels(); 137 138 bool openGuestSession(const QString& strUserName, const QString& strPassword); 138 139 void closeGuestSession(); … … 158 159 CEventListener m_comConsoleListener; 159 160 UIGuestSessionCreateWidget *m_pGuestSessionPanel; 161 QWidget *m_pWarningLabelContainer; 162 QILabel *m_pWarningLabel; 163 QILabel *m_pWarningIconLabel; 160 164 /** True if this table is the current table in parents tab widget. */ 161 165 bool m_fIsCurrent; -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp
r93180 r93185 705 705 , m_pToolBar(0) 706 706 , m_pMainLayout(0) 707 , m_pWarningLabel(0)708 707 , m_pModel(0) 709 708 , m_pView(0) … … 813 812 m_sessionWidgets << m_pView; 814 813 } 815 m_pWarningLabel = new QILabel(this);816 if (m_pWarningLabel)817 {818 m_pMainLayout->addWidget(m_pWarningLabel, 2, 0, 5, 7);819 QFont labelFont = m_pWarningLabel->font();820 float fSizeMultiplier = 1.f;821 if (labelFont.pointSize() != -1)822 labelFont.setPointSize(fSizeMultiplier * labelFont.pointSize());823 else824 labelFont.setPixelSize(fSizeMultiplier * labelFont.pixelSize());825 labelFont.setBold(false);826 m_pWarningLabel->setFont(labelFont);827 m_pWarningLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);828 m_pWarningLabel->setWordWrap(true);829 }830 m_pWarningLabel->setVisible(false);831 814 832 815 m_pSearchLineEdit = new QILineEdit; … … 1471 1454 if (pEvent->type() == QEvent::EnabledChange) 1472 1455 { 1473 m_pWarningLabel->setVisible(!isEnabled());1474 1456 m_pView->setVisible(isEnabled()); 1475 1457 retranslateUi(); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.h
r93115 r93185 257 257 /** This name is appended to the log messages which are shown in the log panel. */ 258 258 QString m_strTableName; 259 QILabel *m_pWarningLabel;260 259 261 260 private slots:
Note:
See TracChangeset
for help on using the changeset viewer.