6 #ifndef SWIFT_GUI_OVERLAYMESSAGES_H
7 #define SWIFT_GUI_OVERLAYMESSAGES_H
13 #include <QMessageBox>
15 #include <QScopedPointer>
34 class COverlayMessages;
36 namespace swift::misc::network
57 void setModeToMessages();
60 void setModeToMessage();
63 void setModeToMessageSmall();
66 void setModeToHTMLMessage();
69 void setModeToProgressBar();
72 void setModeToTextMessage();
75 void setModeToOverlayTextMessage();
78 void activateTextMessages(
bool activate);
81 bool isTextMessagesActivated()
const;
84 void setModeToImage();
93 void setConfirmationMessage(
const QString &message);
97 bool appendOldMessages,
const QString &confirmationMessage,
98 std::function<
void()> okLambda,
99 QMessageBox::StandardButton defaultButton = QMessageBox::Cancel,
100 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
103 void clearOverlayMessages();
107 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
111 bool appendOldMessages =
false,
112 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
116 bool appendOldMessages =
false,
117 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
121 Qt::SortOrder order = Qt::AscendingOrder);
125 Qt::SortOrder order = Qt::AscendingOrder);
129 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
133 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
143 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
146 void showOverlayImage(
const QPixmap &image, std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
150 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
154 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
157 void showHTMLMessage(
const QString &htmlMessage,
158 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
161 void showDownloadProgress(
int progress, qint64 current, qint64 max,
const QUrl &url,
162 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
165 void showProgressBar(
int percentage,
const QString &message,
166 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
172 void setDefaultConfirmationButton(
int button = QMessageBox::Cancel);
175 bool hasPendingConfirmation()
const;
178 void setReducedInfo(
bool reduced);
181 void addShadow(QColor color = Qt::gray);
189 void display(std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
192 virtual void keyPressEvent(QKeyEvent *event)
override;
195 QScopedPointer<Ui::COverlayMessages> ui;
198 int m_lastConfirmation = QMessageBox::Cancel;
199 bool m_awaitingConfirmation =
false;
200 bool m_hasKillButton =
false;
201 bool m_forceSmall =
false;
202 QTimer m_autoCloseTimer {
this };
203 std::function<void()> m_okLambda;
204 QList<std::function<void()>> m_pendingMessageCalls;
207 void onStyleSheetsChanged();
213 void onCancelClicked();
216 void init(
int w,
int h);
219 void setHeader(
const QString &header);
222 bool useSmall()
const;
Display status messages (nested in the parent widget)
void setForceSmall(bool force)
Force small (smaller layout)
void setHeaderText(const QString &header)
Set header text.
void confirmationCompleted()
Confirmation completed.
Pixmap which can be transferred via DBus.
Class template for accessing a specific value in the CSettingsCache.
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...
Value object encapsulating information of a callsign.
Value object encapsulating information of a text message.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.