1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VBoxMediaComboBox class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
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 as published by the Free Software Foundation,
|
---|
14 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
15 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
16 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * If you received this file as part of a commercial VirtualBox
|
---|
19 | * distribution, then only the terms of your commercial VirtualBox
|
---|
20 | * license agreement apply instead of the previous paragraph.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBoxMediaComboBox_h__
|
---|
24 | #define __VBoxMediaComboBox_h__
|
---|
25 |
|
---|
26 | #include "VBoxGlobal.h"
|
---|
27 |
|
---|
28 | #include <qcombobox.h>
|
---|
29 |
|
---|
30 | class QListBoxItem;
|
---|
31 |
|
---|
32 | class VBoxMediaComboBox : public QComboBox
|
---|
33 | {
|
---|
34 | Q_OBJECT
|
---|
35 |
|
---|
36 | public:
|
---|
37 |
|
---|
38 | VBoxMediaComboBox (QWidget *aParent = 0, const char *aName = 0,
|
---|
39 | int aType = 0, bool aUseEmptyItem = false);
|
---|
40 | ~VBoxMediaComboBox() {}
|
---|
41 |
|
---|
42 | void refresh();
|
---|
43 | void setUseEmptyItem (bool);
|
---|
44 | void setBelongsTo (const QUuid &);
|
---|
45 | QUuid getId();
|
---|
46 | QUuid getBelongsTo();
|
---|
47 | void setCurrentItem (const QUuid &);
|
---|
48 |
|
---|
49 | protected slots:
|
---|
50 |
|
---|
51 | void mediaEnumStarted();
|
---|
52 | void mediaEnumerated (const VBoxMedia &, int);
|
---|
53 | void mediaAdded (const VBoxMedia &);
|
---|
54 | void mediaUpdated (const VBoxMedia &);
|
---|
55 | void mediaRemoved (VBoxDefs::DiskType, const QUuid &);
|
---|
56 | void processOnItem (QListBoxItem *);
|
---|
57 | void processActivated (int);
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | void updateToolTip (int);
|
---|
62 | void processMedia (const VBoxMedia &);
|
---|
63 | void processHdMedia (const VBoxMedia &);
|
---|
64 | void processCdMedia (const VBoxMedia &);
|
---|
65 | void processFdMedia (const VBoxMedia &);
|
---|
66 | void appendItem (const QString &, const QUuid &,
|
---|
67 | const QString &, QPixmap *);
|
---|
68 | void replaceItem (int, const QString &,
|
---|
69 | const QString &, QPixmap *);
|
---|
70 | void updateShortcut (const QString &, const QUuid &, const QString &,
|
---|
71 | VBoxMedia::Status);
|
---|
72 |
|
---|
73 | int mType;
|
---|
74 | QStringList mUuidList;
|
---|
75 | QStringList mTipList;
|
---|
76 | QUuid mMachineId;
|
---|
77 | QUuid mRequiredId;
|
---|
78 | bool mUseEmptyItem;
|
---|
79 | QPixmap mPmInacc;
|
---|
80 | QPixmap mPmError;
|
---|
81 | };
|
---|
82 |
|
---|
83 | #endif /* __VBoxMediaComboBox_h__ */
|
---|