Changeset 53068 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 15, 2014 1:31:16 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r53057 r53068 209 209 } 210 210 211 CMachine UIMachineWindow::machine() const 212 { 213 return session().GetMachine(); 211 CMachine& UIMachineWindow::machine() const 212 { 213 return uisession()->machine(); 214 } 215 216 CConsole& UIMachineWindow::console() const 217 { 218 return uisession()->console(); 219 } 220 221 const QString& UIMachineWindow::machineName() const 222 { 223 return uisession()->machineName(); 214 224 } 215 225 … … 284 294 return; 285 295 286 /* Get machine: */287 CMachine m = machine();288 289 296 /* If there is a close hook script defined: */ 290 297 const QString strScript = gEDataManager->machineCloseHookScript(vboxGlobal().managedVMUuid()); … … 292 299 { 293 300 /* Execute asynchronously and leave: */ 294 QProcess::startDetached(strScript, QStringList() << m .GetId());301 QProcess::startDetached(strScript, QStringList() << machine().GetId()); 295 302 return; 296 303 } … … 325 332 /* Prepare close-dialog: */ 326 333 QWidget *pParentDlg = windowManager().realParentWindow(this); 327 QPointer<UIVMCloseDialog> pCloseDlg = new UIVMCloseDialog(pParentDlg, m ,328 session().GetConsole().GetGuestEnteredACPIMode(),334 QPointer<UIVMCloseDialog> pCloseDlg = new UIVMCloseDialog(pParentDlg, machine(), 335 console().GetGuestEnteredACPIMode(), 329 336 restrictedCloseActions); 330 337 … … 481 488 if (iElement & UIVisualElement_WindowTitle) 482 489 { 483 /* Get machine: */484 const CMachine &m = machine();485 490 /* Get machine state: */ 486 491 KMachineState state = uisession()->machineState(); 487 492 /* Prepare full name: */ 488 493 QString strSnapshotName; 489 if (m .GetSnapshotCount() > 0)490 { 491 CSnapshot snapshot = m .GetCurrentSnapshot();494 if (machine().GetSnapshotCount() > 0) 495 { 496 CSnapshot snapshot = machine().GetCurrentSnapshot(); 492 497 strSnapshotName = " (" + snapshot.GetName() + ")"; 493 498 } 494 QString strMachineName = m .GetName() + strSnapshotName;499 QString strMachineName = machineName() + strSnapshotName; 495 500 if (state != KMachineState_Null) 496 501 strMachineName += " [" + gpConverter->toString(state) + "]"; … … 500 505 strMachineName += " - " + (strUserProductName.isEmpty() ? defaultWindowTitle() : strUserProductName); 501 506 #endif /* !Q_WS_MAC */ 502 if (m .GetMonitorCount() > 1)507 if (machine().GetMonitorCount() > 1) 503 508 strMachineName += QString(" : %1").arg(m_uScreenId + 1); 504 509 setWindowTitle(strMachineName); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r53057 r53068 65 65 UIActionPool* actionPool() const; 66 66 UISession* uisession() const; 67 68 /** Returns the session reference. */ 67 69 CSession& session() const; 68 CMachine machine() const; 70 /** Returns the session's machine reference. */ 71 CMachine& machine() const; 72 /** Returns the session's console reference. */ 73 CConsole& console() const; 74 75 /** Returns the machine name. */ 76 const QString& machineName() const; 69 77 70 78 /** Adjusts machine-window size to correspond current machine-view size. -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r52891 r53068 502 502 if (m_pMiniToolBar) 503 503 { 504 /* Get machine: */505 const CMachine &m = machine();506 504 /* Get snapshot(s): */ 507 505 QString strSnapshotName; 508 if (m .GetSnapshotCount() > 0)506 if (machine().GetSnapshotCount() > 0) 509 507 { 510 CSnapshot snapshot = m .GetCurrentSnapshot();508 CSnapshot snapshot = machine().GetCurrentSnapshot(); 511 509 strSnapshotName = " (" + snapshot.GetName() + ")"; 512 510 } 513 511 /* Update mini-toolbar text: */ 514 m_pMiniToolBar->setText(m .GetName() + strSnapshotName);512 m_pMiniToolBar->setText(machineName() + strSnapshotName); 515 513 } 516 514 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r53057 r53068 317 317 UIMachineWindow::loadSettings(); 318 318 319 /* Get machine: */320 CMachine m = machine();321 322 319 /* Load GUI customizations: */ 323 320 { … … 341 338 { 342 339 /* If previous machine-state was SAVED: */ 343 if (m .GetState() == KMachineState_Saved)340 if (machine().GetState() == KMachineState_Saved) 344 341 { 345 342 /* Restore window geometry: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
r52730 r53068 81 81 UIMachineWindow::loadSettings(); 82 82 83 /* Load scale window settings: */84 CMachine m = machine();85 86 83 /* Load extra-data settings: */ 87 84 { … … 121 118 void UIMachineWindowScale::saveSettings() 122 119 { 123 /* Get machine: */124 CMachine m = machine();125 126 120 /* Save window geometry: */ 127 121 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r53057 r53068 269 269 if (m_pMiniToolBar) 270 270 { 271 /* Get machine: */272 const CMachine &m = machine();273 271 /* Get snapshot(s): */ 274 272 QString strSnapshotName; 275 if (m .GetSnapshotCount() > 0)273 if (machine().GetSnapshotCount() > 0) 276 274 { 277 CSnapshot snapshot = m .GetCurrentSnapshot();275 CSnapshot snapshot = machine().GetCurrentSnapshot(); 278 276 strSnapshotName = " (" + snapshot.GetName() + ")"; 279 277 } 280 278 /* Update mini-toolbar text: */ 281 m_pMiniToolBar->setText(m .GetName() + strSnapshotName);279 m_pMiniToolBar->setText(machineName() + strSnapshotName); 282 280 } 283 281 }
Note:
See TracChangeset
for help on using the changeset viewer.