VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMLogViewer.h@ 20554

Last change on this file since 20554 was 10156, checked in by vboxsync, 16 years ago

FE/Qt4: Copyright update & export to OSE.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.2 KB
Line 
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
31class VBoxLogSearchPanel;
32class QTabWidget;
33class QTextEdit;
34class QLineEdit;
35class QLabel;
36class QToolButton;
37class QCheckBox;
38
39class VBoxVMLogViewer : public QIWithRetranslateUI2<QIMainDialog>,
40 public Ui::VBoxVMLogViewer
41{
42 Q_OBJECT;
43
44public:
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
57protected:
58
59 void retranslateUi();
60
61private slots:
62
63 bool close();
64 void refresh();
65 void save();
66 void search();
67
68 void currentLogPageChanged (int aIndex);
69
70private:
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
92class VBoxLogSearchPanel : public QIWithRetranslateUI <QWidget>
93{
94 Q_OBJECT;
95
96public:
97
98 VBoxLogSearchPanel (QWidget *aParent,
99 VBoxVMLogViewer *aViewer);
100protected:
101
102 void retranslateUi();
103
104private slots:
105
106 void findNext() { search (true); }
107 void findBack() { search (false); }
108
109 void findCurrent (const QString &aSearchString);
110
111private:
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
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