Browse Source

Added GUI code documentation and updated GUI Readme

tobias.wach 4 years ago
parent
commit
a83bd7c577

+ 4 - 0
gui/Readme.md

@@ -16,6 +16,8 @@ If no configuration file exists, the program will generate a default file. The u
 
 
 If the configuration file is not valid, the user will get notified and has the option to either quit the program or to generate the default configuration file. The latter would overwrite the existing one.
 If the configuration file is not valid, the user will get notified and has the option to either quit the program or to generate the default configuration file. The latter would overwrite the existing one.
 
 
+Any changes made to the configuration using the GUI have to be explicitly saved using the "Save Changes" button. This includes the selection of a keyfile.
+
 ### Configuration Values
 ### Configuration Values
 
 
 `Autofill-IP`: Should the default IP automatically be filled in on startup.<br/>
 `Autofill-IP`: Should the default IP automatically be filled in on startup.<br/>
@@ -24,6 +26,8 @@ If the configuration file is not valid, the user will get notified and has the o
 `Default-IP`: The default IP to be used for the autofill.<br/>
 `Default-IP`: The default IP to be used for the autofill.<br/>
 `Default-Username`: The default Username to be used for the autofill.<br/>
 `Default-Username`: The default Username to be used for the autofill.<br/>
 `Keyfile-Path`: The absolute path to the keyfile to be used for encryption.<br/>
 `Keyfile-Path`: The absolute path to the keyfile to be used for encryption.<br/>
+`Use-SSL`: Should the SSL file be used for a secure connection.<br/>
+`SSL-Path`: The absolute path to the SSL file to be used.<br/>
 
 
 
 
 ## Connecting to a server
 ## Connecting to a server

+ 34 - 1
gui/include/climanager.h

@@ -5,16 +5,49 @@
 #include "qmlhandler.h"
 #include "qmlhandler.h"
 #include <QGuiApplication>
 #include <QGuiApplication>
 
 
+/**
+ * Namespace which handles the CLI interaction
+ */
 namespace CliManager {
 namespace CliManager {
+/**
+ * Set the qml handler pointer
+ * @param q The reference to the qml handler
+ */
 void setQmlHandler(QMLHandler *q);
 void setQmlHandler(QMLHandler *q);
+/**
+ * Boolean if the user is logged in to enable or disable the background status and list requests
+ */
 extern bool loggedin;
 extern bool loggedin;
-
+/**
+ * Tries to start the CLI in a new thread
+ * @param useSSL Should the CLI be started with the SSL parameter?
+ */
 void init(bool useSSL);
 void init(bool useSSL);
+/**
+ * Writes a command to the CLI
+ * @param s The command
+ */
 void writeToCli(QString s);
 void writeToCli(QString s);
+/**
+ * The background loop that reads the output of the CLI and handles it using the jsonhandler
+ */
 void readPipeLoop();
 void readPipeLoop();
+/**
+ * The background loop that requests the notifications and extendedlist using the CLI every 3 seconds
+ */
 void notificationsLoop();
 void notificationsLoop();
+/**
+ * The background loop that requests the status and extendedstatus using the CLI every second
+ */
 void statusLoop();
 void statusLoop();
+/**
+ * Exit from the CLI and stop the background threads
+ */
 void onExit();
 void onExit();
+/**
+ * Set the programActive variable
+ * @param active The new value
+ */
 void setProgramActive(bool active);
 void setProgramActive(bool active);
 } // namespace CliManager
 } // namespace CliManager
 
 

+ 178 - 3
gui/include/cmdmanager.h

