File indexing completed on 2024-06-02 05:21:03
0001 /* 0002 SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com> 0003 SPDX-FileCopyrightText: 2020 Igor Poboiko <igor.poboiko@gmail.com> 0004 0005 SPDX-License-Identifier: GPL-3.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include "googlesettings.h" 0011 #include "ui_googlesettingswidget.h" 0012 #include <KGAPI/Types> 0013 0014 namespace KGAPI2 0015 { 0016 class Job; 0017 } 0018 class GoogleSettingsWidget : public QWidget, private Ui::GoogleSettingsWidget 0019 { 0020 Q_OBJECT 0021 public: 0022 explicit GoogleSettingsWidget(GoogleSettings &settings, const QString &identifier, QWidget *parent); 0023 ~GoogleSettingsWidget() override; 0024 0025 void loadSettings(); 0026 void saveSettings(); 0027 0028 Q_SIGNALS: 0029 void okEnabled(bool enabled); 0030 0031 protected: 0032 bool handleError(KGAPI2::Job *job); 0033 void accountChanged(); 0034 0035 private: 0036 void slotAuthJobFinished(KGAPI2::Job *job); 0037 void slotReloadCalendars(); 0038 void slotReloadTaskLists(); 0039 0040 GoogleSettings &m_settings; 0041 KGAPI2::AccountPtr m_account; 0042 const QString m_identifier; 0043 };