aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/kdenotify/kdenotifyfactory.cpp
blob: 2fdd9f75b280bea8553256fff5e096cf18d397cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "kdenotifyfactory.h"
#include "kdenotify.h"
#include "settingsdialog.h"

#include <QtGui>

const GeneralProperties KdeNotifyFactory::properties() const
{
    GeneralProperties properties;
    properties.name = tr("KDE 4 notification plugin");
    properties.shortName = "kdenotify_icon";
    properties.hasAbout = TRUE;
    properties.hasSettings = TRUE;
    properties.visibilityControl = FALSE;
    return properties;
}

General *KdeNotifyFactory::create(QObject *parent)
{
    return new KdeNotify(parent);
}

QDialog *KdeNotifyFactory::createConfigDialog(QWidget *parent)
{
    return new SettingsDialog(parent);
}

void KdeNotifyFactory::showAbout(QWidget *parent)
{
    QMessageBox::about (parent, tr("About KDE Notification Plugin"),
                        tr("KDE 4 notification plugin for Qmmp \n") +
                        "Artur Guzik <a.guzik88@gmail.com>");
}

QTranslator *KdeNotifyFactory::createTranslator(QObject *parent)
{
    QTranslator *translator = new QTranslator(parent);
    QString locale = Qmmp::systemLanguageID();
    translator->load(QString(":/kdenotify_plugin_") + locale);
    return translator;
}

Q_EXPORT_PLUGIN(KdeNotifyFactory)