2019-06-17 23:54:24 +02:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
2021-03-20 21:14:47 +01:00
|
|
|
* Copyright 2019-2021, Jonas Kvinge <jonas@jkvinge.net>
|
2019-06-17 23:54:24 +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 SUBSONICSETTINGSPAGE_H
|
|
|
|
#define SUBSONICSETTINGSPAGE_H
|
|
|
|
|
2020-02-12 00:07:05 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2019-06-17 23:54:24 +02:00
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2020-02-09 02:29:35 +01:00
|
|
|
#include <QUrl>
|
2019-06-17 23:54:24 +02:00
|
|
|
|
2023-07-21 05:55:24 +02:00
|
|
|
#include "core/shared_ptr.h"
|
2019-06-17 23:54:24 +02:00
|
|
|
#include "settings/settingspage.h"
|
|
|
|
|
2020-02-09 02:29:35 +01:00
|
|
|
class QEvent;
|
|
|
|
class SettingsDialog;
|
2019-06-17 23:54:24 +02:00
|
|
|
class SubsonicService;
|
|
|
|
class Ui_SubsonicSettingsPage;
|
|
|
|
|
|
|
|
class SubsonicSettingsPage : public SettingsPage {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-06-20 19:04:08 +02:00
|
|
|
explicit SubsonicSettingsPage(SettingsDialog *dialog, QWidget *parent = nullptr);
|
2020-06-15 21:55:05 +02:00
|
|
|
~SubsonicSettingsPage() override;
|
2019-06-17 23:54:24 +02:00
|
|
|
|
|
|
|
static const char *kSettingsGroup;
|
|
|
|
|
2023-02-18 14:09:27 +01:00
|
|
|
enum class AuthMethod {
|
|
|
|
Hex,
|
|
|
|
MD5
|
2021-07-30 21:16:41 +02:00
|
|
|
};
|
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
void Load() override;
|
|
|
|
void Save() override;
|
2019-06-17 23:54:24 +02:00
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
bool eventFilter(QObject *object, QEvent *event) override;
|
2019-06-17 23:54:24 +02:00
|
|
|
|
2024-08-11 23:23:12 +02:00
|
|
|
Q_SIGNALS:
|
2023-04-09 20:23:42 +02:00
|
|
|
void Test(const QUrl &url, const QString &username, const QString &password, const SubsonicSettingsPage::AuthMethod auth_method, const bool redirect = false);
|
2019-06-17 23:54:24 +02:00
|
|
|
|
2024-08-12 01:06:15 +02:00
|
|
|
private Q_SLOTS:
|
2019-06-17 23:54:24 +02:00
|
|
|
void TestClicked();
|
|
|
|
void TestSuccess();
|
2021-06-20 19:04:08 +02:00
|
|
|
void TestFailure(const QString &failure_reason);
|
2019-06-17 23:54:24 +02:00
|
|
|
|
|
|
|
private:
|
2021-06-12 20:53:23 +02:00
|
|
|
Ui_SubsonicSettingsPage *ui_;
|
2023-07-21 05:55:24 +02:00
|
|
|
SharedPtr<SubsonicService> service_;
|
2019-06-17 23:54:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SUBSONICSETTINGSPAGE_H
|