1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * VBoxVMLogViewer class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2008 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBoxVMLogViewer_h__
|
---|
24 | #define __VBoxVMLogViewer_h__
|
---|
25 |
|
---|
26 | #include "VBoxVMLogViewer.gen.h"
|
---|
27 | #include "QIMainDialog.h"
|
---|
28 | #include "COMDefs.h"
|
---|
29 | #include "QIWithRetranslateUI.h"
|
---|
30 |
|
---|
31 | class VBoxLogSearchPanel;
|
---|
32 | class QTabWidget;
|
---|
33 | class QTextEdit;
|
---|
34 | class QLineEdit;
|
---|
35 | class QLabel;
|
---|
36 | class QToolButton;
|
---|
37 | class QCheckBox;
|
---|
38 |
|
---|
39 | class VBoxVMLogViewer : public QIWithRetranslateUI2<QIMainDialog>,
|
---|
40 | public Ui::VBoxVMLogViewer
|
---|
41 | {
|
---|
42 | Q_OBJECT;
|
---|
43 |
|
---|
44 | public:
|
---|
45 |
|
---|
46 | typedef QMap <QString, VBoxVMLogViewer*> LogViewersMap;
|
---|
47 |
|
---|
48 | VBoxVMLogViewer (QWidget *aParent, Qt::WindowFlags aFlags,
|
---|
49 | const CMachine &aMachine);
|
---|
50 | ~VBoxVMLogViewer();
|
---|
51 |
|
---|
52 | static void createLogViewer (QWidget *aParent, CMachine &aMachine);
|
---|
53 |
|
---|
54 | QTextEdit* currentLogPage();
|
---|
55 |
|
---|
56 |
|
---|
57 | protected:
|
---|
58 |
|
---|
59 | void retranslateUi();
|
---|
60 |
|
---|
61 | private slots:
|
---|
62 |
|
---|
63 | bool close();
|
---|
64 | void refresh();
|
---|
65 | void save();
|
---|
66 | void search();
|
---|
67 |
|
---|
68 | void currentLogPageChanged (int aIndex);
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | void showEvent (QShowEvent *aEvent);
|
---|
73 | void loadLogFile (const QString &aName);
|
---|
74 | QTextEdit* createLogPage (const QString &aPage);
|
---|
75 |
|
---|
76 | static LogViewersMap mSelfArray;
|
---|
77 |
|
---|
78 | bool mIsPolished;
|
---|
79 | bool mFirstRun;
|
---|
80 | CMachine mMachine;
|
---|
81 | QTabWidget *mLogList;
|
---|
82 | QStringList mLogFilesList;
|
---|
83 | VBoxLogSearchPanel *mSearchPanel;
|
---|
84 |
|
---|
85 | QPushButton *mBtnHelp;
|
---|
86 | QPushButton *mBtnFind;
|
---|
87 | QPushButton *mBtnSave;
|
---|
88 | QPushButton *mBtnRefresh;
|
---|
89 | QPushButton *mBtnClose;
|
---|
90 | };
|
---|
91 |
|
---|
92 | class VBoxLogSearchPanel : public QIWithRetranslateUI <QWidget>
|
---|
93 | {
|
---|
94 | Q_OBJECT;
|
---|
95 |
|
---|
96 | public:
|
---|
97 |
|
---|
98 | VBoxLogSearchPanel (QWidget *aParent,
|
---|
99 | VBoxVMLogViewer *aViewer);
|
---|
100 | protected:
|
---|
101 |
|
---|
102 | void retranslateUi();
|
---|
103 |
|
---|
104 | private slots:
|
---|
105 |
|
---|
106 | void findNext() { search (true); }
|
---|
107 | void findBack() { search (false); }
|
---|
108 |
|
---|
109 | void findCurrent (const QString &aSearchString);
|
---|
110 |
|
---|
111 | private:
|
---|
112 |
|
---|
113 | void search (bool aForward, bool aStartCurrent = false);
|
---|
114 |
|
---|
115 | bool eventFilter (QObject *aObject, QEvent *aEvent);
|
---|
116 |
|
---|
117 | void showEvent (QShowEvent *aEvent);
|
---|
118 | void hideEvent (QHideEvent *aEvent);
|
---|
119 |
|
---|
120 | void toggleWarning (bool aHide);
|
---|
121 |
|
---|
122 | VBoxVMLogViewer *mViewer;
|
---|
123 | QToolButton *mButtonClose;
|
---|
124 | QLabel *mSearchName;
|
---|
125 | QLineEdit *mSearchString;
|
---|
126 | QToolButton *mButtonPrev;
|
---|
127 | QToolButton *mButtonNext;
|
---|
128 | QCheckBox *mCaseSensitive;
|
---|
129 | QSpacerItem *mWarningSpacer;
|
---|
130 | QLabel *mWarningIcon;
|
---|
131 | QLabel *mWarningString;
|
---|
132 | };
|
---|
133 |
|
---|
134 | #endif // __VBoxVMLogViewer_h__
|
---|
135 |
|
---|