Skip to content

Commit

Permalink
ui: Remove EULA from GUI and Windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
mlangkabel committed Nov 16, 2019
1 parent bb40bcf commit cc17dbe
Show file tree
Hide file tree
Showing 34 changed files with 14 additions and 890 deletions.
444 changes: 0 additions & 444 deletions bin/app/data/license/EULA.rtf

This file was deleted.

132 changes: 0 additions & 132 deletions bin/app/data/license/EULA.txt

This file was deleted.

2 changes: 0 additions & 2 deletions bin/app/user/ApplicationSettings_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
<recent_project><!-- STRING: recent project path --></recent_project>
</recent_projects>

<accepted_eula_version><!-- INTEGER: last accepted eula version --></accepted_eula_version>

<token><!-- UUID: identifier for this user --></token>

<update_check>
Expand Down
5 changes: 0 additions & 5 deletions cmake/linux_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ function(AddSharedToComponent)
DESTINATION Sourcetrail/data/python
)

INSTALL(FILES
${CMAKE_SOURCE_DIR}/bin/app/data/license/EULA.txt
DESTINATION Sourcetrail
)

InstallQt(5)

GetAndInstallLibrary(libicui18n.so 0)
Expand Down
4 changes: 0 additions & 4 deletions cmake/pre_install_linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ endfunction()
set(binPath ${CMAKE_CURRENT_LIST_DIR}/../build/Release/app/Sourcetrail)
set(projPath ${CMAKE_CURRENT_LIST_DIR}/../bin/app/user/projects)

execute_process(
COMMAND ${binPath} accept-eula
)

execute_process(
COMMAND ${binPath} index --full ${projPath}/tictactoe_cpp/tictactoe_cpp.srctrlprj
)
Expand Down
3 changes: 0 additions & 3 deletions deployment/windows/wixSetup/installDir.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@

<Directory Id='LieutenantCommanderData' Name='data'>
<Directory Id='License' Name='license'>
<Component Id='EulaTxt' Guid='*' Win64="$(var.Win64)">
<File Id='EulaTxtId' Name='EULA.txt' DiskId='1' Source='./../../../bin/app/data/license/EULA.txt' KeyPath='yes' />
</Component>
<Directory Id='ThirdPartyLicenses' Name='3rd_party_licenses'>
<Component Id='LicenseBoostTxt' Guid='*' Win64="$(var.Win64)">
<File Id='LicenseBoost' Name='license_boost.txt' DiskId='1' Source='./../../../bin/app/data/license/3rd_party_licenses/license_boost.txt' KeyPath='yes' />
Expand Down
8 changes: 4 additions & 4 deletions deployment/windows/wixSetup/sourcetrail.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@
<ComponentRef Id='QWBmpDll'/>
<ComponentRef Id='QWebpDll'/>

<ComponentRef Id='EulaTxt'/>
<ComponentRef Id='LicenseBoostTxt'/>
<ComponentRef Id='LicenseClangTxt'/>
<ComponentRef Id='LicenseCppSqliteTxt'/>
Expand Down Expand Up @@ -293,7 +292,10 @@
<UIRef Id="WixUI_InstallDir" />

<DialogRef Id="ShortcutDlg" />


<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="3">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>

<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="ShortcutDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ShortcutDlg">1</Publish>
</UI>
Expand All @@ -305,8 +307,6 @@
<Icon Id="Sourcetrail.ico" SourceFile="./../../../bin/app/data/gui/icon/sourcetrail.ico" />
<Icon Id="Project.ico" SourceFile="./../../../bin/app/data/gui/icon/project.ico" />

<WixVariable Id="WixUILicenseRtf" Value="./../../../bin/app/data/license/EULA.rtf" />

<WixVariable Id="WixUIBannerBmp" Value="Images/banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Images/w_installer.bmp" />
</Product>
Expand Down
2 changes: 0 additions & 2 deletions script/deploy_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ if [ $UPDATE_DATABASES = true ]; then
cd temp

echo -e "$INFO configuring application"
../build/win32/Release/app/Sourcetrail.exe accept-eula
../build/win32/Release/app/Sourcetrail.exe config -t 8

