Changeset 71133 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 27, 2018 10:13:17 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121019
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r71105 r71133 378 378 src/runtime/information/guestctrl/UIGuestControlConsole.h \ 379 379 src/runtime/information/guestctrl/UIGuestControlFileManager.h \ 380 src/runtime/information/guestctrl/UIGuestControlFileTree.h \ 380 381 src/runtime/information/guestctrl/UIGuestControlInterface.h \ 381 382 src/runtime/information/guestctrl/UIGuestControlTreeItem.h \ … … 567 568 src/runtime/UIStatusBarEditorWindow.cpp \ 568 569 src/runtime/information/guestctrl/UIGuestControlFileManager.cpp \ 570 src/runtime/information/guestctrl/UIGuestControlFileTree.cpp \ 569 571 src/runtime/information/guestctrl/UIGuestControlWidget.cpp \ 570 572 src/selector/UIActionPoolSelector.cpp \ … … 710 712 src/runtime/information/guestctrl/UIGuestControlConsole.cpp \ 711 713 src/runtime/information/guestctrl/UIGuestControlFileManager.cpp \ 714 src/runtime/information/guestctrl/UIGuestControlFileTree.cpp \ 712 715 src/runtime/information/guestctrl/UIGuestControlInterface.cpp \ 713 716 src/runtime/information/guestctrl/UIGuestControlTreeItem.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.cpp
r71105 r71133 21 21 22 22 /* Qt includes: */ 23 # include <QAbstractItemModel> 24 # include <QHBoxLayout> 25 # include <QPlainTextEdit> 26 # include <QPushButton> 23 27 # include <QSplitter> 24 # include <QHBoxLayout>25 28 # include <QVBoxLayout> 26 29 … … 28 31 # include "QILabel.h" 29 32 # include "QILineEdit.h" 30 # include "QIToolButton.h"31 33 # include "QIWithRetranslateUI.h" 34 # include "UIExtraDataManager.h" 32 35 # include "UIGuestControlFileManager.h" 36 # include "UIGuestControlFileTree.h" 33 37 # include "UIVMInformationDialog.h" 34 38 # include "VBoxGlobal.h" … … 36 40 /* COM includes: */ 37 41 # include "CGuest.h" 42 # include "CGuestDirectory.h" 43 # include "CGuestSessionStateChangedEvent.h" 38 44 39 45 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 40 46 47 41 48 class UIGuestSessionCreateWidget : public QIWithRetranslateUI<QWidget> 42 49 { 43 50 Q_OBJECT; 44 51 52 signals: 53 54 void sigCreateSession(QString strUserName, QString strPassword); 55 void sigCloseButtonClick(); 56 45 57 public: 46 58 47 59 UIGuestSessionCreateWidget(QWidget *pParent = 0); 60 void switchSessionCreateMode(); 61 void switchSessionCloseMode(); 48 62 49 63 protected: 50 64 51 65 void retranslateUi(); 66 67 private slots: 68 69 void sltCreateButtonClick(); 52 70 53 71 private: … … 58 76 QILabel *m_pUserNameLabel; 59 77 QILabel *m_pPasswordLabel; 60 QIToolButton *m_pCreateButton; 78 QPushButton *m_pCreateButton; 79 QPushButton *m_pCloseButton; 61 80 62 81 QHBoxLayout *m_pMainLayout; 63 82 64 83 }; 84 85 86 87 /********************************************************************************************************************************* 88 * UIGuestSessionCreateWidget implementation. * 89 *********************************************************************************************************************************/ 65 90 66 91 UIGuestSessionCreateWidget::UIGuestSessionCreateWidget(QWidget *pParent /* = 0 */) … … 71 96 , m_pPasswordLabel(0) 72 97 , m_pCreateButton(0) 98 , m_pCloseButton(0) 73 99 , m_pMainLayout(0) 74 100 { … … 103 129 } 104 130 105 m_pCreateButton = new Q IToolButton;131 m_pCreateButton = new QPushButton; 106 132 if (m_pCreateButton) 107 133 { 108 134 m_pMainLayout->addWidget(m_pCreateButton); 109 } 135 connect(m_pCreateButton, &QPushButton::clicked, this, &UIGuestSessionCreateWidget::sltCreateButtonClick); 136 } 137 138 m_pCloseButton = new QPushButton; 139 if (m_pCloseButton) 140 { 141 m_pMainLayout->addWidget(m_pCloseButton); 142 connect(m_pCloseButton, &QPushButton::clicked, this, &UIGuestSessionCreateWidget::sigCloseButtonClick); 143 } 144 110 145 retranslateUi(); 146 } 147 148 void UIGuestSessionCreateWidget::sltCreateButtonClick() 149 { 150 if(m_pUserNameEdit && m_pPasswordEdit) 151 emit sigCreateSession(m_pUserNameEdit->text(), m_pPasswordEdit->text()); 111 152 } 112 153 … … 132 173 } 133 174 if(m_pCreateButton) 134 {135 175 m_pCreateButton->setText(UIVMInformationDialog::tr("Create Session")); 136 } 137 } 176 if(m_pCloseButton) 177 m_pCloseButton->setText(UIVMInformationDialog::tr("Close Session")); 178 179 } 180 181 void UIGuestSessionCreateWidget::switchSessionCreateMode() 182 { 183 m_pUserNameEdit->setEnabled(true); 184 m_pPasswordEdit->setEnabled(true); 185 m_pUserNameLabel->setEnabled(true); 186 m_pPasswordLabel->setEnabled(true); 187 m_pCreateButton->setEnabled(true); 188 m_pCloseButton->setEnabled(false); 189 } 190 191 void UIGuestSessionCreateWidget::switchSessionCloseMode() 192 { 193 m_pUserNameEdit->setEnabled(false); 194 m_pPasswordEdit->setEnabled(false); 195 m_pUserNameLabel->setEnabled(false); 196 m_pPasswordLabel->setEnabled(false); 197 m_pCreateButton->setEnabled(false); 198 m_pCloseButton->setEnabled(true); 199 } 200 201 202 /********************************************************************************************************************************* 203 * UIGuestControlFileManager implementation. * 204 *********************************************************************************************************************************/ 138 205 139 206 UIGuestControlFileManager::UIGuestControlFileManager(QWidget *pParent, const CGuest &comGuest) … … 143 210 , m_pSplitter(0) 144 211 , m_pSessionCreateWidget(0) 145 { 212 , m_pLogOutput(0) 213 , m_pGuestFileTree(0) 214 { 215 prepareGuestListener(); 146 216 prepareObjects(); 147 217 prepareConnections(); 218 } 219 220 UIGuestControlFileManager::~UIGuestControlFileManager() 221 { 222 if(m_comGuest.isOk() && m_pQtGuestListener && m_comGuestListener.isOk()) 223 cleanupListener(m_pQtGuestListener, m_comGuestListener, m_comGuest.GetEventSource()); 224 if(m_comGuestSession.isOk() && m_pQtSessionListener && m_comSessionListener.isOk()) 225 cleanupListener(m_pQtSessionListener, m_comSessionListener, m_comGuestSession.GetEventSource()); 226 } 227 228 void UIGuestControlFileManager::prepareGuestListener() 229 { 230 if(m_comGuest.isOk()) 231 { 232 QVector<KVBoxEventType> eventTypes; 233 eventTypes << KVBoxEventType_OnGuestSessionRegistered; 234 235 prepareListener(m_pQtGuestListener, m_comGuestListener, 236 m_comGuest.GetEventSource(), eventTypes); 237 } 148 238 } 149 239 … … 158 248 m_pMainLayout->setSpacing(0); 159 249 160 m_pSplitter = new QSplitter;161 162 if (!m_pSplitter)163 return;164 250 165 251 m_pSessionCreateWidget = new UIGuestSessionCreateWidget(); 166 252 if (m_pSessionCreateWidget) 167 253 { 168 m_pSplitter->addWidget(m_pSessionCreateWidget); 169 } 170 171 m_pSplitter->setOrientation(Qt::Vertical); 172 m_pMainLayout->addWidget(m_pSplitter); 173 254 m_pMainLayout->addWidget(m_pSessionCreateWidget, 0, Qt::AlignTop); 255 } 256 257 m_pSplitter = new QSplitter; 258 if (m_pSplitter) 259 { 260 m_pMainLayout->addWidget(m_pSplitter); 261 m_pSplitter->setOrientation(Qt::Vertical); 262 } 263 264 m_pGuestFileTree = new UIGuestControlFileTree; 265 if (m_pGuestFileTree) 266 { 267 m_pSplitter->addWidget(m_pGuestFileTree); 268 } 269 270 m_pLogOutput = new QPlainTextEdit; 271 if (m_pLogOutput) 272 { 273 m_pLogOutput->setReadOnly(true); 274 m_pMainLayout->addWidget(m_pLogOutput, 0, Qt::AlignBottom); 275 } 174 276 175 277 // m_pSplitter->setStretchFactor(0, 9); … … 179 281 void UIGuestControlFileManager::prepareConnections() 180 282 { 181 283 if (m_pQtGuestListener) 284 { 285 connect(m_pQtGuestListener->getWrapped(), &UIMainEventListener::sigGuestSessionUnregistered, 286 this, &UIGuestControlFileManager::sltGuestSessionUnregistered, Qt::DirectConnection); 287 } 288 if(m_pSessionCreateWidget) 289 { 290 connect(m_pSessionCreateWidget, &UIGuestSessionCreateWidget::sigCreateSession, 291 this, &UIGuestControlFileManager::sltCreateSession); 292 connect(m_pSessionCreateWidget, &UIGuestSessionCreateWidget::sigCloseButtonClick, 293 this, &UIGuestControlFileManager::sltCloseSession); 294 } 295 } 296 297 void UIGuestControlFileManager::sltGuestSessionUnregistered(CGuestSession guestSession) 298 { 299 if (!guestSession.isOk()) 300 return; 301 if(guestSession == m_comGuestSession && m_comGuestSession.isOk()) 302 m_comGuestSession.detach(); 303 if (m_pSessionCreateWidget) 304 m_pSessionCreateWidget->switchSessionCreateMode(); 305 } 306 307 void UIGuestControlFileManager::sltCreateSession(QString strUserName, QString strPassword) 308 { 309 if(strUserName.isEmpty()) 310 { 311 m_pLogOutput->appendPlainText("No user name is given"); 312 return; 313 } 314 createSession(strUserName, strPassword); 315 } 316 317 void UIGuestControlFileManager::sltCloseSession() 318 { 319 // if (!m_comGuestSession.isOk()) 320 // { 321 // m_pLogOutput->appendPlainText("Guest session is not valid"); 322 // return; 323 // } 324 // m_pLogOutput->appendPlainText("Guest session is closed"); 325 326 if(m_comGuestSession.isOk() && m_pQtSessionListener && m_comSessionListener.isOk()) 327 cleanupListener(m_pQtSessionListener, m_comSessionListener, m_comGuestSession.GetEventSource()); 328 329 m_comGuestSession.Close(); 330 if(m_pSessionCreateWidget) 331 m_pSessionCreateWidget->switchSessionCreateMode(); 332 } 333 334 void UIGuestControlFileManager::sltGuestSessionStateChanged(const CGuestSessionStateChangedEvent &cEvent) 335 { 336 //if (cEvent.isOk() && m_comGuestSession.isOk())// && m_comGuestProcess.GetStatus() == KProcessStatus_Error) 337 { 338 CVirtualBoxErrorInfo cErrorInfo = cEvent.GetError(); 339 if (cErrorInfo.isOk())// && cErrorInfo.GetResultCode() != S_OK) 340 { 341 // /* For some reason I am yet to find this emit is not working. 342 // Thus we are calling the parent's function directly: */ 343 // //emit sigGuestProcessErrorText(cErrorInfo.GetText()); 344 // UIGuestSessionTreeItem *sessionParent = dynamic_cast<UIGuestSessionTreeItem*>(QTreeWidgetItem::parent()); 345 // if (sessionParent) 346 // { 347 // sessionParent->errorString(cErrorInfo.GetText().toStdString().c_str()); 348 // } 349 m_pLogOutput->appendPlainText(cErrorInfo.GetText()); 350 } 351 } 352 353 if (m_comGuestSession.GetStatus() == KGuestSessionStatus_Started) 354 { 355 356 // printf("/lk %d c:/users %d\n", m_comGuestSession.DirectoryExists("/lk", true), 357 // m_comGuestSession.DirectoryExists("c:/users", true)); 358 QVector<KDirectoryOpenFlag> flag; 359 flag.push_back(KDirectoryOpenFlag_None); 360 CGuestDirectory directory = m_comGuestSession.DirectoryOpen("c:/", "*", flag); 361 if(directory.isOk()) 362 { 363 m_pLogOutput->appendPlainText("Current Directory"); 364 m_pLogOutput->appendPlainText(directory.GetDirectoryName()); 365 } 366 } 367 368 } 369 370 371 bool UIGuestControlFileManager::createSession(const QString& strUserName, const QString& strPassword, 372 const QString& strDomain /* not used currently */) 373 { 374 if (!m_comGuest.isOk()) 375 return false; 376 m_comGuestSession = m_comGuest.CreateSession(strUserName, strPassword, 377 strDomain, "File Manager Session"); 378 379 if (!m_comGuestSession.isOk()) 380 { 381 m_pLogOutput->appendPlainText("Guest session could not be created"); 382 return false; 383 } 384 385 m_pLogOutput->appendPlainText("Guest session has been created"); 386 if(m_pSessionCreateWidget) 387 m_pSessionCreateWidget->switchSessionCloseMode(); 388 389 /* Prepare session listener */ 390 QVector<KVBoxEventType> eventTypes; 391 eventTypes << KVBoxEventType_OnGuestSessionStateChanged; 392 //<< KVBoxEventType_OnGuestProcessRegistered; 393 prepareListener(m_pQtSessionListener, m_comSessionListener, 394 m_comGuestSession.GetEventSource(), eventTypes); 395 396 /* Connect to session listener */ 397 qRegisterMetaType<CGuestSessionStateChangedEvent>(); 398 399 400 connect(m_pQtSessionListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged, 401 this, &UIGuestControlFileManager::sltGuestSessionStateChanged); 402 // /* Wait session to start: */ 403 // const ULONG waitTimeout = 2000; 404 // KGuestSessionWaitResult waitResult = guestSession.WaitFor(KGuestSessionWaitForFlag_Start, waitTimeout); 405 // if (waitResult != KGuestSessionWaitResult_Start) 406 // return false; 407 408 // outSession = guestSession; 409 410 return true; 411 } 412 413 void UIGuestControlFileManager::prepareListener(ComObjPtr<UIMainEventListenerImpl> &QtListener, 414 CEventListener &comEventListener, 415 CEventSource comEventSource, QVector<KVBoxEventType>& eventTypes) 416 { 417 if (!comEventSource.isOk()) 418 return; 419 /* Create event listener instance: */ 420 QtListener.createObject(); 421 QtListener->init(new UIMainEventListener, this); 422 comEventListener = CEventListener(QtListener); 423 424 /* Register event listener for CProgress event source: */ 425 comEventSource.RegisterListener(comEventListener, eventTypes, 426 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 427 428 /* If event listener registered as passive one: */ 429 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 430 { 431 /* Register event sources in their listeners as well: */ 432 QtListener->getWrapped()->registerSource(comEventSource, comEventListener); 433 } 434 } 435 436 void UIGuestControlFileManager::cleanupListener(ComObjPtr<UIMainEventListenerImpl> &QtListener, 437 CEventListener &comEventListener, 438 CEventSource comEventSource) 439 { 440 if (!comEventSource.isOk()) 441 return; 442 /* If event listener registered as passive one: */ 443 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 444 { 445 /* Unregister everything: */ 446 QtListener->getWrapped()->unregisterSources(); 447 } 448 449 /* Make sure VBoxSVC is available: */ 450 if (!vboxGlobal().isVBoxSVCAvailable()) 451 return; 452 453 /* Unregister event listener for CProgress event source: */ 454 comEventSource.UnregisterListener(comEventListener); 182 455 } 183 456 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileManager.h
r71105 r71133 24 24 /* COM includes: */ 25 25 #include "COMEnums.h" 26 #include "CEventListener.h" 27 #include "CEventSource.h" 26 28 #include "CGuest.h" 29 #include "CGuestSession.h" 30 31 /* GUI includes: */ 32 #include "UIMainEventListener.h" 27 33 28 34 /* Forward declarations: */ 35 class CGuestSessionStateChangedEvent; 36 class QITreeView; 37 class QPlainTextEdit; 29 38 class QVBoxLayout; 30 39 class QSplitter; 31 40 class UIFileListModel; 41 class UIGuestControlFileTree; 42 class UIGuestSessionCreateWidget; 32 43 33 44 /** QWidget extension … … 40 51 41 52 UIGuestControlFileManager(QWidget *pParent, const CGuest &comGuest); 53 ~UIGuestControlFileManager(); 54 55 private slots: 56 57 void sltGuestSessionUnregistered(CGuestSession guestSession); 58 void sltCreateSession(QString strUserName, QString strPassword); 59 void sltCloseSession(); 60 void sltGuestSessionStateChanged(const CGuestSessionStateChangedEvent &cEvent); 42 61 43 62 private: 44 63 45 64 void prepareObjects(); 65 void prepareGuestListener(); 46 66 void prepareConnections(); 67 bool createSession(const QString& strUserName, const QString& strPassword, 68 const QString& strDomain = QString() /* not used currently */); 47 69 48 CGuest m_comGuest; 49 QVBoxLayout *m_pMainLayout; 50 QSplitter *m_pSplitter; 51 QWidget *m_pSessionCreateWidget; 70 void prepareListener(ComObjPtr<UIMainEventListenerImpl> &Qtistener, 71 CEventListener &comEventListener, 72 CEventSource comEventSource, QVector<KVBoxEventType>& eventTypes); 73 74 void cleanupListener(ComObjPtr<UIMainEventListenerImpl> &QtListener, 75 CEventListener &comEventListener, 76 CEventSource comEventSource); 77 78 CGuest m_comGuest; 79 CGuestSession m_comGuestSession; 80 81 QVBoxLayout *m_pMainLayout; 82 QSplitter *m_pSplitter; 83 UIGuestSessionCreateWidget *m_pSessionCreateWidget; 84 QPlainTextEdit *m_pLogOutput; 85 UIGuestControlFileTree* m_pGuestFileTree; 86 87 ComObjPtr<UIMainEventListenerImpl> m_pQtGuestListener; 88 CEventListener m_comGuestListener; 89 90 ComObjPtr<UIMainEventListenerImpl> m_pQtSessionListener; 91 CEventListener m_comSessionListener; 92 52 93 }; 53 94 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileTree.cpp
r71105 r71133 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIGuestControlFile Managerclass implementation.3 * VBox Qt GUI - UIGuestControlFileTree class implementation. 4 4 */ 5 5 … … 21 21 22 22 /* Qt includes: */ 23 # include <QSplitter> 24 # include <QHBoxLayout> 25 # include <QVBoxLayout> 23 // # include <QAbstractItemModel> 24 // # include <QHBoxLayout> 25 // # include <QPlainTextEdit> 26 // # include <QPushButton> 27 // # include <QSplitter> 28 // # include <QVBoxLayout> 26 29 27 30 /* GUI includes: */ 28 # include "QILabel.h"29 # include "QILineEdit.h"30 # include "QIToolButton.h"31 # include "QIWithRetranslateUI.h"32 # include "UIGuestControlFile Manager.h"33 # include "UIVMInformationDialog.h"34 # include "VBoxGlobal.h"31 // # include "QILabel.h" 32 // # include "QILineEdit.h" 33 // # include "QIWithRetranslateUI.h" 34 // # include "UIExtraDataManager.h" 35 # include "UIGuestControlFileTree.h" 36 // # include "UIVMInformationDialog.h" 37 // # include "VBoxGlobal.h" 35 38 36 39 /* COM includes: */ 37 # include "CGuest.h" 40 // # include "CGuest.h" 41 // # include "CGuestSessionStateChangedEvent.h" 38 42 39 43 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 40 44 41 class UIGuest SessionCreateWidget : public QIWithRetranslateUI<QWidget>45 class UIGuestControlFileTreeItem : public QITreeWidgetItem 42 46 { 43 47 Q_OBJECT; 44 48 45 49 public: 46 47 UIGuestSessionCreateWidget(QWidget *pParent = 0); 48 49 protected: 50 51 void retranslateUi(); 52 53 private: 54 void prepareWidgets(); 55 QILineEdit *m_pUserNameEdit; 56 QILineEdit *m_pPasswordEdit; 57 58 QILabel *m_pUserNameLabel; 59 QILabel *m_pPasswordLabel; 60 QIToolButton *m_pCreateButton; 61 62 QHBoxLayout *m_pMainLayout; 50 UIGuestControlFileTreeItem(UIGuestControlFileTree *pTreeWidget, const QStringList &strings = QStringList()); 51 UIGuestControlFileTreeItem(UIGuestControlFileTreeItem *pTreeWidgetItem, const QStringList &strings = QStringList()); 52 virtual ~UIGuestControlFileTreeItem(); 63 53 64 54 }; 65 55 66 UIGuestSessionCreateWidget::UIGuestSessionCreateWidget(QWidget *pParent /* = 0 */) 67 : QIWithRetranslateUI<QWidget>(pParent) 68 , m_pUserNameEdit(0) 69 , m_pPasswordEdit(0) 70 , m_pUserNameLabel(0) 71 , m_pPasswordLabel(0) 72 , m_pCreateButton(0) 73 , m_pMainLayout(0) 56 UIGuestControlFileTreeItem::UIGuestControlFileTreeItem(UIGuestControlFileTree *pTreeWidget, const QStringList &strings /* = QStringList() */) 57 :QITreeWidgetItem(pTreeWidget, strings) 58 74 59 { 75 prepareWidgets(); 60 } 61 UIGuestControlFileTreeItem::UIGuestControlFileTreeItem(UIGuestControlFileTreeItem *pTreeWidgetItem, const QStringList &strings /*= QStringList() */) 62 :QITreeWidgetItem(pTreeWidgetItem, strings) 63 { 76 64 } 77 65 78 void UIGuestSessionCreateWidget::prepareWidgets() 79 { 80 m_pMainLayout = new QHBoxLayout(this); 81 if (!m_pMainLayout) 82 return; 83 m_pUserNameEdit = new QILineEdit; 84 if (m_pUserNameEdit) 85 { 86 m_pMainLayout->addWidget(m_pUserNameEdit); 87 } 88 m_pUserNameLabel = new QILabel; 89 if (m_pUserNameLabel) 90 { 91 m_pMainLayout->addWidget(m_pUserNameLabel); 92 } 93 m_pPasswordEdit = new QILineEdit; 94 if (m_pPasswordEdit) 95 { 96 m_pMainLayout->addWidget(m_pPasswordEdit); 97 } 66 UIGuestControlFileTreeItem::~UIGuestControlFileTreeItem(){} 98 67 99 m_pPasswordLabel = new QILabel; 100 if (m_pPasswordLabel) 101 { 102 m_pMainLayout->addWidget(m_pPasswordLabel); 103 } 104 105 m_pCreateButton = new QIToolButton; 106 if (m_pCreateButton) 107 { 108 m_pMainLayout->addWidget(m_pCreateButton); 109 } 110 retranslateUi(); 111 } 112 113 void UIGuestSessionCreateWidget::retranslateUi() 114 { 115 if (m_pUserNameEdit) 116 { 117 m_pUserNameEdit->setToolTip(UIVMInformationDialog::tr("User name to authenticate session creation")); 118 } 119 if (m_pPasswordEdit) 120 { 121 m_pPasswordEdit->setToolTip(UIVMInformationDialog::tr("Password to authenticate session creation")); 122 } 123 if (m_pUserNameLabel) 124 { 125 m_pUserNameLabel->setToolTip(UIVMInformationDialog::tr("User name to authenticate session creation")); 126 m_pUserNameLabel->setText(UIVMInformationDialog::tr("User name")); 127 } 128 if (m_pPasswordLabel) 129 { 130 m_pPasswordLabel->setToolTip(UIVMInformationDialog::tr("Password to authenticate session creation")); 131 m_pPasswordLabel->setText(UIVMInformationDialog::tr("Password")); 132 } 133 if(m_pCreateButton) 134 { 135 m_pCreateButton->setText(UIVMInformationDialog::tr("Create Session")); 136 } 137 } 138 139 UIGuestControlFileManager::UIGuestControlFileManager(QWidget *pParent, const CGuest &comGuest) 140 : QWidget(pParent) 141 , m_comGuest(comGuest) 142 , m_pMainLayout(0) 143 , m_pSplitter(0) 144 , m_pSessionCreateWidget(0) 145 { 146 prepareObjects(); 147 prepareConnections(); 148 } 149 150 void UIGuestControlFileManager::prepareObjects() 151 { 152 /* Create layout: */ 153 m_pMainLayout = new QVBoxLayout(this); 154 if (!m_pMainLayout) 155 return; 156 157 /* Configure layout: */ 158 m_pMainLayout->setSpacing(0); 159 160 m_pSplitter = new QSplitter; 161 162 if (!m_pSplitter) 163 return; 164 165 m_pSessionCreateWidget = new UIGuestSessionCreateWidget(); 166 if (m_pSessionCreateWidget) 167 { 168 m_pSplitter->addWidget(m_pSessionCreateWidget); 169 } 170 171 m_pSplitter->setOrientation(Qt::Vertical); 172 m_pMainLayout->addWidget(m_pSplitter); 173 174 175 // m_pSplitter->setStretchFactor(0, 9); 176 // m_pSplitter->setStretchFactor(1, 4); 177 } 178 179 void UIGuestControlFileManager::prepareConnections() 180 { 181 182 } 183 184 #include "UIGuestControlFileManager.moc" 68 #include "UIGuestControlFileTree.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestControlFileTree.h
r71105 r71133 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIGuestControlFile Managerclass declaration.3 * VBox Qt GUI - UIGuestControlFileTree class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UIGuestControlFile Manager_h___19 #define ___UIGuestControlFile Manager_h___18 #ifndef ___UIGuestControlFileTree_h___ 19 #define ___UIGuestControlFileTree_h___ 20 20 21 21 /* Qt includes: */ … … 24 24 /* COM includes: */ 25 25 #include "COMEnums.h" 26 #include "CEventListener.h" 27 #include "CEventSource.h" 26 28 #include "CGuest.h" 29 #include "CGuestSession.h" 30 31 /* GUI includes: */ 32 #include "QITreeWidget.h" 27 33 28 34 /* Forward declarations: */ 29 class QVBoxLayout;30 class QSplitter;31 35 32 36 33 /** QWidget extension 34 * providing GUI with guest session information and control tab in session-information window. */ 35 class UIGuestControlFileManager : public QWidget 37 class UIGuestControlFileTree : public QITreeWidget 36 38 { 37 39 Q_OBJECT; … … 39 41 public: 40 42 41 UIGuestControlFileManager(QWidget *pParent, const CGuest &comGuest);42 43 43 44 private: 44 45 45 void prepareObjects();46 void prepareConnections();47 46 48 CGuest m_comGuest;49 QVBoxLayout *m_pMainLayout;50 QSplitter *m_pSplitter;51 QWidget *m_pSessionCreateWidget;52 47 }; 53 48 54 #endif /* !___UIGuestControlFile Manager_h___ */49 #endif /* !___UIGuestControlFileTree_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.