emailQt/ParametersProvider.hpp

47 lines
876 B
C++
Raw Normal View History

2024-03-08 12:10:58 -05:00
#pragma once
#include <QDialog>
#include <QIntValidator>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QSettings>
#include <QString>
2024-03-08 12:10:58 -05:00
#include <QVBoxLayout>
#include <QWidget>
#include "KeychainClass.hpp"
2024-03-08 12:10:58 -05:00
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();
2024-03-08 12:10:58 -05:00
private:
settings sett;
QLineEdit *userField, *passField, *imapField, *portField;
KeychainClass keychain;
QSettings mSettings;
2024-03-08 12:10:58 -05:00
};