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
|
from PyQt4 import QtGui
from clPlugin import *
from misc import *
from clSettings import settings, mpdSettings
MPD_HOST_DEFAULT='localhost'
MPD_PORT_DEFAULT='6600'
class pluginMPD(Plugin):
monty = None
def __init__(self, winMain):
Plugin.__init__(self, winMain, 'MPD')
self.monty = winMain.monty
def getInfo(self):
return "Provides an interface to the MPD settings."
def _getSettings(self):
return [
['host', 'Host', 'Host where mpd resides.', QtGui.QLineEdit(self.getSetting('host'))],
['port', 'Port', 'Port of mpd.', QtGui.QLineEdit(self.getSetting('port'))],
['music_directory', 'Music directory', 'Root directory where all music is located.', QtGui.QLineEdit(mpdSettings.get('music_directory')), mpdSettings],
['', 'Update database', 'Updates the database.\nUse this if you have changed the music_directory. Updating will save all entries on the MPD tab.', Button('Update db', self.onBtnUpdateDBClick)],
]
def onBtnUpdateDBClick(self):
self.saveSettings()
self.monty.updateDB([mpdSettings.get('music_directory')])
pass
|