Thumbnail me
3.0
|
00001 /***************************************************************************/ 00022 #ifndef HEADER_IMAGESHACKLOGINWIDGET 00023 #define HEADER_IMAGESHACKLOGINWIDGET 00024 00025 #include "MainWindow.h" 00026 #include "ImageShackUploader/ImageShackUploader.hpp" 00027 00028 class MainWindow; 00029 00030 class ImageShackLoginWidget : public QStackedWidget 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 explicit ImageShackLoginWidget(MainWindow *main_window); 00036 virtual ~ImageShackLoginWidget(); 00037 void initializeWidget(); 00038 00039 private: 00040 MainWindow *main_window; 00041 00042 QSettings *settings; 00043 QLabel *loginAccountLabel; 00044 QLabel *loginAsLabel; 00045 QLabel *passwordAccountLabel; 00046 QLabel *inProgressLabel; 00047 QLineEdit *loginAccountLineEdit; 00048 QLineEdit *passwordAccountLineEdit; 00049 QCheckBox *rememberPasswordCheckBox; 00050 QCheckBox *autoLoginCheckBox; 00051 QPushButton *loginButton; 00052 QPushButton *logoutButton; 00053 QPushButton *cancelButton; 00054 QString imageShackUsername; 00055 ImageShackUploader *imageShackUploader; 00056 00057 00058 public: 00059 QByteArray getUserLogin(); 00060 QString getImageShackUsername(); 00061 QByteArray getPassword(); 00062 void setLoginAs(QString username); 00063 bool isRememberPasswordChecked(); 00064 00065 private: 00066 QNetworkProxy *readProxySettings(); 00067 void retranslate(); 00068 00069 protected: 00070 bool eventFilter(QObject *o, QEvent *e); 00071 void changeEvent(QEvent* event); 00072 00073 private slots: 00074 void logIn(); 00075 void logOut(); 00076 void manageIndex(bool authentication); 00077 void manageErrors(ImageShackError::UploadError); 00078 void enabledAutoLoginCheckBox(bool checked); 00079 void enabledRememberPassword(QString password); 00080 void forgotPasswordIni(int state); 00081 void autoLoginIni(int state); 00082 00083 signals: 00087 void loginState(bool); 00088 }; 00089 00090 #endif // HEADER_IMAGESHACKLOGINWIDGET