VirtualBox

Ignore:
Timestamp:
Nov 18, 2008 12:36:47 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39479
Message:

Fe/Qt4: Systray: Restructured code.

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

Legend:

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

    r14046 r14296  
    4444class VBoxVMModel;
    4545class VBoxVMItem;
     46class VBoxTrayIcon;
    4647
    4748class QTabWidget;
     
    4950class QEvent;
    5051
    51 class VBoxSelectorWnd: public QIWithRetranslateUI2 <QMainWindow>
     52class VBoxSelectorWnd : public QIWithRetranslateUI2 <QMainWindow>
    5253{
    5354    Q_OBJECT;
     
    8283    void vmRefresh (const QUuid & = QUuid_null);
    8384    void vmShowLogs (const QUuid & = QUuid_null);
    84 
    85 #ifdef VBOX_GUI_WITH_SYSTRAY
    86     void refreshSysTray (bool aRetranslate = false);
    87 #endif
    8885
    8986    void refreshVMList();
     
    159156#ifdef VBOX_GUI_WITH_SYSTRAY
    160157    /* The systray icon */
    161     QSystemTrayIcon *mTrayIcon;
    162     QMenu *mTrayIconMenu;
     158    VBoxTrayIcon *mTrayIcon;
    163159#endif
    164160
     
    179175};
    180176
     177#ifdef VBOX_GUI_WITH_SYSTRAY
     178
     179Q_DECLARE_METATYPE(QUuid);
     180
     181class VBoxTrayIcon : public QSystemTrayIcon
     182{
     183    Q_OBJECT;
     184
     185public:
     186
     187    VBoxTrayIcon (VBoxSelectorWnd* aParent, VBoxVMModel* aVMModel);
     188    virtual ~VBoxTrayIcon ();
     189
     190    void refresh ();
     191    void retranslateUi ();
     192
     193protected:
     194
     195    VBoxVMItem* GetItem (QObject* aObject);
     196
     197signals:
     198
     199public slots:
     200
     201
     202private slots:
     203
     204    void showSubMenu();
     205    void hideSubMenu ();
     206
     207    void vmSettings();
     208    void vmDelete();
     209    void vmStart();
     210    void vmDiscard();
     211    void vmPause(bool aPause);
     212    void vmRefresh();
     213    void vmShowLogs();
     214
     215private:
     216
     217    /* The vm list model */
     218    VBoxVMModel *mVMModel;
     219
     220    VBoxSelectorWnd* mParent;
     221    QMenu *mTrayIconMenu;
     222    QAction *mVmConfigAction;
     223    QAction *mVmDeleteAction;
     224    QAction *mVmStartAction;
     225    QAction *mVmDiscardAction;
     226    QAction *mVmPauseAction;
     227    QAction *mVmRefreshAction;
     228    QAction *mVmShowLogsAction;
     229};
     230
     231#endif // VBOX_GUI_WITH_SYSTRAY
     232
    181233#endif // __VBoxSelectorWnd_h__
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMListView.h

    r14022 r14296  
    6767    ULONG snapshotCount() const { return mSnapshotCount; }
    6868
    69     QAction* vmActionConfig() const { return vmConfigAction; }
    70     QAction* vmActionDelete() const { return vmDeleteAction; }
    71     QAction* vmActionStart() const { return vmStartAction; }
    72     QAction* vmActionDiscard() const { return vmDiscardAction; }
    73     QAction* vmActionPause() const { return vmPauseAction; }
    74     QAction* vmActionRefresh() const { return vmRefreshAction; }
    75     QAction* vmActionShowLogs() const { return vmShowLogsAction; }
    76 
    7769    QString toolTipText() const;
    7870
     
    8880    bool switchTo();
    8981
    90     /* Updates all internal actions depending on the VM's state. */
    91     void updateActions();
    92     void retranslateUi();
    93 
    9482private:
    9583
     
    9785    VBoxSelectorWnd *mParent;
    9886    CMachine mMachine;
    99 
    100     QAction *vmConfigAction;
    101     QAction *vmDeleteAction;
    102     QAction *vmStartAction;
    103     QAction *vmDiscardAction;
    104     QAction *vmPauseAction;
    105     QAction *vmRefreshAction;
    106     QAction *vmShowLogsAction;
    10787
    10888    /* Cached machine data (to minimize server requests) */
     
    122102
    123103    ULONG mPid;
    124 
    125 private slots:
    126 
    127     void vmSettings();
    128     void vmDelete();
    129     void vmStart();
    130     void vmDiscard();
    131     void vmPause(bool aPause);
    132     void vmRefresh();
    133     void vmShowLogs();
    134104};
    135105
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