Changeset 14509 in vbox for trunk/src/VBox
- Timestamp:
- Nov 24, 2008 10:49:09 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h
r14056 r14509 118 118 #endif 119 119 ChangeGUILanguageEventType, 120 #if defined (VBOX_GUI_WITH_SYSTRAY) 121 ChangeGUITrayIconEventType, 122 #endif 120 123 AddVDMUrlsEventType 121 124 }; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r14442 r14509 390 390 }; 391 391 392 #ifdef VBOX_GUI_WITH_SYSTRAY 393 class VBoxChangeGUITrayIconEvent : public QEvent 394 { 395 public: 396 VBoxChangeGUITrayIconEvent (bool aEnabled) 397 : QEvent ((QEvent::Type) VBoxDefs::ChangeGUITrayIconEventType) 398 , mEnabled (aEnabled) 399 {} 400 401 const bool mEnabled; 402 }; 403 #endif 404 392 405 class Process : public QProcess 393 406 { … … 915 928 916 929 /* signals emitted when the VirtualBox callback is called by the server 917 * (not that currently these signals are emitted only when the application930 * (note that currently these signals are emitted only when the application 918 931 * is the in the VM selector mode) */ 919 932 … … 923 936 void sessionStateChanged (const VBoxSessionStateChangeEvent &e); 924 937 void snapshotChanged (const VBoxSnapshotEvent &e); 938 void systrayIconChanged (const VBoxChangeGUITrayIconEvent& e); 925 939 926 940 void canShowRegDlg (bool aCanShow); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r14478 r14509 132 132 void sessionStateChanged (const VBoxSessionStateChangeEvent &e); 133 133 void snapshotChanged (const VBoxSnapshotEvent &e); 134 #ifdef VBOX_GUI_WITH_SYSTRAY 135 void systrayIconChanged (const VBoxChangeGUITrayIconEvent &e); 136 #endif 134 137 135 138 private: -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r14442 r14509 831 831 if (sKey == "GUI/LanguageID") 832 832 QApplication::postEvent (&mGlobal, new VBoxChangeGUILanguageEvent (sVal)); 833 #ifdef VBOX_GUI_WITH_SYSTRAY 834 if (sKey == "GUI/TrayIcon/Enabled") 835 QApplication::postEvent (&mGlobal, new VBoxChangeGUITrayIconEvent ((sVal.toLower() == "true") ? true : false)); 836 #endif 833 837 834 838 mMutex.lock(); … … 5031 5035 { 5032 5036 loadLanguage (static_cast<VBoxChangeGUILanguageEvent*> (e)->mLangId); 5037 return true; 5038 } 5039 case VBoxDefs::ChangeGUITrayIconEventType: 5040 { 5041 emit systrayIconChanged (*(VBoxChangeGUITrayIconEvent *) e); 5033 5042 return true; 5034 5043 } -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r14490 r14509 674 674 connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent &)), 675 675 this, SLOT (snapshotChanged (const VBoxSnapshotEvent &))); 676 #ifdef VBOX_GUI_WITH_SYSTRAY 677 connect (&vboxGlobal(), SIGNAL (systrayIconChanged (const VBoxChangeGUITrayIconEvent &)), 678 this, SLOT (systrayIconChanged (const VBoxChangeGUITrayIconEvent &))); 679 #endif 676 680 677 681 /* bring the VM list to the focus */ … … 739 743 740 744 delete dlg; 741 742 /* Reload settings. */743 settings = vboxGlobal().settings();744 745 /* Update GUI settings. */746 #ifdef VBOX_GUI_WITH_SYSTRAY747 mTrayIcon->trayIconShow (settings.trayIconEnabled());748 #endif749 745 } 750 746 … … 1617 1613 #ifdef VBOX_GUI_WITH_SYSTRAY 1618 1614 1615 void VBoxSelectorWnd::systrayIconChanged (const VBoxChangeGUITrayIconEvent &aEvent) 1616 { 1617 mTrayIcon->trayIconShow (aEvent.mEnabled); 1618 } 1619 1619 1620 VBoxTrayIcon::VBoxTrayIcon (VBoxSelectorWnd* aParent, VBoxVMModel* aVMModel) 1620 1621 { … … 1937 1938 } 1938 1939 setVisible (mActive); 1939 1940 VBoxGlobalSettings settings = vboxGlobal().settings();1941 settings.setTrayIconEnabled (mActive);1942 1943 CVirtualBox vbox = vboxGlobal().virtualBox();1944 settings.save (vbox);1945 1940 } 1946 1941
Note:
See TracChangeset
for help on using the changeset viewer.