def sync(self): self.dialog = Dialog_Loading(self) self.dialog.show() thr = threading.Thread(target=partial(self.do_sync, self.dialog)) thr.start() while True: thr.join(0.1) if thr.is_alive(): QtGui.QApplication.processEvents() self.dialog.repaint() self.dialog.update() else: self.dialog.hide() break
def sync (self): dialog = Dialog_Loading(self) dialog.show() dialog.message.setText("Retrieving messages ...") thr = threading.Thread(target=self.do_sync) thr.start() while True: thr.join(0.1) if thr.is_alive(): QtGui.QApplication.processEvents() dialog.repaint() dialog.update() else: dialog.hide() break
def __init__ (self, profile): self.config = profile['config']['receiver'] self.connector = None self.dialog = Dialog_Loading(self) self.dialog.show() thr = threading.Thread(target=partial(self.create_connection, profile, self.dialog)) thr.start() while True: thr.join(0.1) if thr.is_alive(): QtGui.QApplication.processEvents() self.dialog.repaint() self.dialog.update() else: self.dialog.hide() break
def accept (self): if not self.input_To.text().strip(): QMessageBox(QMessageBox.Critical, "Error", "You have to specify a recipient.").exec_() return to = self.input_To.text().strip() subject = self.input_Subject.text().strip() content = self.editor.getEditorHtml().strip() dialog = Dialog_Loading(self) dialog.message.setText("Sending e-mail ...") dialog.show() thr = threading.Thread(target=partial(self.parent.sendbox.send, to, subject, content)) thr.start() while True: thr.join(0.1) if thr.is_alive(): QtGui.QApplication.processEvents() dialog.repaint() dialog.update() else: dialog.hide() break self.close()