File indexing completed on 2024-12-01 04:46:41
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QDialog> 0010 namespace KABGravatar 0011 { 0012 class GravatarUpdateWidget; 0013 class GravatarUpdateDialog : public QDialog 0014 { 0015 Q_OBJECT 0016 public: 0017 explicit GravatarUpdateDialog(QWidget *parent = nullptr); 0018 ~GravatarUpdateDialog() override; 0019 0020 void setEmail(const QString &email); 0021 0022 [[nodiscard]] QPixmap pixmap() const; 0023 void setOriginalPixmap(const QPixmap &pix); 0024 0025 void setOriginalUrl(const QUrl &url); 0026 0027 [[nodiscard]] QUrl resolvedUrl() const; 0028 0029 [[nodiscard]] bool saveUrl() const; 0030 0031 private: 0032 void slotSaveImage(); 0033 void slotSaveUrl(); 0034 0035 void slotActivateButton(bool state); 0036 void readConfig(); 0037 void writeConfig(); 0038 GravatarUpdateWidget *const mGravatarUpdateWidget; 0039 QPushButton *const mSaveImageButton; 0040 QPushButton *const mSaveUrlButton; 0041 bool mSaveUrl = false; 0042 }; 0043 }