internet: Consolidate ShowConfig methods.

InternetService::ShowConfig() and ShowSettingsPage() were used to show
the settings page for a service.
This commit is contained in:
Jim Broadus 2021-06-29 23:56:20 -07:00 committed by John Maguire
parent 25b537cf26
commit a5fd484a61
10 changed files with 14 additions and 20 deletions

View File

@ -52,6 +52,4 @@ void DigitallyImportedSearchProvider::RecreateItems() {
SetItems(items);
}
void DigitallyImportedSearchProvider::ShowConfig() {
service_->ShowSettingsDialog();
}
void DigitallyImportedSearchProvider::ShowConfig() { service_->ShowConfig(); }

View File

@ -34,7 +34,7 @@ bool CloudFileSearchProvider::IsLoggedIn() {
return service_->has_credentials();
}
void CloudFileSearchProvider::ShowConfig() { service_->ShowSettingsDialog(); }
void CloudFileSearchProvider::ShowConfig() { service_->ShowConfig(); }
InternetService* CloudFileSearchProvider::internet_service() {
return service_;

View File

@ -84,7 +84,7 @@ void CloudFileService::LazyPopulate(QStandardItem* item) {
switch (item->data(InternetModel::Role_Type).toInt()) {
case InternetModel::Type_Service:
if (!has_credentials()) {
ShowSettingsDialog();
ShowConfig();
} else {
Connect();
}
@ -103,8 +103,7 @@ void CloudFileService::PopulateContextMenu() {
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
context_menu_->addSeparator();
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
tr("Configure..."), this,
SLOT(ShowSettingsDialog()));
tr("Configure..."), this, SLOT(ShowConfig()));
}
void CloudFileService::ShowCoverManager() {
@ -122,7 +121,7 @@ void CloudFileService::AddToPlaylist(QMimeData* mime) {
QModelIndex());
}
void CloudFileService::ShowSettingsDialog() {
void CloudFileService::ShowConfig() {
app_->OpenSettingsDialogAtPage(settings_page_);
}

View File

@ -53,7 +53,7 @@ class CloudFileService : public InternetService {
void AllIndexingTasksFinished();
public slots:
void ShowSettingsDialog();
void ShowConfig() override;
protected:
virtual void Connect() = 0;

View File

@ -127,7 +127,7 @@ void DigitallyImportedServiceBase::PopulateStreams() {
if (root_->hasChildren()) root_->removeRows(0, root_->rowCount());
if (!is_premium_account()) {
ShowSettingsDialog();
ShowConfig();
return;
}
@ -180,8 +180,7 @@ void DigitallyImportedServiceBase::ShowContextMenu(const QPoint& global_pos) {
SLOT(ForceRefreshStreams()));
context_menu_->addSeparator();
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
tr("Configure..."), this,
SLOT(ShowSettingsDialog()));
tr("Configure..."), this, SLOT(ShowConfig()));
}
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);
}

View File

@ -65,7 +65,7 @@ class DigitallyImportedServiceBase : public InternetService {
Song* song) const;
public slots:
void ShowSettingsDialog();
void ShowConfig() override;
signals:
void StreamsChanged();

View File

@ -76,7 +76,7 @@ void DropboxService::Connect() {
if (has_credentials()) {
RequestFileList();
} else {
ShowSettingsDialog();
ShowConfig();
}
}

View File

@ -226,8 +226,7 @@ void GoogleDriveService::PopulateContextMenu() {
context_menu_->addAction(IconLoader::Load("download", IconLoader::Base),
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
tr("Configure..."), this,
SLOT(ShowSettingsDialog()));
tr("Configure..."), this, SLOT(ShowConfig()));
}
void GoogleDriveService::UpdateContextMenu() {

View File

@ -218,7 +218,7 @@ void SeafileService::Connect() {
if (has_credentials()) {
UpdateLibraries();
} else {
ShowSettingsDialog();
ShowConfig();
}
}

View File

@ -219,8 +219,7 @@ void SkydriveService::PopulateContextMenu() {
tr("Cover Manager"), this, SLOT(ShowCoverManager()));
context_menu_->addSeparator();
context_menu_->addAction(IconLoader::Load("configure", IconLoader::Base),
tr("Configure..."), this,
SLOT(ShowSettingsDialog()));
tr("Configure..."), this, SLOT(ShowConfig()));
}
void SkydriveService::UpdateContextMenu() {