Changeset 26581 in vbox
- Timestamp:
- Feb 16, 2010 2:21:00 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
-
VBoxConsoleWnd.cpp (modified) (5 diffs)
-
VBoxConsoleWnd.h (modified) (3 diffs)
-
globals/VBoxGlobal.cpp (modified) (2 diffs)
-
settings/global/VBoxGLSettingsGeneral.cpp (modified) (4 diffs)
-
settings/global/VBoxGLSettingsGeneral.ui (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r26568 r26581 678 678 #endif 679 679 680 #ifdef Q_WS_MAC 681 m_pDockMenu = new QMenu(this); 682 /* Add all VM menu entries to the dock menu. Leave out close and stuff like 683 * this. */ 684 QList<QAction*> actions = mVMMenu->actions(); 685 for (int i=0; i < actions.size(); ++i) 686 if (actions.at(i)->menuRole() == QAction::TextHeuristicRole) 687 m_pDockMenu->addAction(actions.at(i)); 688 m_pDockMenu->addSeparator(); 689 690 m_pDockSettingsMenu = new QMenu(this); 691 QActionGroup *pDockPreviewModeGroup = new QActionGroup(this); 692 m_pDockEnablePreviewMonitor = new QAction(pDockPreviewModeGroup); 693 m_pDockEnablePreviewMonitor->setCheckable(true); 694 m_pDockDisablePreview = new QAction(pDockPreviewModeGroup); 695 m_pDockDisablePreview->setCheckable(true); 696 m_pDockSettingsMenu->addActions(pDockPreviewModeGroup->actions()); 697 698 m_pDockMenu->addMenu(m_pDockSettingsMenu); 699 700 /* Add it to the dock. */ 701 extern void qt_mac_set_dock_menu(QMenu *); 702 qt_mac_set_dock_menu(m_pDockMenu); 703 #endif /* Q_WS_MAC */ 704 680 705 /* add to statusbar */ 681 706 statusBar()->addPermanentWidget (indicatorBox, 0); … … 739 764 this, SLOT (processGlobalSettingChange (const char *, const char *))); 740 765 #ifdef Q_WS_MAC 766 connect(pDockPreviewModeGroup, SIGNAL(triggered(QAction*)), 767 this, SLOT(sltDockPreviewModeChanged(QAction*))); 741 768 connect (&vboxGlobal(), SIGNAL (dockIconUpdateChanged (const VBoxChangeDockIconUpdateEvent &)), 742 769 this, SLOT (changeDockIconUpdate (const VBoxChangeDockIconUpdateEvent &))); … … 777 804 #endif 778 805 } 806 807 #ifdef Q_WS_MAC 808 void VBoxConsoleWnd::sltDockPreviewModeChanged(QAction *pAction) 809 { 810 if (mConsole) 811 { 812 CMachine machine = mSession.GetMachine(); 813 if (!machine.isNull()) 814 { 815 if (pAction == m_pDockDisablePreview) 816 machine.SetExtraData(VBoxDefs::GUI_RealtimeDockIconUpdateEnabled, "false"); 817 else if (pAction == m_pDockEnablePreviewMonitor) 818 machine.SetExtraData(VBoxDefs::GUI_RealtimeDockIconUpdateEnabled, "true"); 819 mConsole->updateDockOverlay(); 820 } 821 } 822 } 823 #endif /* Q_WS_MAC */ 779 824 780 825 /** … … 1002 1047 1003 1048 #ifdef Q_WS_MAC 1004 QString testStr = vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_RealtimeDockIconUpdateEnabled).toLower();1049 QString strTest = machine.GetExtraData(VBoxDefs::GUI_RealtimeDockIconUpdateEnabled).toLower(); 1005 1050 /* Default to true if it is an empty value */ 1006 bool f = (testStr.isEmpty() || testStr == "true"); 1051 bool f = (strTest.isEmpty() || strTest == "true"); 1052 if (f) 1053 m_pDockEnablePreviewMonitor->setChecked(true); 1054 else 1055 m_pDockDisablePreview->setChecked(true); 1007 1056 mConsole->setDockIconEnabled (f); 1008 1057 mConsole->updateDockOverlay(); … … 1759 1808 mHelpMenu->setTitle (tr ("&Help")); 1760 1809 // mHelpMenu->setIcon (VBoxGlobal::iconSet (":/help_16px.png")); 1810 1811 #ifdef Q_WS_MAC 1812 m_pDockSettingsMenu->setTitle(tr("Dock Icon")); 1813 m_pDockDisablePreview->setText(tr("Show Application Icon")); 1814 m_pDockEnablePreviewMonitor->setText(tr("Show Monitor Preview")); 1815 #endif /* Q_WS_MAC */ 1761 1816 1762 1817 /* Status bar widgets */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.h
r26567 r26581 115 115 void onDisplayResize (ulong aWidth, ulong aHeight); 116 116 117 #ifdef VBOX_WITH_VIDEOHWACCEL118 117 /* used for obtaining the extradata settings */ 119 118 CSession &session() { return mSession; } 120 #endif121 119 signals: 122 120 … … 188 186 void changePresentationMode (const VBoxChangePresentationModeEvent &aEvent); 189 187 void processGlobalSettingChange (const char *aPublicName, const char *aName); 188 189 #ifdef RT_OS_DARWIN /* Stupid moc doesn't recognize Q_WS_MAC */ 190 void sltDockPreviewModeChanged(QAction *pAction); 191 #endif /* RT_OS_DARWIN */ 190 192 191 193 #ifdef VBOX_WITH_DEBUGGER_GUI … … 308 310 #endif 309 311 312 #ifdef Q_WS_MAC 313 QMenu *m_pDockMenu; 314 QMenu *m_pDockSettingsMenu; 315 QAction *m_pDockDisablePreview; 316 QAction *m_pDockEnablePreviewMonitor; 317 #endif /* Q_WS_MAC */ 318 310 319 /* Timer to update LEDs */ 311 320 QTimer *mIdleTimer; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r26553 r26581 373 373 #endif 374 374 #ifdef Q_WS_MAC 375 if (sKey == VBoxDefs::GUI_RealtimeDockIconUpdateEnabled) 376 { 377 /* Default to true if it is an empty value */ 378 QString testStr = sVal.toLower(); 379 bool f = (testStr.isEmpty() || testStr == "true"); 380 QApplication::postEvent (&mGlobal, new VBoxChangeDockIconUpdateEvent (f)); 381 } 382 else if (sKey == VBoxDefs::GUI_PresentationModeEnabled) 375 if (sKey == VBoxDefs::GUI_PresentationModeEnabled) 383 376 { 384 377 /* Default to true if it is an empty value */ … … 395 388 } 396 389 } 390 #ifdef Q_WS_MAC 391 else if (mGlobal.isVMConsoleProcess()) 392 { 393 /* Check for the currently running machine */ 394 CMachine machine = mGlobal.consoleWnd().session().GetMachine(); 395 if (QString::fromUtf16(id) == machine.GetId()) 396 { 397 QString strKey = QString::fromUtf16(key); 398 QString strVal = QString::fromUtf16(value); 399 if (strKey == VBoxDefs::GUI_RealtimeDockIconUpdateEnabled) 400 { 401 /* Default to true if it is an empty value */ 402 QString strTest = strVal.toLower(); 403 bool f = (strTest.isEmpty() || strTest == "true"); 404 QApplication::postEvent(&mGlobal, new VBoxChangeDockIconUpdateEvent(f)); 405 } 406 } 407 } 408 #endif /* Q_WS_MAC */ 397 409 return S_OK; 398 410 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.cpp
r25319 r26581 34 34 mCbCheckTrayIcon->hide(); 35 35 #endif /* VBOX_GUI_WITH_SYSTRAY */ 36 #ifndef Q_WS_MAC37 mCbCheckDockPreview->hide();38 #endif /* Q_WS_MAC */39 36 #ifndef QT_MAC_USE_COCOA 40 37 mCbCheckPresentationMode->hide(); 41 38 #endif /* QT_MAC_USE_COCOA */ 42 39 if ( mCbCheckTrayIcon->isHidden() 43 && mCbCheckDockPreview->isHidden()44 40 && mCbCheckPresentationMode->isHidden()) 45 41 mLnSeparator2->hide(); … … 62 58 mCbCheckTrayIcon->setChecked (aGs.trayIconEnabled()); 63 59 #ifdef Q_WS_MAC 64 mCbCheckDockPreview->setChecked (aGs.dockPreviewEnabled());65 60 mCbCheckPresentationMode->setChecked (aGs.presentationModeEnabled()); 66 61 #endif /* Q_WS_MAC */ … … 78 73 aGs.setTrayIconEnabled (mCbCheckTrayIcon->isChecked()); 79 74 #ifdef Q_WS_MAC 80 aGs.setDockPreviewEnabled (mCbCheckDockPreview->isChecked());81 75 aGs.setPresentationModeEnabled (mCbCheckPresentationMode->isChecked()); 82 76 #endif /* Q_WS_MAC */ … … 89 83 setTabOrder (mPsMach, mPsVRDP); 90 84 setTabOrder (mPsVRDP, mCbCheckTrayIcon); 91 #ifdef Q_WS_MAC92 setTabOrder (mCbCheckTrayIcon, mCbCheckDockPreview);93 #endif /* Q_WS_MAC */94 85 } 95 86 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsGeneral.ui
r25318 r26581 24 24 <x>0</x> 25 25 <y>0</y> 26 <width> 402</width>27 <height> 212</height>26 <width>379</width> 27 <height>173</height> 28 28 </rect> 29 29 </property> … … 128 128 </widget> 129 129 </item> 130 <item row="6" column="1" colspan="2"> 131 <widget class="QCheckBox" name="mCbCheckDockPreview"> 132 <property name="whatsThis"> 133 <string>When checked, the Dock Icon will reflect the VM window content in realtime.</string> 134 </property> 135 <property name="text"> 136 <string>&Dock Icon Realtime Preview</string> 137 </property> 138 <property name="checked"> 139 <bool>true</bool> 140 </property> 141 </widget> 142 </item> 143 <item row="11" column="0" colspan="3"> 130 <item row="10" column="0" colspan="3"> 144 131 <spacer> 145 132 <property name="orientation"> … … 154 141 </spacer> 155 142 </item> 156 <item row=" 7" column="1" colspan="2">143 <item row="6" column="1" colspan="2"> 157 144 <widget class="QCheckBox" name="mCbCheckPresentationMode"> 158 145 <property name="text">
Note:
See TracChangeset
for help on using the changeset viewer.

