2011-01-15 16:48:09 +01:00
|
|
|
from diservice import DigitallyImportedService
|
|
|
|
from skyservice import SkyFmService
|
2011-01-15 01:57:43 +01:00
|
|
|
from settingsdialog import SettingsDialog
|
|
|
|
|
|
|
|
import clementine
|
|
|
|
|
|
|
|
class Plugin:
|
|
|
|
def __init__(self):
|
|
|
|
self.settings_dialog = None
|
|
|
|
|
2011-01-15 16:48:09 +01:00
|
|
|
# Create the services and add them to the Internet tab
|
2011-05-20 01:02:37 +02:00
|
|
|
self.di_service = DigitallyImportedService(clementine.radio_model, self.ShowSettings)
|
|
|
|
self.sky_service = SkyFmService(clementine.radio_model, self.ShowSettings)
|
2011-01-15 16:48:09 +01:00
|
|
|
clementine.radio_model.AddService(self.di_service)
|
|
|
|
clementine.radio_model.AddService(self.sky_service)
|
2011-01-15 01:57:43 +01:00
|
|
|
|
|
|
|
# Register for when the user clicks the Settings button
|
2011-05-30 16:53:28 +02:00
|
|
|
__script__.connect("SettingsDialogRequested()", self.ShowSettings)
|
2011-01-15 01:57:43 +01:00
|
|
|
|
|
|
|
def ShowSettings(self):
|
|
|
|
if not self.settings_dialog:
|
2011-01-15 14:59:58 +01:00
|
|
|
# Create the dialog the first time it's shown
|
2011-01-15 01:57:43 +01:00
|
|
|
self.settings_dialog = SettingsDialog()
|
2011-05-20 01:02:37 +02:00
|
|
|
self.settings_dialog.connect("accepted()", self.di_service.ReloadSettings)
|
|
|
|
self.settings_dialog.connect("accepted()", self.sky_service.ReloadSettings)
|
2011-01-15 01:57:43 +01:00
|
|
|
|
|
|
|
self.settings_dialog.show()
|
|
|
|
|
|
|
|
plugin = Plugin()
|