File indexing completed on 2024-05-19 04:50:13

0001 /****************************************************************************************
0002  * Copyright (c) 2007 Shane King <kde@dontletsstart.com>                                *
0003  * Copyright (c) 2010 Stefan Derkits <stefan@derkits.at>                                *
0004  * Copyright (c) 2010 Christian Wagner <christian.wagner86@gmx.at>                      *
0005  * Copyright (c) 2010 Felix Winter <ixos01@gmail.com>                                   *
0006  *                                                                                      *
0007  * This program is free software; you can redistribute it and/or modify it under        *
0008  * the terms of the GNU General Public License as published by the Free Software        *
0009  * Foundation; either version 2 of the License, or (at your option) any later           *
0010  * version.                                                                             *
0011  *                                                                                      *
0012  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0013  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0014  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0015  *                                                                                      *
0016  * You should have received a copy of the GNU General Public License along with         *
0017  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0018  ****************************************************************************************/
0019 
0020 #ifndef GPODDERSERVICESETTINGS_H
0021 #define GPODDERSERVICESETTINGS_H
0022 
0023 #include "GpodderServiceConfig.h"
0024 #include <mygpo-qt5/ApiRequest.h>
0025 
0026 #include <KConfigWidgets/KCModule>
0027 
0028 #include <QNetworkReply>
0029 
0030 namespace Ui { class GpodderConfigWidget; }
0031 
0032 class GpodderServiceSettings : public KCModule
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037     GpodderServiceSettings( QWidget *parent, const QVariantList &args );
0038 
0039     ~GpodderServiceSettings() override;
0040 
0041     void save() override;
0042     void load() override;
0043     void defaults() override;
0044 
0045 private Q_SLOTS:
0046     void testLogin();
0047 
0048     void finished();
0049     void onError( QNetworkReply::NetworkError code );
0050     void onParseError( );
0051 
0052     void deviceCreationFinished();
0053     void deviceCreationError( QNetworkReply::NetworkError code );
0054     void settingsChanged();
0055 
0056 private:
0057     Ui::GpodderConfigWidget *m_configDialog;
0058     GpodderServiceConfig m_config;
0059 
0060     mygpo::DeviceListPtr m_devices;
0061     mygpo::AddRemoveResultPtr m_result;
0062     bool m_enableProvider;
0063     QNetworkReply *m_createDevice;
0064 };
0065 
0066 #endif // GPODDERSERVICESETTINGS_H