diff --git a/scripts/digitallyimported-radio/servicebase.py b/scripts/digitallyimported-radio/servicebase.py index da44290db..edc3596b0 100644 --- a/scripts/digitallyimported-radio/servicebase.py +++ b/scripts/digitallyimported-radio/servicebase.py @@ -64,15 +64,9 @@ class DigitallyImportedServiceBase(clementine.RadioService): def ShowContextMenu(self, index, global_pos): if not self.menu: self.menu = QMenu() - self.menu.addAction(clementine.IconLoader.Load("media-playback-start"), - self.tr("Append to current playlist"), self.AddToPlaylist) - self.menu.addAction(clementine.IconLoader.Load("media-playback-start"), - self.tr("Replace current playlist"), self.LoadToPlaylist) - self.menu.addAction(clementine.IconLoader.Load("document-new"), - self.tr("Open in new playlist"), self.OpenInNewPlaylist) - - self.menu.addSeparator() + for action in self.GetPlaylistActions(): + self.menu.addAction(action) self.menu.addAction(clementine.IconLoader.Load("download"), self.tr("Open " + self.HOMEPAGE_NAME + " in browser"), self.Homepage) self.menu.addAction(clementine.IconLoader.Load("view-refresh"), @@ -86,14 +80,8 @@ class DigitallyImportedServiceBase(clementine.RadioService): self.context_index = index self.menu.popup(global_pos) - def AddToPlaylist(self): - self.AddItemToPlaylist(self.context_index, self.AddMode_Append) - - def LoadToPlaylist(self): - self.AddItemToPlaylist(self.context_index, self.AddMode_Replace) - - def OpenInNewPlaylist(self): - self.AddItemToPlaylist(self.context_index, self.AddMode_OpenInNew) + def GetCurrentIndex(self): + return self.context_index def Homepage(self): QDesktopServices.openUrl(self.HOMEPAGE_URL) diff --git a/src/radio/icecastservice.cpp b/src/radio/icecastservice.cpp index a3ec3db72..f485dd84b 100644 --- a/src/radio/icecastservice.cpp +++ b/src/radio/icecastservice.cpp @@ -271,9 +271,9 @@ void IcecastService::ShowContextMenu(const QModelIndex& index, const bool can_play = context_item_.isValid() && model_->GetSong(context_item_).is_valid(); - add_to_playlist_->setEnabled(can_play); - load_to_playlist_->setEnabled(can_play); - open_in_new_playlist_->setEnabled(can_play); + GetAppendToPlaylistAction()->setEnabled(can_play); + GetReplacePlaylistAction()->setEnabled(can_play); + GetOpenInNewPlaylistAction()->setEnabled(can_play); context_menu_->popup(global_pos); } @@ -283,13 +283,7 @@ void IcecastService::EnsureMenuCreated() { context_menu_ = new QMenu; - add_to_playlist_ = context_menu_->addAction( - IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist())); - load_to_playlist_ = context_menu_->addAction( - IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(LoadToPlaylist())); - open_in_new_playlist_ = context_menu_->addAction( - IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist())); - context_menu_->addSeparator(); + context_menu_->addActions(GetPlaylistActions()); context_menu_->addAction(IconLoader::Load("download"), tr("Open dir.xiph.org in browser"), this, SLOT(Homepage())); context_menu_->addAction(IconLoader::Load("view-refresh"), tr("Refresh station list"), this, SLOT(LoadDirectory())); } @@ -298,14 +292,6 @@ void IcecastService::Homepage() { QDesktopServices::openUrl(QUrl(kHomepage)); } -void IcecastService::AddToPlaylist() { - AddItemToPlaylist(context_item_, AddMode_Append); -} - -void IcecastService::LoadToPlaylist() { - AddItemToPlaylist(context_item_, AddMode_Replace); -} - -void IcecastService::OpenInNewPlaylist() { - AddItemToPlaylist(context_item_, AddMode_OpenInNew); +QModelIndex IcecastService::GetCurrentIndex() { + return context_item_; } diff --git a/src/radio/icecastservice.h b/src/radio/icecastservice.h index a912c05e6..a134665a1 100644 --- a/src/radio/icecastservice.h +++ b/src/radio/icecastservice.h @@ -52,12 +52,12 @@ class IcecastService : public RadioService { QWidget* HeaderWidget() const; +protected: + QModelIndex GetCurrentIndex(); + private slots: void LoadDirectory(); void Homepage(); - void AddToPlaylist(); - void LoadToPlaylist(); - void OpenInNewPlaylist(); private: void EnsureMenuCreated(); @@ -68,9 +68,6 @@ class IcecastService : public RadioService { NetworkAccessManager* network_; QMenu* context_menu_; QModelIndex context_item_; - QAction* add_to_playlist_; - QAction* load_to_playlist_; - QAction* open_in_new_playlist_; IcecastBackend* backend_; IcecastModel* model_; diff --git a/src/radio/jamendoservice.cpp b/src/radio/jamendoservice.cpp index efe3c65c9..22ee63353 100644 --- a/src/radio/jamendoservice.cpp +++ b/src/radio/jamendoservice.cpp @@ -378,13 +378,7 @@ void JamendoService::EnsureMenuCreated() { return; context_menu_ = new QMenu; - add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), - tr("Append to current playlist"), this, SLOT(AddToPlaylist())); - load_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), - tr("Replace current playlist"), this, SLOT(LoadToPlaylist())); - open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), - tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist())); - context_menu_->addSeparator(); + context_menu_->addActions(GetPlaylistActions()); album_info_ = context_menu_->addAction(IconLoader::Load("view-media-lyrics"), tr("Album info on jamendo.com..."), this, SLOT(AlbumInfo())); download_album_ = context_menu_->addAction(IconLoader::Load("download"), @@ -409,9 +403,9 @@ void JamendoService::ShowContextMenu(const QModelIndex& index, const QPoint& glo context_item_ = QModelIndex(); } - add_to_playlist_->setEnabled(context_item_.isValid()); - load_to_playlist_->setEnabled(context_item_.isValid()); - open_in_new_playlist_->setEnabled(context_item_.isValid()); + GetAppendToPlaylistAction()->setEnabled(context_item_.isValid()); + GetReplacePlaylistAction()->setEnabled(context_item_.isValid()); + GetOpenInNewPlaylistAction()->setEnabled(context_item_.isValid()); album_info_->setEnabled(context_item_.isValid()); download_album_->setEnabled(context_item_.isValid()); context_menu_->popup(global_pos); @@ -422,16 +416,8 @@ QWidget* JamendoService::HeaderWidget() const { return library_filter_; } -void JamendoService::AddToPlaylist() { - AddItemToPlaylist(context_item_, AddMode_Append); -} - -void JamendoService::LoadToPlaylist() { - AddItemToPlaylist(context_item_, AddMode_Replace); -} - -void JamendoService::OpenInNewPlaylist() { - AddItemToPlaylist(context_item_, AddMode_OpenInNew); +QModelIndex JamendoService::GetCurrentIndex() { + return context_item_; } void JamendoService::AlbumInfo() { diff --git a/src/radio/jamendoservice.h b/src/radio/jamendoservice.h index ff5a4d082..2b21e4682 100644 --- a/src/radio/jamendoservice.h +++ b/src/radio/jamendoservice.h @@ -66,6 +66,9 @@ class JamendoService : public RadioService { static const int kBatchSize; static const int kApproxDatabaseSize; + protected: + QModelIndex GetCurrentIndex(); + private: void ParseDirectory(QIODevice* device) const; @@ -91,9 +94,6 @@ class JamendoService : public RadioService { void ParseDirectoryFinished(); void UpdateTotalSongCount(int count); - void AddToPlaylist(); - void LoadToPlaylist(); - void OpenInNewPlaylist(); void AlbumInfo(); void DownloadAlbum(); void Homepage(); @@ -104,9 +104,6 @@ class JamendoService : public RadioService { QMenu* context_menu_; QModelIndex context_item_; - QAction* add_to_playlist_; - QAction* load_to_playlist_; - QAction* open_in_new_playlist_; QAction* album_info_; QAction* download_album_; diff --git a/src/radio/lastfmservice.cpp b/src/radio/lastfmservice.cpp index 172e0a022..ed1beaf9b 100644 --- a/src/radio/lastfmservice.cpp +++ b/src/radio/lastfmservice.cpp @@ -74,13 +74,7 @@ LastFMService::LastFMService(RadioModel* parent) { ReloadSettings(); - play_action_ = context_menu_->addAction( - IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist())); - load_action_ = context_menu_->addAction( - IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(LoadToPlaylist())); - open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), - tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist())); - context_menu_->addSeparator(); + context_menu_->addActions(GetPlaylistActions()); remove_action_ = context_menu_->addAction( IconLoader::Load("list-remove"), tr("Remove"), this, SLOT(Remove())); context_menu_->addSeparator(); @@ -470,9 +464,9 @@ void LastFMService::ShowContextMenu(const QModelIndex& index, const QPoint &glob } const bool playable = model()->IsPlayable(index); - play_action_->setEnabled(playable); - load_action_->setEnabled(playable); - open_in_new_playlist_->setEnabled(playable); + GetAppendToPlaylistAction()->setEnabled(playable); + GetReplacePlaylistAction()->setEnabled(playable); + GetOpenInNewPlaylistAction()->setEnabled(playable); context_menu_->popup(global_pos); } @@ -558,16 +552,8 @@ void LastFMService::RefreshNeighboursFinished() { } } -void LastFMService::AddToPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_Append); -} - -void LastFMService::LoadToPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_Replace); -} - -void LastFMService::OpenInNewPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_OpenInNew); +QModelIndex LastFMService::GetCurrentIndex() { + return context_item_->index(); } void LastFMService::AddArtistRadio() { diff --git a/src/radio/lastfmservice.h b/src/radio/lastfmservice.h index ad49fe892..26edf6c34 100644 --- a/src/radio/lastfmservice.h +++ b/src/radio/lastfmservice.h @@ -116,6 +116,9 @@ class LastFMService : public RadioService { void ScrobblingEnabledChanged(bool value); void ButtonVisibilityChanged(bool value); + protected: + QModelIndex GetCurrentIndex(); + private slots: void AuthenticateReplyFinished(); void RefreshFriendsFinished(); @@ -124,9 +127,6 @@ class LastFMService : public RadioService { void TunerTrackAvailable(); void TunerError(lastfm::ws::Error error); - void AddToPlaylist(); - void LoadToPlaylist(); - void OpenInNewPlaylist(); void AddArtistRadio(); void AddTagRadio(); void AddCustomRadio(); @@ -172,9 +172,6 @@ class LastFMService : public RadioService { boost::scoped_ptr station_dialog_; boost::scoped_ptr context_menu_; - QAction* play_action_; - QAction* load_action_; - QAction* open_in_new_playlist_; QAction* remove_action_; QAction* add_artist_action_; QAction* add_tag_action_; diff --git a/src/radio/magnatuneservice.cpp b/src/radio/magnatuneservice.cpp index 5acc7b7dc..7def5d9fe 100644 --- a/src/radio/magnatuneservice.cpp +++ b/src/radio/magnatuneservice.cpp @@ -248,13 +248,7 @@ void MagnatuneService::EnsureMenuCreated() { context_menu_ = new QMenu; - add_to_playlist_ = context_menu_->addAction( - IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist())); - load_to_playlist_ = context_menu_->addAction( - IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(LoadToPlaylist())); - open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), - tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist())); - context_menu_->addSeparator(); + context_menu_->addActions(GetPlaylistActions()); download_ = context_menu_->addAction( IconLoader::Load("download"), tr("Download this album"), this, SLOT(Download())); context_menu_->addSeparator(); @@ -278,23 +272,15 @@ void MagnatuneService::ShowContextMenu(const QModelIndex& index, const QPoint& g else context_item_ = QModelIndex(); - add_to_playlist_->setEnabled(context_item_.isValid()); - load_to_playlist_->setEnabled(context_item_.isValid()); - open_in_new_playlist_->setEnabled(context_item_.isValid()); + GetAppendToPlaylistAction()->setEnabled(context_item_.isValid()); + GetReplacePlaylistAction()->setEnabled(context_item_.isValid()); + GetOpenInNewPlaylistAction()->setEnabled(context_item_.isValid()); download_->setEnabled(context_item_.isValid() && membership_ == Membership_Download); context_menu_->popup(global_pos); } -void MagnatuneService::AddToPlaylist() { - AddItemToPlaylist(context_item_, AddMode_Append); -} - -void MagnatuneService::LoadToPlaylist() { - AddItemToPlaylist(context_item_, AddMode_Replace); -} - -void MagnatuneService::OpenInNewPlaylist() { - AddItemToPlaylist(context_item_, AddMode_OpenInNew); +QModelIndex MagnatuneService::GetCurrentIndex() { + return context_item_; } void MagnatuneService::Homepage() { diff --git a/src/radio/magnatuneservice.h b/src/radio/magnatuneservice.h index 173791cb7..b23fed48b 100644 --- a/src/radio/magnatuneservice.h +++ b/src/radio/magnatuneservice.h @@ -88,14 +88,14 @@ class MagnatuneService : public RadioService { signals: void DownloadFinished(const QStringList& albums); + protected: + QModelIndex GetCurrentIndex(); + private slots: void UpdateTotalSongCount(int count); void ReloadDatabase(); void ReloadDatabaseFinished(); - void AddToPlaylist(); - void LoadToPlaylist(); - void OpenInNewPlaylist(); void Download(); void Homepage(); void ShowConfig(); @@ -110,9 +110,6 @@ class MagnatuneService : public RadioService { QModelIndex context_item_; QStandardItem* root_; - QAction* add_to_playlist_; - QAction* load_to_playlist_; - QAction* open_in_new_playlist_; QAction* download_; LibraryBackend* library_backend_; diff --git a/src/radio/radioservice.cpp b/src/radio/radioservice.cpp index 5610e2614..57f2655fe 100644 --- a/src/radio/radioservice.cpp +++ b/src/radio/radioservice.cpp @@ -19,14 +19,63 @@ #include "radiomodel.h" #include "core/mergedproxymodel.h" #include "core/mimedata.h" +#include "ui/iconloader.h" + +#include RadioService::RadioService(const QString& name, RadioModel* model) : QObject(model), model_(model), - name_(name) + name_(name), + append_to_playlist_(NULL), + replace_playlist_(NULL), + open_in_new_playlist_(NULL), + separator_(NULL) { } +QList RadioService::GetPlaylistActions() { + if(!separator_) { + separator_ = new QAction(this); + separator_->setSeparator(true); + } + + return QList() << GetAppendToPlaylistAction() + << GetReplacePlaylistAction() + << GetOpenInNewPlaylistAction() + << separator_; +} + +QAction* RadioService::GetAppendToPlaylistAction() { + if(!append_to_playlist_) { + append_to_playlist_ = new QAction(IconLoader::Load("media-playback-start"), + tr("Append to current playlist"), this); + connect(append_to_playlist_, SIGNAL(triggered()), this, SLOT(AppendToPlaylist())); + } + + return append_to_playlist_; +} + +QAction* RadioService::GetReplacePlaylistAction() { + if(!replace_playlist_) { + replace_playlist_ = new QAction(IconLoader::Load("media-playback-start"), + tr("Replace current playlist"), this); + connect(replace_playlist_, SIGNAL(triggered()), this, SLOT(ReplacePlaylist())); + } + + return replace_playlist_; +} + +QAction* RadioService::GetOpenInNewPlaylistAction() { + if(!open_in_new_playlist_) { + open_in_new_playlist_ = new QAction(IconLoader::Load("document-new"), + tr("Open in new playlist"), this); + connect(open_in_new_playlist_, SIGNAL(triggered()), this, SLOT(OpenInNewPlaylist())); + } + + return open_in_new_playlist_; +} + PlaylistItem::SpecialLoadResult RadioService::StartLoading(const QUrl &url) { return PlaylistItem::SpecialLoadResult( PlaylistItem::SpecialLoadResult::TrackAvailable, url, url); @@ -49,3 +98,15 @@ void RadioService::AddItemsToPlaylist(const QModelIndexList& indexes, AddMode ad } emit AddToPlaylistSignal(data); } + +void RadioService::AppendToPlaylist() { + AddItemToPlaylist(GetCurrentIndex(), AddMode_Append); +} + +void RadioService::ReplacePlaylist() { + AddItemToPlaylist(GetCurrentIndex(), AddMode_Replace); +} + +void RadioService::OpenInNewPlaylist() { + AddItemToPlaylist(GetCurrentIndex(), AddMode_OpenInNew); +} diff --git a/src/radio/radioservice.h b/src/radio/radioservice.h index 50728fd42..8787a27b0 100644 --- a/src/radio/radioservice.h +++ b/src/radio/radioservice.h @@ -65,7 +65,26 @@ signals: void AddToPlaylistSignal(QMimeData* data); +private slots: + void AppendToPlaylist(); + void ReplacePlaylist(); + void OpenInNewPlaylist(); + protected: + // Subclass provides the currently selected QModelIndex on RadioService's + // request. + virtual QModelIndex GetCurrentIndex() = 0; + + // Returns all the playlist insertion related QActions (see below). + QList GetPlaylistActions(); + + // Returns the 'append to playlist' QAction. + QAction* GetAppendToPlaylistAction(); + // Returns the 'replace playlist' QAction. + QAction* GetReplacePlaylistAction(); + // Returns the 'open in new playlist' QAction. + QAction* GetOpenInNewPlaylistAction(); + // Describes how songs should be added to playlist. enum AddMode { // appends songs to the current playlist @@ -84,6 +103,11 @@ protected: private: RadioModel* model_; QString name_; + + QAction* append_to_playlist_; + QAction* replace_playlist_; + QAction* open_in_new_playlist_; + QAction* separator_; }; Q_DECLARE_METATYPE(RadioService*); diff --git a/src/radio/savedradio.cpp b/src/radio/savedradio.cpp index 7c5e09c1e..db1dbbd09 100644 --- a/src/radio/savedradio.cpp +++ b/src/radio/savedradio.cpp @@ -90,10 +90,7 @@ void SavedRadio::ShowContextMenu(const QModelIndex& index, const QPoint& global_pos) { if (!context_menu_) { context_menu_ = new QMenu; - add_action_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist())); - load_action_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(LoadToPlaylist())); - open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist())); - context_menu_->addSeparator(); + context_menu_->addActions(GetPlaylistActions()); remove_action_ = context_menu_->addAction(IconLoader::Load("list-remove"), tr("Remove"), this, SLOT(Remove())); edit_action_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit..."), this, SLOT(Edit())); context_menu_->addSeparator(); @@ -103,9 +100,9 @@ void SavedRadio::ShowContextMenu(const QModelIndex& index, context_item_ = model()->itemFromIndex(index); const bool is_root = index.data(RadioModel::Role_Type).toInt() == RadioModel::Type_Service; - add_action_->setEnabled(!is_root); - load_action_->setEnabled(!is_root); - open_in_new_playlist_->setEnabled(!is_root); + GetAppendToPlaylistAction()->setEnabled(!is_root); + GetReplacePlaylistAction()->setEnabled(!is_root); + GetOpenInNewPlaylistAction()->setEnabled(!is_root); remove_action_->setEnabled(!is_root); edit_action_->setEnabled(!is_root); @@ -140,16 +137,8 @@ void SavedRadio::Edit() { SaveStreams(); } -void SavedRadio::AddToPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_Append); -} - -void SavedRadio::LoadToPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_Replace); -} - -void SavedRadio::OpenInNewPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_OpenInNew); +QModelIndex SavedRadio::GetCurrentIndex() { + return context_item_->index(); } void SavedRadio::AddStreamToList(const Stream& stream, QStandardItem* parent) { diff --git a/src/radio/savedradio.h b/src/radio/savedradio.h index e3f790717..a57da04b1 100644 --- a/src/radio/savedradio.h +++ b/src/radio/savedradio.h @@ -50,10 +50,10 @@ class SavedRadio : public RadioService { signals: void ShowAddStreamDialog(); + protected: + QModelIndex GetCurrentIndex(); + private slots: - void AddToPlaylist(); - void LoadToPlaylist(); - void OpenInNewPlaylist(); void Remove(); void Edit(); @@ -78,9 +78,6 @@ class SavedRadio : public RadioService { QStandardItem* context_item_; QStandardItem* root_; - QAction* add_action_; - QAction* load_action_; - QAction* open_in_new_playlist_; QAction* remove_action_; QAction* edit_action_; diff --git a/src/radio/somafmservice.cpp b/src/radio/somafmservice.cpp index 5039e4674..bbd4d0e34 100644 --- a/src/radio/somafmservice.cpp +++ b/src/radio/somafmservice.cpp @@ -69,10 +69,7 @@ void SomaFMService::LazyPopulate(QStandardItem* item) { void SomaFMService::ShowContextMenu(const QModelIndex& index, const QPoint& global_pos) { if (!context_menu_) { context_menu_ = new QMenu; - context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist())); - context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(LoadToPlaylist())); - context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist())); - context_menu_->addSeparator(); + context_menu_->addActions(GetPlaylistActions()); context_menu_->addAction(IconLoader::Load("download"), tr("Open somafm.com in browser"), this, SLOT(Homepage())); context_menu_->addAction(IconLoader::Load("view-refresh"), tr("Refresh channels"), this, SLOT(RefreshChannels())); } @@ -213,16 +210,8 @@ void SomaFMService::Homepage() { QDesktopServices::openUrl(QUrl(kHomepage)); } -void SomaFMService::AddToPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_Append); -} - -void SomaFMService::LoadToPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_Replace); -} - -void SomaFMService::OpenInNewPlaylist() { - AddItemToPlaylist(context_item_->index(), AddMode_OpenInNew); +QModelIndex SomaFMService::GetCurrentIndex() { + return context_item_->index(); } PlaylistItem::Options SomaFMService::playlistitem_options() const { diff --git a/src/radio/somafmservice.h b/src/radio/somafmservice.h index b4392e000..ddb0fb185 100644 --- a/src/radio/somafmservice.h +++ b/src/radio/somafmservice.h @@ -48,14 +48,14 @@ class SomaFMService : public RadioService { PlaylistItem::Options playlistitem_options() const; PlaylistItem::SpecialLoadResult StartLoading(const QUrl& url); + protected: + QModelIndex GetCurrentIndex(); + private slots: void RefreshChannels(); void RefreshChannelsFinished(); void LoadPlaylistFinished(); - void AddToPlaylist(); - void LoadToPlaylist(); - void OpenInNewPlaylist(); void Homepage(); private: diff --git a/src/scripting/python/radioservice.sip b/src/scripting/python/radioservice.sip index 396244915..377d88d35 100644 --- a/src/scripting/python/radioservice.sip +++ b/src/scripting/python/radioservice.sip @@ -35,6 +35,14 @@ signals: void AddToPlaylistSignal(QMimeData* data); protected: + virtual QModelIndex GetCurrentIndex() = 0; + + QList GetPlaylistActions(); + + QAction* GetAppendToPlaylistAction(); + QAction* GetReplacePlaylistAction(); + QAction* GetOpenInNewPlaylistAction(); + enum AddMode { AddMode_Append, AddMode_Replace,