1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * UIVMLogViewer class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2008-2011 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 __UIVMLogViewer_h__
|
---|
20 | #define __UIVMLogViewer_h__
|
---|
21 |
|
---|
22 | /* Global includes: */
|
---|
23 | #include <QMainWindow>
|
---|
24 | #include <QMap>
|
---|
25 | #include <QPair>
|
---|
26 |
|
---|
27 | /* Local includes: */
|
---|
28 | #include "UIVMLogViewer.gen.h"
|
---|
29 | #include "QIWithRetranslateUI.h"
|
---|
30 | #include "COMDefs.h"
|
---|
31 |
|
---|
32 | /* Forward declarations: */
|
---|
33 | class QPushButton;
|
---|
34 | class QTextEdit;
|
---|
35 | class QITabWidget;
|
---|
36 | class UIVMLogViewer;
|
---|
37 | class UIVMLogViewerSearchPanel;
|
---|
38 |
|
---|
39 | /* Typedefs: */
|
---|
40 | typedef QMap<QString, UIVMLogViewer*> VMLogViewerMap;
|
---|
41 | typedef QPair<QString, QTextEdit*> LogPage;
|
---|
42 | typedef QList<LogPage> LogBook;
|
---|
43 |
|
---|
44 | /* VM Log Viewer window: */
|
---|
45 | class UIVMLogViewer : public QIWithRetranslateUI2<QMainWindow>,
|
---|
46 | public Ui::UIVMLogViewer
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /* Static method to create/show VM Log Viewer: */
|
---|
53 | static void showLogViewerFor(QWidget *pParent, const CMachine &machine);
|
---|
54 |
|
---|
55 | protected:
|
---|
56 |
|
---|
57 | /* Constructor/destructor: */
|
---|
58 | UIVMLogViewer(QWidget *pParent, Qt::WindowFlags flags, const CMachine &machine);
|
---|
59 | ~UIVMLogViewer();
|
---|
60 |
|
---|
61 | private slots:
|
---|
62 |
|
---|
63 | /* Button slots: */
|
---|
64 | void search();
|
---|
65 | void refresh();
|
---|
66 | bool close();
|
---|
67 | void save();
|
---|
68 |
|
---|
69 | private:
|
---|
70 |
|
---|
71 | /* Translation stuff: */
|
---|
72 | void retranslateUi();
|
---|
73 |
|
---|
74 | /* Event handlers: */
|
---|
75 | void showEvent(QShowEvent *aEvent);
|
---|
76 | void keyPressEvent(QKeyEvent *pEvent);
|
---|
77 |
|
---|
78 | /* Various helpers: */
|
---|
79 | QTextEdit* currentLogPage();
|
---|
80 | QTextEdit* createLogPage(const QString &strPage);
|
---|
81 |
|
---|
82 | /* Array containing all VM Log Viewers: */
|
---|
83 | static VMLogViewerMap m_viewers;
|
---|
84 |
|
---|
85 | /* VM Log Viewer variables: */
|
---|
86 | bool m_fIsPolished;
|
---|
87 | CMachine m_machine;
|
---|
88 | QITabWidget *m_pViewerContainer;
|
---|
89 | UIVMLogViewerSearchPanel *m_pSearchPanel;
|
---|
90 | LogBook m_book;
|
---|
91 |
|
---|
92 | /* Buttons: */
|
---|
93 | QPushButton *mBtnHelp;
|
---|
94 | QPushButton *mBtnFind;
|
---|
95 | QPushButton *mBtnRefresh;
|
---|
96 | QPushButton *mBtnClose;
|
---|
97 | QPushButton *mBtnSave;
|
---|
98 |
|
---|
99 | /* Friends: */
|
---|
100 | friend class UIVMLogViewerSearchPanel;
|
---|
101 | };
|
---|
102 |
|
---|
103 | #endif // __UIVMLogViewer_h__
|
---|
104 |
|
---|