1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
/**************************************************************************
* *
* SPDX-FileCopyrightText: 2019 Karol Kosek <krkkx@protonmail.com> *
* *
* SPDX-License-Identifier: GPL-3.0-or-later
* *
**************************************************************************/
#pragma once
#include "dialog.h"
#include <Quotient/settings.h>
#include <Quotient/csapi/definitions/client_device.h>
#include <QtCore/QPointer>
class AccountSelector;
class MainWindow;
class QComboBox;
class QLineEdit;
namespace Quotient {
class AccountRegistry;
class GetDevicesJob;
class Connection;
class KeyVerificationSession;
}
class ProfileDialog : public Dialog
{
Q_OBJECT
public:
explicit ProfileDialog(Quotient::AccountRegistry* accounts,
MainWindow* parent);
~ProfileDialog() override;
void setAccount(Quotient::Connection* newAccount);
Quotient::Connection* account() const;
private slots:
void load() override;
void apply() override;
void uploadAvatar();
Quotient::KeyVerificationSession* initiateVerification(const QString& deviceId,
QAction* verifyAction);
private:
Quotient::SettingsGroup m_settings;
class DeviceTable;
DeviceTable* m_deviceTable;
QPushButton* m_avatar;
AccountSelector* m_accountSelector;
QLineEdit* m_displayName;
QLabel* m_accessTokenLabel;
Quotient::Connection* m_currentAccount;
QString m_newAvatarPath;
QPointer<Quotient::GetDevicesJob> m_devicesJob;
QVector<Quotient::Device> m_devices;
void setVerifiedItem(int row, const QString& deviceId);
void refreshDevices();
};
|