VirtualBox

Changeset 14455 in vbox


Ignore:
Timestamp:
Nov 21, 2008 1:15:28 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39725
Message:

Fe/Qt4: Systray:

  • Removed "Delete" action from VM sub menu.
  • Made the "Show Selector Window" entry bold.
  • Added re-translation support for show/exit actions.
  • Added separators to systray menu (only when VMs are existing).
Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
3 edited

Legend:

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

    r10219 r14455  
    4747    QString languageId;
    4848    QString maxGuestRes;
     49    bool trayIconEnabled;
    4950
    5051    friend class VBoxGlobalSettings;
     
    6162    Q_PROPERTY (QString languageId READ languageId WRITE setLanguageId)
    6263    Q_PROPERTY (QString maxGuestRes READ maxGuestRes WRITE setMaxGuestRes)
     64    Q_PROPERTY (bool trayIconEnabled READ trayIconEnabled WRITE setTrayIconEnabled)
    6365
    6466public:
     
    103105    }
    104106
     107    bool trayIconEnabled() const { return data()->trayIconEnabled; }
     108    void setTrayIconEnabled (bool enabled) {
     109        mData()->trayIconEnabled = enabled;
     110    }
     111
    105112    //
    106113
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobalSettings.cpp

    r10219 r14455  
    6060    languageId  = QString::null;
    6161    maxGuestRes = "auto";
     62    trayIconEnabled = true;
    6263}
    6364
     
    6970    languageId  = that.languageId;
    7071    maxGuestRes = that.maxGuestRes;
     72    trayIconEnabled = that.trayIconEnabled;
    7173}
    7274
     
    8284         guiFeatures == that.guiFeatures &&
    8385         languageId  == that.languageId &&
    84          maxGuestRes == that.maxGuestRes);
     86         maxGuestRes == that.maxGuestRes &&
     87         trayIconEnabled == that.trayIconEnabled);
    8588}
    8689
     
    103106gPropertyMap[] =
    104107{
    105     { "GUI/Input/HostKey",      "hostKey",      "\\d*[1-9]\\d*", true },
    106     { "GUI/Input/AutoCapture",  "autoCapture",  "true|false", true },
    107     { "GUI/Customizations",     "guiFeatures",  "\\S+", true },
    108     { "GUI/LanguageID",         "languageId",   gVBoxLangIDRegExp, true },
    109     { "GUI/MaxGuestResolution", "maxGuestRes",  "\\d*[1-9]\\d*,\\d*[1-9]\\d*|any|auto", true }
     108    { "GUI/Input/HostKey",       "hostKey",         "\\d*[1-9]\\d*", true },
     109    { "GUI/Input/AutoCapture",   "autoCapture",     "true|false", true },
     110    { "GUI/Customizations",      "guiFeatures",     "\\S+", true },
     111    { "GUI/LanguageID",          "languageId",      gVBoxLangIDRegExp, true },
     112    { "GUI/MaxGuestResolution",  "maxGuestRes",     "\\d*[1-9]\\d*,\\d*[1-9]\\d*|any|auto", true },
     113    { "GUI/TrayIcon/Enabled",    "trayIconEnabled", "true|false", true }
    110114};
    111115
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r14449 r14455  
    16071607    mShowSelectorAction->setIcon (VBoxGlobal::iconSet (
    16081608        ":/VirtualBox_16px.png"));
    1609     mShowSelectorAction->setText (VBoxVMListView::tr ("Show Selector Window"));
    1610     mShowSelectorAction->setStatusTip (VBoxVMListView::tr ("Shows the selector window assigned to this menu"));
    16111609    mExitSelectorAction = new QAction (this);
    16121610    Assert (mExitSelectorAction);
    16131611    mExitSelectorAction->setIcon (VBoxGlobal::iconSet (
    16141612        ":/exit_16px.png"));
    1615     mExitSelectorAction->setText (VBoxVMListView::tr ("Exit Selector Window"));
    1616     mExitSelectorAction->setStatusTip (VBoxVMListView::tr ("Exits the selector window assigned to this menu"));
    16171613
    16181614    mVmConfigAction = new QAction (this);
     
    16711667    VBoxGlobalSettings settings = vboxGlobal().settings();
    16721668    mActive = QSystemTrayIcon::isSystemTrayAvailable() &&
    1673               !settings.isFeatureActive ("noSystrayMenu");
     1669              settings.trayIconEnabled();
    16741670
    16751671    connect (mShowSelectorAction, SIGNAL (triggered()), mParent, SLOT (showWindow()));
     
    18011797    pMenu->addAction (mVmStartAction);
    18021798    pMenu->addAction (mVmPauseAction);
    1803     pMenu->addAction (mVmDeleteAction);
    18041799}
    18051800
     
    18081803    if (!mActive)
    18091804        return;
     1805
     1806    QFont fontBold;
     1807    fontBold.setBold (true);
     1808
     1809    mShowSelectorAction->setText (VBoxVMListView::tr ("Show Selector Window"));
     1810    mShowSelectorAction->setStatusTip (VBoxVMListView::tr ("Shows the selector window assigned to this menu"));
     1811    mShowSelectorAction->setFont(fontBold);
     1812
     1813    mExitSelectorAction->setText (VBoxVMListView::tr ("Exit Selector Window"));
     1814    mExitSelectorAction->setStatusTip (VBoxVMListView::tr ("Exits the selector window assigned to this menu"));
    18101815
    18111816    mVmConfigAction->setText (VBoxVMListView::tr ("&Settings..."));
     
    18621867
    18631868    mTrayIconMenu->addAction (mShowSelectorAction);
     1869
     1870    if (mVMModel->rowCount() > 0)
     1871        mTrayIconMenu->addSeparator();
    18641872
    18651873    for (int i = 0; i < mVMModel->rowCount(); i++, iCurItemCount++)
     
    18921900    }
    18931901
     1902    if (mVMModel->rowCount() > 0)
     1903        mTrayIconMenu->addSeparator();
     1904
    18941905    mTrayIconMenu->addAction (mExitSelectorAction);
    18951906
Note: See TracChangeset for help on using the changeset viewer.

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