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 UIMachineWindow;
|
---|
33 | class QTimer;
|
---|
34 |
|
---|
35 | class VBoxVMInformationDlg : public QIWithRetranslateUI2 <QIMainDialog>, public Ui::VBoxVMInformationDlg
|
---|
36 | {
|
---|
37 | Q_OBJECT;
|
---|
38 |
|
---|
39 | public:
|
---|
40 |
|
---|
41 | typedef QMap <QString, QString> DataMapType;
|
---|
42 | typedef QMap <QString, QStringList> LinksMapType;
|
---|
43 | struct CounterElementType { QString type; DataMapType list; };
|
---|
44 | typedef QMap <QString, VBoxVMInformationDlg*> InfoDlgMap;
|
---|
45 |
|
---|
46 | #ifdef VBOX_WITH_NEW_RUNTIME_CORE
|
---|
47 | static void createInformationDlg(UIMachineWindow *pMachineWindow);
|
---|
48 | #else /* VBOX_WITH_NEW_RUNTIME_CORE */
|
---|
49 | static void createInformationDlg (const CSession &aSession, VBoxConsoleView *aConsole);
|
---|
50 | #endif /* VBOX_WITH_NEW_RUNTIME_CORE */
|
---|
51 |
|
---|
52 | protected:
|
---|
53 |
|
---|
54 | #ifdef VBOX_WITH_NEW_RUNTIME_CORE
|
---|
55 | VBoxVMInformationDlg (UIMachineWindow *pMachineWindow, Qt::WindowFlags aFlags);
|
---|
56 | #else /* VBOX_WITH_NEW_RUNTIME_CORE */
|
---|
57 | VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, Qt::WindowFlags aFlags);
|
---|
58 | #endif /* VBOX_WITH_NEW_RUNTIME_CORE */
|
---|
59 | ~VBoxVMInformationDlg();
|
---|
60 |
|
---|
61 | void retranslateUi();
|
---|
62 |
|
---|
63 | virtual bool event (QEvent *aEvent);
|
---|
64 | virtual void resizeEvent (QResizeEvent *aEvent);
|
---|
65 | virtual void showEvent (QShowEvent *aEvent);
|
---|
66 |
|
---|
67 | private slots:
|
---|
68 |
|
---|
69 | void updateDetails();
|
---|
70 | void processStatistics();
|
---|
71 | void onPageChanged (int aIndex);
|
---|
72 |
|
---|
73 | private:
|
---|
74 |
|
---|
75 | QString parseStatistics (const QString &aText);
|
---|
76 | void refreshStatistics();
|
---|
77 |
|
---|
78 | QString formatValue (const QString &aValueName, const QString &aValue, int aMaxSize);
|
---|
79 | QString formatMedium (const QString &aCtrName, LONG aPort, LONG aDevice, const QString &aBelongsTo);
|
---|
80 | QString formatAdapter (ULONG aSlot, const QString &aBelongsTo);
|
---|
81 |
|
---|
82 | QString composeArticle (const QString &aBelongsTo, int aSpacesCount = 0);
|
---|
83 |
|
---|
84 | static InfoDlgMap mSelfArray;
|
---|
85 |
|
---|
86 | #ifndef VBOX_WITH_NEW_RUNTIME_CORE
|
---|
87 | VBoxConsoleView *mConsole;
|
---|
88 | #endif /* !VBOX_WITH_NEW_RUNTIME_CORE */
|
---|
89 | CSession mSession;
|
---|
90 | bool mIsPolished;
|
---|
91 | QTimer *mStatTimer;
|
---|
92 |
|
---|
93 | int mWidth;
|
---|
94 | int mHeight;
|
---|
95 | bool mMax;
|
---|
96 |
|
---|
97 | DataMapType mNamesMap;
|
---|
98 | DataMapType mValuesMap;
|
---|
99 | DataMapType mUnitsMap;
|
---|
100 | LinksMapType mLinksMap;
|
---|
101 | };
|
---|
102 |
|
---|
103 | #endif // __VBoxVMInformationDlg_h__
|
---|
104 |
|
---|