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