Changeset 51305 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 20, 2014 12:25:16 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93783
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
r51304 r51305 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VBox frontends: Qt4 GUI ("VirtualBox"): 5 * UIVMInfoDialog class implementation 3 * VBox Qt GUI - UIVMInfoDialog class implementation. 6 4 */ 7 5 8 6 /* 9 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 10 8 * 11 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 76 74 : QIWithRetranslateUI<QMainWindow>(0) 77 75 , m_pPseudoParentWidget(pMachineWindow) 76 , mIsPolished (false) 77 , mWidth(0), mHeight(0), mMax(false) 78 78 , mSession (pMachineWindow->session()) 79 , mIsPolished (false)80 79 , mStatTimer (new QTimer (this)) 81 80 { -
trunk/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.h
r51304 r51305 1 1 /** @file 2 * 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * UIVMInfoDialog class declaration 2 * VBox Qt GUI - UIVMInfoDialog class declaration. 5 3 */ 6 4 7 5 /* 8 * Copyright (C) 2006-201 2Oracle Corporation6 * Copyright (C) 2006-2014 Oracle Corporation 9 7 * 10 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 17 15 */ 18 16 19 #ifndef __ VBoxVMInformationDlg_h__20 #define __ VBoxVMInformationDlg_h__17 #ifndef ___UIVMInfoDialog_h___ 18 #define ___UIVMInfoDialog_h___ 21 19 22 20 /* Qt includes: */ … … 24 22 25 23 /* GUI includes: */ 24 #include "QIWithRetranslateUI.h" 26 25 #include "UIVMInfoDialog.gen.h" 27 #include "QIWithRetranslateUI.h"28 26 29 27 /* COM includes: */ … … 31 29 #include "CSession.h" 32 30 31 /* Forward declarations: */ 33 32 class UIMachineWindow; 34 33 class QTimer; 35 34 35 /** QMainWindow based dialog providing user with VM details and statistics. */ 36 36 class UIVMInfoDialog : public QIWithRetranslateUI<QMainWindow>, public Ui::UIVMInfoDialog 37 37 { … … 40 40 public: 41 41 42 typedef QMap <QString, QString> DataMapType; 43 typedef QMap <QString, QStringList> LinksMapType; 44 struct CounterElementType { QString type; DataMapType list; }; 42 /** Instance pointer map. */ 45 43 typedef QMap <QString, UIVMInfoDialog*> InfoDlgMap; 46 44 45 /** VM statistics counter data map. */ 46 typedef QMap <QString, QString> DataMapType; 47 /** VM statistics counter links map. */ 48 typedef QMap <QString, QStringList> LinksMapType; 49 /** VM statistics counter struct. */ 50 struct CounterElementType { QString type; DataMapType list; }; 51 52 /** Factory function to create information-dialog for passed @a pMachineWindow. */ 47 53 static void createInformationDlg(UIMachineWindow *pMachineWindow); 48 54 49 55 protected: 50 56 57 /** Information dialog constructor. */ 51 58 UIVMInfoDialog(UIMachineWindow *pMachineWindow); 52 ~UIVMInfoDialog(); 59 /** Information dialog destructor. */ 60 ~UIVMInfoDialog(); 53 61 62 /** Translation handler. */ 54 63 void retranslateUi(); 55 64 65 /** Common event-handler. */ 56 66 virtual bool event (QEvent *aEvent); 67 /** Resize event-handler. */ 57 68 virtual void resizeEvent (QResizeEvent *aEvent); 69 /** Show event-handler. */ 58 70 virtual void showEvent (QShowEvent *aEvent); 59 71 60 72 private slots: 61 73 74 /** Slot to update general VM details. */ 62 75 void updateDetails(); 76 /** Slot to update runtime VM statistics. */ 63 77 void processStatistics(); 78 /** Slot to handle tab-widget page change. */ 64 79 void onPageChanged (int aIndex); 65 80 66 81 private: 67 82 83 /** Helper to parse passed VM statistics @a aText. */ 68 84 QString parseStatistics (const QString &aText); 85 /** Helper to re-acquire whole VM statistics. */ 69 86 void refreshStatistics(); 70 87 88 /** Helper to format common VM statistics value. */ 71 89 QString formatValue (const QString &aValueName, const QString &aValue, int aMaxSize); 90 /** Helper to format VM storage-medium statistics value. */ 72 91 QString formatMedium (const QString &aCtrName, LONG aPort, LONG aDevice, const QString &aBelongsTo); 92 /** Helper to format VM network-adapter statistics value. */ 73 93 QString formatAdapter (ULONG aSlot, const QString &aBelongsTo); 74 94 95 /** Helper to compose user-oriented article. */ 75 96 QString composeArticle (const QString &aBelongsTo, int aSpacesCount = 0); 76 97 98 /** @name General variables. 99 * @{ */ 100 /** Dialog instance array. */ 77 101 static InfoDlgMap mSelfArray; 102 /** Widget to center dialog according. */ 103 QWidget *m_pPseudoParentWidget; 104 /** Whether dialog was polished. */ 105 bool mIsPolished; 106 /** @} */ 78 107 79 /** Widget to center UIMediumManager according. */ 80 QWidget *m_pPseudoParentWidget; 108 /** @name Geometry variables. 109 * @{ */ 110 /** Current dialog width. */ 111 int mWidth; 112 /** Current dialog height. */ 113 int mHeight; 114 /** Whether dialog maximized. */ 115 bool mMax; 116 /** @} */ 81 117 118 /** @name VM details/statistics variables. 119 * @{ */ 120 /** Session to acquire VM details/statistics from. */ 82 121 CSession mSession; 83 bool mIsPolished;122 /** VM statistics update timer. */ 84 123 QTimer *mStatTimer; 85 86 int mWidth; 87 int mHeight; 88 bool mMax; 89 124 /** VM statistics counter names. */ 90 125 DataMapType mNamesMap; 126 /** VM statistics counter values. */ 91 127 DataMapType mValuesMap; 128 /** VM statistics counter units. */ 92 129 DataMapType mUnitsMap; 130 /** VM statistics counter links. */ 93 131 LinksMapType mLinksMap; 132 /** @} */ 94 133 }; 95 134 96 #endif // __VBoxVMInformationDlg_h__ 97 135 #endif /* !___UIVMInfoDialog_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.