def doAction(self, confirmed): if not confirmed or confirmed[1] == "abort": return action = confirmed[1] serviceUtil.setServices(self.service_list, self.destinationpath) total, used, free = diskUsage(self.destinationpath) job = serviceUtil.prepareJob() services = job.prepare() required = job.getSizeTotal() if required > free: serviceUtil.clear() text = [] text = _( "On destination data carrier is not enough space available.") if action == "move": text += " " + _("Another %s are required to move the data." ) % (realSize(required - free)) else: text += " " + _("Another %s are required to copy the data." ) % (realSize(required - free)) text += "\r\n\r\n" + _("Destination carrier") text += "\r\n" + _("Free space:") + " " + realSize(free) text += "\r\n" + _("Total size:") + " " + realSize(total) self.session.open(MessageBox, text, MessageBox.TYPE_ERROR) return if len(services) != 0: serviceUtil.clear() text = [] for s in services: print s.getName() text.append(s.getName()) self.session.open( MessageBox, _("Movie(s) are already in the destination directory. Operation cancelled!" ) + "\r\n\r\n" + "\r\n".join(text), MessageBox.TYPE_INFO) return if action == "copy": serviceUtil.copy() elif action == "move": serviceUtil.move() if config.AdvancedMovieSelection.show_move_copy_progress.value: serviceUtil.setCallback(showFinished, self.session) self.session.openWithCallback(self.__doClose, MoveCopyProgress) else: serviceUtil.setCallback(None) self.__doClose()
def doAction(self, confirmed): if not confirmed or confirmed[1] == "abort": return action = confirmed[1] serviceUtil.setServices(self.service_list, self.destinationpath) total, used, free = diskUsage(self.destinationpath) job = serviceUtil.prepareJob() services = job.prepare() required = job.getSizeTotal() if required > free: serviceUtil.clear() text = [] text = _("On destination data carrier is not enough space available.") if action == "move": text += " " + _("Another %s are required to move the data.") % (realSize(required - free)) else: text += " " + _("Another %s are required to copy the data.") % (realSize(required - free)) text += "\r\n\r\n" + _("Destination carrier") text += "\r\n" + _("Free space:") + " " + realSize(free) text += "\r\n" + _("Total size:") + " " + realSize(total) self.session.open(MessageBox, text, MessageBox.TYPE_ERROR) return if len(services) != 0: serviceUtil.clear() text = [] for s in services: print s.getName() text.append(s.getName()) self.session.open(MessageBox, _("Movie(s) are already in the destination directory. Operation cancelled!") + "\r\n\r\n" + "\r\n".join(text), MessageBox.TYPE_INFO) return if action == "copy": serviceUtil.copy() elif action == "move": serviceUtil.move() if config.AdvancedMovieSelection.show_move_copy_progress.value: moveCopyNotifier.start(self.session) self.session.openWithCallback(self.__doClose, MoveCopyProgress) else: self.__doClose()