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
@@ -253,8 +253,6 @@ add_files(
qt/window/QtBookmarkBrowser.h
qt/window/QtBookmarkCreator.cpp
qt/window/QtBookmarkCreator.h
qt/window/QtEulaWindow.cpp
qt/window/QtEulaWindow.h
qt/window/QtIndexingDialog.cpp
qt/window/QtIndexingDialog.h
qt/window/QtIndexingProgressDialog.cpp
@@ -63,8 +63,6 @@ void setupApp(int argc, char *argv[])
userDataPath.concatenate(L"Sourcetrail/");
}
userDataPath.makeCanonical();
Application::EULA_ACCEPT_REQUIRED = false;
}
else
{
+2 -2
View File
@@ -98,12 +98,12 @@ void QtMainView::saveLayout()
m_window->saveLayout();
}
void QtMainView::loadWindow(bool showStartWindow, bool showEULA)
void QtMainView::loadWindow(bool showStartWindow)
{
m_onQtThread(
[=]()
{
m_window->loadWindow(showStartWindow, showEULA);
m_window->loadWindow(showStartWindow);
}
);
}
+1 -1
View File
@@ -48,7 +48,7 @@ public:
void loadLayout() override;
void saveLayout() override;
void loadWindow(bool showStartWindow, bool showEULA) override;
void loadWindow(bool showStartWindow) override;
void refreshView() override;
-65
View File
@@ -1,65 +0,0 @@
#include "QtEulaWindow.h"
#include <QTextEdit>
#include <QVBoxLayout>
#include <QLabel>
#include "ResourcePaths.h"
#include "TextAccess.h"
QtEulaWindow::QtEulaWindow(QWidget *parent, bool forceAccept)
: QtWindow(false, parent)
, m_forceAccept(forceAccept)
{
}
QSize QtEulaWindow::sizeHint() const
{
return QSize(700, 600);
}
void QtEulaWindow::populateWindow(QWidget* widget)
{
QVBoxLayout* layout = new QVBoxLayout(widget);
layout->setContentsMargins(0, 0, 0, 0);
if (m_forceAccept)
{
layout->addSpacing(5);
QLabel* label = new QLabel("Please read and agree to our End User License Agreement:");
QFont _font = label->font();
_font.setBold(true);
label->setFont(_font);
layout->addWidget(label);
}
std::shared_ptr<TextAccess> text =
TextAccess::createFromFile(ResourcePaths::getLicensePath().concatenate(L"EULA.txt"));
QTextEdit* licenseText = new QTextEdit();
licenseText->setObjectName("textField");
licenseText->setReadOnly(true);
licenseText->setText(QString::fromStdString(text->getText()));
layout->addWidget(licenseText);
widget->setLayout(layout);
}
void QtEulaWindow::windowReady()
{
updateTitle("End User License Agreement");
if (m_forceAccept)
{
updateCloseButton("Quit");
updateNextButton("I agree");
}
else
{
updateCloseButton("Close");
setNextVisible(false);
}
setPreviousVisible(false);
}
-24
View File
@@ -1,24 +0,0 @@
#ifndef QT_EULA_LICENSE_H
#define QT_EULA_LICENSE_H
#include "QtWindow.h"
class QtEulaWindow
: public QtWindow
{
Q_OBJECT
public:
QtEulaWindow(QWidget* parent, bool forceAccept);
QSize sizeHint() const override;
protected:
// QtWindow implementation
virtual void populateWindow(QWidget* widget) override;
virtual void windowReady() override;
private:
bool m_forceAccept;
};
#endif // QT_EULA_LICENSE_H
+1 -37
View File
@@ -22,7 +22,6 @@
#include "QtProjectWizard.h"
#include "QtAbout.h"
#include "QtAboutLicense.h"
#include "QtEulaWindow.h"
#include "QtKeyboardShortcuts.h"
#include "QtPreferencesWindow.h"
#include "QtStartScreen.h"
@@ -323,17 +322,12 @@ void QtMainWindow::loadDockWidgetLayout()
}
}
void QtMainWindow::loadWindow(bool showStartWindow, bool showEULA)
void QtMainWindow::loadWindow(bool showStartWindow)
{
if (showStartWindow)
{
showStartScreen();
}
if (showEULA)
{
showEula(true);
}
}
void QtMainWindow::saveLayout()
@@ -528,35 +522,6 @@ void QtMainWindow::showBugtracker()
QDesktopServices::openUrl(QUrl("https://github.com/CoatiSoftware/SourcetrailBugTracker/issues"));
}
void QtMainWindow::showEula(bool forceAccept)
{
QtEulaWindow* window = new QtEulaWindow(this, forceAccept);
m_windowStack.pushWindow(window);
window->setup();
if (forceAccept)
{
setEnabled(false);
window->setEnabled(true);
connect(window, &QtEulaWindow::finished, this, &QtMainWindow::acceptedEula);
connect(window, &QtEulaWindow::canceled, dynamic_cast<QApplication*>(QCoreApplication::instance()), &QApplication::quit);
}
else
{
connect(window, &QtEulaWindow::canceled, &m_windowStack, &QtWindowStack::popWindow);
}
}
void QtMainWindow::acceptedEula()
{
ApplicationSettings::getInstance()->setAcceptedEulaVersion(Application::EULA_VERSION);
ApplicationSettings::getInstance()->save();
setEnabled(true);
m_windowStack.popWindow();
}
void QtMainWindow::showLicenses()
{
QtAboutLicense* licenseWindow = createWindow<QtAboutLicense>();
@@ -1052,7 +1017,6 @@ void QtMainWindow::setupHelpMenu()
menu->addSeparator();
menu->addAction(tr("End User License Agreement"), this, &QtMainWindow::showEula);
menu->addAction(tr("3rd Party Licenses"), this, &QtMainWindow::showLicenses);
menu->addAction(tr("&About Sourcetrail"), this, &QtMainWindow::about);
+1 -3
View File
@@ -73,7 +73,7 @@ public:
void saveLayout();
void loadDockWidgetLayout();
void loadWindow(bool showStartWindow, bool showEULA);
void loadWindow(bool showStartWindow);
void updateHistoryMenu(std::shared_ptr<MessageBase> message);
void clearHistoryMenu();
@@ -106,8 +106,6 @@ public slots:
void showDocumentation();
void showKeyboardShortcuts();
void showErrorHelpMessage();
void showEula(bool forceAccept = false);
void acceptedEula();
void showLicenses();
void showDataFolder();