2020-05-09 01:48:08 +02:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
2021-03-20 21:14:47 +01:00
|
|
|
* Copyright 2020-2021, Jonas Kvinge <jonas@jkvinge.net>
|
2020-05-09 01:48:08 +02:00
|
|
|
*
|
|
|
|
* Strawberry is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Strawberry is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef COVERSSETTINGSPAGE_H
|
|
|
|
#define COVERSSETTINGSPAGE_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include "settings/settingspage.h"
|
|
|
|
|
|
|
|
class QListWidgetItem;
|
|
|
|
|
|
|
|
class CoverProvider;
|
|
|
|
class SettingsDialog;
|
|
|
|
class Ui_CoversSettingsPage;
|
|
|
|
|
|
|
|
class CoversSettingsPage : public SettingsPage {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-06-20 19:04:08 +02:00
|
|
|
explicit CoversSettingsPage(SettingsDialog *dialog, QWidget *parent = nullptr);
|
2020-06-15 21:55:05 +02:00
|
|
|
~CoversSettingsPage() override;
|
2020-05-09 01:48:08 +02:00
|
|
|
|
|
|
|
static const char *kSettingsGroup;
|
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
void Load() override;
|
|
|
|
void Save() override;
|
2020-05-09 01:48:08 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void NoProviderSelected();
|
|
|
|
void ProvidersMove(const int d);
|
|
|
|
void DisableAuthentication();
|
2021-06-22 13:45:29 +02:00
|
|
|
void DisconnectAuthentication(CoverProvider *provider) const;
|
2020-05-09 01:48:08 +02:00
|
|
|
static bool ProviderCompareOrder(CoverProvider *a, CoverProvider *b);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void CurrentItemChanged(QListWidgetItem *item_current, QListWidgetItem *item_previous);
|
|
|
|
void ItemSelectionChanged();
|
|
|
|
void ItemChanged(QListWidgetItem *item);
|
|
|
|
void ProvidersMoveUp();
|
|
|
|
void ProvidersMoveDown();
|
|
|
|
void AuthenticateClicked();
|
|
|
|
void LogoutClicked();
|
|
|
|
void AuthenticationSuccess();
|
|
|
|
void AuthenticationFailure(const QStringList &errors);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui_CoversSettingsPage *ui_;
|
|
|
|
bool provider_selected_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // COVERSSETTINGSPAGE_H
|