This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
ImageShackLoginWidget.h
95 lines (81 loc) · 2.82 KB
/
ImageShackLoginWidget.h
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/***************************************************************************//**
* @brief Thumbnail me 3.0
* Thumbnail me is a user interface for Movie thumbnailer.
* Generate thumbnails from any movie is now easier !
*
* @file ImageShackLoginWidget.h
* @class ImageShackLoginWidget
* Cette classe permet la génération du widget permettant à l'utilisateur
* de s'authentifier auprès de imageShack.
*
* @author Quentin Rousseau\n
* @note Copyright (C) 2011-2012 Quentin Rousseau\n
* License: GNU General Public License version 2 (GPLv2) - http://www.gnu.org/licenses/gpl-2.0.html\n
* Site web: www.thumbnailme.com\n
* Email: [email protected]
*
* @since 3.0
* @version 3.0
* @date 2011-2012
*******************************************************************************/
#ifndef HEADER_IMAGESHACKLOGINWIDGET
#define HEADER_IMAGESHACKLOGINWIDGET
#include "ImageShackUploader/ImageShackUploader.hpp"
#include <QLabel>
#include <QCheckBox>
#include <QStackedWidget>
#include <QSettings>
#include <QLineEdit>
#include <QPushButton>
class MainWindow;
class ImageShackLoginWidget : public QStackedWidget
{
Q_OBJECT
public:
explicit ImageShackLoginWidget(MainWindow *main_window);
virtual ~ImageShackLoginWidget();
void initializeWidget();
private:
MainWindow *main_window;
QSettings *settings;
QLabel *loginAccountLabel;
QLabel *loginAsLabel;
QLabel *passwordAccountLabel;
QLabel *inProgressLabel;
QLineEdit *loginAccountLineEdit;
QLineEdit *passwordAccountLineEdit;
QCheckBox *rememberPasswordCheckBox;
QCheckBox *autoLoginCheckBox;
QPushButton *loginButton;
QPushButton *logoutButton;
QPushButton *cancelButton;
QString imageShackUsername;
ImageShackUploader *imageShackUploader;
public:
QByteArray getUserLogin();
QString getImageShackUsername();
QByteArray getPassword();
void setLoginAs(QString username);
bool isRememberPasswordChecked();
private:
QNetworkProxy *readProxySettings();
void retranslate();
protected:
bool eventFilter(QObject *o, QEvent *e);
void changeEvent(QEvent* event);
private slots:
void logIn();
void logOut();
void manageIndex(bool authentication);
void manageErrors(ImageShackError::UploadError);
void enabledAutoLoginCheckBox(bool checked);
void enabledRememberPassword(QString password);
void forgotPasswordIni(int state);
void autoLoginIni(int state);
signals:
/**
*@brief Ce signal est émit lorsque le login change d'état.
*/
void loginState(bool);
};
#endif // HEADER_IMAGESHACKLOGINWIDGET