Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ruff == 0.14.*
moto == 5.*
jsondiff == 2.*
pyinstrument == 5.*
pytest-qt == 4.*
PySide6-essentials >= 6.6, < 6.11
# MCP (Model Context Protocol) library for MCP unit tests
mcp >= 1.13.0; python_version >= '3.10'
# OpenJD model library for job template parsing in mock backend
Expand Down
6 changes: 5 additions & 1 deletion src/deadline/client/ui/cli_job_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def show_cli_job_submitter(parent: Optional[QWidget] = None, f=Qt.WindowFlags())
if parent is None:
# Get the main application window so we can parent ours to it
app = QApplication.instance()
parent = [widget for widget in app.topLevelWidgets() if isinstance(widget, QMainWindow)][0] # type: ignore[union-attr]
if app:
main_windows = [
widget for widget in app.topLevelWidgets() if isinstance(widget, QMainWindow)
]
parent = main_windows[0] if main_windows else None

def on_create_job_bundle_callback(
widget: SubmitJobToDeadlineDialog,
Expand Down
311 changes: 2 additions & 309 deletions src/deadline/client/ui/dialogs/deadline_config_dialog.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/deadline/client/ui/dialogs/deadline_login_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ def on_button_clicked(self, button):
# Tell the login thread to cancel, then wait for it.
self.canceled = True
if self.__login_thread:
app = QApplication.instance()
while self.__login_thread.is_alive():
QApplication.instance().processEvents() # type: ignore[union-attr]
if app:
app.processEvents()

def exec_(self) -> bool:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class SubmitJobProgressDialog(QDialog):

# This signal is sent when the background thread succeeds.
submission_thread_succeeded = Signal(str)
progress_window_closed = Signal(None)
progress_window_closed = Signal()

job_id: Optional[str] = None

Expand Down Expand Up @@ -325,8 +325,10 @@ def closeEvent(self, event: QCloseEvent) -> None:
logger.info("Canceling submission...")
self.status_label.setText(tr("Canceling submission..."))
if self.__submission_thread is not None:
app = QApplication.instance()
while self.__submission_thread.is_alive():
QApplication.instance().processEvents() # type: ignore[union-attr]
if app:
app.processEvents()
super().closeEvent(event)

def exec_(self) -> Optional[str]: # type: ignore[override]
Expand Down
13 changes: 11 additions & 2 deletions src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(
attachments: AssetReferences,
on_create_job_bundle_callback: OnCreateJobBundleCallback,
parent: Optional[QWidget] = None,
f: Qt.WindowFlags = Qt.WindowFlags(),
f=Qt.WindowFlags(),
show_host_requirements_tab: bool = False,
host_requirements: Optional[HostRequirements] = None,
submitter_info: Optional[SubmitterInfo] = None,
Expand Down Expand Up @@ -225,6 +225,13 @@ def _build_ui(
self.deadline_authentication_status.api_availability_changed.connect(
self.refresh_deadline_settings
)
# Note: we intentionally do NOT connect deadline_config_changed here.
# Farm/queue/storage profile changes in DeadlineCloudSettingsWidget call
# set_setting() which writes to disk, triggering the QFileSystemWatcher.
# If we connected deadline_config_changed → refresh_deadline_settings,
# every selection change would trigger the full refresh cascade twice
# (once synchronously via _notify_parent_refresh, once asynchronously
# via the file watcher). The synchronous path is sufficient.

# Refresh the submit button enable state once queue parameter status changes
self.shared_job_settings.valid_parameters.connect(self._set_submit_button_state)
Expand Down Expand Up @@ -554,7 +561,9 @@ def on_submit(self):
job_progress_dialog.progress_window_closed.connect(self._close_event_receiver)
job_progress_dialog.setModal(True)
job_progress_dialog.show()
QApplication.instance().processEvents() # type: ignore[union-attr]
app = QApplication.instance()
if app:
app.processEvents()

# Submit the job
try:
Expand Down
4 changes: 2 additions & 2 deletions src/deadline/client/ui/job_bundle_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def show_job_bundle_submitter(
app = QApplication.instance()
main_windows = [
widget
for widget in app.topLevelWidgets()
if isinstance(widget, QMainWindow) # type: ignore[union-attr]
for widget in (app.topLevelWidgets() if app else [])
if isinstance(widget, QMainWindow)
]
if main_windows:
parent = main_windows[0]
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Standard-Farm",
"Default queue": "Standard-Warteschlange",
"Default storage profile": "Standard-Speicherprofil",
"Storage profile": "Speicherprofil",
"Delete": "Löschen",
"Description": "Beschreibung",
"Do not ask again": "Nicht erneut fragen",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Default farm",
"Default queue": "Default queue",
"Default storage profile": "Default storage profile",
"Storage profile": "Storage profile",
"Delete": "Delete",
"Description": "Description",
"Do not ask again": "Do not ask again",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Granja predeterminada",
"Default queue": "Cola predeterminada",
"Default storage profile": "Perfil de almacenamiento predeterminado",
"Storage profile": "Perfil de almacenamiento",
"Delete": "Eliminar",
"Description": "Descripción",
"Do not ask again": "No volver a preguntar",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Ferme par défaut",
"Default queue": "File d'attente par défaut",
"Default storage profile": "Profil de stockage par défaut",
"Storage profile": "Profil de stockage",
"Delete": "Supprimer",
"Description": "Description",
"Do not ask again": "Ne plus demander",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/id_ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Peternakan default",
"Default queue": "Antrian default",
"Default storage profile": "Profil penyimpanan default",
"Storage profile": "Profil penyimpanan",
"Delete": "Hapus",
"Description": "Deskripsi",
"Do not ask again": "Jangan tanya lagi",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Farm predefinita",
"Default queue": "Coda predefinita",
"Default storage profile": "Profilo di archiviazione predefinito",
"Storage profile": "Profilo di archiviazione",
"Delete": "Elimina",
"Description": "Descrizione",
"Do not ask again": "Non chiedere più",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "デフォルトファーム",
"Default queue": "デフォルトキュー",
"Default storage profile": "デフォルトストレージプロファイル",
"Storage profile": "ストレージプロファイル",
"Delete": "削除",
"Description": "説明",
"Do not ask again": "今後表示しない",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "기본 팜",
"Default queue": "기본 대기열",
"Default storage profile": "기본 스토리지 프로필",
"Storage profile": "스토리지 프로필",
"Delete": "삭제",
"Description": "설명",
"Do not ask again": "다시 묻지 않음",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Fazenda padrão",
"Default queue": "Fila padrão",
"Default storage profile": "Perfil de armazenamento padrão",
"Storage profile": "Perfil de armazenamento",
"Delete": "Excluir",
"Description": "Descrição",
"Do not ask again": "Não perguntar novamente",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/tr_TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "Varsayılan farm",
"Default queue": "Varsayılan kuyruk",
"Default storage profile": "Varsayılan depolama profili",
"Storage profile": "Depolama profili",
"Delete": "Sil",
"Description": "Açıklama",
"Do not ask again": "Bir daha sorma",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "默认服务器农场",
"Default queue": "默认队列",
"Default storage profile": "默认存储配置文件",
"Storage profile": "存储配置文件",
"Delete": "删除",
"Description": "描述",
"Do not ask again": "不再询问",
Expand Down
1 change: 1 addition & 0 deletions src/deadline/client/ui/translations/locales/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"Default farm": "預設伺服器陣列",
"Default queue": "預設佇列",
"Default storage profile": "預設儲存設定檔",
"Storage profile": "儲存設定檔",
"Delete": "刪除",
"Description": "描述",
"Do not ask again": "不要再詢問",
Expand Down
2 changes: 1 addition & 1 deletion src/deadline/client/ui/widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from .openjd_parameters_widget import OpenJDParametersWidget
from .path_widgets import DirectoryPickerWidget, InputFilePickerWidget, OutputFilePickerWidget
from .shared_job_settings_tab import (
DeadlineCloudSettingsWidget,
SharedJobSettingsWidget,
SharedJobPropertiesWidget,
DeadlineCloudSettingsWidget,
)
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def showEvent(self, event):
"""
Override showEvent to position the menu to the right of the parent button.
"""
if self.parent():
parent_top_right = self.parent().mapToGlobal(self.parent().rect().topRight())
parent_widget = self.parent()
if isinstance(parent_widget, QWidget):
parent_top_right = parent_widget.mapToGlobal(parent_widget.rect().topRight())
self.move(parent_top_right.x(), parent_top_right.y())

super().showEvent(event)
Expand Down Expand Up @@ -403,4 +404,4 @@ def _apply_ui_state(self, config: AuthenticationStateConfig) -> None:
if any(action.isVisible() for action in self._auth_menu.actions()):
self._profile_button.setMenu(self._auth_menu)
else:
self._profile_button.setMenu(None)
self._profile_button.setMenu(None) # type: ignore[arg-type]
Loading
Loading