Refactoring
This commit is contained in:
@@ -31,11 +31,11 @@
|
||||
#include <QDateTime>
|
||||
#include <QImage>
|
||||
|
||||
#include "core/shared_ptr.h"
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/song.h"
|
||||
#include "playlist/playlistsequence.h"
|
||||
#include "constants/notificationssettings.h"
|
||||
|
||||
class Application;
|
||||
class OSDPretty;
|
||||
class SystemTrayIcon;
|
||||
|
||||
@@ -43,18 +43,9 @@ class OSDBase : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OSDBase(SharedPtr<SystemTrayIcon> tray_icon, Application *app, QObject *parent = nullptr);
|
||||
explicit OSDBase(const SharedPtr<SystemTrayIcon> tray_icon, QObject *parent = nullptr);
|
||||
~OSDBase() override;
|
||||
|
||||
static const char *kSettingsGroup;
|
||||
|
||||
enum class Behaviour {
|
||||
Disabled = 0,
|
||||
Native,
|
||||
TrayPopup,
|
||||
Pretty
|
||||
};
|
||||
|
||||
int timeout_msec() const { return timeout_msec_; }
|
||||
void ReloadPrettyOSDSettings();
|
||||
void SetPrettyOSDToggleMode(bool toggle);
|
||||
@@ -79,7 +70,9 @@ class OSDBase : public QObject {
|
||||
|
||||
void ReshowCurrentSong();
|
||||
|
||||
void ShowPreview(const OSDBase::Behaviour type, const QString &line1, const QString &line2, const Song &song);
|
||||
void ShowPreview(const OSDSettings::Type type, const QString &line1, const QString &line2, const Song &song);
|
||||
|
||||
void AlbumCoverLoaded(const Song &song, const QUrl &cover_url, const QImage &image);
|
||||
|
||||
private:
|
||||
enum class MessageType {
|
||||
@@ -91,17 +84,13 @@ class OSDBase : public QObject {
|
||||
QString ReplaceMessage(const MessageType type, const QString &message, const Song &song);
|
||||
virtual void ShowMessageNative(const QString &summary, const QString &message, const QString &icon = QString(), const QImage &image = QImage());
|
||||
|
||||
private Q_SLOTS:
|
||||
void AlbumCoverLoaded(const Song &song, const QUrl &cover_url, const QImage &image);
|
||||
|
||||
private:
|
||||
Application *app_;
|
||||
SharedPtr<SystemTrayIcon> tray_icon_;
|
||||
const SharedPtr<SystemTrayIcon> tray_icon_;
|
||||
OSDPretty *pretty_popup_;
|
||||
|
||||
QString app_name_;
|
||||
int timeout_msec_;
|
||||
Behaviour behaviour_;
|
||||
OSDSettings::Type type_;
|
||||
bool show_on_volume_change_;
|
||||
bool show_art_;
|
||||
bool show_on_play_mode_change_;
|
||||
|
||||
Reference in New Issue
Block a user