VirtualBox

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

Last change on this file since 35740 was 30356, checked in by vboxsync, 14 years ago

FE/Qt4: added a new segmented button type; code cleanup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.3 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * VBoxVMLogViewer class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2008 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 __VBoxVMLogViewer_h__
20#define __VBoxVMLogViewer_h__
21
22/* Local includes */
23#include "VBoxVMLogViewer.gen.h"
24#include "QIMainDialog.h"
25#include "COMDefs.h"
26#include "QIWithRetranslateUI.h"
27
28/* Local forward declarations */
29class QITabWidget;
30class QIToolButton;
31class UIMiniCancelButton;
32class UIRoundRectSegmentedButton;
33class UISearchField;
34class VBoxLogSearchPanel;
35
36/* Global forward declarations */
37class QCheckBox;
38class QLabel;
39class QTextEdit;
40
41class VBoxVMLogViewer : public QIWithRetranslateUI2<QIMainDialog>,
42 public Ui::VBoxVMLogViewer
43{
44 Q_OBJECT;
45
46public:
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
59protected:
60
61 void retranslateUi();
62
63private slots:
64
65 bool close();
66 void refresh();
67 void save();
68 void search();
69
70 void currentLogPageChanged (int aIndex);
71
72private:
73
74 void showEvent (QShowEvent *aEvent);
75 QTextEdit* createLogPage (const QString &aPage);
76
77 static LogViewersMap mSelfArray;
78
79 bool mIsPolished;
80 bool mFirstRun;
81 CMachine mMachine;
82 QITabWidget *mLogList;
83 VBoxLogSearchPanel *mSearchPanel;
84 QList< QPair<QString, QTextEdit*> > mLogFiles;
85
86 QPushButton *mBtnHelp;
87 QPushButton *mBtnFind;
88 QPushButton *mBtnSave;
89 QPushButton *mBtnRefresh;
90 QPushButton *mBtnClose;
91};
92
93class VBoxLogSearchPanel : public QIWithRetranslateUI <QWidget>
94{
95 Q_OBJECT;
96
97public:
98
99 VBoxLogSearchPanel (QWidget *aParent,
100 VBoxVMLogViewer *aViewer);
101protected:
102
103 void retranslateUi();
104
105private slots:
106
107 void find (int aButton);
108 void findNext() { search (true); }
109 void findBack() { search (false); }
110
111 void findCurrent (const QString &aSearchString);
112
113private:
114
115 void search (bool aForward, bool aStartCurrent = false);
116
117 bool eventFilter (QObject *aObject, QEvent *aEvent);
118
119 void showEvent (QShowEvent *aEvent);
120 void hideEvent (QHideEvent *aEvent);
121
122 void toggleWarning (bool aHide);
123
124 VBoxVMLogViewer *mViewer;
125 UIMiniCancelButton *mButtonClose;
126 QLabel *mSearchName;
127 UISearchField *mSearchString;
128 UIRoundRectSegmentedButton *mButtonsNextPrev;
129 QCheckBox *mCaseSensitive;
130 QSpacerItem *mWarningSpacer;
131 QLabel *mWarningIcon;
132 QLabel *mWarningString;
133};
134
135#endif // __VBoxVMLogViewer_h__
136
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use