ui: Remove EULA from GUI and Windows installer

This commit is contained in:
mlangkabel
2019-11-16 14:57:31 +01:00
parent bb40bcfe45
commit cc17dbe2ea
34 changed files with 14 additions and 890 deletions
-2
View File
@@ -384,8 +384,6 @@ add_files(
utility/commandline/CommandLineParser.h
utility/commandline/commands/CommandlineCommand.cpp
utility/commandline/commands/CommandlineCommand.h
utility/commandline/commands/CommandlineCommandAcceptEULA.cpp
utility/commandline/commands/CommandlineCommandAcceptEULA.h
utility/commandline/commands/CommandlineCommandConfig.cpp
utility/commandline/commands/CommandlineCommandConfig.h
utility/commandline/commands/CommandlineCommandIndex.cpp
+1 -4
View File
@@ -33,7 +33,6 @@
std::shared_ptr<Application> Application::s_instance;
std::string Application::s_uuid;
bool Application::EULA_ACCEPT_REQUIRED = true;
void Application::createInstance(
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory
@@ -424,9 +423,7 @@ void Application::loadWindow(bool showStartWindow)
updateTitle();
bool showEula = (EULA_ACCEPT_REQUIRED && appSettings->getAcceptedEulaVersion() < EULA_VERSION);
m_mainView->loadWindow(showStartWindow, showEula);
m_mainView->loadWindow(showStartWindow);
m_loadedWindow = true;
}
else if (!showStartWindow)
-3
View File
@@ -35,9 +35,6 @@ class Application
, public MessageListener<MessageWindowFocus>
{
public:
static const int EULA_VERSION = 5;
static bool EULA_ACCEPT_REQUIRED;
static void createInstance(const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory);
static std::shared_ptr<Application> getInstance();
static void destroyInstance();
+1 -1
View File
@@ -32,7 +32,7 @@ public:
virtual void refreshView() = 0;
virtual void loadWindow(bool showStartWindow, bool showEULA) = 0;
virtual void loadWindow(bool showStartWindow) = 0;
virtual void hideStartScreen() = 0;
virtual void setTitle(const std::wstring& title) = 0;
-10
View File
@@ -553,16 +553,6 @@ bool ApplicationSettings::setRecentProjects(const std::vector<FilePath> &recentP
return setPathValues("user/recent_projects/recent_project", recentProjects);
}
int ApplicationSettings::getAcceptedEulaVersion() const
{
return getValue<int>("user/accepted_eula_version", 0);
}
void ApplicationSettings::setAcceptedEulaVersion(int version)
{
setValue<int>("user/accepted_eula_version", version);
}
std::string ApplicationSettings::getUserToken() const
{
return getValue<std::string>("user/token", "");
-3
View File
@@ -152,9 +152,6 @@ public:
std::vector<FilePath> getRecentProjects() const;
bool setRecentProjects(const std::vector<FilePath>& recentProjects);
int getAcceptedEulaVersion() const;
void setAcceptedEulaVersion(int version);
std::string getUserToken() const;
void setUserToken(std::string token);
@@ -6,7 +6,6 @@
#include <boost/program_options.hpp>
#include "CommandlineHelper.h"
#include "CommandlineCommandAcceptEULA.h"
#include "CommandlineCommandConfig.h"
#include "CommandlineCommandIndex.h"
#include "ConfigManager.h"
@@ -42,7 +41,6 @@ void CommandLineParser::setup()
addCommand(std::make_unique<commandline::CommandlineCommandConfig>(this));
addCommand(std::make_unique<commandline::CommandlineCommandIndex>(this));
addCommand(std::make_unique<commandline::CommandlineCommandAcceptEULA>(this));
for (auto& command : m_commands)
{
@@ -76,7 +74,6 @@ void CommandLineParser::preparse(std::vector<std::string>& args)
{
if ( m_args[0] == command->name())
{
command->preparse();
m_withoutGUI = true;
return;
}
@@ -193,11 +190,6 @@ bool CommandLineParser::exitApplication() const
return m_quit;
}
bool CommandLineParser::acceptedEULA() const
{
return m_acceptEULA;
}
bool CommandLineParser::hasError() const
{
return !m_errorString.empty();
@@ -247,11 +239,6 @@ void CommandLineParser::incompleteRefresh()
m_refreshMode = REFRESH_UPDATED_AND_INCOMPLETE_FILES;
}
void CommandLineParser::acceptEULA()
{
m_acceptEULA = true;
}
const FilePath& CommandLineParser::getProjectFilePath() const
{
return m_projectFile;
@@ -30,12 +30,10 @@ public:
bool runWithoutGUI() const;
bool exitApplication() const;
bool acceptedEULA() const;
bool hasError() const;
std::wstring getError();
void acceptEULA();
void fullRefresh();
void incompleteRefresh();
@@ -61,7 +59,6 @@ private:
bool m_quit = false;
bool m_withoutGUI = false;
bool m_acceptEULA = false;
std::wstring m_errorString;
};
@@ -27,7 +27,6 @@ public:
const std::string& description();
virtual void setup() = 0;
virtual void preparse() = 0;
virtual ReturnStatus parse(std::vector<std::string>& args) = 0;
virtual bool hasHelp() const = 0;
@@ -1,32 +0,0 @@
#include "CommandlineCommandAcceptEULA.h"
#include "CommandlineHelper.h"
#include "CommandLineParser.h"
namespace commandline
{
CommandlineCommandAcceptEULA::CommandlineCommandAcceptEULA(CommandLineParser* parser)
: CommandlineCommand("accept-eula", "Accept the Sourcetrail End User License Agreement.", parser)
{
}
CommandlineCommandAcceptEULA::~CommandlineCommandAcceptEULA()
{
}
void CommandlineCommandAcceptEULA::setup()
{
}
void CommandlineCommandAcceptEULA::preparse()
{
m_parser->acceptEULA();
}
CommandlineCommand::ReturnStatus CommandlineCommandAcceptEULA::parse(std::vector<std::string>& args)
{
return ReturnStatus::CMD_QUIT;
}
}
@@ -1,27 +0,0 @@
#ifndef COMMANDLINE_COMMAND_ACCEPT_EULA_H
#define COMMANDLINE_COMMAND_ACCEPT_EULA_H
#include "CommandlineCommand.h"
class CommandLineParser;
namespace commandline
{
class CommandlineCommandAcceptEULA
: public CommandlineCommand
{
public:
CommandlineCommandAcceptEULA(CommandLineParser* parser);
virtual ~CommandlineCommandAcceptEULA();
virtual void setup();
virtual void preparse();
virtual ReturnStatus parse(std::vector<std::string>& args);
virtual bool hasHelp() const { return false; }
};
} // namespace commandline
#endif // COMMANDLINE_COMMAND_ACCEPT_EULA_H
@@ -121,10 +121,6 @@ void CommandlineCommandConfig::setup()
m_options.add(options);
}
void CommandlineCommandConfig::preparse()
{
}
CommandlineCommand::ReturnStatus CommandlineCommandConfig::parse(std::vector<std::string>& args)
{
po::variables_map vm;
@@ -14,7 +14,6 @@ public:
virtual ~CommandlineCommandConfig();
virtual void setup();
virtual void preparse();
virtual ReturnStatus parse(std::vector<std::string>& args);
virtual bool hasHelp() const { return true; }
@@ -33,10 +33,6 @@ void CommandlineCommandIndex::setup()
m_positional.add("project-file", 1);
}
void CommandlineCommandIndex::preparse()
{
}
CommandlineCommand::ReturnStatus CommandlineCommandIndex::parse(std::vector<std::string>& args)
{
po::variables_map vm;
@@ -13,7 +13,6 @@ public:
virtual ~CommandlineCommandIndex();
virtual void setup();
virtual void preparse();
virtual ReturnStatus parse(std::vector<std::string>& args);
virtual bool hasHelp() const { return true; }