@@ -9,6 +9,9 @@
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
 
 
+/**
+ * The struct for a file entry in the GUI file list
+ */
 struct fileEntry {
 struct fileEntry {
 	bool dirty;
 	bool dirty;
 	std::string type;
 	std::string type;
@@ -17,41 +20,213 @@ struct fileEntry {
 	float speed;
 	float speed;
 };
 };
 
 
+/**
+ * Namespace which handles the commands received from the CLI
+ */
 namespace CmdManager {
 namespace CmdManager {
+/**
+ * Initialize the cmdmap with the references to the according methods
+ */
 void init();
 void init();
+/**
+ * Set the qml handler pointer
+ * @param q The reference to the qml handler
+ */
 void setQmlHandler(QMLHandler *q);
 void setQmlHandler(QMLHandler *q);
-
+/**
+ * Update a file in the file map
+ * @param name The name of the file
+ * @param type The new type of the file
+ * @param method The new method of the file
+ * @param progress The new progress of the file
+ * @param speed The new speed of the file
+ */
 void updateInternalFile(std::string name, std::string type, std::string method, int progress, float speed);
 void updateInternalFile(std::string name, std::string type, std::string method, int progress, float speed);
+/**
+ * Update the GUI file list to match the file map
+ */
 void emitFileList();
 void emitFileList();
+/**
+ * Clear the file map
+ */
 void cleanInternalList();
 void cleanInternalList();
-
+/**
+ * Execute a command received from the CLI
+ * @param cmd The command to be executed using the cmdmap
+ * @param root The entire JSON value
+ */
 void executeCmd(std::string cmd, Json::Value root);
 void executeCmd(std::string cmd, Json::Value root);
-
+/**
+ * Sets the cached ip address
+ * @param ip The ip address
+ */
 void setCachedIP(QString ip);
 void setCachedIP(QString ip);
+/**
+ * Sets the cached port
+ * @param port The port
+ */
 void setCachedPort(QString port);
 void setCachedPort(QString port);
 
 
+/**
+ * Handle the error command
+ *
+ * Print the error in the log
+ * @param root The entire JSON value
+ */
 void handleError(Json::Value root);
 void handleError(Json::Value root);
+/**
+ * Handle the status command
+ *
+ * Update the status text in the GUI
+ * @param root The entire JSON value
+ */
 void handleStatus(Json::Value root);
 void handleStatus(Json::Value root);
+/**
+ * Handle the close command
+ *
+ * Set the program as inactive to stop the CLI background threads
+ * @param root The entire JSON value
+ */
 void handleClose(Json::Value root);
 void handleClose(Json::Value root);
+/**
+ * Handle the list command
+ *
+ * List the server files in the GUI
+ * @param root The entire JSON value
+ */
 void handleList(Json::Value root);
 void handleList(Json::Value root);
+/**
+ * Handle the extendedlist command
+ *
+ * List the server files in the GUI with detailed information
+ * @param root The entire JSON value
+ */
 void handleExtendedList(Json::Value root);
 void handleExtendedList(Json::Value root);
+/**
+ * Handle the connect command
+ *
+ * If there was an error, reactivate the connect button and show the error
+ * @param root The entire JSON value
+ */
 void handleConnect(Json::Value root);
 void handleConnect(Json::Value root);
+/**
+ * Handle the version command
+ *
+ * Close the ip popup and open the login/signup popup if it was accepted, else reactivate the connect button and show the error
+ * @param root The entire JSON value
+ */
 void handleVersion(Json::Value root);
 void handleVersion(Json::Value root);
+/**
+ * Handle the login command
+ *
+ * Set the loggedin value to true and close the popup if it was accepted, else reactivate the login button and show the error
+ * @param root The entire JSON value
+ */
 void handleLogin(Json::Value root);
 void handleLogin(Json::Value root);
+/**
+ * Handle the signup command
+ *
+ * Set the loggedin value to true and close the popup if it was accepted, else reactivate the signup button and show the error
+ * @param root The entire JSON value
+ */
 void handleSignup(Json::Value root);
 void handleSignup(Json::Value root);
+/**
+ * Handle the put command
+ *
+ * Show an error if it was not accepted
+ * @param root The entire JSON value
+ */
 void handlePut(Json::Value root);
 void handlePut(Json::Value root);
+/**
+ * Handle the putdata command
+ *
+ * Show an error if it was not accepted
+ * @param root The entire JSON value
+ */
 void handlePutData(Json::Value root);
 void handlePutData(Json::Value root);
+/**
+ * Handle the get command
+ *
+ * Show an error if it was not accepted, else disable the file's download button
+ * @param root The entire JSON value
+ */
 void handleGet(Json::Value root);
 void handleGet(Json::Value root);
+/**
+ * Handle the getdata command
+ *
+ * Show an error if it was not accepted
+ * @param root The entire JSON value
+ */
 void handleGetData(Json::Value root);
 void handleGetData(Json::Value root);
+/**
+ * Handle the deleteme command
+ *
+ * Show an error if it was not accepted, else disconnect from the server and restart the application
+ * @param root The entire JSON value
+ */
 void handleDeleteMe(Json::Value root);
 void handleDeleteMe(Json::Value root);
+/**
+ * Handle the deletefile command
+ *
+ * Show an error if it was not accepted, else show the confirmation in the log
+ * @param root The entire JSON value
+ */
 void handleDeleteFile(Json::Value root);
 void handleDeleteFile(Json::Value root);
+/**
+ * Handle the notifications command
+ *
+ * Show an error if it was not accepted, else handle the new notifications if there are some
+ * @param root The entire JSON value
+ */
 void handleNotifications(Json::Value root);
 void handleNotifications(Json::Value root);
+/**
+ * Handle the queue command
+ *
+ * Show an error if it was not accepted
+ * @param root The entire JSON value
+ */
 void handleQueue(Json::Value root);
 void handleQueue(Json::Value root);
+/**
+ * Handle the dequeue command
+ *
+ * Show an error if it was not accepted
+ * @param root The entire JSON value
+ */
 void handleDequeue(Json::Value root);
 void handleDequeue(Json::Value root);
+/**
+ * Handle the extendedstatus command
+ *
+ * Show an error if it was not accepted, else update the file list with the new data
+ * @param root The entire JSON value
+ */
 void handleExtendedStatus(Json::Value root);
 void handleExtendedStatus(Json::Value root);
+/**
+ * Handle the keyfile command
+ *
+ * Show an error if it was not accepted, else update the keyfile status in the settings tab
+ * @param root The entire JSON value
+ */
 void handleKeyfile(Json::Value root);
 void handleKeyfile(Json::Value root);
+/**
+ * Handle the closekey command
+ *
+ * Show an error if it was not accepted, else update the keyfile status in the settings tab
+ * @param root The entire JSON value
+ */
 void handleClosekey(Json::Value root);
 void handleClosekey(Json::Value root);
+/**
+ * Handle the disconnect command
+ *
+ * Set the loggedin variable to false to stop the background CLI threads if it was accepted
+ * @param root The entire JSON value
+ */
 void handleDisconnect(Json::Value root);
 void handleDisconnect(Json::Value root);
+/**
+ * Handle the connectionerror command
+ *
+ * Sets the footer error to encourage the user to restart the application on a lost connection
+ * @param root The entire JSON value
+ */
 void handleConnectionError(Json::Value root);
 void handleConnectionError(Json::Value root);
 } // namespace CmdManager
 } // namespace CmdManager
 
 

+ 27 - 0
gui/include/config.h

@@ -6,12 +6,39 @@
 #include <sstream>
 #include <sstream>
 #include <vector>
 #include <vector>
 
 
+/**
+ * Namespace which handles the GUI configuration and it's config file
+ */
 namespace Config {
 namespace Config {
+/**
+ * Set up the configuration map with the default values and declare the configuration valid
+ */
 void setupDefaultConfig();
 void setupDefaultConfig();
+/**
+ * Check the loaded config if the values are valid and if it's size is valid
+ * @return Is the config valid?
+ */
 bool checkConfig();
 bool checkConfig();
+/**
+ * Load the configuration file - if values are missing, they are added with their default values
+ * @return Has the config file been successfully loaded?
+ */
 bool loadFile();
 bool loadFile();
+/**
+ * Save the configuration map to the config file
+ */
 void saveFile();
 void saveFile();
+/**
+ * Get a value from the configuration map
+ * @param key The configuration key to get
+ * @return The value
+ */
 std::string getValue(const std::string &key);
 std::string getValue(const std::string &key);
+/**
+ * Set a value in the configuration map to the given one
+ * @param key The configuration key
+ * @param value The new value
+ */
 void setValue(const std::string &key, const std::string &value);
 void setValue(const std::string &key, const std::string &value);
 } // namespace Config
 } // namespace Config
 
 

+ 11 - 0
gui/include/jsonhandler.h

@@ -4,8 +4,19 @@
 #include "qmlhandler.h"
 #include "qmlhandler.h"
 #include <json/json.h>
 #include <json/json.h>
 
 
+/**
+ * Namespace which handles JSON strings
+ */
 namespace JsonHandler {
 namespace JsonHandler {
+/**
+ * Set the qml handler pointer
+ * @param q The reference to the qml handler
+ */
 void setQmlHandler(QMLHandler *q);
 void setQmlHandler(QMLHandler *q);
+/**
+ * Parse a JSON string, put them in the terminal and in the log and handle the command using the CmdManager class
+ * @param buffer The JSON string
+ */
 void parseJSON(std::string buffer);
 void parseJSON(std::string buffer);
 } // namespace JsonHandler
 } // namespace JsonHandler
 
 

+ 354 - 17
gui/include/qmlhandler.h

@@ -6,143 +6,480 @@
 
 
 extern bool _RESTART;
 extern bool _RESTART;
 
 
+/**
+ * @class QMLHandler
+ *
+ * This class is the connection between Qml and C++, where signals can be emitted using code to interact with the forms
+ * and slots can be used to run code from a Qml form.
+ */
 class QMLHandler : public QObject {
 class QMLHandler : public QObject {
 	Q_OBJECT
 	Q_OBJECT
 
 
 public:
 public:
+	/**
+	 * This class
+	 */
 	explicit QMLHandler(QObject *parent = 0);
 	explicit QMLHandler(QObject *parent = 0);
+
+	/**
+	 * Handle the closing of the main window
+	 */
 	void onExit();
 	void onExit();
-	void closeCLI();
+
+	/**
+	 * Get the settings from the config class and adjust the gui settings accordingly
+	 */
 	void loadSettingsToGUI();
 	void loadSettingsToGUI();
-	QString getIP();
+
+	/**
+	 * Set the _RESTART variable
+	 * @param restart The new value
+	 */
 	void setRestart(bool restart);
 	void setRestart(bool restart);
+
+	/**
+	 * Set the configExists variable
+	 * @param exists The new value
+	 */
 	void setConfigExists(bool exists);
 	void setConfigExists(bool exists);
 
 
 	// C++ -> QML
 	// C++ -> QML
 signals:
 signals:
 	// No Config Found Popup
 	// No Config Found Popup
+
+	/**
+	 * Open the popup for when no config has been found
+	 */
 	void noConfigFoundPopupOpen();
 	void noConfigFoundPopupOpen();
+	/**
+	 * Close the popup for when no config has been found
+	 */
 	void noConfigFoundPopupClose();
 	void noConfigFoundPopupClose();
 
 
 	// Invalid Cli Path Popup
 	// Invalid Cli Path Popup
+
+	/**
+	 * Open the popup for when the cli path is not valid
+	 */
 	void invalidCliPathPopupOpen();
 	void invalidCliPathPopupOpen();
+	/**
+	 * Close the popup for when the cli path is not valid
+	 */
 	void invalidCliPathPopupClose();
 	void invalidCliPathPopupClose();
 
 
 	// Invalid Config Popup
 	// Invalid Config Popup
+
+	/**
+	 * Open the popup for when the config is invalid
+	 */
 	void invalidConfigPopupOpen();
 	void invalidConfigPopupOpen();
+	/**
+	 * Close the popup for when the config is invalid
+	 */
 	void invalidConfigPopupClose();
 	void invalidConfigPopupClose();
 
 
 	// Server Files
 	// Server Files
+
+	/**
+	 * Set the text that shows the selected file to be uploaded
+	 * @param signalText The new file url
+	 */
 	void serverFilesSetFileUrlText(QString signalText);
 	void serverFilesSetFileUrlText(QString signalText);
+	/**
+	 * Enable the Upload File button
+	 */
 	void serverFilesEnableSendButton();
 	void serverFilesEnableSendButton();
+	/**
+	 * Disable the Upload File button
+	 */
 	void serverFilesDisableSendButton();
 	void serverFilesDisableSendButton();
-
+	/**
+	 * Clear the list of files that are on the server
+	 */
 	void serverFilesClearFileList();
 	void serverFilesClearFileList();
+	/**
+	 * List a new file in the file list
+	 * @param fileName The name of the file
+	 * @param fileSize The size of the file
+	 * @param fileDecryptable Is the file decryptable for the current user?
+	 * @param existsLocally Is the file already downloaded?
+	 */
 	void serverFilesListFile(QString fileName, QString fileSize, QString fileDecryptable, bool existsLocally);
 	void serverFilesListFile(QString fileName, QString fileSize, QString fileDecryptable, bool existsLocally);
+	/**
+	 * Update an existing file in the file list
+	 * @param fileName The name of the file
+	 * @param fileProgress The download or upload progress of the file
+	 * @param isQueued Is the file queued on the server?
+	 */
 	void serverFilesUpdateFile(QString fileName, QString fileProgress, bool isQueued);
 	void serverFilesUpdateFile(QString fileName, QString fileProgress, bool isQueued);
+	/**
+	 * Disable the download button for a specific file
+	 * @param The name of the file
+	 */
 	void serverFilesDisableDownloadButton(QString fileName);
 	void serverFilesDisableDownloadButton(QString fileName);
+	/**
+	 * Close the delete popup for a file
+	 */
 	void serverFilesCloseConfirmDeletePopup();
 	void serverFilesCloseConfirmDeletePopup();
 
 
-	// Messages
-	void message(QString msg);
-
 	// Settings
 	// Settings
+
+	/**
+	 * Close the main window
+	 */
 	void closeWindow();
 	void closeWindow();
+	/**
+	 * Load the settings to the GUI
+	 * @param saveIP Should the autofill ip toggle be switched on or off?
+	 * @param saveUsername Should the autofill username toggle be switched on or off?
+	 * @param cliPath The path to the cli
+	 * @param keyPath The path to the keyfile
+	 */
 	void loadSettings(bool saveIP, bool saveUsername, QString cliPath, QString keyPath);
 	void loadSettings(bool saveIP, bool saveUsername, QString cliPath, QString keyPath);
+	/**
+	 * Update the status of the keyfile
+	 * @param success Has the keyfile successfully been loaded?
+	 * @param msg The message to be shown
+	 */
 	void keyfileStatus(bool success, QString msg);
 	void keyfileStatus(bool success, QString msg);
+	/**
+	 * Signal for when the keyfile has been successfully closed and should be shown in the settings
+	 */
 	void keyfileClosedOK();
 	void keyfileClosedOK();
 
 
 	// Delete Me Popup
 	// Delete Me Popup
+
+	/**
+	 * Set the status on the delete me popup (when a user want's to delete their acccount)
+	 * @param status The status message
+	 */
 	void deleteMePopupSetStatus(QString status);
 	void deleteMePopupSetStatus(QString status);
 
 
 	// Ip Popup
 	// Ip Popup
+
+	/**
+	 * Set the status on the ip popup
+	 * @param status The status messsage
+	 */
 	void ipPopupSetStatus(QString status);
 	void ipPopupSetStatus(QString status);
+	/**
+	 * Set the ip address in the ip input field (used for autofill ip)
+	 * @param default_ip The ip address
+	 */
 	void ipPopupSetIP(QString default_ip);
 	void ipPopupSetIP(QString default_ip);
+	/**
+	 * Close the ip popup
+	 */
 	void ipPopupClose();
 	void ipPopupClose();
+	/**
+	 * Open the ip popup
+	 */
 	void ipPopupOpen();
 	void ipPopupOpen();
+	/**
+	 * Enable the connect button in the ip popup
+	 */
 	void ipPopupEnableConnectButton();
 	void ipPopupEnableConnectButton();
+	/**
+	 * Disbale the connect button in the ip popup
+	 */
 	void ipPopupDisableConnectButton();
 	void ipPopupDisableConnectButton();
+	/**
+	 * Tick the "Save IP" checkbox in the ip popup
+	 */
 	void ipPopupCheckSaveCheckbox();
 	void ipPopupCheckSaveCheckbox();
 
 
 	// Login Signup Popup
 	// Login Signup Popup
+
+	/**
+	 * Close the login/signup popup
+	 */
 	void loginSignupPopupClose();
 	void loginSignupPopupClose();
+	/**
+	 * Open the login/signup popup
+	 */
 	void loginSignupPopupOpen();
 	void loginSignupPopupOpen();
+	/**
+	 * Tick the "Save Username" checkbox in the login/signup popup
+	 */
 	void loginSignupCheckSaveCheckbox();
 	void loginSignupCheckSaveCheckbox();
 
 
 	// Login
 	// Login
+
+	/**
+	 * Set the status for the login tab in the login/signup popup
+	 * @param status The status message
+	 */
 	void loginSetStatus(QString status);
 	void loginSetStatus(QString status);
+	/**
+	 * Enable the login button for the login tab in the login/signup popup
+	 */
 	void loginEnableLoginButton();
 	void loginEnableLoginButton();
+	/**
+	 * Disable the login button for the login tab in the login/signup popup
+	 */
 	void loginDisableLoginButton();
 	void loginDisableLoginButton();
+	/**
+	 * Set the username input field for the login tab in the login/signup popup (used for autofill username)
+	 * @param username The username
+	 */
 	void loginSetUsername(QString username);
 	void loginSetUsername(QString username);
 
 
 	// Signup
 	// Signup
+
+	/**
+	 * Set the status for the signup tab in the login/signup popup
+	 * @param status The status message
+	 */
 	void signupSetStatus(QString status);
 	void signupSetStatus(QString status);
+	/**
+	 * Disable the register button for the signup tab in the login/signup popup
+	 */
 	void signupEnableRegisterButton();
 	void signupEnableRegisterButton();
+	/**
+	 * Disable the register button for the signup tab in the login/signup popup
+	 */
 	void signupDisableRegisterButton();
 	void signupDisableRegisterButton();
 
 
 	// Footer
 	// Footer
-	void log(QString logText);
+
+	/**
+	 * Set the status in the footer
+	 * @param status The new status
+	 */
 	void footerSetStatus(QString status);
 	void footerSetStatus(QString status);
+	/**
+	 * Set the error in the footer
+	 * @param error The error message
+	 */
 	void footerSetError(QString error);
 	void footerSetError(QString error);
 
 
 	// Notifications
 	// Notifications
+
+	/**
+	 * Add a new notification to the notifications tab
+	 * @param message The new notification message
+	 */
 	void notification(QString message);
 	void notification(QString message);
+	/**
+	 * Dismiss an existing notification in the notifications tab
+	 * @param index The index of the notification
+	 */
 	void dismissNotification(int index);
 	void dismissNotification(int index);
+	/**
+	 * Show a desktop notification
+	 * @param title The title of the notification
+	 * @param message The message of the notification
+	 */
 	void showDesktopNotification(QString title, QString message);
 	void showDesktopNotification(QString title, QString message);
 
 
+	// Log
+
+	/**
+	 * Add a message to the log
+	 * @param logText The message to be added
+	 */
+	void log(QString logText);
+
 	// QML -> C++
 	// QML -> C++
 public slots:
 public slots:
 	// Main
 	// Main
-	void onStart(bool startWithCli);
 
 
+	/**
+	 * Handle the start of the main window
+	 *
+	 * Check the configuration, load the values to the GUI and start the CLI is needed
+	 * Opens the according popup in the window
+	 * @param startWithCli Should the CLI be started?
+	 */
+	void onStart(bool startWithCli);
+	/**
+	 * Handle the "Switch Server" button
+	 *
+	 * Disconnect from the server
+	 */
 	void onSwitchServer();
 	void onSwitchServer();
 
 
 	// No Config Found Popup
 	// No Config Found Popup
+
+	/**
+	 * Handle the continue button after a CLI has been selected
+	 *
+	 * Creates a default config with the path to the selected CLI and runs the onStart method
+	 * @param cli_path The path to the CLI
+	 */
 	void onNoConfigFoundPopupContinueButton(QString cli_path);
 	void onNoConfigFoundPopupContinueButton(QString cli_path);
 
 
 	// Invalid Cli Path Popup
 	// Invalid Cli Path Popup
+
+	/**
+	 * Handle the continue button after a CLI has been selected
+	 *
+	 * Sets the new CLI path in the config and runs the onStart method
+	 * @param cli_path The path to the CLI
+	 */
 	void onInvalidCliPathPopupContinueButton(QString cli_path);
 	void onInvalidCliPathPopupContinueButton(QString cli_path);
+	/**
+	 * Handle the quit button
+	 *
+	 * Emits a signal to close the main window
+	 */
 	void onInvalidCliPathPopupQuitButton();
 	void onInvalidCliPathPopupQuitButton();
 
 
 	// Invalid Config Popup
 	// Invalid Config Popup
+
+	/**
+	 * Handle the "create default" button
+	 *
+	 * Sets up a default config and opens the "invalid cli path" popup so that the user can select a CLI
+	 */
 	void onInvalidConfigPopupCreateDefaultButton();
 	void onInvalidConfigPopupCreateDefaultButton();
+	/**
+	 * Handle the quit button
+	 *
+	 * Emits a signal to close the main window
+	 */
 	void onInvalidConfigPopupQuitButton();
 	void onInvalidConfigPopupQuitButton();
 
 
 	// Server Files
 	// Server Files
+
+	/**
+	 * Handle the selection of a file with the file dialog
+	 *
+	 * Sets the text for the selected file and enables the "send file" button
+	 * @param url The new file url
+	 */
 	void onServerFilesSelectFileButton(QUrl url);
 	void onServerFilesSelectFileButton(QUrl url);
+	/**
+	 * Handle the "send file" button
+	 *
+	 * Upload the selected file to the server
+	 */
 	void onServerFilesSendFileButton();
 	void onServerFilesSendFileButton();
+	/**
+	 * Handle the "clear selection" button
+	 *
+	 * Resets the selected file
+	 */
 	void onServerFilesClearSelectionButton();
 	void onServerFilesClearSelectionButton();
-
+	/**
+	 * Handle the download button for a file
+	 *
+	 * Downloads the file from the server
+	 * @param fileName The name of the file
+	 */
 	void onServerFilesDownloadFileButton(QString fileName);
 	void onServerFilesDownloadFileButton(QString fileName);
+	/**
+	 * Handle the delete button in the delete confirmation popup
+	 *
+	 * Deletes the file from the server
+	 * @param filename The name of the file
+	 */
 	void onServerFilesConfirmDeleteFileButton(QString fileName);
 	void onServerFilesConfirmDeleteFileButton(QString fileName);
-
-	// Messages
-	void onMessagesSendButton(QString msg);
+	/**
+	 * Handle the queue button for a file
+	 *
+	 * Puts the file into the queue on the server
+	 * @param fileName The name of the file
+	 */
+	void onReceivingQueueFileButton(QString fileName);
+	/**
+	 * Handle the queue button for a file
+	 *
+	 * Dequeues the file on the server
+	 * @param fileName The name of the file
+	 */
+	void onReceivingDequeueFileButton(QString fileName);
 
 
 	// Settings
 	// Settings
+
+	/**
+	 * Handle the selection of a keyfile with the file dialog
+	 *
+	 * Selects the new keyfile on the CLI for further use
+	 * @param path The path to the keyfile
+	 */
 	void onKeyfileSelected(QString path);
 	void onKeyfileSelected(QString path);
+	/**
+	 * Handle the "close keyfile" button
+	 *
+	 * Closes the keyfile on the CLi
+	 */
 	void onKeyfileClosed();
 	void onKeyfileClosed();
+	/**
+	 * Handle the delete button in the delete me confirmation popup
+	 *
+	 * Tries to delete the current user from the server when the password is correct
+	 * @param password The entered password
+	 */
 	void onSettingsDeleteMeButton(QString password);
 	void onSettingsDeleteMeButton(QString password);
+	/**
+	 * Handle the "revert changes" button
+	 *
+	 * Sets the settings values to those in the config file
+	 */
 	void onSettingsRevertChangesButton();
 	void onSettingsRevertChangesButton();
+	/**
+	 * Handle the reset button
+	 *
+	 * Sets the settings to the default values
+	 */
 	void onSettingsResetButton();
 	void onSettingsResetButton();
+	/**
+	 * Handle the save button
+	 *
+	 * Saves the current values of the settings in the GUI to the config file
+	 * @param saveIP Should the autofill ip toggle be switched on or off?
+	 * @param saveUsername Should the autofill username toggle be switched on or off?
+	 * @param cliPath The path to the cli
+	 * @param keyPath The path to the keyfile
+	 */
 	void onSettingsSaveButton(bool saveIP, bool saveUsername, QString cliPath, QString keyPath);
 	void onSettingsSaveButton(bool saveIP, bool saveUsername, QString cliPath, QString keyPath);
 
 
 	// Ip Popup
 	// Ip Popup
+
+	/**
+	 * Handle the connect button
+	 *
+	 * Connects to the server and saves the ip in the config if desired
+	 * @param ip The entered ip address
+	 * @param saveAsDefault Was the "Save IP" checkbox ticked?
+	 */
 	void onIpPopupConnectButton(QString ip, bool saveAsDefault);
 	void onIpPopupConnectButton(QString ip, bool saveAsDefault);
 
 
 	// Login
 	// Login
+
+	/**
+	 * Handle the login button
+	 *
+	 * Logs in on the server and saves the username in the config if desired
+	 * @param username The entered username
+	 * @param password The entered password
+	 * @param saveAsDefault Was the "Save Username" checkbox ticked?
+	 */
 	void onLoginLoginButton(QString username, QString password, bool saveAsDefault);
 	void onLoginLoginButton(QString username, QString password, bool saveAsDefault);
 
 
 	// Signup
 	// Signup
+
+	/**
+	 * Handle the register button
+	 *
+	 * Registers on the server and saves the username in the config if desired
+	 * @param username The entered username
+	 * @param passwordOne The entered first password
+	 * @param passwordTwo The entered confirmation password
+	 * @param saveAsDefault Was the "Save Username" checkbox ticked?
+	 */
 	void onSignupRegisterButton(QString username, QString passwordOne, QString passwordTwo, bool saveAsDefault);
 	void onSignupRegisterButton(QString username, QString passwordOne, QString passwordTwo, bool saveAsDefault);
 
 
 	// Notifications
 	// Notifications
-	void onDismissNotificationButton(int id);
-
-	// Queueing
-	void onReceivingQueueFileButton(QString fileName);
 
 
-	void onReceivingDequeueFileButton(QString fileName);
+	/**
+	 * Handle the "x" button on a noticiation
+	 *
+	 * Dismiss the notification in the notifications tab
+	 * @param id The id of the notification
+	 */
+	void onDismissNotificationButton(int id);
 };
 };
 
 
 #endif // QMLHANDLER_H
 #endif // QMLHANDLER_H

+ 1 - 1
gui/src/cmdmanager.cpp

@@ -234,7 +234,7 @@ void CmdManager::handleGetData(Json::Value root) {
 
 
 void CmdManager::handleDeleteMe(Json::Value root) {
 void CmdManager::handleDeleteMe(Json::Value root) {
 	if (root["accept"] == true) {
 	if (root["accept"] == true) {
-		CliManager::loggedin = true;
+		CliManager::loggedin = false;
 		qmlHandler->setRestart(true);
 		qmlHandler->setRestart(true);
 		emit qmlHandler->closeWindow();
 		emit qmlHandler->closeWindow();
 	} else {
 	} else {

+ 5 - 8
gui/src/main.cpp

@@ -23,7 +23,6 @@ using namespace std;
 int main(int argc, char *argv[]) {
 int main(int argc, char *argv[]) {
 	QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
 	QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
 
 
-	// This has to be here to fix warnings
 	QCoreApplication::setOrganizationName("CCats");
 	QCoreApplication::setOrganizationName("CCats");
 
 
 	QApplication app(argc, argv);
 	QApplication app(argc, argv);
@@ -38,8 +37,7 @@ int main(int argc, char *argv[]) {
 	CliManager::setQmlHandler(&qmlHandler);
 	CliManager::setQmlHandler(&qmlHandler);
 	JsonHandler::setQmlHandler(&qmlHandler);
 	JsonHandler::setQmlHandler(&qmlHandler);
 
 
-	// Set the context for the window, so that the qml files can be connected to
-	// the qmlHandler
+	// Set the context for the window, so that the qml files can be connected to the qmlHandler
 	engine.rootContext()->setContextProperty("_qmlHandler", &qmlHandler);
 	engine.rootContext()->setContextProperty("_qmlHandler", &qmlHandler);
 
 
 	// Load the main window
 	// Load the main window
@@ -47,15 +45,14 @@ int main(int argc, char *argv[]) {
 
 
 	QObject *object = component.create();
 	QObject *object = component.create();
 
 
-	// Run the main window and save the return of the application in an integer
-	// ret This is blocking, which means it will block the main program until the
-	// window is closed
+	// Run the main window and save the return of the application in an integer ret
+	// This is blocking, which means it will block the main program until the window is closed
 	int ret = app.exec();
 	int ret = app.exec();
 
 
-	// If we land here, the window has been closed. Properly disconnect from the
-	// server now
+	// If we land here, the window has been closed. Properly disconnect from the server now
 	CliManager::onExit();
 	CliManager::onExit();
 
 
+	// Restart this application if the _RESTART variable is set (for example when the user deletes their account)
 	if (_RESTART) {
 	if (_RESTART) {
 		pid_t pid = 0;
 		pid_t pid = 0;
 		pid = fork();
 		pid = fork();

+ 0 - 3
gui/src/qmlhandler.cpp

@@ -143,9 +143,6 @@ void QMLHandler::onServerFilesConfirmDeleteFileButton(QString fileName) {
 	CliManager::writeToCli(command);
 	CliManager::writeToCli(command);
 }
 }
 
 
-// Messages
-void QMLHandler::onMessagesSendButton(QString msg) { emit message(msg); }
-
 // Settings
 // Settings
 void QMLHandler::onKeyfileSelected(QString path) {
 void QMLHandler::onKeyfileSelected(QString path) {
 	QString command = "keyfile \"" + path + "\"";
 	QString command = "keyfile \"" + path + "\"";