123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- #ifndef QMLHANDLER_H
- #define QMLHANDLER_H
- #include <QObject>
- #include <QUrl>
- extern bool _RESTART;
- class QMLHandler : public QObject {
- Q_OBJECT
- private:
- void fileExists(std::string name);
- public:
- explicit QMLHandler(QObject *parent = 0);
- void onExit();
- void closeCLI();
- void loadSettingsToGUI();
- QString getIP();
- void setRestart(bool restart);
- // C++ -> QML
- signals:
- // No Config Found Popup
- void noConfigFoundPopupOpen();
- void noConfigFoundPopupClose();
- // Invalid Cli Path Popup
- void invalidCliPathPopupOpen();
- void invalidCliPathPopupClose();
- // Invalid Config Popup
- void invalidConfigPopupOpen();
- void invalidConfigPopupClose();
- // Sending
- void sendingSetFileUrlText(QString signalText);
- void sendingEnableSendButton();
- void sendingDisableSendButton();
- // Receiving
- void receivingClearFileList();
- void receivingListFile(QString fileName, bool existsLocally);
- void receivingDisableDownloadButton(QString fileName);
- void receivingCloseConfirmDeletePopup();
- // Messages
- void message(QString msg);
- // Settings
- void closeWindow();
- void loadSettings(int covertMethod, bool saveIP, bool saveUsername, QString cliPath);
- // Delete Me Popup
- void deleteMePopupSetStatus(QString status);
- // Ip Popup
- void ipPopupSetStatus(QString status);
- void ipPopupSetIP(QString default_ip);
- void ipPopupClose();
- void ipPopupOpen();
- void ipPopupEnableConnectButton();
- void ipPopupDisableConnectButton();
- void ipPopupCheckSaveCheckbox();
- // Login Signup Popup
- void loginSignupPopupClose();
- void loginSignupPopupOpen();
- void loginSignupCheckSaveCheckbox();
- // Login
- void loginSetStatus(QString status);
- void loginEnableLoginButton();
- void loginDisableLoginButton();
- void loginSetUsername(QString username);
- // Signup
- void signupSetStatus(QString status);
- void signupEnableRegisterButton();
- void signupDisableRegisterButton();
- // Footer
- void log(QString logText);
- void footerSetStatus(QString status);
- // Notifications
- void notification(QString message);
- void dismissNotification(int index);
- void showDesktopNotification(QString title, QString message);
- // QML -> C++
- public slots:
- void onStart();
- // No Config Found Popup
- void onNoConfigFoundPopupContinueButton(QString cli_path);
- // Invalid Cli Path Popup
- void onInvalidCliPathPopupContinueButton(QString cli_path);
- void onInvalidCliPathPopupQuitButton();
- // Invalid Config Popup
- void onInvalidConfigPopupCreateDefaultButton();
- void onInvalidConfigPopupQuitButton();
- // Sending
- void onSendingSelectFileButton(QUrl url);
- void onSendingSendFileButton();
- void onSendingClearSelectionButton();
- // Receiving
- void onReceivingListFilesButton();
- void onReceivingDownloadFileButton(QString fileName);
- void onReceivingConfirmDeleteFileButton(QString fileName);
- // Messages
- void onMessagesSendButton(QString msg);
- // Settings
- void onSettingsDeleteMeButton(QString password);
- void onSettingsRevertChangesButton();
- void onSettingsResetButton();
- void onSettingsSaveButton(int covertMethod, bool saveIP, bool saveUsername, QString cliPath);
- // Ip Popup
- void onIpPopupConnectButton(QString ip, bool saveAsDefault);
- // Login
- void onLoginLoginButton(QString username, QString password, bool saveAsDefault);
- // Signup
- void onSignupRegisterButton(QString username, QString passwordOne, QString passwordTwo, bool saveAsDefault);
- // Footer
- void onFooterGetStatusButton();
- // Notifications
- void onDismissNotificationButton(int id);
- };
- #endif // QMLHANDLER_H
|