- Timestamp:
- Mar 17, 2023 2:19:31 PM (23 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r98940 r99012 255 255 const KMachineState enmState = uimachine()->machineState(); 256 256 if (enmState == KMachineState_Null) 257 return; 258 259 /* Prepare full name: */ 260 QString strMachineName = machineName(); 261 262 /* Append snapshot name: */ 263 ulong uSnapshotCount = 0; 264 uimachine()->acquireSnapshotCount(uSnapshotCount); 265 if (uSnapshotCount > 0) 266 { 267 QString strCurrentSnapshotName; 268 uimachine()->acquireCurrentSnapshotName(strCurrentSnapshotName); 269 strMachineName += " (" + strCurrentSnapshotName + ")"; 270 } 271 272 /* Append state name: */ 273 strMachineName += " [" + gpConverter->toString(enmState) + "]"; 257 { 258 /* Assign default window title: */ 259 setWindowTitle(defaultWindowTitle()); 260 } 261 else 262 { 263 /* Prepare full name: */ 264 QString strMachineName = machineName(); 265 266 /* Append snapshot name: */ 267 ulong uSnapshotCount = 0; 268 uimachine()->acquireSnapshotCount(uSnapshotCount); 269 if (uSnapshotCount > 0) 270 { 271 QString strCurrentSnapshotName; 272 uimachine()->acquireCurrentSnapshotName(strCurrentSnapshotName); 273 strMachineName += " (" + strCurrentSnapshotName + ")"; 274 } 275 276 /* Append state name: */ 277 strMachineName += " [" + gpConverter->toString(enmState) + "]"; 274 278 275 279 #ifndef VBOX_WS_MAC 276 /* Append user product name (besides macOS): */277 const QString strUserProductName = uimachine()->machineWindowNamePostfix();278 strMachineName += " - " + (strUserProductName.isEmpty() ? defaultWindowTitle() : strUserProductName);280 /* Append user product name (besides macOS): */ 281 const QString strUserProductName = uimachine()->machineWindowNamePostfix(); 282 strMachineName += " - " + (strUserProductName.isEmpty() ? defaultWindowTitle() : strUserProductName); 279 283 #endif /* !VBOX_WS_MAC */ 280 284 281 /* Append screen number only if there are more than one present: */ 282 ulong cMonitorCount = 0; 283 uimachine()->acquireMonitorCount(cMonitorCount); 284 if (cMonitorCount > 1) 285 strMachineName += QString(" : %1").arg(m_uScreenId + 1); 286 287 /* Assign title finally: */ 288 setWindowTitle(strMachineName); 285 /* Append screen number only if there are more than one present: */ 286 ulong cMonitorCount = 0; 287 uimachine()->acquireMonitorCount(cMonitorCount); 288 if (cMonitorCount > 1) 289 strMachineName += QString(" : %1").arg(m_uScreenId + 1); 290 291 /* Assign title finally: */ 292 setWindowTitle(strMachineName); 293 } 289 294 } 290 295 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h
r98849 r99012 189 189 190 190 /* Helpers: */ 191 const QString&defaultWindowTitle() const { return m_strWindowTitlePrefix; }191 QString defaultWindowTitle() const { return m_strWindowTitlePrefix; } 192 192 static Qt::Alignment viewAlignment(UIVisualStateType visualStateType); 193 193
Note:
See TracChangeset
for help on using the changeset viewer.