VirtualBox

Changeset 14490 in vbox


Ignore:
Timestamp:
Nov 22, 2008 10:17:17 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39771
Message:

Fe/Qt4: Systray: Show/hide systray on the fly (without restart needed).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r14478 r14490  
    677677    /* bring the VM list to the focus */
    678678    mVMListView->setFocus();
     679
     680#ifdef VBOX_GUI_WITH_SYSTRAY
     681    mTrayIcon->trayIconShow (settings.trayIconEnabled());
     682#endif
    679683}
    680684
     
    735739
    736740    delete dlg;
     741
     742    /* Reload settings. */
     743    settings = vboxGlobal().settings();
     744
     745    /* Update GUI settings. */
     746#ifdef VBOX_GUI_WITH_SYSTRAY   
     747    mTrayIcon->trayIconShow (settings.trayIconEnabled());
     748#endif
    737749}
    738750
     
    16571669    setContextMenu (mTrayIconMenu);
    16581670
    1659     VBoxGlobalSettings settings = vboxGlobal().settings();
    1660     mActive = QSystemTrayIcon::isSystemTrayAvailable() &&
    1661               settings.trayIconEnabled();
    1662 
    16631671    connect (mShowSelectorAction, SIGNAL (triggered()), mParent, SLOT (showWindow()));
    16641672    connect (mHideSystrayMenuAction, SIGNAL (triggered()), this, SLOT (trayIconShow()));
    16651673
    1666     retranslateUi();
     1674    VBoxGlobalSettings settings = vboxGlobal().settings();
     1675    trayIconShow (settings.trayIconEnabled());
    16671676}
    16681677
     
    19181927void VBoxTrayIcon::trayIconShow (bool aShow)
    19191928{
    1920     mActive = aShow;
    1921     refresh();
     1929    if (false == QSystemTrayIcon::isSystemTrayAvailable())
     1930        return;
     1931
     1932    mActive = aShow;   
     1933    if (mActive)
     1934    {
     1935        refresh();
     1936        retranslateUi();
     1937    }
    19221938    setVisible (mActive);
    19231939
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette