Skip to content

Commit

Permalink
Merge pull request #31 from hjaltisan/EO11386
Browse files Browse the repository at this point in the history
EO-11386
  • Loading branch information
hjaltisan authored Dec 8, 2020
2 parents f5e5187 + ea7bf47 commit b26fb5c
Show file tree
Hide file tree
Showing 16 changed files with 468 additions and 127 deletions.
28 changes: 0 additions & 28 deletions src/libs/installer/eventlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,6 @@ void EventLogger::uninstallerShutDown(eve_launcher::uninstaller::Page page, eve_
m_httpThreadController->lastChanceToFinish();
}

void EventLogger::uninstallerDetailsDisplayed()
{
auto evt = new eve_launcher::uninstaller::DetailsDisplayed;
evt->set_allocated_event_metadata(getEventMetadata());
sendAllocatedEvent(evt);
}

void EventLogger::uninstallerDetailsHidden()
{
auto evt = new eve_launcher::uninstaller::DetailsHidden;
evt->set_allocated_event_metadata(getEventMetadata());
sendAllocatedEvent(evt);
}

void EventLogger::uninstallerUninstallationStarted()
{
auto evt = new eve_launcher::uninstaller::UninstallationStarted;
Expand Down Expand Up @@ -473,20 +459,6 @@ void EventLogger::installerPreparationFinished(int duration)
sendAllocatedEvent(evt);
}

void EventLogger::installerDetailsDisplayed()
{
auto evt = new eve_launcher::installer::DetailsDisplayed;
evt->set_allocated_event_metadata(getEventMetadata());
sendAllocatedEvent(evt);
}

void EventLogger::installerDetailsHidden()
{
auto evt = new eve_launcher::installer::DetailsHidden;
evt->set_allocated_event_metadata(getEventMetadata());
sendAllocatedEvent(evt);
}

void EventLogger::installerAutoRunEnabled()
{
auto evt = new eve_launcher::installer::AutoRunEnabled;
Expand Down
4 changes: 0 additions & 4 deletions src/libs/installer/eventlogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class EventLogger : QObject
void uninstallerFinishedPageDisplayed();
void uninstallerFailedPageDisplayed();
void uninstallerShutDown(eve_launcher::uninstaller::Page page, eve_launcher::uninstaller::ShutDown_State state, bool finishButton);
void uninstallerDetailsDisplayed();
void uninstallerDetailsHidden();
void uninstallerUninstallationStarted();
void uninstallerUninstallationInterrupted(int duration);
void uninstallerUninstallationFinished(int duration);
Expand All @@ -44,8 +42,6 @@ class EventLogger : QObject
void installerShutDown(eve_launcher::installer::Page page, eve_launcher::installer::ShutDown_State state, bool finishButton);
void installerPreparationStarted();
void installerPreparationFinished(int duration);
void installerDetailsDisplayed();
void installerDetailsHidden();
void installerAutoRunEnabled();
void installerAutoRunDisabled();
void installerEulaAccepted();
Expand Down
16 changes: 0 additions & 16 deletions src/libs/installer/installereventoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,6 @@ bool InstallerEventOperation::sendUninstallerEvent(QStringList args)

EventLogger::instance()->uninstallerShutDown(page, state, finishButton);
}
else if (event == QString::fromLatin1("DetailsDisplayed"))
{
EventLogger::instance()->uninstallerDetailsDisplayed();
}
else if (event == QString::fromLatin1("DetailsHidden"))
{
EventLogger::instance()->uninstallerDetailsHidden();
}
else if (event == QString::fromLatin1("UninstallationStarted"))
{
EventLogger::instance()->uninstallerUninstallationStarted();
Expand Down Expand Up @@ -292,14 +284,6 @@ bool InstallerEventOperation::sendInstallerEvent(QStringList args)

EventLogger::instance()->installerPreparationFinished(duration);
}
else if (event == QString::fromLatin1("DetailsDisplayed"))
{
EventLogger::instance()->installerDetailsDisplayed();
}
else if (event == QString::fromLatin1("DetailsHidden"))
{
EventLogger::instance()->installerDetailsHidden();
}
else if (event == QString::fromLatin1("AutoRunEnabled"))
{
EventLogger::instance()->installerAutoRunEnabled();
Expand Down
34 changes: 25 additions & 9 deletions src/libs/installer/packagemanagergui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,27 @@ PackageManagerGui::PackageManagerGui(PackageManagerCore *core, QWidget *parent)
, m_core(core)
{
if (m_core->isInstaller())
setWindowTitle(tr("%1 Setup").arg(m_core->value(scTitle)));
{
if (m_core->isCustomInstaller())
{
setWindowTitle(tr("EVE Online Launcher Setup"));
}
else
{
setWindowTitle(tr("%1 Setup").arg(m_core->value(scTitle)));
}
}
else
setWindowTitle(tr("Maintain %1").arg(m_core->value(scTitle)));
{
if (m_core->isCustomInstaller())
{
setWindowTitle(tr("EVE Online Uninstaller"));
}
else
{
setWindowTitle(tr("Maintain %1").arg(m_core->value(scTitle)));
}
}
setWindowFlags(windowFlags() &~ Qt::WindowContextHelpButtonHint);

#ifndef Q_OS_MACOS
Expand Down Expand Up @@ -1778,8 +1796,7 @@ CustomIntroductionPage::CustomIntroductionPage(PackageManagerCore *core)
m_msgLabel = new QLabel(this);
m_msgLabel->setWordWrap(true);
m_msgLabel->setObjectName(QLatin1String("MessageLabel"));
// m_msgLabel->setText(tr("Welcome to the %1 Setup Wizard.").arg(productName()));
m_msgLabel->setText(tr("Please specify the directory where %1 will be installed.").arg(productName()));
m_msgLabel->setText(tr("Install location:"));
layout->addWidget(m_msgLabel);

QHBoxLayout *hlayout = new QHBoxLayout;
Expand All @@ -1796,7 +1813,7 @@ CustomIntroductionPage::CustomIntroductionPage(PackageManagerCore *core)
m_browseButton->setObjectName(QLatin1String("BrowseDirectoryButton"));
connect(m_browseButton, &QAbstractButton::clicked, this, &CustomIntroductionPage::dirRequested);
m_browseButton->setShortcut(QKeySequence(tr("Alt+R", "browse file system to choose a file")));
m_browseButton->setText(tr("B&rowse..."));
m_browseButton->setText(tr("Change..."));
hlayout->addWidget(m_browseButton);

layout->addLayout(hlayout);
Expand Down Expand Up @@ -2309,9 +2326,9 @@ void CustomIntroductionPage::entering()
if (core->isUninstaller()) {
// m_taskDetailsBrowser->setVisible(false);
setButtonText(QWizard::CommitButton, tr("U&ninstall"));
setColoredTitle(tr("Ready to Uninstall %1").arg(productName()));
setColoredTitle(tr("Ready to Uninstall"));
m_spaceLabel->setText(tr("Setup is now ready to begin removing %1 from your computer.<br>"
"<font color=\"red\">The program directory %2 will be deleted completely</font>, "
"<font color=\"red\">%2 will be deleted completely</font>, "
"including all content in that directory!")
.arg(productName(),
QDir::toNativeSeparators(QDir(core->value(scTargetDir))
Expand Down Expand Up @@ -2343,8 +2360,7 @@ void CustomIntroductionPage::entering()

QString installRedistText = core->value(QLatin1String("InstallRedists"), QLatin1String("false"));
if (installRedistText == QLatin1String("true")) {
m_redistLabel->setText(tr("Your system is missing C++ runtime that is needed to run the EVE Launcher, "
"so the missing runtime will be installed on your computer as part of the installation."));
m_redistLabel->setText(tr("Update for Universal C Runtime in Windows will be installed."));
} else {
m_redistLabel->setVisible(false);
}
Expand Down
18 changes: 14 additions & 4 deletions src/sdk/installerbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,16 @@ int InstallerBase::run()
const QString newDirectory = QLatin1String(":/translations_new");
const QStringList translations = m_core->settings().translations();
const bool isChinaInstaller = m_core->settings().isChinaInstaller();
const bool isCustomInstaller = m_core->isCustomInstaller();
QStringList uiLanguages = QLocale().uiLanguages();
int allowedLanguages [6] = { QLocale::English, QLocale::German, QLocale::French, QLocale::Russian, QLocale::Japanese, QLocale::Chinese };

if (isChinaInstaller) {
QLocale locale = QLocale::Chinese;
QScopedPointer<QTranslator> qtTranslator(new QTranslator(QCoreApplication::instance()));
bool qtLoaded = qtTranslator->load(locale, QLatin1String("qt"),
QLatin1String("_"), newDirectory);
bool qtLoaded = qtTranslator->load(locale, QLatin1String("qt"), QLatin1String("_"), newDirectory);
if (!qtLoaded)
qtLoaded = qtTranslator->load(locale, QLatin1String("qt"),
QLatin1String("_"), directory);
qtLoaded = qtTranslator->load(locale, QLatin1String("qt"), QLatin1String("_"), directory);

if (qtLoaded) {
QCoreApplication::instance()->installTranslator(qtTranslator.take());
Expand All @@ -303,6 +304,15 @@ int InstallerBase::run()
} else {
if (translations.isEmpty()) {
foreach (const QLocale locale, QLocale().uiLanguages()) {
// Is this language listed in our allowed languages?
int *languageIndex = std::find(std::begin(allowedLanguages), std::end(allowedLanguages), locale.language());

// If we are using the custom installer and the language is not allowed, skip it
if (isCustomInstaller && languageIndex == std::end(allowedLanguages))
{
continue;
}

QScopedPointer<QTranslator> qtTranslator(new QTranslator(QCoreApplication::instance()));
bool qtLoaded = qtTranslator->load(locale, QLatin1String("qt"),
QLatin1String("_"), newDirectory);
Expand Down
45 changes: 39 additions & 6 deletions src/sdk/translations/ifw_ca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2567,6 +2567,31 @@ S&apos;instal·la el component %1...</translation>
-->


<!--
==============================================================================================
=== | START | QInstaller::PackageManagerGui | ================================================
==============================================================================================
Here we are providing translations for the new installer/uninstaller names.
==============================================================================================
-->
<context>
<name>QInstaller::PackageManagerGui</name>
<message>
<source>EVE Online Launcher Setup</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>EVE Online Uninstaller</source>
<translation type="unfinished"></translation>
</message>
</context>
<!--
==============================================================================================
=== | END | QInstaller::PackageManagerGui | ==================================================
==============================================================================================
-->


<!--
==============================================================================================
=== | START | CustomIntroductionPage | =======================================================
Expand Down Expand Up @@ -2630,8 +2655,8 @@ S&apos;instal·la el component %1...</translation>
<translation>Llest per a desinstal·lar</translation>
</message>
<message>
<source>Setup is now ready to begin removing %1 from your computer.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;The program directory %2 will be deleted completely&lt;/font&gt;, including all content in that directory!</source>
<translation>El programa d&apos;instal·lació està preparat per a començar a eliminar %1 de l&apos;ordinador.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;El directori del programa %2 se suprimirà completament&lt;/font&gt;, incloent tot el contingut d&apos;aquest directori.</translation>
<source>Setup is now ready to begin removing %1 from your computer.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;%2 will be deleted completely&lt;/font&gt;, including all content in that directory!</source>
<translation type="unfinished">El programa d&apos;instal·lació està preparat per a començar a eliminar %1 de l&apos;ordinador.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;El directori del programa %2 se suprimirà completament&lt;/font&gt;, incloent tot el contingut d&apos;aquest directori.</translation>
</message>
<message>
<source>U&amp;pdate</source>
Expand Down Expand Up @@ -2662,17 +2687,17 @@ S&apos;instal·la el component %1...</translation>
<translation>Carpeta d&apos;instal·lació</translation>
</message>
<message>
<source>Please specify the directory where %1 will be installed.</source>
<translation>Especifiqueu el directori en el que s&apos;instal·larà %1.</translation>
<source>Install location:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt+R</source>
<comment>browse file system to choose a file</comment>
<translation>Alt+X</translation>
</message>
<message>
<source>B&amp;rowse...</source>
<translation>E&amp;xplora...</translation>
<source>Change...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The directory you selected already exists and contains an installation. Choose a different target for installation.</source>
Expand Down Expand Up @@ -2740,6 +2765,14 @@ Voleu continuar?</translation>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<source>Update for Universal C Runtime in Windows will be installed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 Required, %2 Available.</source>
<translation type="unfinished"></translation>
</message>
</context>
<!--
==============================================================================================
Expand Down
45 changes: 39 additions & 6 deletions src/sdk/translations/ifw_da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,31 @@ Installerer komponenten %1...</translation>
-->


<!--
==============================================================================================
=== | START | QInstaller::PackageManagerGui | ================================================
==============================================================================================
Here we are providing translations for the new installer/uninstaller names.
==============================================================================================
-->
<context>
<name>QInstaller::PackageManagerGui</name>
<message>
<source>EVE Online Launcher Setup</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>EVE Online Uninstaller</source>
<translation type="unfinished"></translation>
</message>
</context>
<!--
==============================================================================================
=== | END | QInstaller::PackageManagerGui | ==================================================
==============================================================================================
-->


<!--
==============================================================================================
=== | START | CustomIntroductionPage | =======================================================
Expand Down Expand Up @@ -2602,8 +2627,8 @@ Installerer komponenten %1...</translation>
<translation>Klar til afinstallation</translation>
</message>
<message>
<source>Setup is now ready to begin removing %1 from your computer.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;The program directory %2 will be deleted completely&lt;/font&gt;, including all content in that directory!</source>
<translation>Opsætningen er nu klar til at begynde fjernelsen af %1 fra din computer.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;Programmappen %2 slettes fuldstændigt&lt;/font&gt;, inklusiv alt indhold i mappen!</translation>
<source>Setup is now ready to begin removing %1 from your computer.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;%2 will be deleted completely&lt;/font&gt;, including all content in that directory!</source>
<translation type="unfinished">Opsætningen er nu klar til at begynde fjernelsen af %1 fra din computer.&lt;br&gt;&lt;font color=&quot;red&quot;&gt;Programmappen %2 slettes fuldstændigt&lt;/font&gt;, inklusiv alt indhold i mappen!</translation>
</message>
<message>
<source>U&amp;pdate</source>
Expand Down Expand Up @@ -2658,17 +2683,17 @@ Installerer komponenten %1...</translation>
<translation>Installationsmappe</translation>
</message>
<message>
<source>Please specify the directory where %1 will be installed.</source>
<translation>Angiv venligst mappen hvor %1 skal installeres.</translation>
<source>Install location:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Alt+R</source>
<comment>browse file system to choose a file</comment>
<translation>Alt+G</translation>
</message>
<message>
<source>B&amp;rowse...</source>
<translation>&amp;Gennemse...</translation>
<source>Change...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The directory you selected already exists and contains an installation. Choose a different target for installation.</source>
Expand Down Expand Up @@ -2736,6 +2761,14 @@ Vil du fortsætte?</translation>
<source>Error</source>
<translation>Fejl</translation>
</message>
<message>
<source>Update for Universal C Runtime in Windows will be installed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>%1 Required, %2 Available.</source>
<translation type="unfinished"></translation>
</message>
</context>
<!--
==============================================================================================
Expand Down
Loading

0 comments on commit b26fb5c

Please sign in to comment.