VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h@ 58267

Last change on this file since 58267 was 58267, checked in by vboxsync, 9 years ago

FE/Qt: 8069: Filtering feature implementation in VM Log-Viewer and Cleanup/Rework of old code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 4.5 KB
Line 
1/* $Id: UIVMLogViewer.h 58267 2015-10-15 17:27:34Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVMLogViewer class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2015 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___UIVMLogViewer_h___
19#define ___UIVMLogViewer_h___
20
21/* Qt includes: */
22#include <QMainWindow>
23#include <QMap>
24#include <QPair>
25
26/* GUI includes: */
27#include "QIWithRetranslateUI.h"
28#include "UIVMLogViewer.gen.h"
29
30/* COM includes: */
31#include "COMEnums.h"
32#include "CMachine.h"
33
34/* Forward declarations: */
35class QComboBox;
36class QITabWidget;
37class QPushButton;
38class QTextEdit;
39class UIVMLogViewer;
40class UIVMLogViewerFilterPanel;
41class UIVMLogViewerSearchPanel;
42
43/* Type definitions: */
44typedef QMap<QString, UIVMLogViewer*> VMLogViewerMap;
45typedef QPair<QString, QTextEdit*> LogPage;
46typedef QList<LogPage> LogBook;
47typedef QMap<QTextEdit*, QString*> VMLogMap;
48
49/** QMainWindow extension
50 * providing GUI with VirtualBox LogViewer. */
51class UIVMLogViewer : public QIWithRetranslateUI2<QMainWindow>,
52 public Ui::UIVMLogViewer
53{
54 Q_OBJECT;
55
56public:
57
58 /** Static method to create/show VM Log Viewer by passing @a pParent to QWidget base-class constructor.
59 * @a machine specifies the machine for which VM Log-Viewer is requested. */
60 static void showLogViewerFor(QWidget *pParent, const CMachine &machine);
61
62protected:
63
64 /** Constructs the VM Log-Viewer by passing @a pParent to QWidget base-class constructor.
65 * @a flags specifies Qt window flags.
66 * @a machine specifies the machine for which VM Log-Viewer is requested. */
67 UIVMLogViewer(QWidget *pParent, Qt::WindowFlags flags, const CMachine &machine);
68 /** Destructs the VM Log-Viewer. */
69 ~UIVMLogViewer();
70
71private slots:
72
73 /** Handles search action triggering. */
74 void search();
75 /** Handles search action triggering. */
76 void refresh();
77 /** Handles close action triggering. */
78 bool close();
79 /** Handles save action triggering. */
80 void save();
81 /** Handles filter action triggering. */
82 void filter();
83
84private:
85
86 /** Prepares VM Log-Viewer. */
87 void prepare();
88
89 /** Prepares widgets. */
90 void prepareWidgets();
91
92 /** Prepares connections. */
93 void prepareConnections();
94
95 /** Cleanups VM Log-Viewer. */
96 void cleanup();
97
98 /** Handles translation event. */
99 void retranslateUi();
100
101 /** Handles Qt show @a pEvent. */
102 void showEvent(QShowEvent *pEvent);
103
104 /** Handles Qt key-press @a pEvent. */
105 void keyPressEvent(QKeyEvent *pEvent);
106
107 /** Returns the current log-page. */
108 QTextEdit* currentLogPage();
109 /** Returns the newly created log-page using @a strPage filename. */
110 QTextEdit* createLogPage(const QString &strPage);
111 /** Returns the content of current log-page. */
112 const QString* currentLog();
113
114 /** Load settings helper. */
115 void loadSettings();
116
117 /** Save settings helper. */
118 void saveSettings();
119
120 /** Holds the list of all VM Log Viewers. */
121 static VMLogViewerMap m_viewers;
122
123 /** Holds whether the dialog is polished. */
124 bool m_fIsPolished;
125
126 /** Holds the machine instance. */
127 CMachine m_machine;
128
129 /** Holds container for log-pages. */
130 QITabWidget *m_pViewerContainer;
131
132 /** Holds the instance of search panel. */
133 UIVMLogViewerSearchPanel *m_pSearchPanel;
134
135 /** Holds the list of log-pages. */
136 LogBook m_book;
137
138 /** Holds the instance of filter panel. */
139 UIVMLogViewerFilterPanel *m_pFilterPanel;
140
141 /** Holds the list of log-content. */
142 VMLogMap m_logMap;
143
144 /** Current dialog geometry. */
145 QRect m_geometry;
146
147 /** Holds the help button instance. */
148 QPushButton *m_pButtonHelp;
149 /** Holds the find button instance. */
150 QPushButton *m_pButtonFind;
151 /** Holds the refresh button instance. */
152 QPushButton *m_pButtonRefresh;
153 /** Holds the close button instance. */
154 QPushButton *m_pButtonClose;
155 /** Holds the save button instance. */
156 QPushButton *m_pButtonSave;
157 /** Holds the filter button instance. */
158 QPushButton *m_pButtonFilter;
159
160 friend class UIVMLogViewerSearchPanel;
161 friend class UIVMLogViewerFilterPanel;
162};
163
164#endif /* !___UIVMLogViewer_h___ */
165
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette