X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsnorenotificationbackend.cpp;h=6732c5493529bf36ca70f153497bc2dfe716f415;hb=6806244fe047e06b7bedb0cfa55b2b8cdddf7c6d;hp=f07aedd4f355fd56132ce139e5b7051555fe297b;hpb=5cd33e3933873a41be78b229bca15295f9b7b01b;p=quassel.git diff --git a/src/qtui/snorenotificationbackend.cpp b/src/qtui/snorenotificationbackend.cpp index f07aedd4..6732c549 100644 --- a/src/qtui/snorenotificationbackend.cpp +++ b/src/qtui/snorenotificationbackend.cpp @@ -24,7 +24,6 @@ #include #include "client.h" -#include "iconloader.h" #include "networkmodel.h" #include "systraynotificationbackend.h" #include "qtui.h" @@ -37,7 +36,7 @@ SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent) - :AbstractNotificationBackend(parent), + : AbstractNotificationBackend(parent), m_systrayBackend(NULL) { NotificationSettings notificationSettings; @@ -50,12 +49,12 @@ SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent) //TODO: try to get an instance of the tray icon to be able to show popups m_snore = new Snore::SnoreCore(); m_snore->loadPlugins(Snore::SnorePlugin::BACKEND); - m_application = Snore::Application("Quassel", Snore::Icon(DesktopIcon("quassel").toImage())); + m_icon = Snore::Icon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")).pixmap(48).toImage()); + m_application = Snore::Application("Quassel", m_icon); m_application.hints().setValue("WINDOWS_APP_ID","QuasselProject.QuasselIRC"); connect(m_snore, SIGNAL(actionInvoked(Snore::Notification)), this, SLOT(actionInvoked(Snore::Notification))); - m_icon = Snore::Icon(DesktopIcon("dialog-information").toImage()); m_alert = Snore::Alert(tr("Private Message"), m_icon); m_application.addAlert(m_alert); @@ -76,12 +75,7 @@ SnoreNotificationBackend::~SnoreNotificationBackend() void SnoreNotificationBackend::backendChanged(const QVariant &v) { QString backend = v.toString(); - if (backend == "Default") { - if (m_snore->setPrimaryNotificationBackend()) {//try to find the default backend for the platform - return; - } - } - else if (backend != "SystemTray") { + if (backend != "Default") { if (setSnoreBackend(backend)) { return; } @@ -154,8 +148,10 @@ SnoreNotificationBackend::ConfigWidget::ConfigWidget(Snore::SnoreCore *snore, QW m_snore(snore) { ui.setupUi(this); - ui.backends->insertItem(0, "Default"); - ui.backends->insertItems(1, m_snore->notificationBackends()); + QStringList backends = m_snore->notificationBackends(); + backends.append("Default"); + qSort(backends); + ui.backends->insertItems(0, backends); connect(ui.backends, SIGNAL(currentIndexChanged(QString)), SLOT(backendChanged(QString))); connect(ui.timeout, SIGNAL(valueChanged(int)), this, SLOT(timeoutChanged(int))); @@ -188,10 +184,7 @@ void SnoreNotificationBackend::ConfigWidget::defaults() void SnoreNotificationBackend::ConfigWidget::load() { NotificationSettings s; - QString backend = m_snore->primaryNotificationBackend(); - if (backend.isEmpty()) { - backend = "SystemTray"; - } + QString backend = s.value("Snore/Backend", "Default").toString(); int timeout = s.value("Snore/Timeout", 10).toInt(); ui.backends->setCurrentIndex(ui.backends->findText(backend)); ui.timeout->setValue(timeout);