swift
Loading...
Searching...
No Matches
statusmessagesdetail.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_GUI_COMPONENTS_STATUSMESSAGESDETAIL_H
7#define SWIFT_GUI_COMPONENTS_STATUSMESSAGESDETAIL_H
8
9#include <QFrame>
10#include <QObject>
11#include <QScopedPointer>
12
13#include "gui/menus/menudelegate.h"
14#include "gui/swiftguiexport.h"
15#include "misc/digestsignal.h"
17#include "misc/variant.h"
18
19namespace Ui
20{
21 class CStatusMessagesDetail;
22}
24{
27 {
29
30 public:
32 explicit CStatusMessagesDetail(QWidget *parent = nullptr);
33
36
39
42
44 void showDetails(bool details);
45
47 void showFilterDialog();
48
50 void showFilterBar();
51
53 void hideFilterBar();
54
56 void clear();
57
59 int rowCount() const;
60
62 void setMaxLogMessages(int desiredNumber) { m_maxLogMessages = desiredNumber; }
63
65 void filterUseRadioButtonDescriptiveIcons(bool oneCharacterText);
66
68 void setSorting(const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order = Qt::AscendingOrder);
69
71 void setNoSorting();
72
73 signals:
75 void modelDataChangedDigest(int count, bool withFilter);
76
79
80 private:
82 int m_maxLogMessages = -1;
84 m_pending;
85 swift::misc::CDigestSignal m_dsDeferredUpdate { this, &CStatusMessagesDetail::deferredUpdate,
86 std::chrono::milliseconds(2000), 25 };
87
89 void deferredUpdate();
90
93 class CMessageMenu : public menus::IMenuDelegate
94 {
95 public:
97 CMessageMenu(CStatusMessagesDetail *parent) : IMenuDelegate(parent) {}
98
100 void customMenu(menus::CMenuActions &menuActions) override;
101
102 private:
103 QAction *m_action = nullptr;
104 };
105 };
106} // namespace swift::gui::components
107
108#endif // SWIFT_GUI_COMPONENTS_STATUSMESSAGESDETAIL_H
void modelDataChangedDigest(int count, bool withFilter)
Model data changed,.
void appendStatusMessageToList(const swift::misc::CStatusMessage &message)
Add message.
int rowCount() const
Number of status messages in view.
CStatusMessagesDetail(QWidget *parent=nullptr)
Constructor.
void appendStatusMessagesToList(const swift::misc::CStatusMessageList &messages)
Add messages.
void showDetails(bool details)
Show log details.
void showFilterDialog()
Show filter dialog and disable bar.
void setMaxLogMessages(int desiredNumber)
Set max.log messages.
void filterChanged(const swift::misc::CVariant &filter)
The user changed their message filter.
Bunch of CMenuAction objects.
Definition menuaction.h:384
Interface to implement a custom menu.
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Definition variant.h:69
High level reusable GUI components.
QFrame(QWidget *parent, Qt::WindowFlags f)
Q_OBJECTQ_OBJECT
QObject * parent() const const
SortOrder
QWidget(QWidget *parent, Qt::WindowFlags f)
#define SWIFT_GUI_EXPORT
Export a class or function from the library.