Eject message is now hidden when eject is done

CURA-2200
This commit is contained in:
Jaime van Kessel 2016-08-26 16:23:23 +02:00
parent fcfbf78f9e
commit 7a7b634108
2 changed files with 4 additions and 3 deletions

View file

@ -99,7 +99,7 @@ class RemovableDriveOutputDevice(OutputDevice):
self._writing = False self._writing = False
self.writeFinished.emit(self) self.writeFinished.emit(self)
if job.getResult(): if job.getResult():
message = Message(catalog.i18nc("@info:status", "Saved to Removable Drive {0} as {1}").format(self.getName(), os.path.basename(job.getFileName())), lifetime = 0) message = Message(catalog.i18nc("@info:status", "Saved to Removable Drive {0} as {1}").format(self.getName(), os.path.basename(job.getFileName())))
message.addAction("eject", catalog.i18nc("@action:button", "Eject"), "eject", catalog.i18nc("@action", "Eject removable device {0}").format(self.getName())) message.addAction("eject", catalog.i18nc("@action:button", "Eject"), "eject", catalog.i18nc("@action", "Eject removable device {0}").format(self.getName()))
message.actionTriggered.connect(self._onActionTriggered) message.actionTriggered.connect(self._onActionTriggered)
message.show() message.show()
@ -112,5 +112,5 @@ class RemovableDriveOutputDevice(OutputDevice):
def _onActionTriggered(self, message, action): def _onActionTriggered(self, message, action):
if action == "eject": if action == "eject":
Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("RemovableDriveOutputDevice").ejectDevice(self) if Application.getInstance().getOutputDeviceManager().getOutputDevicePlugin("RemovableDriveOutputDevice").ejectDevice(self):
message.hide()

View file

@ -51,6 +51,7 @@ class RemovableDrivePlugin(OutputDevicePlugin):
else: else:
message = Message(catalog.i18nc("@info:status", "Failed to eject {0}. Maybe it is still in use?").format(device.getName())) message = Message(catalog.i18nc("@info:status", "Failed to eject {0}. Maybe it is still in use?").format(device.getName()))
message.show() message.show()
return result
def performEjectDevice(self, device): def performEjectDevice(self, device):
raise NotImplementedError() raise NotImplementedError()