Changeset 13790 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include
- Timestamp:
- Nov 4, 2008 4:01:42 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r13580 r13790 33 33 /* Qt includes */ 34 34 #include <QMainWindow> 35 #ifdef VBOX_GUI_WITH_SYSTRAY 36 #include <QSystemTrayIcon> 37 #endif 38 #include <QUuid> 35 39 36 40 class VBoxSnapshotsWgt; … … 66 70 67 71 void fileMediaMgr(); 72 VBoxVMItem* getSelectedItem(); 73 #ifdef VBOX_GUI_WITH_SYSTRAY 74 void iconActivated(QSystemTrayIcon::ActivationReason aReason); 75 void showWindow(); 76 #endif 68 77 void fileSettings(); 69 78 void fileExit(); … … 71 80 void vmNew(); 72 81 void vmSettings (const QString &aCategory = QString::null, 73 const QString &aControl = QString::null); 74 void vmDelete(); 75 void vmStart(); 76 void vmDiscard(); 77 void vmPause (bool); 78 void vmRefresh(); 79 void vmShowLogs(); 82 const QString &aControl = QString::null, 83 const QUuid& = ""); 84 void vmDelete(const QUuid& = ""); 85 void vmStart (const QUuid& = ""); 86 void vmDiscard(const QUuid& = ""); 87 void vmPause (bool, const QUuid& = ""); 88 void vmRefresh(const QUuid& = ""); 89 void vmShowLogs(const QUuid& = ""); 80 90 91 #ifdef VBOX_GUI_WITH_SYSTRAY 92 void refreshSysTray(); 93 #endif 81 94 void refreshVMList(); 82 95 void refreshVMItem (const QUuid &aID, bool aDetails, … … 129 142 QAction *fileExitAction; 130 143 QAction *vmNewAction; 144 #ifdef VBOX_GUI_WITH_SYSTRAY 145 QAction *trayShowWindowAction; 146 QAction *trayExitAction; 147 #endif 131 148 QAction *vmConfigAction; 132 149 QAction *vmDeleteAction; … … 138 155 139 156 VBoxHelpActions mHelpActions; 157 158 #ifdef VBOX_GUI_WITH_SYSTRAY 159 /* The systray icon */ 160 QSystemTrayIcon *trayIcon; 161 QMenu *trayIconMenu; 162 #endif 140 163 141 164 /* The vm list view/model */ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMListView.h
r9729 r13790 31 31 #include <QDateTime> 32 32 33 class VBoxVMItem 34 { 35 public: 36 VBoxVMItem (const CMachine &aM); 33 class VBoxVMItem : public QObject 34 { 35 Q_OBJECT; 36 37 public: 38 39 enum Action 40 { 41 Config = 0, 42 Delete, 43 Start, 44 Discard, 45 Pause, 46 Refresh, 47 ShowLogs 48 }; 49 50 public: 51 52 VBoxVMItem (const CMachine &aM, QObject* pParent); 37 53 virtual ~VBoxVMItem(); 38 54 … … 42 58 QIcon osIcon() const { return mAccessible ? vboxGlobal().vmGuestOSTypeIcon (mOSTypeId) :QPixmap (":/os_unknown.png"); } 43 59 QUuid id() const { return mId; } 44 60 45 61 QString sessionStateName() const; 46 62 QIcon sessionStateIcon() const { return mAccessible ? vboxGlobal().toIcon (mState) : QPixmap (":/state_aborted_16px.png"); } … … 49 65 ULONG snapshotCount() const { return mSnapshotCount; } 50 66 67 QAction* vmActionConfig() const { return vmConfigAction; } 68 QAction* vmActionDelete() const { return vmDeleteAction; } 69 QAction* vmActionStart() const { return vmStartAction; } 70 QAction* vmActionDiscard() const { return vmDiscardAction; } 71 QAction* vmActionPause() const { return vmPauseAction; } 72 QAction* vmActionRefresh() const { return vmRefreshAction; } 73 QAction* vmActionShowLogs() const { return vmShowLogsAction; } 74 51 75 QString toolTipText() const; 52 76 53 77 bool accessible() const { return mAccessible; } 78 bool running() const { return (sessionState() != KSessionState_Closed); } 54 79 const CVirtualBoxErrorInfo &accessError() const { return mAccessError; } 55 80 KMachineState state() const { return mState; } … … 60 85 bool canSwitchTo() const; 61 86 bool switchTo(); 87 88 void updateActions(); 62 89 63 90 private: 64 91 65 92 /* Private member vars */ 93 QObject* mParent; 66 94 CMachine mMachine; 95 96 QAction *vmConfigAction; 97 QAction *vmDeleteAction; 98 QAction *vmStartAction; 99 QAction *vmDiscardAction; 100 QAction *vmPauseAction; 101 QAction *vmRefreshAction; 102 QAction *vmShowLogsAction; 67 103 68 104 /* Cached machine data (to minimize server requests) */ … … 82 118 83 119 ULONG mPid; 120 121 private slots: 122 123 void vmSettings(); 124 void vmDelete(); 125 void vmStart(); 126 void vmDiscard(); 127 void vmPause(bool aPause); 128 void vmRefresh(); 129 void vmShowLogs(); 84 130 }; 85 131 … … 111 157 112 158 VBoxVMItem *itemById (const QUuid &aId) const; 159 VBoxVMItem *itemByRow (int aRow) const; 113 160 QModelIndex indexById (const QUuid &aId) const; 114 161 … … 163 210 void mousePressEvent (QMouseEvent *aEvent); 164 211 bool selectCurrent(); 165 }; 212 }; 166 213 167 214 class VBoxVMItemPainter: public QIItemDelegate … … 181 228 inline QIcon::Mode iconMode (QStyle::State aState) const 182 229 { 183 if (!(aState & QStyle::State_Enabled)) 230 if (!(aState & QStyle::State_Enabled)) 184 231 return QIcon::Disabled; 185 if (aState & QStyle::State_Selected) 232 if (aState & QStyle::State_Selected) 186 233 return QIcon::Selected; 187 234 return QIcon::Normal;
Note:
See TracChangeset
for help on using the changeset viewer.