[10156] | 1 | /** @file
|
---|
| 2 | *
|
---|
| 3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
| 4 | * VBoxVMLogViewer class declaration
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | /*
|
---|
[28800] | 8 | * Copyright (C) 2006-2008 Oracle Corporation
|
---|
[10156] | 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 |
|
---|
[30356] | 22 | /* Local includes */
|
---|
[10156] | 23 | #include "VBoxVMLogViewer.gen.h"
|
---|
| 24 | #include "QIMainDialog.h"
|
---|
| 25 | #include "COMDefs.h"
|
---|
| 26 | #include "QIWithRetranslateUI.h"
|
---|
| 27 |
|
---|
[30356] | 28 | /* Local forward declarations */
|
---|
[29972] | 29 | class QITabWidget;
|
---|
[23260] | 30 | class QIToolButton;
|
---|
[30356] | 31 | class UIMiniCancelButton;
|
---|
| 32 | class UIRoundRectSegmentedButton;
|
---|
| 33 | class UISearchField;
|
---|
| 34 | class VBoxLogSearchPanel;
|
---|
| 35 |
|
---|
| 36 | /* Global forward declarations */
|
---|
[10156] | 37 | class QCheckBox;
|
---|
[30356] | 38 | class QLabel;
|
---|
| 39 | class QTextEdit;
|
---|
[10156] | 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 | QTextEdit* createLogPage (const QString &aPage);
|
---|
| 76 |
|
---|
| 77 | static LogViewersMap mSelfArray;
|
---|
| 78 |
|
---|
| 79 | bool mIsPolished;
|
---|
| 80 | bool mFirstRun;
|
---|
| 81 | CMachine mMachine;
|
---|
[29972] | 82 | QITabWidget *mLogList;
|
---|
[10156] | 83 | VBoxLogSearchPanel *mSearchPanel;
|
---|
[28344] | 84 | QList< QPair<QString, QTextEdit*> > mLogFiles;
|
---|
[10156] | 85 |
|
---|
| 86 | QPushButton *mBtnHelp;
|
---|
| 87 | QPushButton *mBtnFind;
|
---|
| 88 | QPushButton *mBtnSave;
|
---|
| 89 | QPushButton *mBtnRefresh;
|
---|
| 90 | QPushButton *mBtnClose;
|
---|
| 91 | };
|
---|
| 92 |
|
---|
| 93 | class VBoxLogSearchPanel : public QIWithRetranslateUI <QWidget>
|
---|
| 94 | {
|
---|
| 95 | Q_OBJECT;
|
---|
| 96 |
|
---|
| 97 | public:
|
---|
| 98 |
|
---|
| 99 | VBoxLogSearchPanel (QWidget *aParent,
|
---|
| 100 | VBoxVMLogViewer *aViewer);
|
---|
| 101 | protected:
|
---|
| 102 |
|
---|
| 103 | void retranslateUi();
|
---|
| 104 |
|
---|
| 105 | private slots:
|
---|
| 106 |
|
---|
[24107] | 107 | void find (int aButton);
|
---|
[10156] | 108 | void findNext() { search (true); }
|
---|
| 109 | void findBack() { search (false); }
|
---|
| 110 |
|
---|
| 111 | void findCurrent (const QString &aSearchString);
|
---|
| 112 |
|
---|
| 113 | private:
|
---|
| 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 |
|
---|
[30356] | 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;
|
---|
[10156] | 133 | };
|
---|
| 134 |
|
---|
| 135 | #endif // __VBoxVMLogViewer_h__
|
---|
| 136 |
|
---|