VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerBookmarksWidget.h

Last change on this file was 103923, checked in by vboxsync, 2 months ago

FE/Qt. bugref:10622. Using new UITranslationEventListener in log viewer classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/* $Id: UIVMLogViewerBookmarksWidget.h 103923 2024-03-19 17:01:11Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVMLogViewer class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerBookmarksWidget_h
29#define FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerBookmarksWidget_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIVMLogBookmark.h"
36#include "UIVMLogViewerPanel.h"
37
38/* Forward declarations: */
39class QComboBox;
40class QWidget;
41class QIToolButton;
42
43/** UIVMLogViewerPanel extension providing GUI for bookmark management. Show a list of bookmarks currently set
44 * for displayed log page. It has controls to navigate and clear bookmarks. */
45class UIVMLogViewerBookmarksWidget : public UIVMLogViewerPane
46{
47 Q_OBJECT;
48
49public:
50
51 UIVMLogViewerBookmarksWidget(QWidget *pParent, UIVMLogViewerWidget *pViewer);
52
53 /** Adds a single bookmark to an existing list of bookmarks. Possibly called
54 * by UIVMLogViewerWidget when user adds a bookmark thru context menu etc. */
55 void addBookmark(const QPair<int, QString> &newBookmark);
56 /** Clear the bookmark list and show this list instead. Probably done after
57 * user switches to another log page tab etc. */
58 void setBookmarksList(const QVector<QPair<int, QString> > &bookmarkList);
59 void updateBookmarkList(const QVector<UIVMLogBookmark>& bookmarkList);
60 /** Disable/enable all the widget except the close button */
61 void disableEnableBookmarking(bool flag);
62
63signals:
64
65 void sigDeleteBookmarkByIndex(int bookmarkIndex);
66 void sigDeleteAllBookmarks();
67 void sigBookmarkSelected(int index);
68
69protected:
70
71 virtual void prepareWidgets() RT_OVERRIDE;
72 virtual void prepareConnections() RT_OVERRIDE;
73
74private slots:
75
76 void sltDeleteCurrentBookmark();
77 void sltBookmarkSelected(int index);
78 void sltGotoNextBookmark();
79 void sltGotoPreviousBookmark();
80 void sltGotoSelectedBookmark();
81 /** Handles the translation event. */
82 void sltRetranslateUI();
83
84private:
85
86 /** @a index is the index of the curent bookmark. */
87 void setBookmarkIndex(int index);
88
89 const int m_iMaxBookmarkTextLength;
90 QComboBox *m_pBookmarksComboBox;
91 QIToolButton *m_pGotoSelectedBookmark;
92 QIToolButton *m_pDeleteAllButton;
93 QIToolButton *m_pDeleteCurrentButton;
94 QIToolButton *m_pNextButton;
95 QIToolButton *m_pPreviousButton;
96};
97
98#endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerBookmarksWidget_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use