1 | /** @file
|
---|
2 | * VBox Qt GUI - UIVMLogViewer class declaration.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2008-2012 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #ifndef __UIVMLogViewer_h__
|
---|
18 | #define __UIVMLogViewer_h__
|
---|
19 |
|
---|
20 | /* Qt includes: */
|
---|
21 | #include <QMainWindow>
|
---|
22 | #include <QMap>
|
---|
23 | #include <QPair>
|
---|
24 |
|
---|
25 | /* GUI includes: */
|
---|
26 | #include "UIVMLogViewer.gen.h"
|
---|
27 | #include "QIWithRetranslateUI.h"
|
---|
28 |
|
---|
29 | /* COM includes: */
|
---|
30 | #include "COMEnums.h"
|
---|
31 | #include "CMachine.h"
|
---|
32 |
|
---|
33 | /* Forward declarations: */
|
---|
34 | class QPushButton;
|
---|
35 | class QTextEdit;
|
---|
36 | class QITabWidget;
|
---|
37 | class UIVMLogViewer;
|
---|
38 | class UIVMLogViewerSearchPanel;
|
---|
39 |
|
---|
40 | /* Typedefs: */
|
---|
41 | typedef QMap<QString, UIVMLogViewer*> VMLogViewerMap;
|
---|
42 | typedef QPair<QString, QTextEdit*> LogPage;
|
---|
43 | typedef QList<LogPage> LogBook;
|
---|
44 |
|
---|
45 | /* VM Log Viewer window: */
|
---|
46 | class UIVMLogViewer : public QIWithRetranslateUI2<QMainWindow>,
|
---|
47 | public Ui::UIVMLogViewer
|
---|
48 | {
|
---|
49 | Q_OBJECT;
|
---|
50 |
|
---|
51 | public:
|
---|
52 |
|
---|
53 | /* Static method to create/show VM Log Viewer: */
|
---|
54 | static void showLogViewerFor(QWidget *pParent, const CMachine &machine);
|
---|
55 |
|
---|
56 | protected:
|
---|
57 |
|
---|
58 | /* Constructor/destructor: */
|
---|
59 | UIVMLogViewer(QWidget *pParent, Qt::WindowFlags flags, const CMachine &machine);
|
---|
60 | ~UIVMLogViewer();
|
---|
61 |
|
---|
62 | private slots:
|
---|
63 |
|
---|
64 | /* Button slots: */
|
---|
65 | void search();
|
---|
66 | void refresh();
|
---|
67 | bool close();
|
---|
68 | void save();
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | /* Translation stuff: */
|
---|
73 | void retranslateUi();
|
---|
74 |
|
---|
75 | /* Event handlers: */
|
---|
76 | void showEvent(QShowEvent *aEvent);
|
---|
77 | void keyPressEvent(QKeyEvent *pEvent);
|
---|
78 |
|
---|
79 | /* Various helpers: */
|
---|
80 | QTextEdit* currentLogPage();
|
---|
81 | QTextEdit* createLogPage(const QString &strPage);
|
---|
82 |
|
---|
83 | /* Array containing all VM Log Viewers: */
|
---|
84 | static VMLogViewerMap m_viewers;
|
---|
85 |
|
---|
86 | /* VM Log Viewer variables: */
|
---|
87 | bool m_fIsPolished;
|
---|
88 | CMachine m_machine;
|
---|
89 | QITabWidget *m_pViewerContainer;
|
---|
90 | UIVMLogViewerSearchPanel *m_pSearchPanel;
|
---|
91 | LogBook m_book;
|
---|
92 |
|
---|
93 | /* Buttons: */
|
---|
94 | QPushButton *mBtnHelp;
|
---|
95 | QPushButton *mBtnFind;
|
---|
96 | QPushButton *mBtnRefresh;
|
---|
97 | QPushButton *mBtnClose;
|
---|
98 | QPushButton *mBtnSave;
|
---|
99 |
|
---|
100 | /* Friends: */
|
---|
101 | friend class UIVMLogViewerSearchPanel;
|
---|
102 | };
|
---|
103 |
|
---|
104 | #endif // __UIVMLogViewer_h__
|
---|
105 |
|
---|