Changeset 56058 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 25, 2015 1:42:13 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r56037 r56058 498 498 }; 499 499 500 class UIActionSimplePerformWindowAdjust : public UIActionSimple 501 { 502 Q_OBJECT; 503 504 public: 505 506 UIActionSimplePerformWindowAdjust(UIActionPool *pParent) 507 : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png") {} 508 509 protected: 510 511 /** Returns action extra-data ID. */ 512 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow; } 513 /** Returns action extra-data key. */ 514 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); } 515 /** Returns whether action is allowed. */ 516 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); } 517 518 QString shortcutExtraDataID() const 519 { 520 return QString("WindowAdjust"); 521 } 522 523 QKeySequence defaultShortcut(UIActionPoolType) const 524 { 525 return QKeySequence("A"); 526 } 527 528 void retranslateUi() 529 { 530 setName(QApplication::translate("UIActionPool", "&Adjust Window Size")); 531 setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display")); 532 } 533 }; 534 500 535 class UIActionToggleGuestAutoresize : public UIActionToggle 501 536 { … … 532 567 setName(QApplication::translate("UIActionPool", "Auto-resize &Guest Display")); 533 568 setStatusTip(QApplication::translate("UIActionPool", "Automatically resize the guest display when the window is resized (requires Guest Additions)")); 534 }535 };536 537 class UIActionSimplePerformWindowAdjust : public UIActionSimple538 {539 Q_OBJECT;540 541 public:542 543 UIActionSimplePerformWindowAdjust(UIActionPool *pParent)544 : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png") {}545 546 protected:547 548 /** Returns action extra-data ID. */549 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow; }550 /** Returns action extra-data key. */551 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); }552 /** Returns whether action is allowed. */553 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); }554 555 QString shortcutExtraDataID() const556 {557 return QString("WindowAdjust");558 }559 560 QKeySequence defaultShortcut(UIActionPoolType) const561 {562 return QKeySequence("A");563 }564 565 void retranslateUi()566 {567 setName(QApplication::translate("UIActionPool", "&Adjust Window Size"));568 setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));569 569 } 570 570 }; … … 2031 2031 m_pool[UIActionIndexRT_M_View_T_Seamless] = new UIActionToggleSeamlessMode(this); 2032 2032 m_pool[UIActionIndexRT_M_View_T_Scale] = new UIActionToggleScaleMode(this); 2033 m_pool[UIActionIndexRT_M_View_S_AdjustWindow] = new UIActionSimplePerformWindowAdjust(this); 2033 2034 m_pool[UIActionIndexRT_M_View_T_GuestAutoresize] = new UIActionToggleGuestAutoresize(this); 2034 m_pool[UIActionIndexRT_M_View_S_AdjustWindow] = new UIActionSimplePerformWindowAdjust(this);2035 2035 m_pool[UIActionIndexRT_M_View_S_TakeScreenshot] = new UIActionSimplePerformTakeScreenshot(this); 2036 2036 m_pool[UIActionIndexRT_M_View_M_VideoCapture] = new UIActionMenuVideoCapture(this); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r55977 r56058 957 957 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Seamless)); 958 958 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Scale)); 959 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow)); 959 960 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)); 960 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow));961 961 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD)); 962 962 #ifdef Q_WS_X11 … … 1040 1040 1041 1041 /* 'View' actions connections: */ 1042 connect(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow), SIGNAL(triggered()), 1043 this, SLOT(sltAdjustWindow())); 1042 1044 connect(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize), SIGNAL(toggled(bool)), 1043 1045 this, SLOT(sltToggleGuestAutoresize(bool))); 1044 connect(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow), SIGNAL(triggered()),1045 this, SLOT(sltAdjustWindow()));1046 1046 connect(actionPool()->action(UIActionIndexRT_M_View_S_TakeScreenshot), SIGNAL(triggered()), 1047 1047 this, SLOT(sltTakeScreenshot()));
Note:
See TracChangeset
for help on using the changeset viewer.