47 lines
876 B
C++
47 lines
876 B
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QIntValidator>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QPushButton>
|
|
#include <QSettings>
|
|
#include <QString>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
|
|
#include "KeychainClass.hpp"
|
|
|
|
class ParametersProvider : public QDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
struct settings {
|
|
std::string userS, passS, imapS;
|
|
int port;
|
|
};
|
|
|
|
explicit ParametersProvider(QWidget *parent = nullptr);
|
|
~ParametersProvider() = default;
|
|
|
|
void setFocusInternal();
|
|
const settings &getSettings();
|
|
|
|
signals:
|
|
void done();
|
|
|
|
public slots:
|
|
// Keychain to save password
|
|
void keyRead(const QString &key, const QString &value);
|
|
|
|
// When clicking OK
|
|
void start();
|
|
|
|
private:
|
|
settings sett;
|
|
QLineEdit *userField, *passField, *imapField, *portField;
|
|
|
|
KeychainClass keychain;
|
|
QSettings mSettings;
|
|
};
|