VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxMediaComboBox.h@ 23740

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

FE/Qt4: Storage Settings UI: Removing 'device' combo from the right pane, updating context menu, updating icons, few fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 2.7 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxMediaComboBox class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef __VBoxMediaComboBox_h__
24#define __VBoxMediaComboBox_h__
25
26#include "VBoxGlobal.h"
27
28#include <QComboBox>
29#include <QPixmap>
30
31class VBoxMediaComboBox : public QComboBox
32{
33 Q_OBJECT
34
35public:
36
37 typedef QMap <QString, QString> BaseToDiffMap;
38
39 VBoxMediaComboBox (QWidget *aParent);
40
41 void refresh();
42 void repopulate();
43
44 QString id (int = -1) const;
45 QString location (int = -1) const;
46 VBoxDefs::MediumType type() const { return mType; }
47
48 void setCurrentItem (const QString &aItemId);
49 void setType (VBoxDefs::MediumType aMediumType);
50 void setMachineId (const QString &aMachineId = QString::null);
51 void setNullItemPresent (bool aNullItemPresent);
52
53 void setShowDiffs (bool aShowDiffs);
54 bool showDiffs() const { return mShowDiffs; }
55
56protected slots:
57
58 void mediumEnumStarted();
59 void mediumEnumerated (const VBoxMedium &);
60
61 void mediumAdded (const VBoxMedium &);
62 void mediumUpdated (const VBoxMedium &);
63 void mediumRemoved (VBoxDefs::MediumType, const QString &);
64
65 void processActivated (int aIndex);
66// void processIndexChanged (int aIndex);
67
68 void processOnItem (const QModelIndex &aIndex);
69
70protected:
71
72 void updateToolTip (int);
73
74 void appendItem (const VBoxMedium &);
75 void replaceItem (int, const VBoxMedium &);
76
77 bool findMediaIndex (const QString &aId, int &aIndex);
78
79 VBoxDefs::MediumType mType;
80
81 /** Obtruncated VBoxMedium structure. */
82 struct Medium
83 {
84 Medium() {}
85 Medium (const QString &aId, const QString &aLocation,
86 const QString aToolTip)
87 : id (aId), location (aLocation), toolTip (aToolTip) {}
88
89 QString id;
90 QString location;
91 QString toolTip;
92 };
93
94 typedef QVector <Medium> Media;
95 Media mMedia;
96
97 QString mLastId;
98
99 bool mShowDiffs : 1;
100 bool mShowNullItem : 1;
101
102 QString mMachineId;
103};
104
105#endif /* __VBoxMediaComboBox_h__ */
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