Changeset 98606 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 16, 2023 3:51:22 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r98605 r98606 1612 1612 1613 1613 if (!m_pVMInformationDialog) 1614 m_pVMInformationDialog = new UIVMInformationDialog( activeMachineWindow());1614 m_pVMInformationDialog = new UIVMInformationDialog(uimachine()); 1615 1615 1616 1616 if (m_pVMInformationDialog) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r98385 r98606 44 44 #include "UIMachine.h" 45 45 #include "UIMachineView.h" 46 #include "UIMachineWindow.h"47 46 #include "UIMessageCenter.h" 48 47 #include "UIVMActivityMonitor.h" … … 68 67 #include <iprt/time.h> 69 68 70 UIVMInformationDialog::UIVMInformationDialog(UIMachine Window *pMachineWindow)69 UIVMInformationDialog::UIVMInformationDialog(UIMachine *pMachine) 71 70 : QMainWindowWithRestorableGeometryAndRetranslateUi(0) 71 , m_pMachine(pMachine) 72 72 , m_pTabWidget(0) 73 , m_pMachineWindow(pMachineWindow)74 73 , m_fCloseEmitted(false) 75 74 , m_iGeometrySaveTimerId(-1) 76 75 { 77 if (m_pMachineWindow && !m_pMachineWindow->console().isNull())78 {79 CMachine comMachine = m_pMachineWindow->console().GetMachine();80 m_uMachineId = comMachine.GetId();81 }82 /* Prepare: */83 76 prepare(); 84 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,85 this, &UIVMInformationDialog::sltMachineStateChange);86 }87 88 UIVMInformationDialog::~UIVMInformationDialog()89 {90 77 } 91 78 … … 98 85 { 99 86 /* Setup dialog title: */ 100 setWindowTitle(tr("%1 - Session Information").arg(m_ pMachineWindow->machine().GetName()));87 setWindowTitle(tr("%1 - Session Information").arg(m_strMachineName)); 101 88 102 89 /* Translate tabs: */ … … 185 172 void UIVMInformationDialog::prepare() 186 173 { 187 /* Prepare dialog: */188 prepareThis();189 /* Load settings: */ 190 loadDialogGeometry();191 } 192 193 void UIVMInformationDialog::prepareThis() 194 { 174 /* Load and clear: */ 175 AssertPtrReturnVoid(m_pMachine); 176 177 /// @todo to be encapsulated in UIMachine soon 178 CMachine comMachine = m_pMachine->uisession()->machine(); 179 m_uMachineId = comMachine.GetId(); 180 m_strMachineName = comMachine.GetName(); 181 195 182 #ifdef VBOX_WS_MAC 196 183 /* No window-icon on Mac OS X, because it acts as proxy icon which isn't necessary here. */ … … 201 188 #endif 202 189 203 /* Prepare central-widget: */190 /* Prepare stuff: */ 204 191 prepareCentralWidget(); 205 206 /* Retranslate: */ 192 prepareConnections(); 193 194 /* Apply language settings: */ 207 195 retranslateUi(); 196 197 /* Load settings: */ 198 loadDialogGeometry(); 208 199 } 209 200 … … 238 229 /* Create Configuration Details tab: */ 239 230 UIInformationConfiguration *pInformationConfigurationWidget = 240 new UIInformationConfiguration(this, m_pMachine Window->machine(), m_pMachineWindow->console());231 new UIInformationConfiguration(this, m_pMachine->uisession()->machine(), m_pMachine->uisession()->console()); 241 232 if (pInformationConfigurationWidget) 242 233 { … … 247 238 /* Create Runtime Information tab: */ 248 239 UIInformationRuntime *pInformationRuntimeWidget = 249 new UIInformationRuntime(this, m_pMachine Window->machine(), m_pMachineWindow->console(), m_pMachineWindow->uimachine());240 new UIInformationRuntime(this, m_pMachine->uisession()->machine(), m_pMachine->uisession()->console(), m_pMachine); 250 241 if (pInformationRuntimeWidget) 251 242 { … … 256 247 /* Create Performance Monitor tab: */ 257 248 UIVMActivityMonitor *pVMActivityMonitorWidget = 258 new UIVMActivityMonitor(EmbedTo_Dialog, this, m_pMachine Window->machine());249 new UIVMActivityMonitor(EmbedTo_Dialog, this, m_pMachine->uisession()->machine()); 259 250 if (pVMActivityMonitorWidget) 260 251 { 261 connect(m_pMachine Window->uimachine(), &UIMachine::sigAdditionsStateChange,252 connect(m_pMachine, &UIMachine::sigAdditionsStateChange, 262 253 pVMActivityMonitorWidget, &UIVMActivityMonitor::sltGuestAdditionsStateChange); 263 254 m_tabs.insert(Tabs_ActivityMonitor, pVMActivityMonitorWidget); … … 266 257 267 258 /* Create Guest Process Control tab: */ 268 QString strMachineName;269 if (m_pMachineWindow && m_pMachineWindow->console().isOk())270 {271 CMachine comMachine = m_pMachineWindow->console().GetMachine();272 if (comMachine.isOk())273 strMachineName = comMachine.GetName();274 }275 259 UIGuestProcessControlWidget *pGuestProcessControlWidget = 276 new UIGuestProcessControlWidget(EmbedTo_Dialog, m_pMachine Window->console().GetGuest(),277 this, strMachineName, false /* fShowToolbar */);260 new UIGuestProcessControlWidget(EmbedTo_Dialog, m_pMachine->uisession()->guest(), 261 this, m_strMachineName, false /* fShowToolbar */); 278 262 if (pGuestProcessControlWidget) 279 263 { … … 311 295 } 312 296 297 void UIVMInformationDialog::prepareConnections() 298 { 299 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, 300 this, &UIVMInformationDialog::sltMachineStateChange); 301 } 302 313 303 void UIVMInformationDialog::loadDialogGeometry() 314 304 { 315 const QRect geo = gEDataManager->sessionInformationDialogGeometry(this, m_pMachine Window);305 const QRect geo = gEDataManager->sessionInformationDialogGeometry(this, m_pMachine->activeWindow()); 316 306 LogRel2(("GUI: UIVMInformationDialog: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n", 317 307 geo.x(), geo.y(), geo.width(), geo.height())); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
r98103 r98606 46 46 class QITabWidget; 47 47 class QIDialogButtonBox; 48 class UIMachine Window;48 class UIMachine; 49 49 50 50 /* Type definitions: */ … … 65 65 public: 66 66 67 /** Constructs information dialog for passed @a pMachineWindow. */ 68 UIVMInformationDialog(UIMachineWindow *pMachineWindow); 69 /** Destructs information dialog. */ 70 ~UIVMInformationDialog(); 67 /** Constructs information dialog for passed @a pMachine. */ 68 UIVMInformationDialog(UIMachine *pMachine); 71 69 72 70 /** Returns whether the dialog should be maximized when geometry being restored. */ … … 96 94 /** Prepares all. */ 97 95 void prepare(); 98 /** Prepares this. */99 void prepareThis();100 96 /** Prepares central-widget. */ 101 97 void prepareCentralWidget(); … … 106 102 /** Prepares button-box. */ 107 103 void prepareButtonBox(); 104 /** Prepares connections: */ 105 void prepareConnections(); 108 106 void loadDialogGeometry(); 109 107 void saveDialogGeometry(); 108 109 /** Holds the machine UI reference. */ 110 UIMachine *m_pMachine; 110 111 111 112 /** @name Widget variables. … … 117 118 /** Holds the dialog button-box instance. */ 118 119 QIDialogButtonBox *m_pButtonBox; 119 /** Holds the machine-window reference. */120 UIMachineWindow *m_pMachineWindow;121 120 /** @} */ 122 121 bool m_fCloseEmitted; 123 122 int m_iGeometrySaveTimerId; 124 123 QUuid m_uMachineId; 124 QString m_strMachineName; 125 125 }; 126 126
Note:
See TracChangeset
for help on using the changeset viewer.