Improve callback usage
offlate/ui/editor.py
369 | 369 | def save(self): | |
370 | 370 | self.project.save() | |
371 | 371 | ||
372 | - | def send(self): | |
372 | + | def send(self, callback=Interface()): | |
373 | 373 | self.project.save() | |
374 | - | self.project.send(Interface()) | |
374 | + | self.project.send(callback) | |
375 | 375 | ||
376 | 376 | def update(self, callback=Interface()): | |
377 | 377 | self.project.save() | |
… | |||
766 | 766 | self.setGeometry(0, 0, 800, 600) | |
767 | 767 | self.setWindowTitle('Offlate') | |
768 | 768 | ||
769 | - | class UploadRunnable(RunnableCallback): | |
769 | + | class UploadRunnable(RunnableCallback, Interface): | |
770 | 770 | def __init__(self, widget): | |
771 | - | super().__init__() | |
771 | + | Interface.__init__(self) | |
772 | + | RunnableCallback.__init__(self) | |
772 | 773 | self.widget = widget | |
773 | 774 | self.parent = widget | |
774 | 775 | self.signals = RunnableSignals() | |
… | |||
777 | 778 | self.name = self.widget.project.name | |
778 | 779 | ||
779 | 780 | def do_run(self): | |
780 | - | self.widget.send() | |
781 | + | self.widget.send(self) | |
781 | 782 | ||
782 | 783 | def do_finish(self): | |
783 | 784 | self.signals.finished.emit(self.name) | |
784 | 785 | ||
785 | - | class UpdateRunnable(RunnableCallback): | |
786 | + | class UpdateRunnable(RunnableCallback, Interface): | |
786 | 787 | def __init__(self, widget): | |
787 | - | super().__init__() | |
788 | + | Interface.__init__(self) | |
789 | + | RunnableCallback.__init__(self) | |
788 | 790 | self.widget = widget | |
789 | 791 | self.parent = widget | |
790 | 792 | self.signals = RunnableSignals() | |
… | |||
793 | 795 | self.name = self.widget.project.name | |
794 | 796 | ||
795 | 797 | def do_run(self): | |
796 | - | self.widget.update(Interface()) | |
798 | + | self.widget.update(self) | |
797 | 799 | ||
798 | 800 | def do_finish(self): | |
799 | 801 | self.signals.finished.emit(self.name) |