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 VBoxSearchField;
|
---|
35 | class QLabel;
|
---|
36 | class QIToolButton;
|
---|
37 | class VBoxMiniCancelButton;
|
---|
38 | class VBoxSegmentedButton;
|
---|
39 | class QCheckBox;
|
---|
40 |
|
---|
41 | class VBoxVMLogViewer : public QIWithRetranslateUI2<QIMainDialog>,
|
---|
42 | public Ui::VBoxVMLogViewer
|
---|
43 | {
|
---|
44 | Q_OBJECT;
|
---|
45 |
|
---|
46 | public:
|
---|
47 |
|
---|
48 | typedef QMap <QString, VBoxVMLogViewer*> LogViewersMap;
|
---|
49 |
|
---|
50 | VBoxVMLogViewer (QWidget *aParent, Qt::WindowFlags aFlags,
|
---|
51 | const CMachine &aMachine);
|
---|
52 | ~VBoxVMLogViewer();
|
---|
53 |
|
---|
54 | static void createLogViewer (QWidget *aParent, CMachine &aMachine);
|
---|
55 |
|
---|
56 | QTextEdit* currentLogPage();
|
---|
57 |
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | void retranslateUi();
|
---|
62 |
|
---|
63 | private slots:
|
---|
64 |
|
---|
65 | bool close();
|
---|
66 | void refresh();
|
---|
67 | void save();
|
---|
68 | void search();
|
---|
69 |
|
---|
70 | void currentLogPageChanged (int aIndex);
|
---|
71 |
|
---|
72 | private:
|
---|
73 |
|
---|
74 | void showEvent (QShowEvent *aEvent);
|
---|
75 | void loadLogFile (const QString &aName);
|
---|
76 | QTextEdit* createLogPage (const QString &aPage);
|
---|
77 |
|
---|
78 | static LogViewersMap mSelfArray;
|
---|
79 |
|
---|
80 | bool mIsPolished;
|
---|
81 | bool mFirstRun;
|
---|
82 | CMachine mMachine;
|
---|
83 | QTabWidget *mLogList;
|
---|
84 | QStringList mLogFilesList;
|
---|
85 | VBoxLogSearchPanel *mSearchPanel;
|
---|
86 |
|
---|
87 | QPushButton *mBtnHelp;
|
---|
88 | QPushButton *mBtnFind;
|
---|
89 | QPushButton *mBtnSave;
|
---|
90 | QPushButton *mBtnRefresh;
|
---|
91 | QPushButton *mBtnClose;
|
---|
92 | };
|
---|
93 |
|
---|
94 | class VBoxLogSearchPanel : public QIWithRetranslateUI <QWidget>
|
---|
95 | {
|
---|
96 | Q_OBJECT;
|
---|
97 |
|
---|
98 | public:
|
---|
99 |
|
---|
100 | VBoxLogSearchPanel (QWidget *aParent,
|
---|
101 | VBoxVMLogViewer *aViewer);
|
---|
102 | protected:
|
---|
103 |
|
---|
104 | void retranslateUi();
|
---|
105 |
|
---|
106 | private slots:
|
---|
107 |
|
---|
108 | void find (int aButton);
|
---|
109 | void findNext() { search (true); }
|
---|
110 | void findBack() { search (false); }
|
---|
111 |
|
---|
112 | void findCurrent (const QString &aSearchString);
|
---|
113 |
|
---|
114 | private:
|
---|
115 |
|
---|
116 | void search (bool aForward, bool aStartCurrent = false);
|
---|
117 |
|
---|
118 | bool eventFilter (QObject *aObject, QEvent *aEvent);
|
---|
119 |
|
---|
120 | void showEvent (QShowEvent *aEvent);
|
---|
121 | void hideEvent (QHideEvent *aEvent);
|
---|
122 |
|
---|
123 | void toggleWarning (bool aHide);
|
---|
124 |
|
---|
125 | VBoxVMLogViewer *mViewer;
|
---|
126 | VBoxMiniCancelButton *mButtonClose;
|
---|
127 | QLabel *mSearchName;
|
---|
128 | VBoxSearchField *mSearchString;
|
---|
129 | VBoxSegmentedButton *mButtonsNextPrev;
|
---|
130 | QCheckBox *mCaseSensitive;
|
---|
131 | QSpacerItem *mWarningSpacer;
|
---|
132 | QLabel *mWarningIcon;
|
---|
133 | QLabel *mWarningString;
|
---|
134 | };
|
---|
135 |
|
---|
136 | #endif // __VBoxVMLogViewer_h__
|
---|
137 |
|
---|