コード例 #1
0
TaskbarNotificationBackend::TaskbarNotificationBackend(QObject* parent)
    : AbstractNotificationBackend(parent)
{
    NotificationSettings notificationSettings;
    _enabled = notificationSettings.value("Taskbar/Enabled", true).toBool();
    _timeout = notificationSettings.value("Taskbar/Timeout", 0).toInt();

    notificationSettings.notify("Taskbar/Enabled", this, &TaskbarNotificationBackend::enabledChanged);
    notificationSettings.notify("Taskbar/Timeout", this, &TaskbarNotificationBackend::timeoutChanged);
}
コード例 #2
0
QtMultimediaNotificationBackend::QtMultimediaNotificationBackend(QObject* parent)
    : AbstractNotificationBackend(parent)
{
    NotificationSettings notificationSettings;
    notificationSettings.notify("QtMultimedia/Enabled", this, &QtMultimediaNotificationBackend::enabledChanged);
    notificationSettings.notify("QtMultimedia/AudioFile", this, &QtMultimediaNotificationBackend::audioFileChanged);

    createMediaObject(notificationSettings.value("QtMultimedia/AudioFile", QString()).toString());

    _enabled = notificationSettings.value("QtMultimedia/Enabled", true).toBool();
}
コード例 #3
0
void QtMultimediaNotificationBackend::ConfigWidget::load()
{
    NotificationSettings s;
    _enabled = s.value("QtMultimedia/Enabled", false).toBool();
    _filename = s.value("QtMultimedia/AudioFile", QString()).toString();

    ui.enabled->setChecked(_enabled);
    ui.filename->setText(_filename);

    setChangedState(false);
}
コード例 #4
0
void TaskbarNotificationBackend::ConfigWidget::load()
{
    NotificationSettings s;
    enabled = s.value("Taskbar/Enabled", true).toBool();
    timeout = s.value("Taskbar/Timeout", 0).toInt();

    enabledBox->setChecked(enabled);
    timeoutBox->setValue(timeout / 1000);

    setChangedState(false);
}
コード例 #5
0
void SystrayNotificationBackend::ConfigWidget::load()
{
    NotificationSettings s;
    _showBubble = s.value("Systray/ShowBubble", false).toBool();
    _showBubbleBox->setChecked(_showBubble);
    setChangedState(false);
}
コード例 #6
0
void DockManagerNotificationBackend::ConfigWidget::load()
{
    NotificationSettings s;
    enabled = s.value("DockManager/Enabled", false).toBool();

    enabledBox->setChecked(enabled);
    setChangedState(false);
}
コード例 #7
0
DockManagerNotificationBackend::DockManagerNotificationBackend(QObject* parent)
    : AbstractNotificationBackend(parent)
    , _bus(QDBusConnection::sessionBus())
{
    NotificationSettings notificationSettings;
    _enabled = notificationSettings.value("DockManager/Enabled", false).toBool();

    notificationSettings.notify("DockManager/Enabled", this, &DockManagerNotificationBackend::enabledChanged);

    _dock = new QDBusInterface("net.launchpad.DockManager", "/net/launchpad/DockManager", "net.launchpad.DockManager", _bus, this);
    if (_dock->isValid()) {
        _bus.connect("net.launchpad.DockManager",
                     "/net/launchpad/DockManager",
                     "net.launchpad.DockManager",
                     "ItemAdded",
                     this,
                     SLOT(itemAdded(QDBusObjectPath)));
    }
    else {
        // evil implementations (awn) use fd.o
        _dock = new QDBusInterface("org.freedesktop.DockManager", "/org/freedesktop/DockManager", "org.freedesktop.DockManager", _bus, this);
        if (_dock->isValid()) {
            _bus.connect("org.freedesktop.DockManager",
                         "/org/freedesktop/DockManager",
                         "org.freedesktop.DockManager",
                         "ItemAdded",
                         this,
                         SLOT(itemAdded(QDBusObjectPath)));
        }
        else {
            _available = _enabled = false;
            return;
        }
    }
    _available = true;

    itemAdded(QDBusObjectPath());

    connect(Client::coreConnection(),
            &CoreConnection::progressValueChanged,
            this,
            selectOverload<int>(&DockManagerNotificationBackend::updateProgress));
    connect(Client::coreConnection(), &CoreConnection::synchronized, this, &DockManagerNotificationBackend::synchronized);
}