Add job polish (#63)

* Remove legacy client

* Misc cleanup

* Add message box after submission success / fail

* Use a new is_localhost method to handle localhost not including '.local'

* Code cleanup

* Fix issue where engine browser would think we're downloading forever

* Add message box after submission success / fail

* Use a new is_localhost method to handle localhost not including '.local'

* Code cleanup

* Fix issue where engine browser would think we're downloading forever

* Add pubsub messages to serverproxy_manager.py

* Add resolution, fps and renderer versions to add_job.py

* Add cameras to add_job.py

* Add message box after submission success / fail

* Use a new is_localhost method to handle localhost not including '.local'

* Code cleanup

* Fix issue where engine browser would think we're downloading forever

* Add message box after submission success / fail

* Code cleanup

* Add cameras to add_job.py

* Add dynamic engine options and output format

* Move UI work out of BG threads and add engine presubmission tasks

* Submit dynamic args when creating a new job

* Hide groups and show messagebox after submission

* Choose file when pressing New Job in main window now
This commit is contained in:
2023-11-11 07:35:56 -06:00
committed by GitHub
parent 0271abf705
commit da61bf72f8
15 changed files with 486 additions and 156 deletions

View File

@@ -12,11 +12,12 @@ from PIL import Image
from PyQt6.QtCore import Qt, QByteArray, QBuffer, QIODevice, QThread
from PyQt6.QtGui import QPixmap, QImage, QFont, QIcon
from PyQt6.QtWidgets import QMainWindow, QWidget, QHBoxLayout, QListWidget, QTableWidget, QAbstractItemView, \
QTableWidgetItem, QLabel, QVBoxLayout, QHeaderView, QMessageBox, QGroupBox, QPushButton, QListWidgetItem
QTableWidgetItem, QLabel, QVBoxLayout, QHeaderView, QMessageBox, QGroupBox, QPushButton, QListWidgetItem, \
QFileDialog
from src.api.server_proxy import RenderServerProxy
from src.render_queue import RenderQueue
from src.utilities.misc_helper import get_time_elapsed, resources_dir
from src.utilities.misc_helper import get_time_elapsed, resources_dir, is_localhost
from src.utilities.status_utils import RenderStatus
from src.utilities.zeroconf_server import ZeroconfServer
from .add_job import NewRenderJobForm
@@ -292,7 +293,7 @@ class MainWindow(QMainWindow):
logger.error(f"Error fetching image: {e}")
job_id = self.selected_job_ids()[0] if self.selected_job_ids() else None
local_server = self.current_hostname == socket.gethostname()
local_server = is_localhost(self.current_hostname)
if job_id:
fetch_thread = threading.Thread(target=fetch_preview, args=(job_id,))
@@ -380,11 +381,12 @@ class MainWindow(QMainWindow):
def update_servers(self):
found_servers = list(set(ZeroconfServer.found_hostnames() + self.added_hostnames))
# Always make sure local hostname is first
current_hostname = socket.gethostname()
if found_servers and found_servers[0] != current_hostname:
if current_hostname in found_servers:
found_servers.remove(current_hostname)
found_servers.insert(0, current_hostname)
if found_servers and not is_localhost(found_servers[0]):
for hostname in found_servers:
if is_localhost(hostname):
found_servers.remove(hostname)
found_servers.insert(0, hostname)
break
old_count = self.server_list_view.count()
@@ -555,5 +557,8 @@ class MainWindow(QMainWindow):
raise OSError("Unsupported operating system")
def new_job(self) -> None:
self.new_job_window = NewRenderJobForm()
self.new_job_window.show()
file_name, _ = QFileDialog.getOpenFileName(self, "Select Scene File")
if file_name:
self.new_job_window = NewRenderJobForm(file_name)
self.new_job_window.show()