Changeset 88900 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 6, 2021 12:53:11 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r88874 r88900 111 111 } 112 112 113 void UIVMInformationDialog::resizeEvent(QResizeEvent *pEvent) 114 { 115 saveDialogGeometry(); 116 QMainWindowWithRestorableGeometryAndRetranslateUi::resizeEvent(pEvent); 117 } 118 119 void UIVMInformationDialog::moveEvent(QMoveEvent *pEvent) 120 { 121 QMainWindowWithRestorableGeometryAndRetranslateUi::moveEvent(pEvent); 122 saveDialogGeometry(); 123 } 124 113 125 void UIVMInformationDialog::sltHandlePageChanged(int iIndex) 114 126 { … … 117 129 } 118 130 119 void UIVMInformationDialog::sltSaveSettings() 120 { 121 /* Save window geometry: */ 122 { 123 const QRect geo = currentGeometry(); 124 LogRel2(("GUI: UIVMInformationDialog: Saving geometry as: Origin=%dx%d, Size=%dx%d\n", 125 geo.x(), geo.y(), geo.width(), geo.height())); 126 gEDataManager->setSessionInformationDialogGeometry(geo, isCurrentlyMaximized()); 127 } 131 void UIVMInformationDialog::saveDialogGeometry() 132 { 133 const QRect geo = currentGeometry(); 134 LogRel2(("GUI: UIVMInformationDialog: Saving geometry as: Origin=%dx%d, Size=%dx%d\n", 135 geo.x(), geo.y(), geo.width(), geo.height())); 136 gEDataManager->setSessionInformationDialogGeometry(geo, isCurrentlyMaximized()); 128 137 } 129 138 … … 133 142 prepareThis(); 134 143 /* Load settings: */ 135 loadSettings(); 136 connect(&uiCommon(), &UICommon::sigAskToCommitData, 137 this, &UIVMInformationDialog::sltSaveSettings); 144 loadDialogGeometry(); 138 145 } 139 146 … … 260 267 } 261 268 262 void UIVMInformationDialog::loadSettings() 263 { 264 /* Load window geometry: */ 265 { 266 const QRect geo = gEDataManager->sessionInformationDialogGeometry(this, m_pMachineWindow); 267 LogRel2(("GUI: UIVMInformationDialog: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n", 268 geo.x(), geo.y(), geo.width(), geo.height())); 269 restoreGeometry(geo); 270 } 271 } 269 void UIVMInformationDialog::loadDialogGeometry() 270 { 271 const QRect geo = gEDataManager->sessionInformationDialogGeometry(this, m_pMachineWindow); 272 LogRel2(("GUI: UIVMInformationDialog: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n", 273 geo.x(), geo.y(), geo.width(), geo.height())); 274 restoreGeometry(geo); 275 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
r88874 r88900 66 66 67 67 /** Handles translation event. */ 68 void retranslateUi() /* override */; 69 void closeEvent(QCloseEvent *pEvent) /* override */; 68 virtual void retranslateUi() /* override */; 69 virtual void closeEvent(QCloseEvent *pEvent) /* override */; 70 virtual void resizeEvent(QResizeEvent *pEvent) /* override */; 71 virtual void moveEvent(QMoveEvent *pEvent) /* override */; 70 72 71 73 private slots: … … 73 75 /** Handles tab-widget page change. */ 74 76 void sltHandlePageChanged(int iIndex); 75 void sltSaveSettings();76 77 77 78 private: … … 89 90 /** Prepares button-box. */ 90 91 void prepareButtonBox(); 91 /** Loads settings. */92 void loadSettings();92 void loadDialogGeometry(); 93 void saveDialogGeometry(); 93 94 94 95 /** @name Widget variables.
Note:
See TracChangeset
for help on using the changeset viewer.