1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxVMInformationDlg class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2009 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 __VBoxVMInformationDlg_h__
|
---|
24 | #define __VBoxVMInformationDlg_h__
|
---|
25 |
|
---|
26 | #include "VBoxVMInformationDlg.gen.h"
|
---|
27 | #include "QIMainDialog.h"
|
---|
28 | #include "COMDefs.h"
|
---|
29 | #include "QIWithRetranslateUI.h"
|
---|
30 |
|
---|
31 | class VBoxConsoleView;
|
---|
32 | class QTimer;
|
---|
33 |
|
---|
34 | class VBoxVMInformationDlg : public QIWithRetranslateUI2 <QIMainDialog>, public Ui::VBoxVMInformationDlg
|
---|
35 | {
|
---|
36 | Q_OBJECT;
|
---|
37 |
|
---|
38 | public:
|
---|
39 |
|
---|
40 | typedef QMap <QString, QString> DataMapType;
|
---|
41 | typedef QMap <QString, QStringList> LinksMapType;
|
---|
42 | struct CounterElementType { QString type; DataMapType list; };
|
---|
43 | typedef QMap <QString, VBoxVMInformationDlg*> InfoDlgMap;
|
---|
44 |
|
---|
45 | static void createInformationDlg (const CSession &aSession, VBoxConsoleView *aConsole);
|
---|
46 |
|
---|
47 | protected:
|
---|
48 |
|
---|
49 | VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, Qt::WindowFlags aFlags);
|
---|
50 | ~VBoxVMInformationDlg();
|
---|
51 |
|
---|
52 | void retranslateUi();
|
---|
53 |
|
---|
54 | virtual bool event (QEvent *aEvent);
|
---|
55 | virtual void resizeEvent (QResizeEvent *aEvent);
|
---|
56 | virtual void showEvent (QShowEvent *aEvent);
|
---|
57 |
|
---|
58 | private slots:
|
---|
59 |
|
---|
60 | void updateDetails();
|
---|
61 | void processStatistics();
|
---|
62 | void onPageChanged (int aIndex);
|
---|
63 |
|
---|
64 | private:
|
---|
65 |
|
---|
66 | QString parseStatistics (const QString &aText);
|
---|
67 | void refreshStatistics();
|
---|
68 |
|
---|
69 | QString formatValue (const QString &aValueName, const QString &aValue, int aMaxSize);
|
---|
70 | QString formatMedium (const QString &aCtrName, LONG aPort, LONG aDevice, const QString &aBelongsTo);
|
---|
71 | QString formatAdapter (ULONG aSlot, const QString &aBelongsTo);
|
---|
72 |
|
---|
73 | QString composeArticle (const QString &aBelongsTo, int aSpacesCount = 0);
|
---|
74 |
|
---|
75 | static InfoDlgMap mSelfArray;
|
---|
76 |
|
---|
77 | bool mIsPolished;
|
---|
78 | VBoxConsoleView *mConsole;
|
---|
79 | CSession mSession;
|
---|
80 | QTimer *mStatTimer;
|
---|
81 |
|
---|
82 | int mWidth;
|
---|
83 | int mHeight;
|
---|
84 | bool mMax;
|
---|
85 |
|
---|
86 | DataMapType mNamesMap;
|
---|
87 | DataMapType mValuesMap;
|
---|
88 | DataMapType mUnitsMap;
|
---|
89 | LinksMapType mLinksMap;
|
---|
90 | };
|
---|
91 |
|
---|
92 | #endif // __VBoxVMInformationDlg_h__
|
---|
93 |
|
---|