Changeset 89049 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 14, 2021 2:59:39 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.cpp
r89041 r89049 19 19 #include <QApplication> 20 20 #include <QMenu> 21 #include <QSplitter>22 21 #include <QVBoxLayout> 23 22 … … 296 295 , m_comGuest(comGuest) 297 296 , m_pMainLayout(0) 298 , m_pSplitter(0)299 297 , m_pTreeWidget(0) 300 298 , m_enmEmbedding(enmEmbedding) … … 309 307 prepareToolBar(); 310 308 initGuestSessionTree(); 311 loadSettings();312 309 retranslateUi(); 313 310 } … … 338 335 /* Configure layout: */ 339 336 m_pMainLayout->setSpacing(0); 340 341 m_pSplitter = new QSplitter;342 343 if (!m_pSplitter)344 return;345 346 m_pSplitter->setOrientation(Qt::Vertical);347 348 m_pMainLayout->addWidget(m_pSplitter);349 350 351 337 m_pTreeWidget = new UIGuestControlTreeWidget; 352 338 353 339 if (m_pTreeWidget) 354 340 { 355 m_p Splitter->addWidget(m_pTreeWidget);341 m_pMainLayout->addWidget(m_pTreeWidget); 356 342 m_pTreeWidget->setColumnCount(3); 357 343 } 358 359 m_pSplitter->setStretchFactor(0, 2);360 m_pSplitter->setStretchFactor(1, 1);361 362 344 updateTreeWidget(); 363 345 } … … 392 374 this, &UIGuestProcessControlWidget::sltGuestSessionUnregistered); 393 375 } 394 connect(&uiCommon(), &UICommon::sigAskToCommitData,395 this, &UIGuestProcessControlWidget::sltSaveSettings);396 376 } 397 377 … … 559 539 } 560 540 561 void UIGuestProcessControlWidget::sltSaveSettings()562 {563 if (!m_pSplitter)564 return;565 gEDataManager->setGuestControlProcessControlSplitterHints(m_pSplitter->sizes());566 }567 568 541 void UIGuestProcessControlWidget::sltCleanupListener() 569 542 { … … 583 556 } 584 557 585 void UIGuestProcessControlWidget::loadSettings()586 {587 if (!m_pSplitter)588 return;589 QList<int> splitterHints = gEDataManager->guestControlProcessControlSplitterHints();590 if (splitterHints.size() != 2)591 return;592 if (splitterHints[0] != 0 && splitterHints[1] != 0)593 m_pSplitter->setSizes(splitterHints);594 }595 596 558 #include "UIGuestProcessControlWidget.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.h
r88874 r89049 71 71 void sltCloseSessionOrProcess(); 72 72 void sltShowProperties(); 73 void sltSaveSettings();74 73 void sltCleanupListener(); 75 74 … … 83 82 void updateTreeWidget(); 84 83 void addGuestSession(CGuestSession guestSession); 85 void loadSettings();86 84 87 85 CGuest m_comGuest; 88 86 QVBoxLayout *m_pMainLayout; 89 QSplitter *m_pSplitter;90 87 UIGuestControlTreeWidget *m_pTreeWidget; 91 88 const EmbedTo m_enmEmbedding; -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp
r88903 r89049 65 65 , m_pActionPool(pActionPool) 66 66 , m_comMachine(comMachine) 67 , m_iGeometrySaveTimerId(-1) 67 68 { 68 69 } … … 94 95 } 95 96 96 void UIVMLogViewerDialog::resizeEvent(QResizeEvent *pEvent) 97 { 98 QIWithRetranslateUI<QIManagerDialog>::resizeEvent(pEvent); 99 saveDialogGeometry(); 100 } 101 102 void UIVMLogViewerDialog::moveEvent(QMoveEvent *pEvent) 103 { 104 QIWithRetranslateUI<QIManagerDialog>::moveEvent(pEvent); 105 saveDialogGeometry(); 97 bool UIVMLogViewerDialog::event(QEvent *pEvent) 98 { 99 switch (pEvent->type()) 100 { 101 case QEvent::Resize: 102 case QEvent::Move: 103 { 104 if (m_iGeometrySaveTimerId != -1) 105 killTimer(m_iGeometrySaveTimerId); 106 m_iGeometrySaveTimerId = startTimer(300); 107 break; 108 } 109 case QEvent::Timer: 110 { 111 QTimerEvent *pTimerEvent = static_cast<QTimerEvent*>(pEvent); 112 if (pTimerEvent->timerId() == m_iGeometrySaveTimerId) 113 { 114 killTimer(m_iGeometrySaveTimerId); 115 m_iGeometrySaveTimerId = -1; 116 saveDialogGeometry(); 117 } 118 break; 119 } 120 default: 121 break; 122 } 123 return QIWithRetranslateUI<QIManagerDialog>::event(pEvent); 106 124 } 107 125 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h
r88903 r89049 86 86 /** Handles translation event. */ 87 87 virtual void retranslateUi() /* override */; 88 virtual void resizeEvent(QResizeEvent *pEvent) /* override */; 89 virtual void moveEvent(QMoveEvent *pEvent) /* override */; 88 virtual bool event(QEvent *pEvent) /* override */; 90 89 /** @} */ 91 90 … … 123 122 /** Holds the machine reference. */ 124 123 CMachine m_comMachine; 124 int m_iGeometrySaveTimerId; 125 125 }; 126 126 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
r89046 r89049 94 94 /** @name Widget variables. 95 95 * @{ */ 96 /** Holds the dialog tab-widget instance. */97 QITabWidget *m_pTabWidget;98 /** Holds the map of dialog tab instances. */99 QMap<int, QWidget*> m_tabs;100 /** Holds the dialog button-box instance. */101 QIDialogButtonBox *m_pButtonBox;102 /** Holds the machine-window reference. */103 UIMachineWindow *m_pMachineWindow;96 /** Holds the dialog tab-widget instance. */ 97 QITabWidget *m_pTabWidget; 98 /** Holds the map of dialog tab instances. */ 99 QMap<int, QWidget*> m_tabs; 100 /** Holds the dialog button-box instance. */ 101 QIDialogButtonBox *m_pButtonBox; 102 /** Holds the machine-window reference. */ 103 UIMachineWindow *m_pMachineWindow; 104 104 /** @} */ 105 105 bool m_fCloseEmitted;
Note:
See TracChangeset
for help on using the changeset viewer.