1 | /* $Id: UIVMLogViewerBookmarksPanel.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMLogViewer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerBookmarksPanel_h
|
---|
19 | #define FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerBookmarksPanel_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "UIVMLogViewerPanel.h"
|
---|
26 |
|
---|
27 | /* Forward declarations: */
|
---|
28 | class QComboBox;
|
---|
29 | class QWidget;
|
---|
30 | class QIToolButton;
|
---|
31 |
|
---|
32 | /** UIVMLogViewerPanel extension providing GUI for bookmark management. Show a list of bookmarks currently set
|
---|
33 | * for displayed log page. It has controls to navigate and clear bookmarks. */
|
---|
34 | class UIVMLogViewerBookmarksPanel : public UIVMLogViewerPanel
|
---|
35 | {
|
---|
36 | Q_OBJECT;
|
---|
37 |
|
---|
38 | public:
|
---|
39 |
|
---|
40 | UIVMLogViewerBookmarksPanel(QWidget *pParent, UIVMLogViewerWidget *pViewer);
|
---|
41 |
|
---|
42 | /** Adds a single bookmark to an existing list of bookmarks. Possibly called
|
---|
43 | * by UIVMLogViewerWidget when user adds a bookmark thru context menu etc. */
|
---|
44 | void addBookmark(const QPair<int, QString> &newBookmark);
|
---|
45 | /** Clear the bookmark list and show this list instead. Probably done after
|
---|
46 | * user switches to another log page tab etc. */
|
---|
47 | void setBookmarksList(const QVector<QPair<int, QString> > &bookmarkList);
|
---|
48 | void updateBookmarkList(const QVector<QPair<int, QString> > &bookmarkVector);
|
---|
49 | /** Disable/enable all the widget except the close button */
|
---|
50 | void disableEnableBookmarking(bool flag);
|
---|
51 | virtual QString panelName() const /* override */;
|
---|
52 | signals:
|
---|
53 |
|
---|
54 | void sigDeleteBookmark(int bookmarkIndex);
|
---|
55 | void sigDeleteAllBookmarks();
|
---|
56 | void sigBookmarkSelected(int index);
|
---|
57 |
|
---|
58 | protected:
|
---|
59 |
|
---|
60 | virtual void prepareWidgets() /* override */;
|
---|
61 | virtual void prepareConnections() /* override */;
|
---|
62 |
|
---|
63 | /** Handles the translation event. */
|
---|
64 | void retranslateUi();
|
---|
65 |
|
---|
66 | private slots:
|
---|
67 |
|
---|
68 | void sltDeleteCurrentBookmark();
|
---|
69 | void sltBookmarkSelected(int index);
|
---|
70 | void sltGotoNextBookmark();
|
---|
71 | void sltGotoPreviousBookmark();
|
---|
72 | void sltGotoSelectedBookmark();
|
---|
73 |
|
---|
74 | private:
|
---|
75 |
|
---|
76 | /** @a index is the index of the curent bookmark. */
|
---|
77 | void setBookmarkIndex(int index);
|
---|
78 |
|
---|
79 | const int m_iMaxBookmarkTextLength;
|
---|
80 | QComboBox *m_pBookmarksComboBox;
|
---|
81 | QIToolButton *m_pGotoSelectedBookmark;
|
---|
82 | QIToolButton *m_pDeleteAllButton;
|
---|
83 | QIToolButton *m_pDeleteCurrentButton;
|
---|
84 | QIToolButton *m_pNextButton;
|
---|
85 | QIToolButton *m_pPreviousButton;
|
---|
86 | };
|
---|
87 |
|
---|
88 | #endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerBookmarksPanel_h */
|
---|