1 /***************************************************************************
2  *   Copyright (C) 2017 by Ilya Kotov                                      *
3  *   forkotov02@ya.ru                                                      *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20 
21 #include <QMessageBox>
22 #include <QtPlugin>
23 #include <qmmp/qmmp.h>
24 #include "history.h"
25 #include "historysettingsdialog.h"
26 #include "historyfactory.h"
27 
properties() const28 GeneralProperties HistoryFactory::properties() const
29 {
30     GeneralProperties properties;
31     properties.name = tr("Listening History Plugin");
32     properties.shortName = "history";
33     properties.hasAbout = true;
34     properties.hasSettings = true;
35     properties.visibilityControl = false;
36     return properties;
37 }
38 
create(QObject * parent)39 QObject *HistoryFactory::create(QObject *parent)
40 {
41     return new History(parent);
42 }
43 
createConfigDialog(QWidget * parent)44 QDialog *HistoryFactory::createConfigDialog(QWidget *parent)
45 {
46     return new HistorySettingsDialog(parent) ;
47 }
48 
showAbout(QWidget * parent)49 void HistoryFactory::showAbout(QWidget *parent)
50 {
51     QMessageBox::about (parent, tr("About Listening History Plugin"),
52                         tr("Qmmp Listening History Plugin")+"\n"+
53                         tr("This plugin collects information about listened tracks")+"\n"+
54                         tr("Written by: Ilya Kotov <forkotov02@ya.ru>"));
55 }
56 
translation() const57 QString HistoryFactory::translation() const
58 {
59     return QLatin1String(":/history_plugin_");
60 }
61