Bug 1401649 - Add support for 'firefox-l10n' app to GUI

This commit is contained in:
Ian Moody 2020-06-14 22:08:20 +01:00 коммит произвёл KwanEsq
Родитель 857396929e
Коммит 0e75241dbc
3 изменённых файлов: 43 добавлений и 3 удалений

Просмотреть файл

@ -1,7 +1,7 @@
from PySide2.QtCore import QObject, QThread, QTimer, Signal, Slot
from mozregression.download_manager import BuildDownloadManager
from mozregression.errors import LauncherError
from mozregression.errors import LauncherError, MozRegressionError
from mozregression.network import get_http_session
from mozregression.persist_limit import PersistLimit
from mozregression.telemetry import UsageMetrics, send_telemetry_ping
@ -154,6 +154,13 @@ class AbstractBuildRunner(QObject):
if options.get("url") and fetch_config.app_name != "thunderbird":
launcher_kwargs["cmdargs"] += [options["url"]]
# Lang only works for firefox-l10n
if options.get("lang"):
if options["application"] == "firefox-l10n":
fetch_config.set_lang(options["lang"])
else:
raise MozRegressionError("Invalid lang argument")
self.worker = self.worker_class(fetch_config, self.test_runner, self.download_manager)
# Move self.bisector in the thread. This will
# allow to the self.bisector slots (connected after the move)

Просмотреть файл

@ -59,7 +59,7 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="repository_label">
<property name="toolTip">
<string>you can choose a specific repository name here</string>
</property>
@ -79,6 +79,26 @@
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lang_label">
<property name="toolTip">
<string>enter the code of the lang you want a build for</string>
</property>
<property name="text">
<string>Lang</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lang">
<property name="toolTip">
<string>Lang code such as he, ar, zh-TW</string>
</property>
<property name="placeholderText">
<string>The lang code (e.g. de)</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="url_label">
<property name="toolTip">
<string>enter a URL to pass to the app</string>
@ -88,7 +108,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLineEdit" name="url">
<property name="toolTip">
<string>URL such as example.org, https://mozilla.org, about:logo</string>

Просмотреть файл

@ -61,6 +61,7 @@ class IntroPage(WizardPage):
"bits": "bits_combo",
"arch": "arch_combo",
"build_type": "build_type",
"lang": "lang",
"url": "url",
}
@ -147,6 +148,18 @@ class IntroPage(WizardPage):
self.ui.url.show()
self.ui.url_label.show()
# lang only makes sense for firefox-l10n, and repo doesn't
if app_name == "firefox-l10n":
self.ui.lang.setEnabled(True)
self.ui.lang_label.setEnabled(True)
self.ui.repository.setDisabled(True)
self.ui.repository_label.setDisabled(True)
else:
self.ui.lang.setDisabled(True)
self.ui.lang_label.setDisabled(True)
self.ui.repository.setEnabled(True)
self.ui.repository_label.setEnabled(True)
def validatePage(self):
app_name = self.fetch_config.app_name
launcher_class = LAUNCHER_REGISTRY.get(app_name)