VirtualBox

Changeset 14467 in vbox for trunk


Ignore:
Timestamp:
Nov 21, 2008 3:25:20 PM (16 years ago)
Author:
vboxsync
Message:

Fe/Qt4: Systray: Hide systray icon only instead of exiting selector window.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
2 edited

Legend:

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

    r14449 r14467  
    194194public slots:
    195195
     196    void trayIconShow (bool aShow = false);
    196197
    197198private slots:
     
    219220
    220221    QAction *mShowSelectorAction;
    221     QAction *mExitSelectorAction;
     222    QAction *mHideSystrayMenuAction;
    222223    QAction *mVmConfigAction;
    223224    QAction *mVmDeleteAction;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r14456 r14467  
    16111611    mShowSelectorAction->setIcon (VBoxGlobal::iconSet (
    16121612        ":/VirtualBox_16px.png"));
    1613     mExitSelectorAction = new QAction (this);
    1614     Assert (mExitSelectorAction);
    1615     mExitSelectorAction->setIcon (VBoxGlobal::iconSet (
     1613    mHideSystrayMenuAction = new QAction (this);
     1614    Assert (mHideSystrayMenuAction);
     1615    mHideSystrayMenuAction->setIcon (VBoxGlobal::iconSet (
    16161616        ":/exit_16px.png"));
    16171617
     
    16741674
    16751675    connect (mShowSelectorAction, SIGNAL (triggered()), mParent, SLOT (showWindow()));
    1676     connect (mExitSelectorAction, SIGNAL (triggered()), mParent, SLOT (fileExit()));
     1676    connect (mHideSystrayMenuAction, SIGNAL (triggered()), this, SLOT (trayIconShow()));
    16771677
    16781678    retranslateUi();
     
    16821682{
    16831683    hide();
     1684}
     1685
     1686void VBoxTrayIcon::retranslateUi ()
     1687{
     1688    if (!mActive)
     1689        return;
     1690
     1691    QFont fontBold;
     1692    fontBold.setBold (true);
     1693
     1694    mShowSelectorAction->setText (VBoxVMListView::tr ("Show Selector Window"));
     1695    mShowSelectorAction->setStatusTip (VBoxVMListView::tr ("Shows the selector window assigned to this menu"));
     1696    mShowSelectorAction->setFont(fontBold);
     1697
     1698    mHideSystrayMenuAction->setText (VBoxVMListView::tr ("Hide this menu"));
     1699    mHideSystrayMenuAction->setStatusTip (VBoxVMListView::tr ("Removes this menu from the systray"));
     1700
     1701    mVmConfigAction->setText (VBoxVMListView::tr ("&Settings..."));
     1702    mVmConfigAction->setStatusTip (VBoxVMListView::tr ("Configure the selected virtual machine"));
     1703
     1704    mVmDeleteAction->setText (VBoxVMListView::tr ("&Delete"));
     1705    mVmDeleteAction->setStatusTip (VBoxVMListView::tr ("Delete the selected virtual machine"));
     1706
     1707    mVmPauseAction->setText (VBoxVMListView::tr ("&Pause"));
     1708    mVmPauseAction->setStatusTip (VBoxVMListView::tr ("Suspend the execution of the virtual machine"));
     1709
     1710    mVmDiscardAction->setText (VBoxVMListView::tr ("D&iscard"));
     1711    mVmDiscardAction->setStatusTip (VBoxVMListView::tr ("Discard the saved state of the selected virtual machine"));
     1712
     1713    mVmShowLogsAction->setText (VBoxVMListView::tr ("Show &Log..."));
     1714    mVmShowLogsAction->setStatusTip (VBoxVMListView::tr ("Show the log files of the selected virtual machine"));
    16841715}
    16851716
     
    18031834}
    18041835
    1805 void VBoxTrayIcon::retranslateUi ()
    1806 {
    1807     if (!mActive)
    1808         return;
    1809 
    1810     QFont fontBold;
    1811     fontBold.setBold (true);
    1812 
    1813     mShowSelectorAction->setText (VBoxVMListView::tr ("Show Selector Window"));
    1814     mShowSelectorAction->setStatusTip (VBoxVMListView::tr ("Shows the selector window assigned to this menu"));
    1815     mShowSelectorAction->setFont(fontBold);
    1816 
    1817     mExitSelectorAction->setText (VBoxVMListView::tr ("Exit Selector Window"));
    1818     mExitSelectorAction->setStatusTip (VBoxVMListView::tr ("Exits the selector window assigned to this menu"));
    1819 
    1820     mVmConfigAction->setText (VBoxVMListView::tr ("&Settings..."));
    1821     mVmConfigAction->setStatusTip (VBoxVMListView::tr ("Configure the selected virtual machine"));
    1822 
    1823     mVmDeleteAction->setText (VBoxVMListView::tr ("&Delete"));
    1824     mVmDeleteAction->setStatusTip (VBoxVMListView::tr ("Delete the selected virtual machine"));
    1825 
    1826     mVmPauseAction->setText (VBoxVMListView::tr ("&Pause"));
    1827     mVmPauseAction->setStatusTip (VBoxVMListView::tr ("Suspend the execution of the virtual machine"));
    1828 
    1829     mVmDiscardAction->setText (VBoxVMListView::tr ("D&iscard"));
    1830     mVmDiscardAction->setStatusTip (VBoxVMListView::tr ("Discard the saved state of the selected virtual machine"));
    1831 
    1832     mVmShowLogsAction->setText (VBoxVMListView::tr ("Show &Log..."));
    1833     mVmShowLogsAction->setStatusTip (VBoxVMListView::tr ("Show the log files of the selected virtual machine"));
    1834 }
    1835 
    18361836void VBoxTrayIcon::hideSubMenu ()
    18371837{
     
    19071907        mTrayIconMenu->addSeparator();
    19081908
    1909     mTrayIconMenu->addAction (mExitSelectorAction);
     1909    mTrayIconMenu->addAction (mHideSystrayMenuAction);
    19101910
    19111911    /* We're done constructing the menu, show it */
     
    19271927}
    19281928
     1929void VBoxTrayIcon::trayIconShow (bool aShow)
     1930{
     1931    mActive = aShow;
     1932    refresh();
     1933    setVisible (mActive);
     1934
     1935    VBoxGlobalSettings settings = vboxGlobal().settings();
     1936    settings.setTrayIconEnabled (mActive);
     1937    settings.save (vboxGlobal().virtualBox());
     1938}
     1939
    19291940void VBoxTrayIcon::vmSettings()
    19301941{
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