summaryrefslogtreecommitdiff
path: root/plugins/Lyrics.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Lyrics.py')
-rw-r--r--plugins/Lyrics.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/Lyrics.py b/plugins/Lyrics.py
index 518940d..c4534d2 100644
--- a/plugins/Lyrics.py
+++ b/plugins/Lyrics.py
@@ -56,7 +56,6 @@ class wgLyrics(QtGui.QWidget):
editMode=False
lyFormat=None
p=None # plugin
- monty = None
def __init__(self, p, parent=None):
QtGui.QWidget.__init__(self, parent)
self.p=p
@@ -65,7 +64,6 @@ class wgLyrics(QtGui.QWidget):
self.btnRefetch=Button("Refetch", self.onBtnRefetchClick)
self.btnSave=Button("Save lyrics", self.onBtnSaveClick)
self.btnSearch=Button("Search www", self.onBtnSearch)
- self.monty = p.monty
self.txtView=QtGui.QTextEdit(parent)
self.txtView.setReadOnly(True)
@@ -92,7 +90,7 @@ class wgLyrics(QtGui.QWidget):
def onBtnSearch(self):
SE=self.p.getSetting('engine')
f=format.compile(SE)
- SE_url=toAscii(f(format.params(monty.getCurrentSong())))
+ SE_url=toAscii(f(format.params(self.p.monty.getCurrentSong())))
webbrowser.open(urllib.quote(SE_url, ":/+?="))
def onBtnEditClick(self):
@@ -102,16 +100,16 @@ class wgLyrics(QtGui.QWidget):
def onBtnSaveClick(self):
self.setMode(False)
self.curLyrics=self.txtView.toPlainText()
- file=open(self.getLyricsFilePath(monty.getCurrentSong()), 'w')
+ file=open(self.getLyricsFilePath(self.p.monty.getCurrentSong()), 'w')
file.write(self.curLyrics)
file.close()
# just to test if everything's still fine
- self.fetchLyrics(monty.getCurrentSong())
+ self.fetchLyrics(self.p.monty.getCurrentSong())
def onBtnRefetchClick(self):
# force refetch
- lyFName=self.getLyricsFilePath(monty.getCurrentSong())
+ lyFName=self.getLyricsFilePath(self.p.monty.getCurrentSong())
try:
os.remove(lyFName)
except:
@@ -124,7 +122,7 @@ class wgLyrics(QtGui.QWidget):
self.setMode(False)
self.lyFormat=format.compile(self.p.getSetting('downloadto'))
- song=monty.getCurrentSong()
+ song = self.p.monty.getCurrentSong()
try:
song._data['file']
except:
@@ -238,7 +236,7 @@ class wgLyrics(QtGui.QWidget):
max=t.verticalScrollBar().maximum()
if max<=0:
return
- t.verticalScrollBar().setValue((max+t.height()/t.currentFont().pointSize())*time/monty.getCurrentSong()._data['time'])
+ t.verticalScrollBar().setValue((max+t.height()/t.currentFont().pointSize())*time/self.p.monty.getCurrentSong()._data['time'])