1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00
Clementine-audio-player-Mac.../scripts/digitallyimported-radio/main.py

34 lines
1.2 KiB
Python
Raw Normal View History

2011-01-15 16:48:09 +01:00
from diservice import DigitallyImportedService
from skyservice import SkyFmService
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
self.di_service = DigitallyImportedService(clementine.radio_model)
self.sky_service = SkyFmService(clementine.radio_model)
clementine.radio_model.AddService(self.di_service)
clementine.radio_model.AddService(self.sky_service)
# Register for when the user clicks the Settings button
script.SettingsDialogRequested.connect(self.ShowSettings)
2011-01-15 16:48:09 +01:00
# Register for the "Configure..." right click menu items
self.di_service.SettingsDialogRequested.connect(self.ShowSettings)
self.sky_service.SettingsDialogRequested.connect(self.ShowSettings)
def ShowSettings(self):
if not self.settings_dialog:
# Create the dialog the first time it's shown
self.settings_dialog = SettingsDialog()
2011-01-15 16:48:09 +01:00
self.settings_dialog.accepted.connect(self.di_service.ReloadSettings)
self.settings_dialog.accepted.connect(self.sky_service.ReloadSettings)
self.settings_dialog.show()
plugin = Plugin()