mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
re-addded connection text
CL-541
This commit is contained in:
parent
06f35096ad
commit
1986677276
4 changed files with 27 additions and 4 deletions
|
@ -41,6 +41,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
# # Signal to indicate that the hotend of the active printer on the remote changed.
|
# # Signal to indicate that the hotend of the active printer on the remote changed.
|
||||||
hotendIdChanged = pyqtSignal()
|
hotendIdChanged = pyqtSignal()
|
||||||
|
|
||||||
|
# Signal to indicate that the info text about the connection has changed.
|
||||||
|
connectionTextChanged = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, device_id, parent = None):
|
def __init__(self, device_id, parent = None):
|
||||||
super().__init__(device_id = device_id, parent = parent)
|
super().__init__(device_id = device_id, parent = parent)
|
||||||
|
|
||||||
|
@ -65,11 +68,21 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
self._connection_state = ConnectionState.closed
|
self._connection_state = ConnectionState.closed
|
||||||
|
|
||||||
self._address = ""
|
self._address = ""
|
||||||
|
self._connection_text = ""
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, notify = connectionTextChanged)
|
||||||
def address(self):
|
def address(self):
|
||||||
return self._address
|
return self._address
|
||||||
|
|
||||||
|
def setConnectionText(self, connection_text):
|
||||||
|
if self._connection_text != connection_text:
|
||||||
|
self._connection_text = connection_text
|
||||||
|
self.connectionTextChanged.emit()
|
||||||
|
|
||||||
|
@pyqtProperty(str, constant=True)
|
||||||
|
def connectionText(self):
|
||||||
|
return self._connection_text
|
||||||
|
|
||||||
def materialHotendChangedMessage(self, callback):
|
def materialHotendChangedMessage(self, callback):
|
||||||
Logger.log("w", "materialHotendChangedMessage needs to be implemented, returning 'Yes'")
|
Logger.log("w", "materialHotendChangedMessage needs to be implemented, returning 'Yes'")
|
||||||
callback(QMessageBox.Yes)
|
callback(QMessageBox.Yes)
|
||||||
|
|
|
@ -69,6 +69,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print over network"))
|
self.setShortDescription(i18n_catalog.i18nc("@action:button Preceded by 'Ready to'.", "Print over network"))
|
||||||
self.setDescription(i18n_catalog.i18nc("@properties:tooltip", "Print over network"))
|
self.setDescription(i18n_catalog.i18nc("@properties:tooltip", "Print over network"))
|
||||||
|
|
||||||
|
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network"))
|
||||||
|
|
||||||
self._printer_uuid_to_unique_name_mapping = {}
|
self._printer_uuid_to_unique_name_mapping = {}
|
||||||
|
|
||||||
self._finished_jobs = []
|
self._finished_jobs = []
|
||||||
|
|
|
@ -78,10 +78,16 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
|
|
||||||
def _onAuthenticationStateChanged(self):
|
def _onAuthenticationStateChanged(self):
|
||||||
# We only accept commands if we are authenticated.
|
# We only accept commands if we are authenticated.
|
||||||
|
self._setAcceptsCommands(self._authentication_state == AuthState.Authenticated)
|
||||||
|
|
||||||
if self._authentication_state == AuthState.Authenticated:
|
if self._authentication_state == AuthState.Authenticated:
|
||||||
self._setAcceptsCommands(True)
|
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network."))
|
||||||
else:
|
elif self._authentication_state == AuthState.AuthenticationRequested:
|
||||||
self._setAcceptsCommands(False)
|
self.setConnectionText(i18n_catalog.i18nc("@info:status",
|
||||||
|
"Connected over the network. Please approve the access request on the printer."))
|
||||||
|
elif self._authentication_state == AuthState.AuthenticationDenied:
|
||||||
|
self.setConnectionText(i18n_catalog.i18nc("@info:status", "Connected over the network. No access to control the printer."))
|
||||||
|
|
||||||
|
|
||||||
def _setupMessages(self):
|
def _setupMessages(self):
|
||||||
self._authentication_requested_message = Message(i18n_catalog.i18nc("@info:status",
|
self._authentication_requested_message = Message(i18n_catalog.i18nc("@info:status",
|
||||||
|
|
|
@ -80,6 +80,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
self._firmware_progress = 0
|
self._firmware_progress = 0
|
||||||
self._firmware_update_state = FirmwareUpdateState.idle
|
self._firmware_update_state = FirmwareUpdateState.idle
|
||||||
|
|
||||||
|
self.setConnectionText(catalog.i18nc("@info:status", "Connected via USB"))
|
||||||
|
|
||||||
# Queue for commands that need to be send. Used when command is sent when a print is active.
|
# Queue for commands that need to be send. Used when command is sent when a print is active.
|
||||||
self._command_queue = Queue()
|
self._command_queue = Queue()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue