internet: Consolidate ShowConfig methods.
InternetService::ShowConfig() and ShowSettingsPage() were used to show the settings page for a service.
This commit is contained in:
parent
25b537cf26
commit
a5fd484a61
@ -52,6 +52,4 @@ void DigitallyImportedSearchProvider::RecreateItems() {
|
|||||||
SetItems(items);
|
SetItems(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitallyImportedSearchProvider::ShowConfig() {
|
void DigitallyImportedSearchProvider::ShowConfig() { service_->ShowConfig(); }
|
||||||
service_->ShowSettingsDialog();
|
|
||||||
}
|
|
||||||
|
@ -34,7 +34,7 @@ bool CloudFileSearchProvider::IsLoggedIn() {
|
|||||||
return service_->has_credentials();
|
return service_->has_credentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloudFileSearchProvider::ShowConfig() { service_->ShowSettingsDialog(); }
|
void CloudFileSearchProvider::ShowConfig() { service_->ShowConfig(); }
|
||||||
|
|
||||||
InternetService* CloudFileSearchProvider::internet_service() {
|
InternetService* CloudFileSearchProvider::internet_service() {
|
||||||
return service_;
|
return service_;
|
||||||
|
@ -84,7 +84,7 @@ void CloudFileService::LazyPopulate(QStandardItem* item) {
|
|||||||
switch (item->data(InternetModel::Role_Type).toInt()) {
|
switch (item->data(InternetModel::Role_Type).toInt()) {
|
||||||
case InternetModel::Type_Service:
|
case InternetModel::Type_Service:
|
||||||
if (!has_credentials()) {
|
if (!has_credentials()) {
|
||||||
ShowSettingsDialog();
|
ShowConfig();
|
||||||
} else {
|
} else {
|
||||||
Connect();
|
Connect();
|
||||||
}
|
}
|
||||||
@ -103,8 +103,7 @@ void CloudFileService::PopulateContextMenu() {
|
|||||||
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
|
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
||||||
tr("Configure..."), this,
|
tr("Configure..."), this, SLOT(ShowConfig()));
|
||||||
SLOT(ShowSettingsDialog()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloudFileService::ShowCoverManager() {
|
void CloudFileService::ShowCoverManager() {
|
||||||
@ -122,7 +121,7 @@ void CloudFileService::AddToPlaylist(QMimeData* mime) {
|
|||||||
QModelIndex());
|
QModelIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloudFileService::ShowSettingsDialog() {
|
void CloudFileService::ShowConfig() {
|
||||||
app_->OpenSettingsDialogAtPage(settings_page_);
|
app_->OpenSettingsDialogAtPage(settings_page_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class CloudFileService : public InternetService {
|
|||||||
void AllIndexingTasksFinished();
|
void AllIndexingTasksFinished();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ShowSettingsDialog();
|
void ShowConfig() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void Connect() = 0;
|
virtual void Connect() = 0;
|
||||||
|
@ -127,7 +127,7 @@ void DigitallyImportedServiceBase::PopulateStreams() {
|
|||||||
if (root_->hasChildren()) root_->removeRows(0, root_->rowCount());
|
if (root_->hasChildren()) root_->removeRows(0, root_->rowCount());
|
||||||
|
|
||||||
if (!is_premium_account()) {
|
if (!is_premium_account()) {
|
||||||
ShowSettingsDialog();
|
ShowConfig();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,8 +180,7 @@ void DigitallyImportedServiceBase::ShowContextMenu(const QPoint& global_pos) {
|
|||||||
SLOT(ForceRefreshStreams()));
|
SLOT(ForceRefreshStreams()));
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
||||||
tr("Configure..."), this,
|
tr("Configure..."), this, SLOT(ShowConfig()));
|
||||||
SLOT(ShowSettingsDialog()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context_menu_->popup(global_pos);
|
context_menu_->popup(global_pos);
|
||||||
@ -204,7 +203,7 @@ void DigitallyImportedServiceBase::LoadPlaylistFinished(QNetworkReply* reply) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitallyImportedServiceBase::ShowSettingsDialog() {
|
void DigitallyImportedServiceBase::ShowConfig() {
|
||||||
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_DigitallyImported);
|
app_->OpenSettingsDialogAtPage(SettingsDialog::Page_DigitallyImported);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class DigitallyImportedServiceBase : public InternetService {
|
|||||||
Song* song) const;
|
Song* song) const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ShowSettingsDialog();
|
void ShowConfig() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void StreamsChanged();
|
void StreamsChanged();
|
||||||
|
@ -76,7 +76,7 @@ void DropboxService::Connect() {
|
|||||||
if (has_credentials()) {
|
if (has_credentials()) {
|
||||||
RequestFileList();
|
RequestFileList();
|
||||||
} else {
|
} else {
|
||||||
ShowSettingsDialog();
|
ShowConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,8 +226,7 @@ void GoogleDriveService::PopulateContextMenu() {
|
|||||||
context_menu_->addAction(IconLoader::Load("download", IconLoader::Base),
|
context_menu_->addAction(IconLoader::Load("download", IconLoader::Base),
|
||||||
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
|
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
|
||||||
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
||||||
tr("Configure..."), this,
|
tr("Configure..."), this, SLOT(ShowConfig()));
|
||||||
SLOT(ShowSettingsDialog()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoogleDriveService::UpdateContextMenu() {
|
void GoogleDriveService::UpdateContextMenu() {
|
||||||
|
@ -218,7 +218,7 @@ void SeafileService::Connect() {
|
|||||||
if (has_credentials()) {
|
if (has_credentials()) {
|
||||||
UpdateLibraries();
|
UpdateLibraries();
|
||||||
} else {
|
} else {
|
||||||
ShowSettingsDialog();
|
ShowConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,8 +219,7 @@ void SkydriveService::PopulateContextMenu() {
|
|||||||
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
|
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
|
||||||
tr("Configure..."), this,
|
tr("Configure..."), this, SLOT(ShowConfig()));
|
||||||
SLOT(ShowSettingsDialog()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkydriveService::UpdateContextMenu() {
|
void SkydriveService::UpdateContextMenu() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user