VirtualBox

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

Last change on this file since 25045 was 24107, checked in by vboxsync, 15 years ago

FE/Qt4-OSX: initial set of native Cocoa controls

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.4 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 VBoxSearchField;
35class QLabel;
36class QIToolButton;
37class VBoxMiniCancelButton;
38class VBoxSegmentedButton;
39class QCheckBox;
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 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
94class VBoxLogSearchPanel : public QIWithRetranslateUI <QWidget>
95{
96 Q_OBJECT;
97
98public:
99
100 VBoxLogSearchPanel (QWidget *aParent,
101 VBoxVMLogViewer *aViewer);
102protected:
103
104 void retranslateUi();
105
106private 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
114private:
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
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