mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-12 03:45:51 -05:00
Some checks are pending
Build Porymap / build-linux (, 5.14.2) (push) Waiting to run
Build Porymap / build-linux (, 6.8.*) (push) Waiting to run
Build Porymap / build-linux (minimal, 5.14.2) (push) Waiting to run
Build Porymap / build-macos (macos-15-intel) (push) Waiting to run
Build Porymap / build-macos (macos-latest) (push) Waiting to run
Build Porymap / build-static-windows (push) Waiting to run
37 lines
883 B
C++
37 lines
883 B
C++
#pragma once
|
|
#ifndef LOGSTATUSBAR_H
|
|
#define LOGSTATUSBAR_H
|
|
|
|
#include "log.h"
|
|
|
|
#include <QLabel>
|
|
#include <QStatusBar>
|
|
#include <QSet>
|
|
#include <QTimer>
|
|
|
|
class LogStatusBar : public QStatusBar
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
LogStatusBar(QWidget* parent = nullptr);
|
|
~LogStatusBar();
|
|
|
|
void showLogMessage(const QString& message, LogType type);
|
|
void clearLogMessage();
|
|
|
|
void setLogMessageTimeout(std::chrono::milliseconds interval) {m_timeout = interval;}
|
|
std::chrono::milliseconds logMessageTimeout() const {return m_timeout;}
|
|
|
|
void setLogTypes(const QSet<LogType>& logTypes) { m_acceptedLogTypes = logTypes;}
|
|
const QSet<LogType>& logTypes() const {return m_acceptedLogTypes;}
|
|
|
|
private:
|
|
QLabel m_icon;
|
|
QLabel m_message;
|
|
QTimer m_timer;
|
|
std::chrono::milliseconds m_timeout{5000};
|
|
QSet<LogType> m_acceptedLogTypes;
|
|
};
|
|
|
|
#endif // LOGSTATUSBAR_H
|