VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.h@ 30868

Last change on this file since 30868 was 30868, checked in by vboxsync, 15 years ago

FE/Qt4: new VMDesktop view in selector window; file system restructure

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 2.5 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * VBoxSnapshotsWgt class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2009 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __VBoxSnapshotsWgt_h__
20#define __VBoxSnapshotsWgt_h__
21
22/* Global includes */
23#include <QTimer>
24
25/* Local includes */
26#include "VBoxSnapshotsWgt.gen.h"
27#include "VBoxGlobal.h"
28#include "QIWithRetranslateUI.h"
29
30/* Local forwards */
31class SnapshotWgtItem;
32
33/* Snapshot age format */
34enum SnapshotAgeFormat
35{
36 AgeInSeconds,
37 AgeInMinutes,
38 AgeInHours,
39 AgeInDays,
40 AgeMax
41};
42
43class VBoxSnapshotsWgt : public QIWithRetranslateUI <QWidget>, public Ui::VBoxSnapshotsWgt
44{
45 Q_OBJECT;
46
47public:
48
49 VBoxSnapshotsWgt (QWidget *aParent);
50
51 void setMachine (const CMachine &aMachine);
52
53protected:
54
55 void retranslateUi();
56
57private slots:
58
59 void onCurrentChanged (QTreeWidgetItem *aItem = 0);
60 void onContextMenuRequested (const QPoint &aPoint);
61 void onItemChanged (QTreeWidgetItem *aItem);
62
63 void restoreSnapshot();
64 void deleteSnapshot();
65 void showSnapshotDetails();
66 void takeSnapshot();
67
68 void machineDataChanged(QString strId);
69 void machineStateChanged(QString strId, KMachineState state);
70 void sessionStateChanged(QString strId, KSessionState state);
71
72 void updateSnapshotsAge();
73
74private:
75
76 void refreshAll();
77 SnapshotWgtItem* findItem (const QString &aSnapshotId);
78 SnapshotWgtItem* curStateItem();
79 void populateSnapshots (const CSnapshot &aSnapshot, QTreeWidgetItem *aItem);
80 SnapshotAgeFormat traverseSnapshotAge (QTreeWidgetItem *aParentItem);
81
82 CMachine mMachine;
83 QString mMachineId;
84 KSessionState mSessionState;
85 SnapshotWgtItem *mCurSnapshotItem;
86 bool mEditProtector;
87
88 QActionGroup *mSnapshotActionGroup;
89 QActionGroup *mCurStateActionGroup;
90
91 QAction *mRestoreSnapshotAction;
92 QAction *mDeleteSnapshotAction;
93 QAction *mShowSnapshotDetailsAction;
94 QAction *mTakeSnapshotAction;
95
96 QTimer mAgeUpdateTimer;
97};
98
99#endif // __VBoxSnapshotsWgt_h__
100
Note: See TracBrowser for help on using the repository browser.

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