summaryrefslogtreecommitdiff
path: root/nephilim/plugins/Notify.py
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2010-08-26 13:04:54 +0200
committerAnton Khirnov <wyskas@gmail.com>2010-08-26 13:21:56 +0200
commit3029049140ffd2d61c96f91976fefcbea63b64e2 (patch)
tree4d6ed8fa011f4388f2481e21b541d164bcab694e /nephilim/plugins/Notify.py
parentf22dab76b500a22109a734fa7dafca9d50a24725 (diff)
switch to QVariant API 2
i.e., remove all explicite usage of QVariant
Diffstat (limited to 'nephilim/plugins/Notify.py')
-rw-r--r--nephilim/plugins/Notify.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/nephilim/plugins/Notify.py b/nephilim/plugins/Notify.py
index af97e06..bb01aab 100644
--- a/nephilim/plugins/Notify.py
+++ b/nephilim/plugins/Notify.py
@@ -17,7 +17,6 @@
#
from PyQt4 import QtGui, QtCore
-from PyQt4.QtCore import QVariant
from ..common import sec2min, APPNAME, expand_tags
from ..plugin import Plugin
@@ -123,18 +122,17 @@ class Notify(Plugin):
if not song:
return
self.settings.beginGroup(self.name)
- self.o.show(expand_tags(self.settings.value('songformat').toString(), (song,)), self.settings.value('timer').toInt()[0],
- NOTIFY_PRIORITY_SONG)
+ self.o.show(expand_tags(self.settings.value('songformat'), (song,)), int(self.settings.value('timer')), NOTIFY_PRIORITY_SONG)
self.settings.endGroup()
def on_connect_changed(self, val):
- self.o.show('%s.'%('Connected' if val else 'Disconnected'), self.settings.value(self.name + '/timer').toInt()[0])
+ self.o.show('%s.'%('Connected' if val else 'Disconnected'), int(self.settings.value(self.name + '/timer')))
def onStateChange(self, new_state):
- self.o.show(new_state, self.settings.value(self.name + '/timer').toInt()[0])
+ self.o.show(new_state, int(self.settings.value(self.name + '/timer')))
def onVolumeChange(self, new_vol):
- self.o.show('Volume: %i%%'%(new_vol), self.settings.value(self.name + '/timer').toInt()[0], priority = NOTIFY_PRIORITY_VOLUME)
+ self.o.show('Volume: %i%%'%(new_vol), int(self.settings.value(self.name + '/timer')), priority = NOTIFY_PRIORITY_VOLUME)
class SettingsWidgetNotify(Plugin.SettingsWidget):
format = None
@@ -144,9 +142,9 @@ class Notify(Plugin):
Plugin.SettingsWidget.__init__(self, plugin)
self.settings.beginGroup(self.plugin.name)
- self.format = QtGui.QLineEdit(self.settings.value('songformat').toString())
+ self.format = QtGui.QLineEdit(self.settings.value('songformat'))
- self.timer = QtGui.QLineEdit(self.settings.value('timer').toString())
+ self.timer = QtGui.QLineEdit(self.settings.value('timer'))
self.timer.setValidator(QtGui.QIntValidator(self.timer))
self.setLayout(QtGui.QVBoxLayout())
@@ -158,8 +156,8 @@ class Notify(Plugin):
def save_settings(self):
self.settings.beginGroup(self.plugin.name)
- self.settings.setValue('songformat', QVariant(self.format.text()))
- self.settings.setValue('timer', QVariant(int(self.timer.text())))
+ self.settings.setValue('songformat', self.format.text())
+ self.settings.setValue('timer', int(self.timer.text()))
self.settings.endGroup()
self.plugin.onSongChange()