aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/scrobbler/scrobblerfactory.cpp
blob: 906dd65c59517090d8b0dc8e649627834ffcea64 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/***************************************************************************
 *   Copyright (C) 2008-2012 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/

#include <QtGui>
#include <qmmp/qmmp.h>
#include "scrobblerhandler.h"
#include "settingsdialog.h"
#include "scrobblerfactory.h"

const GeneralProperties ScrobblerFactory::properties() const
{
    GeneralProperties properties;
    properties.name = tr("Scrobbler Plugin");
    properties.shortName = "scrobbler";
    properties.hasAbout = true;
    properties.hasSettings = true;
    properties.visibilityControl = false;
    return properties;
}

QObject *ScrobblerFactory::create(QObject *parent)
{
    return new ScrobblerHandler(parent);
}

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

void ScrobblerFactory::showAbout(QWidget *parent)
{
    QMessageBox::about (parent, tr("About Scrobbler Plugin"),
                        tr("Qmmp AudioScrobbler Plugin")+"\n"+
                        tr("Written by: Ilya Kotov <forkotov02@hotmail.ru>"));
}

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

Q_EXPORT_PLUGIN2(scrobbler, ScrobblerFactory)
8-e032-0410-971d-27865f9a5e38> 2016-01-19 07:42:23 +0000 committer trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> 2016-01-19 07:42:23 +0000 added feature to refresh playlist' href='/qmmp/commit/src/plugins/Ui/skinned/actionmanager.cpp?id=2ab1fd161b64ad3cdf87bf8bf0be78d42f69157c'>2ab1fd161
40c82a8a1








40c82a8a1
40c82a8a1
7e96b6eb6
40c82a8a1





72a939a9e
ffc1ef2de
40c82a8a1

f40087159
40c82a8a1

24af8da3f
79fcd1357
24af8da3f

f40087159
24af8da3f



79fcd1357
24af8da3f














0b96bbb6b




24af8da3f








b312fcd85
24af8da3f








4d69ace7b






40c82a8a1
79fcd1357


3b01f3e26
79fcd1357










40c82a8a1




fa1e4194b
40c82a8a1

b312fcd85





b312fcd85

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
                                                                            
                                                                            














                                                                            
                                                                            





                                                                             
                       









                                                                         
                                               
              





                                                                                                    
                                                                                   







                                                                                                    
          

                                                                                                   
                                                                                           
                                                                                    
                                                                                              
                                                                                         

                                                                                                                  



                                                                           











                                                                                                     
                                                                                         








                                                                                                     
                                                                                             
                                                                                                      
                                                                                   





                                                                                            
                                                                                                  
                                                                                                       

                                                                                                    
                                                               

                                                                                          
                           
                 

                      
                                                  



                               
                 














                                                                                  




                                         








                                                                                                  
                                                








                                                    






                                                                                 
 


                                      
                                                                                               










                                                                                




                                                                 
                                                                                                 

     





                                                                            

     
/***************************************************************************
 *   Copyright (C) 2010-2016 by Ilya Kotov                                 *
 *   forkotov02@hotmail.ru                                                 *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/

#include <QSettings>
#include <QAction>
#include <QIcon>
#include <QFile>
#include <QApplication>
#include <qmmp/qmmp.h>
#include "actionmanager.h"

ActionManager *ActionManager::m_instance = 0;

ActionManager::ActionManager(QObject *parent) :
    QObject(parent)
{
    m_instance = this;
    m_settings = new QSettings(Qmmp::configFile(), QSettings::IniFormat);
    m_settings->beginGroup("SkinnedShortcuts");
    //playback
    m_actions[PLAY] = createAction(tr("&Play"), "play", tr("X"), "media-playback-start");
    m_actions[PAUSE] = createAction(tr("&Pause"), "pause", tr("C"), "media-playback-pause");
    m_actions[STOP] = createAction(tr("&Stop"), "stop", tr("V"), "media-playback-stop");
    m_actions[PREVIOUS] = createAction(tr("&Previous"), "previous", tr("Z"), "media-skip-backward");
    m_actions[NEXT] = createAction(tr("&Next"), "next", tr("B"), "media-skip-forward");
    m_actions[PLAY_PAUSE] = createAction(tr("&Play/Pause"), "play_pause", tr("Space"));
    m_actions[JUMP] = createAction(tr("&Jump to Track"), "jump", tr("J"), "go-up");
    m_actions[REPEAT_ALL] = createAction2(tr("&Repeat Playlist"), "repeate_playlist", tr("R"));
    m_actions[REPEAT_TRACK] = createAction2(tr("&Repeat Track"), "repeate_track", tr("Ctrl+R"));
    m_actions[SHUFFLE] = createAction2(tr("&Shuffle"), "shuffle", tr("S"));
    m_actions[NO_PL_ADVANCE] = createAction2(tr("&No Playlist Advance"), "no_playlist_advance",
                                            tr("Ctrl+N"));
    m_actions[STOP_AFTER_SELECTED] = createAction(tr("&Stop After Selected"), "stop_after_selected",
                                                  tr("Ctrl+S"));
    m_actions[CLEAR_QUEUE] = createAction(tr("&Clear Queue"), "clear_queue", tr("Alt+Q"));
    //view
    m_actions[SHOW_PLAYLIST] = createAction2(tr("Show Playlist"), "show_playlist", tr("Alt+E"));
    m_actions[SHOW_EQUALIZER] = createAction2(tr("Show Equalizer"), "show_equalizer", tr("Alt+G"));
    m_actions[WM_ALLWAYS_ON_TOP] = createAction2(tr("Always on Top"), "always_on_top", "");
    m_actions[WM_STICKY] = createAction2(tr("Put on All Workspaces"), "sticky", "");
    m_actions[WM_DOUBLE_SIZE] = createAction2(tr("Double Size"), "double_size", tr("Meta+D"));
    m_actions[WM_ANTIALIASING] = createAction2(tr("Anti-aliasing"), "anti_aliasing", "");
    connect(m_actions[WM_DOUBLE_SIZE], SIGNAL(toggled(bool)), m_actions[WM_ANTIALIASING], SLOT(setEnabled(bool)));
    m_actions[WM_ANTIALIASING]->setEnabled(false);
    //volume
    m_actions[VOL_ENC] = createAction(tr("Volume &+"), "vol_enc", tr("0"));
    m_actions[VOL_DEC] = createAction(tr("Volume &-"), "vol_dec", tr("9"));
    m_actions[VOL_MUTE] = createAction2(tr("&Mute"), "vol_mute", tr("M"));
    //playlist
    m_actions[PL_ADD_FILE] = createAction(tr("&Add File"), "add_file", tr("F"), "audio-x-generic");
    m_actions[PL_ADD_DIRECTORY] = createAction(tr("&Add Directory"), "add_dir", tr("D"), "folder");
    m_actions[PL_ADD_URL] = createAction(tr("&Add Url"), "add_url", tr("U"), "network-server");
    m_actions[PL_REMOVE_SELECTED] = createAction(tr("&Remove Selected"), "remove_selected",
                                                 tr("Del"), "edit-delete");
    m_actions[PL_REMOVE_ALL] = createAction(tr("&Remove All"), "remove_all", "", "edit-clear");
    m_actions[PL_REMOVE_UNSELECTED] = createAction(tr("&Remove Unselected"), "remove_unselected",
                                                   "", "edit-delete");
    m_actions[PL_REMOVE_INVALID] = createAction(tr("Remove unavailable files"), "remove_invalid",
                                                "", "dialog-error");