ui: windows installer
Created a windows installer (vs deployment project).
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
|
||||
std::string Application::m_appSettingsPath = "data/ApplicationSettings.xml";
|
||||
|
||||
std::shared_ptr<Application> Application::create(
|
||||
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory
|
||||
){
|
||||
@@ -51,7 +53,7 @@ std::shared_ptr<Application> Application::create(
|
||||
|
||||
void Application::loadSettings()
|
||||
{
|
||||
ApplicationSettings::getInstance()->load("data/ApplicationSettings.xml");
|
||||
ApplicationSettings::getInstance()->load(FilePath(m_appSettingsPath));
|
||||
ColorScheme::getInstance()->load(ApplicationSettings::getInstance()->getColorSchemePath());
|
||||
|
||||
GraphViewStyle::loadStyleSettings();
|
||||
@@ -111,6 +113,11 @@ void Application::saveProject(const FilePath& projectSettingsFilePath)
|
||||
}
|
||||
}
|
||||
|
||||
void Application::setAppSettingsPath(const std::string& appSettingsPath)
|
||||
{
|
||||
m_appSettingsPath = appSettingsPath;
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageActivateWindow* message)
|
||||
{
|
||||
m_mainView->activateWindow();
|
||||
@@ -177,5 +184,5 @@ void Application::updateRecentProjects(const FilePath& projectSettingsFilePath)
|
||||
}
|
||||
|
||||
appSettings->setRecentProjects(recentProjects);
|
||||
appSettings->save("data/ApplicationSettings.xml");
|
||||
appSettings->save(m_appSettingsPath);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ public:
|
||||
void refreshProject();
|
||||
void saveProject(const FilePath& projectSettingsFilePath);
|
||||
|
||||
static void setAppSettingsPath(const std::string& appSettingsPath);
|
||||
|
||||
private:
|
||||
Application();
|
||||
|
||||
@@ -54,6 +56,8 @@ private:
|
||||
std::shared_ptr<ComponentManager> m_componentManager;
|
||||
|
||||
std::shared_ptr<IDECommunicationController> m_ideCommunicationController;
|
||||
|
||||
static std::string m_appSettingsPath;
|
||||
};
|
||||
|
||||
#endif // APPLICATION_H
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "FileLogger.h"
|
||||
|
||||
#include <direct.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
const std::string FileLogger::s_filePath = "data/log/";
|
||||
std::string FileLogger::s_filePath = "data/log/";
|
||||
|
||||
FileLogger::FileLogger()
|
||||
: Logger("FileLogger")
|
||||
@@ -15,6 +16,13 @@ FileLogger::~FileLogger()
|
||||
{
|
||||
}
|
||||
|
||||
void FileLogger::setFilePath(const std::string& filePath)
|
||||
{
|
||||
s_filePath = filePath;
|
||||
|
||||
createDirectory();
|
||||
}
|
||||
|
||||
void FileLogger::logInfo(const LogMessage& message)
|
||||
{
|
||||
logMessage("INFO", message);
|
||||
@@ -44,6 +52,14 @@ void FileLogger::setupFileName()
|
||||
m_fileName = filename.str();
|
||||
}
|
||||
|
||||
void FileLogger::createDirectory()
|
||||
{
|
||||
if (s_filePath.length() > 0)
|
||||
{
|
||||
mkdir(s_filePath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void FileLogger::logMessage(const std::string& type, const LogMessage& message)
|
||||
{
|
||||
std::ofstream fileStream;
|
||||
|
||||
@@ -12,12 +12,15 @@ public:
|
||||
FileLogger();
|
||||
virtual ~FileLogger();
|
||||
|
||||
static void setFilePath(const std::string& filePath);
|
||||
|
||||
private:
|
||||
virtual void logInfo(const LogMessage& message);
|
||||
virtual void logWarning(const LogMessage& message);
|
||||
virtual void logError(const LogMessage& message);
|
||||
|
||||
static const std::string s_filePath;
|
||||
static void createDirectory();
|
||||
static std::string s_filePath;
|
||||
|
||||
void setupFileName();
|
||||
void logMessage(const std::string& type, const LogMessage& message);
|
||||
|
||||
Reference in New Issue
Block a user