#ifndef __SETTINGS_H__
#define __SETTINGS_H__


#define SETTINGS_NAME "GridMatrix"

#define CONFIG_SECTION "config"
#define GENERAL_CONFIG_SECTION "config/general"
#define NETWORK_CONFIG_SECTION "config/network"

#define OPEN_LAST_NETWORK "config/general/openLastNetwork"

#define OPEN_OUTPUT_WINDOW "config/general/openOutputWindow"

#define SHOW_SIMULATION_PROGRESS_OUTPUT_WINDOW_ENTRY "showSimulationProgressOutputWindow"
#define SHOW_SIMULATION_PROGRESS_NETWORK_ENTRY "showSimulationProgressNetwork"
#define SIMULATION_CHANGE_NODES_COLOR_ENTRY "changeNodesColor"
#define SIMULATION_CUSTOM_PROGRESS_ENTRY "customSimulationProgress"
#define SHOW_SIMULATION_OUTPUT_ENTRY "showSimulationOutput"
#define SHOW_SIMULATION_ERRORS_ENTRY "showSimulationErrors"
#define SIMULATION_DEBUG_MODE_ENTRY "debugMode"

#define SHOW_SIMULATION_PROGRESS_OUTPUT_WINDOW "config/general/"##SHOW_SIMULATION_PROGRESS_OUTPUT_WINDOW_ENTRY
#define SHOW_SIMULATION_PROGRESS_NETWORK "config/general/"##SHOW_SIMULATION_PROGRESS_NETWORK_ENTRY
#define SIMULATION_CHANGE_NODES_COLOR "config/general/"##SIMULATION_CHANGE_NODES_COLOR_ENTRY
#define SIMULATION_CUSTOM_PROGRESS "config/general/"##SIMULATION_CUSTOM_PROGRESS_ENTRY
#define SHOW_SIMULATION_OUTPUT "config/general/"##SHOW_SIMULATION_OUTPUT_ENTRY
#define SHOW_SIMULATION_ERRORS "config/general/"##SHOW_SIMULATION_ERRORS_ENTRY
#define SIMULATION_DEBUG_MODE "config/general/"##SIMULATION_DEBUG_MODE_ENTRY

#define DEFAULT_CPU_POWER "config/network/defaultCPUPower"
#define DEFAULT_BANDWIDTH "config/network/defaultBandwidth"
#define DEFAULT_LATENCY "config/network/defaultLatency"

#define LAST_DOCUMENT "file/lastOpenedDocument"

#define TEMPLATE_SECTION "templates"
#define TEMPLATE_ENTRIES_SECTION "templates/entries"
#define TEMPLATE_LAST_DIR "lastTemplateDir"


#define DEPLOY_SECTION "deploy"
#define DEPLOY_LAST_DIR "deployTemplateDir"

#include <qsettings.h>

class AppSettings {
public:
	static QSettings &settings();

	static bool openLastNetwork();
	static void setOpenLastNetwork(bool val);

	static double defaultCPUPower();
	static void setDefaultCPUPower(double val);

	static double defaultBandwidth();
	static void setDefaultBandwidth(double val);

	static double defaultLatency();
	static void setDefaultLatency(double val);

	static QString lastDocument();
	static void setLastDocument(const QString &docName);

	static bool openOutputWindow();
	static void setOpenOutputWindow(bool open);

	static bool showSimulationProgressOutputWindow();
	static void setShowSimulationProgressOutputWindow(bool show);

	static bool showSimulationProgressNetwork();
	static void setShowSimulationProgressNetwork(bool show);

	static bool changeNodeColor();
	static void setChangeNodeColor(bool change);

	static bool showCustomSimulationProgress();
	static void setShowCustomSimulationProgress(bool show);

	static bool showSimulationOutput();
	static void setShowSimulationOutput(bool show);

	static bool showSimulationErrors();
	static void setShowSimulationErrors(bool show);

	static bool debugMode();
	static void setDebugMode(bool mode);

};

#endif // __SETTINGS_H__
