Changeset 53320 in vbox
- Timestamp:
- Nov 13, 2014 11:23:02 AM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r53311 r53320 3512 3512 } 3513 3513 } 3514 /* Make sure event came for the currently running VM: */ 3515 else if ( vboxGlobal().isVMConsoleProcess() 3516 && strMachineID == vboxGlobal().managedVMUuid()) 3517 { 3518 /* Status-bar configuration change: */ 3514 /* Machine extra-data 'change' event: */ 3515 else 3516 { 3517 /* Current VM only: */ 3518 if ( vboxGlobal().isVMConsoleProcess() 3519 && strMachineID == vboxGlobal().managedVMUuid()) 3520 { 3521 /* HID LEDs sync state changed (allowed if not restricted)? */ 3522 if (strKey == GUI_HidLedsSync) 3523 emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, strMachineID)); 3524 #ifdef Q_WS_MAC 3525 /* 'Dock icon' appearance changed (allowed if not restricted)? */ 3526 else if ( strKey == GUI_RealtimeDockIconUpdateEnabled 3527 || strKey == GUI_RealtimeDockIconUpdateMonitor) 3528 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID)); 3529 #endif /* Q_WS_MAC */ 3530 } 3531 3532 /* Menu-bar configuration change: */ 3519 3533 if (strKey == GUI_MenuBar_Enabled || 3520 3534 strKey == GUI_RestrictedRuntimeMenus || … … 3530 3544 #endif /* VBOX_WITH_DEBUGGER_GUI */ 3531 3545 strKey == GUI_RestrictedRuntimeHelpMenuActions) 3532 emit sigMenuBarConfigurationChange( );3546 emit sigMenuBarConfigurationChange(strMachineID); 3533 3547 /* Status-bar configuration change: */ 3534 3548 else if (strKey == GUI_StatusBar_Enabled || 3535 3549 strKey == GUI_RestrictedStatusBarIndicators || 3536 3550 strKey == GUI_StatusBar_IndicatorOrder) 3537 emit sigStatusBarConfigurationChange(); 3538 /* HID LEDs sync state changed (allowed if not restricted)? */ 3539 else if (strKey == GUI_HidLedsSync) 3540 emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, strMachineID)); 3541 #ifdef Q_WS_MAC 3542 /* 'Dock icon' appearance changed (allowed if not restricted)? */ 3543 else if ( strKey == GUI_RealtimeDockIconUpdateEnabled 3544 || strKey == GUI_RealtimeDockIconUpdateMonitor) 3545 emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID)); 3546 #endif /* Q_WS_MAC */ 3551 emit sigStatusBarConfigurationChange(strMachineID); 3547 3552 } 3548 3553 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r53250 r53320 69 69 70 70 /** Notifies about menu-bar configuration change. */ 71 void sigMenuBarConfigurationChange( );71 void sigMenuBarConfigurationChange(const QString &strMachineID); 72 72 /** Notifies about status-bar configuration change. */ 73 void sigStatusBarConfigurationChange( );73 void sigStatusBarConfigurationChange(const QString &strMachineID); 74 74 75 75 /** Notifies about HID LEDs synchronization state change. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r53086 r53320 1885 1885 #endif /* VBOX_WITH_DEBUGGER_GUI */ 1886 1886 1887 void UIActionPoolRuntime::sltHandleConfigurationChange() 1888 { 1887 void UIActionPoolRuntime::sltHandleConfigurationChange(const QString &strMachineID) 1888 { 1889 /* Skip unrelated machine IDs: */ 1890 if (vboxGlobal().managedVMUuid() != strMachineID) 1891 return; 1892 1889 1893 /* Update configuration: */ 1890 1894 updateConfiguration(); … … 2059 2063 /* Prepare connections: */ 2060 2064 connect(gShortcutPool, SIGNAL(sigMachineShortcutsReloaded()), this, SLOT(sltApplyShortcuts())); 2061 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange()), this, SLOT(sltHandleConfigurationChange())); 2065 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)), 2066 this, SLOT(sltHandleConfigurationChange(const QString&))); 2062 2067 2063 2068 /* Call to base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r52937 r53320 181 181 182 182 /** Handles configuration-change. */ 183 void sltHandleConfigurationChange( );183 void sltHandleConfigurationChange(const QString &strMachineID); 184 184 185 185 /** Prepare 'View' : 'Virtual Screen #' menu routine (Normal, Scale). */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r53301 r53320 1073 1073 } 1074 1074 1075 void UIIndicatorsPool::sltHandleConfigurationChange() 1076 { 1075 void UIIndicatorsPool::sltHandleConfigurationChange(const QString &strMachineID) 1076 { 1077 /* Skip unrelated machine IDs: */ 1078 if (vboxGlobal().managedVMUuid() != strMachineID) 1079 return; 1080 1077 1081 /* Update pool: */ 1078 1082 updatePool(); … … 1150 1154 { 1151 1155 /* Listen for the status-bar configuration changes: */ 1152 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange( )),1153 this, SLOT(sltHandleConfigurationChange( )));1156 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)), 1157 this, SLOT(sltHandleConfigurationChange(const QString&))); 1154 1158 } 1155 1159 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r52658 r53320 66 66 67 67 /** Handles configuration change. */ 68 void sltHandleConfigurationChange( );68 void sltHandleConfigurationChange(const QString &strMachineID); 69 69 70 70 /** Handles indicator-states auto-update. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp
r52939 r53320 58 58 public: 59 59 60 /** Constructor, taking @a pActionPool argument. */ 61 UIMenuBarEditorWidget(UIActionPool *pActionPool); 60 /** Constructor. 61 * @param pParent is passed to QWidget constructor, 62 * @param strMachineID brings the machine ID to be used by the editor, 63 * @param pActionPool brings the action-pool to be used by the editor. */ 64 UIMenuBarEditorWidget(QWidget *pParent, 65 const QString &strMachineID, 66 UIActionPool *pActionPool); 67 68 /** Returns the machine ID instance. */ 69 const QString& machineID() const { return m_strMachineID; } 62 70 63 71 /** Returns the action-pool reference. */ … … 67 75 68 76 /** Handles configuration change. */ 69 void sltHandleConfigurationChange( );77 void sltHandleConfigurationChange(const QString &strMachineID); 70 78 71 79 /** Handles menu-bar menu click. */ … … 143 151 /** @name General 144 152 * @{ */ 153 /** Holds the machine ID instance. */ 154 QString m_strMachineID; 145 155 /** Holds the action-pool reference. */ 146 156 const UIActionPool *m_pActionPool; … … 160 170 }; 161 171 162 163 UIMenuBarEditorWidget::UIMenuBarEditorWidget(UIActionPool *pActionPool) 164 : m_pActionPool(pActionPool) 172 UIMenuBarEditorWidget::UIMenuBarEditorWidget(QWidget *pParent, 173 const QString &strMachineID, 174 UIActionPool *pActionPool) 175 : QIWithRetranslateUI2<QWidget>(pParent) 176 , m_strMachineID(strMachineID) 177 , m_pActionPool(pActionPool) 165 178 , m_pMainLayout(0) 166 179 , m_pToolBar(0) … … 171 184 } 172 185 173 void UIMenuBarEditorWidget::sltHandleConfigurationChange() 174 { 186 void UIMenuBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID) 187 { 188 /* Skip unrelated machine IDs: */ 189 if (machineID() != strMachineID) 190 return; 191 175 192 /* Update menus: */ 176 193 updateMenus(); … … 192 209 static_cast<UIExtraDataMetaDefs::MenuType>(pAction->property("type").toInt()); 193 210 /* Load current menu-bar restrictions: */ 194 UIExtraDataMetaDefs::MenuType restrictions = gEDataManager->restrictedRuntimeMenuTypes( vboxGlobal().managedVMUuid());211 UIExtraDataMetaDefs::MenuType restrictions = gEDataManager->restrictedRuntimeMenuTypes(machineID()); 195 212 /* Invert restriction for sender type: */ 196 213 restrictions = (UIExtraDataMetaDefs::MenuType)(restrictions ^ type); 197 214 /* Save updated menu-bar restrictions: */ 198 gEDataManager->setRestrictedRuntimeMenuTypes(restrictions, vboxGlobal().managedVMUuid());215 gEDataManager->setRestrictedRuntimeMenuTypes(restrictions, machineID()); 199 216 break; 200 217 } … … 206 223 static_cast<UIExtraDataMetaDefs::MenuApplicationActionType>(pAction->property("type").toInt()); 207 224 /* Load current menu-bar restrictions: */ 208 UIExtraDataMetaDefs::MenuApplicationActionType restrictions = gEDataManager->restrictedRuntimeMenuApplicationActionTypes( vboxGlobal().managedVMUuid());225 UIExtraDataMetaDefs::MenuApplicationActionType restrictions = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(machineID()); 209 226 /* Invert restriction for sender type: */ 210 227 restrictions = (UIExtraDataMetaDefs::MenuApplicationActionType)(restrictions ^ type); 211 228 /* Save updated menu-bar restrictions: */ 212 gEDataManager->setRestrictedRuntimeMenuApplicationActionTypes(restrictions, vboxGlobal().managedVMUuid());229 gEDataManager->setRestrictedRuntimeMenuApplicationActionTypes(restrictions, machineID()); 213 230 break; 214 231 } … … 220 237 static_cast<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(pAction->property("type").toInt()); 221 238 /* Load current menu-bar restrictions: */ 222 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictions = gEDataManager->restrictedRuntimeMenuMachineActionTypes( vboxGlobal().managedVMUuid());239 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictions = gEDataManager->restrictedRuntimeMenuMachineActionTypes(machineID()); 223 240 /* Invert restriction for sender type: */ 224 241 restrictions = (UIExtraDataMetaDefs::RuntimeMenuMachineActionType)(restrictions ^ type); 225 242 /* Save updated menu-bar restrictions: */ 226 gEDataManager->setRestrictedRuntimeMenuMachineActionTypes(restrictions, vboxGlobal().managedVMUuid());243 gEDataManager->setRestrictedRuntimeMenuMachineActionTypes(restrictions, machineID()); 227 244 break; 228 245 } … … 233 250 static_cast<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(pAction->property("type").toInt()); 234 251 /* Load current menu-bar restrictions: */ 235 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictions = gEDataManager->restrictedRuntimeMenuViewActionTypes( vboxGlobal().managedVMUuid());252 UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictions = gEDataManager->restrictedRuntimeMenuViewActionTypes(machineID()); 236 253 /* Invert restriction for sender type: */ 237 254 restrictions = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)(restrictions ^ type); 238 255 /* Save updated menu-bar restrictions: */ 239 gEDataManager->setRestrictedRuntimeMenuViewActionTypes(restrictions, vboxGlobal().managedVMUuid());256 gEDataManager->setRestrictedRuntimeMenuViewActionTypes(restrictions, machineID()); 240 257 break; 241 258 } … … 246 263 static_cast<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(pAction->property("type").toInt()); 247 264 /* Load current menu-bar restrictions: */ 248 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictions = gEDataManager->restrictedRuntimeMenuInputActionTypes( vboxGlobal().managedVMUuid());265 UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictions = gEDataManager->restrictedRuntimeMenuInputActionTypes(machineID()); 249 266 /* Invert restriction for sender type: */ 250 267 restrictions = (UIExtraDataMetaDefs::RuntimeMenuInputActionType)(restrictions ^ type); 251 268 /* Save updated menu-bar restrictions: */ 252 gEDataManager->setRestrictedRuntimeMenuInputActionTypes(restrictions, vboxGlobal().managedVMUuid());269 gEDataManager->setRestrictedRuntimeMenuInputActionTypes(restrictions, machineID()); 253 270 break; 254 271 } … … 259 276 static_cast<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(pAction->property("type").toInt()); 260 277 /* Load current menu-bar restrictions: */ 261 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictions = gEDataManager->restrictedRuntimeMenuDevicesActionTypes( vboxGlobal().managedVMUuid());278 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictions = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(machineID()); 262 279 /* Invert restriction for sender type: */ 263 280 restrictions = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)(restrictions ^ type); 264 281 /* Save updated menu-bar restrictions: */ 265 gEDataManager->setRestrictedRuntimeMenuDevicesActionTypes(restrictions, vboxGlobal().managedVMUuid());282 gEDataManager->setRestrictedRuntimeMenuDevicesActionTypes(restrictions, machineID()); 266 283 break; 267 284 } … … 273 290 static_cast<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(pAction->property("type").toInt()); 274 291 /* Load current menu-bar restrictions: */ 275 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictions = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes( vboxGlobal().managedVMUuid());292 UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictions = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(machineID()); 276 293 /* Invert restriction for sender type: */ 277 294 restrictions = (UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType)(restrictions ^ type); 278 295 /* Save updated menu-bar restrictions: */ 279 gEDataManager->setRestrictedRuntimeMenuDebuggerActionTypes(restrictions, vboxGlobal().managedVMUuid());296 gEDataManager->setRestrictedRuntimeMenuDebuggerActionTypes(restrictions, machineID()); 280 297 break; 281 298 } … … 287 304 static_cast<UIExtraDataMetaDefs::MenuHelpActionType>(pAction->property("type").toInt()); 288 305 /* Load current menu-bar restrictions: */ 289 UIExtraDataMetaDefs::MenuHelpActionType restrictions = gEDataManager->restrictedRuntimeMenuHelpActionTypes( vboxGlobal().managedVMUuid());306 UIExtraDataMetaDefs::MenuHelpActionType restrictions = gEDataManager->restrictedRuntimeMenuHelpActionTypes(machineID()); 290 307 /* Invert restriction for sender type: */ 291 308 restrictions = (UIExtraDataMetaDefs::MenuHelpActionType)(restrictions ^ type); 292 309 /* Save updated menu-bar restrictions: */ 293 gEDataManager->setRestrictedRuntimeMenuHelpActionTypes(restrictions, vboxGlobal().managedVMUuid());310 gEDataManager->setRestrictedRuntimeMenuHelpActionTypes(restrictions, machineID()); 294 311 break; 295 312 } … … 363 380 364 381 /* Listen for the menu-bar configuration changes: */ 365 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange( )),366 this, SLOT(sltHandleConfigurationChange( )));382 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)), 383 this, SLOT(sltHandleConfigurationChange(const QString&))); 367 384 368 385 /* Update menus: */ … … 644 661 { 645 662 /* Recache menu-bar configuration: */ 646 const UIExtraDataMetaDefs::MenuType restrictionsMenuBar = gEDataManager->restrictedRuntimeMenuTypes( vboxGlobal().managedVMUuid());663 const UIExtraDataMetaDefs::MenuType restrictionsMenuBar = gEDataManager->restrictedRuntimeMenuTypes(machineID()); 647 664 /* Get static meta-object: */ 648 665 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 687 704 { 688 705 /* Recache menu-bar configuration: */ 689 const UIExtraDataMetaDefs::MenuApplicationActionType restrictionsMenuApplication = gEDataManager->restrictedRuntimeMenuApplicationActionTypes( vboxGlobal().managedVMUuid());706 const UIExtraDataMetaDefs::MenuApplicationActionType restrictionsMenuApplication = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(machineID()); 690 707 /* Get static meta-object: */ 691 708 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 717 734 { 718 735 /* Recache menu-bar configuration: */ 719 const UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictionsMenuMachine = gEDataManager->restrictedRuntimeMenuMachineActionTypes( vboxGlobal().managedVMUuid());736 const UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictionsMenuMachine = gEDataManager->restrictedRuntimeMenuMachineActionTypes(machineID()); 720 737 /* Get static meta-object: */ 721 738 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 746 763 { 747 764 /* Recache menu-bar configuration: */ 748 const UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictionsMenuView = gEDataManager->restrictedRuntimeMenuViewActionTypes( vboxGlobal().managedVMUuid());765 const UIExtraDataMetaDefs::RuntimeMenuViewActionType restrictionsMenuView = gEDataManager->restrictedRuntimeMenuViewActionTypes(machineID()); 749 766 /* Get static meta-object: */ 750 767 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 775 792 { 776 793 /* Recache menu-bar configuration: */ 777 const UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictionsMenuInput = gEDataManager->restrictedRuntimeMenuInputActionTypes( vboxGlobal().managedVMUuid());794 const UIExtraDataMetaDefs::RuntimeMenuInputActionType restrictionsMenuInput = gEDataManager->restrictedRuntimeMenuInputActionTypes(machineID()); 778 795 /* Get static meta-object: */ 779 796 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 804 821 { 805 822 /* Recache menu-bar configuration: */ 806 const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictionsMenuDevices = gEDataManager->restrictedRuntimeMenuDevicesActionTypes( vboxGlobal().managedVMUuid());823 const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restrictionsMenuDevices = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(machineID()); 807 824 /* Get static meta-object: */ 808 825 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 834 851 { 835 852 /* Recache menu-bar configuration: */ 836 const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictionsMenuDebug = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes( vboxGlobal().managedVMUuid());853 const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restrictionsMenuDebug = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(machineID()); 837 854 /* Get static meta-object: */ 838 855 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 864 881 { 865 882 /* Recache menu-bar configuration: */ 866 const UIExtraDataMetaDefs::MenuHelpActionType restrictionsMenuHelp = gEDataManager->restrictedRuntimeMenuHelpActionTypes( vboxGlobal().managedVMUuid());883 const UIExtraDataMetaDefs::MenuHelpActionType restrictionsMenuHelp = gEDataManager->restrictedRuntimeMenuHelpActionTypes(machineID()); 867 884 /* Get static meta-object: */ 868 885 const QMetaObject &smo = UIExtraDataMetaDefs::staticMetaObject; … … 964 981 UIMenuBarEditorWindow::UIMenuBarEditorWindow(UIMachineWindow *pParent, UIActionPool *pActionPool) 965 982 #ifndef Q_WS_MAC 966 : UISlidingToolBar(pParent, pParent->menuBar(), new UIMenuBarEditorWidget( pActionPool), UISlidingToolBar::Position_Top)983 : UISlidingToolBar(pParent, pParent->menuBar(), new UIMenuBarEditorWidget(0, vboxGlobal().managedVMUuid(), pActionPool), UISlidingToolBar::Position_Top) 967 984 #else /* Q_WS_MAC */ 968 : UISlidingToolBar(pParent, 0, new UIMenuBarEditorWidget( pActionPool), UISlidingToolBar::Position_Top)985 : UISlidingToolBar(pParent, 0, new UIMenuBarEditorWidget(0, vboxGlobal().managedVMUuid(), pActionPool), UISlidingToolBar::Position_Top) 969 986 #endif /* Q_WS_MAC */ 970 987 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r53227 r53320 637 637 638 638 #ifdef RT_OS_DARWIN 639 void UISession::sltHandleMenuBarConfigurationChange() 640 { 639 void UISession::sltHandleMenuBarConfigurationChange(const QString &strMachineID) 640 { 641 /* Skip unrelated machine IDs: */ 642 if (vboxGlobal().managedVMUuid() != strMachineID) 643 return; 644 641 645 /* Update Mac OS X menu-bar: */ 642 646 updateMenu(); … … 1138 1142 { 1139 1143 /* Configure Mac OS X menu-bar: */ 1140 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange( )),1141 this, SLOT(sltHandleMenuBarConfigurationChange( )));1144 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)), 1145 this, SLOT(sltHandleMenuBarConfigurationChange(const QString&))); 1142 1146 /* Update Mac OS X menu-bar: */ 1143 1147 updateMenu(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r53047 r53320 309 309 #ifdef RT_OS_DARWIN 310 310 /** Mac OS X: Handles menu-bar configuration-change. */ 311 void sltHandleMenuBarConfigurationChange( );311 void sltHandleMenuBarConfigurationChange(const QString &strMachineID); 312 312 #endif /* RT_OS_DARWIN */ 313 313 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
r52730 r53320 127 127 public: 128 128 129 /** Constructor, passes @a pParent to the QWidget constructor. */ 130 UIStatusBarEditorWidget(QWidget *pParent = 0); 129 /** Constructor. 130 * @param pParent is passed to QWidget constructor, 131 * @param strMachineID brings the machine ID to be used by the editor. */ 132 UIStatusBarEditorWidget(QWidget *pParent, 133 const QString &strMachineID); 134 135 /** Returns the machine ID instance. */ 136 const QString& machineID() const { return m_strMachineID; } 131 137 132 138 private slots: 133 139 134 140 /** Handles configuration change. */ 135 void sltHandleConfigurationChange( );141 void sltHandleConfigurationChange(const QString &strMachineID); 136 142 137 143 /** Handles button click. */ … … 170 176 /** Returns position for passed @a type. */ 171 177 int position(IndicatorType type) const; 178 179 /** @name General 180 * @{ */ 181 /** Holds the machine ID instance. */ 182 QString m_strMachineID; 183 /** @} */ 172 184 173 185 /** @name Contents … … 345 357 346 358 347 UIStatusBarEditorWidget::UIStatusBarEditorWidget(QWidget *pParent /* = 0 */) 359 UIStatusBarEditorWidget::UIStatusBarEditorWidget(QWidget *pParent, 360 const QString &strMachineID) 348 361 : QIWithRetranslateUI2<QWidget>(pParent) 362 , m_strMachineID(strMachineID) 349 363 , m_pMainLayout(0), m_pButtonLayout(0) 350 364 , m_pButtonClose(0) … … 356 370 } 357 371 358 void UIStatusBarEditorWidget::sltHandleConfigurationChange() 359 { 372 void UIStatusBarEditorWidget::sltHandleConfigurationChange(const QString &strMachineID) 373 { 374 /* Skip unrelated machine IDs: */ 375 if (machineID() != strMachineID) 376 return; 377 360 378 /* Update status buttons: */ 361 379 updateStatusButtons(); … … 373 391 /* Load current status-bar indicator restrictions: */ 374 392 QList<IndicatorType> restrictions = 375 gEDataManager->restrictedStatusBarIndicators( vboxGlobal().managedVMUuid());393 gEDataManager->restrictedStatusBarIndicators(machineID()); 376 394 377 395 /* Invert restriction for sender type: */ … … 382 400 383 401 /* Save updated status-bar indicator restrictions: */ 384 gEDataManager->setRestrictedStatusBarIndicators(restrictions, vboxGlobal().managedVMUuid());402 gEDataManager->setRestrictedStatusBarIndicators(restrictions, machineID()); 385 403 } 386 404 … … 464 482 465 483 /* Listen for the status-bar configuration changes: */ 466 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange( )),467 this, SLOT(sltHandleConfigurationChange( )));484 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)), 485 this, SLOT(sltHandleConfigurationChange(const QString&))); 468 486 469 487 /* Update status buttons: */ … … 490 508 { 491 509 /* Recache status-bar configuration: */ 492 m_restrictions = gEDataManager->restrictedStatusBarIndicators( vboxGlobal().managedVMUuid());493 m_order = gEDataManager->statusBarIndicatorOrder( vboxGlobal().managedVMUuid());510 m_restrictions = gEDataManager->restrictedStatusBarIndicators(machineID()); 511 m_order = gEDataManager->statusBarIndicatorOrder(machineID()); 494 512 for (int iType = IndicatorType_Invalid; iType < IndicatorType_Max; ++iType) 495 513 if (iType != IndicatorType_Invalid && iType != IndicatorType_KeyboardExtension && … … 688 706 /* Load current status-bar indicator order and make sure it's complete: */ 689 707 QList<IndicatorType> order = 690 gEDataManager->statusBarIndicatorOrder( vboxGlobal().managedVMUuid());708 gEDataManager->statusBarIndicatorOrder(machineID()); 691 709 for (int iType = IndicatorType_Invalid; iType < IndicatorType_Max; ++iType) 692 710 if (iType != IndicatorType_Invalid && iType != IndicatorType_KeyboardExtension && … … 703 721 704 722 /* Save updated status-bar indicator order: */ 705 gEDataManager->setStatusBarIndicatorOrder(order, vboxGlobal().managedVMUuid());723 gEDataManager->setStatusBarIndicatorOrder(order, machineID()); 706 724 } 707 725 … … 719 737 720 738 UIStatusBarEditorWindow::UIStatusBarEditorWindow(UIMachineWindow *pParent) 721 : UISlidingToolBar(pParent, pParent->statusBar(), new UIStatusBarEditorWidget , UISlidingToolBar::Position_Bottom)739 : UISlidingToolBar(pParent, pParent->statusBar(), new UIStatusBarEditorWidget(0, vboxGlobal().managedVMUuid()), UISlidingToolBar::Position_Bottom) 722 740 { 723 741 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r53068 r53320 121 121 122 122 #ifndef RT_OS_DARWIN 123 void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange() 124 { 123 void UIMachineWindowNormal::sltHandleMenuBarConfigurationChange(const QString &strMachineID) 124 { 125 /* Skip unrelated machine IDs: */ 126 if (vboxGlobal().managedVMUuid() != strMachineID) 127 return; 128 125 129 /* Check whether menu-bar is enabled: */ 126 130 const bool fEnabled = gEDataManager->menuBarEnabled(vboxGlobal().managedVMUuid()); … … 150 154 #endif /* !RT_OS_DARWIN */ 151 155 152 void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange() 153 { 156 void UIMachineWindowNormal::sltHandleStatusBarConfigurationChange(const QString &strMachineID) 157 { 158 /* Skip unrelated machine IDs: */ 159 if (vboxGlobal().managedVMUuid() != strMachineID) 160 return; 161 154 162 /* Check whether status-bar is enabled: */ 155 163 const bool fEnabled = gEDataManager->statusBarEnabled(vboxGlobal().managedVMUuid()); … … 246 254 connect(menuBar(), SIGNAL(customContextMenuRequested(const QPoint&)), 247 255 this, SLOT(sltHandleMenuBarContextMenuRequest(const QPoint&))); 248 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange( )),249 this, SLOT(sltHandleMenuBarConfigurationChange( )));256 connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange(const QString&)), 257 this, SLOT(sltHandleMenuBarConfigurationChange(const QString&))); 250 258 /* Update menu-bar: */ 251 259 updateMenu(); … … 278 286 } 279 287 /* Post-configure status-bar: */ 280 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange( )),281 this, SLOT(sltHandleStatusBarConfigurationChange( )));288 connect(gEDataManager, SIGNAL(sigStatusBarConfigurationChange(const QString&)), 289 this, SLOT(sltHandleStatusBarConfigurationChange(const QString&))); 282 290 } 283 291 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r52727 r53320 59 59 #ifndef RT_OS_DARWIN 60 60 /** Handles menu-bar configuration-change. */ 61 void sltHandleMenuBarConfigurationChange( );61 void sltHandleMenuBarConfigurationChange(const QString &strMachineID); 62 62 /** Handles menu-bar context-menu-request. */ 63 63 void sltHandleMenuBarContextMenuRequest(const QPoint &position); … … 65 65 66 66 /** Handles status-bar configuration-change. */ 67 void sltHandleStatusBarConfigurationChange( );67 void sltHandleStatusBarConfigurationChange(const QString &strMachineID); 68 68 /** Handles status-bar context-menu-request. */ 69 69 void sltHandleStatusBarContextMenuRequest(const QPoint &position);
Note:
See TracChangeset
for help on using the changeset viewer.