echo -e "$INFO creating database for tutorial"
Expand Down Expand Up @@ -204,7 +203,6 @@ if [ $CREATE_PORTABLE_ZIP = true ]; then
# COPYING APPLICATION DATA
mkdir -p $PORTABLE_PACKAGE_APP_DIR/data/license/3rd_party_licenses/
cp -u -r bin/app/data/license/3rd_party_licenses/* $PORTABLE_PACKAGE_APP_DIR/data/license/3rd_party_licenses/
cp -u -r bin/app/data/license/EULA.txt $PORTABLE_PACKAGE_APP_DIR/data/license/
mkdir -p $PORTABLE_PACKAGE_APP_DIR/data/color_schemes/
cp -u -r bin/app/data/color_schemes/* $PORTABLE_PACKAGE_APP_DIR/data/color_schemes/
mkdir -p $PORTABLE_PACKAGE_APP_DIR/data/cxx/
Expand Down
2 changes: 0 additions & 2 deletions setup/MacOSX/bundle_install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ cp -R ../../../ide_plugins/eclipse $PACKAGE_DIR/plugins/eclipse/
cp -R ../../../ide_plugins/idea $PACKAGE_DIR/plugins/idea/
cp -R ../../../ide_plugins/qt_creator $PACKAGE_DIR/plugins/qt_creator/

cp ../../../bin/app/data/license/EULA.rtf $PACKAGE_DIR/EULA.rtf

ln -s /Applications $PACKAGE_DIR/Applications

echo -e $INFO "create DMG package"
Expand Down
48 changes: 2 additions & 46 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "ScopedFunctor.h"
#include "SourceGroupFactory.h"
#include "SourceGroupFactoryModuleCustom.h"
#include "TextAccess.h"
#include "UserPaths.h"
#include "utility.h"
#include "utilityApp.h"
Expand Down Expand Up @@ -94,18 +93,6 @@ void addLanguagePackages()
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
}

QCoreApplication* createApplication(int &argc, char *argv[], bool noGUI = false)
{
if (noGUI)
{
return new QtCoreApplication(argc, argv);
}
else
{
return new QtApplication(argc, argv);
}
}

int main(int argc, char *argv[])
{
QCoreApplication::addLibraryPath(".");
Expand Down Expand Up @@ -159,37 +146,7 @@ int main(int argc, char *argv[])
Application::destroyInstance();
});

// check if already agreed to EULA
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
if (appSettings->getAcceptedEulaVersion() < Application::EULA_VERSION)
{
if (!commandLineParser.acceptedEULA())
{
// to avoid interferring with other console output
std::this_thread::sleep_for(std::chrono::milliseconds(250));

std::shared_ptr<TextAccess> text =
TextAccess::createFromFile(ResourcePaths::getLicensePath().concatenate(L"EULA.txt"));

std::cout << std::endl << text->getText() << std::endl;
std::cout << "Do you accept the Sourcetrail End User License Agreement? (y/n)" << std::endl;

char c = 'n';
std::cin >> c;

if (c != 'Y' && c != 'y')
{
std::cout << "\nAgreement not accepted. quitting..." << std::endl;
return 1;
}
}

std::cout << "\nSourcetrail End User License Agreement accepted.\n" << std::endl;
appSettings->setAcceptedEulaVersion(Application::EULA_VERSION);
appSettings->save();
}

ApplicationSettingsPrefiller::prefillPaths(appSettings);
ApplicationSettingsPrefiller::prefillPaths(ApplicationSettings::getInstance().get());
addLanguagePackages();

signal(SIGINT, signalHandler);
Expand Down Expand Up @@ -248,8 +205,7 @@ int main(int argc, char *argv[])
Application::destroyInstance();
});

ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
ApplicationSettingsPrefiller::prefillPaths(appSettings);
ApplicationSettingsPrefiller::prefillPaths(ApplicationSettings::getInstance().get());
addLanguagePackages();

utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), L".otf");
Expand Down
2 changes: 0 additions & 2 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/lib/app/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit cc17dbe

Please sign in to comment.