summaryrefslogtreecommitdiff
path: root/plugins/MPD.py
blob: b6d7d4e3796e34d6592052e7bbdad113bdb8e298 (plain)
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
from PyQt4 import QtGui
from clMonty import monty
from clPlugin import *
from misc import *
from clSettings import settings, mpdSettings

class pluginMPD(Plugin):
	def __init__(self, winMain):
		Plugin.__init__(self, winMain, 'MPD')
	def getInfo(self):
		return "Provides an interface to the MPD settings."
	
	
	def _getSettings(self):
		return [
			['host', 'Host', 'Host where mpd resides.', QtGui.QLineEdit(settings.get('host', 'localhost'))],
			['port', 'Port', 'Port of mpd.', QtGui.QLineEdit(settings.get('port', '6600'))],
			['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()
		monty.updateDB([mpdSettings.get('music_directory')])
		pass