def __init__(self, thread, show_file, parent=None): QProgressDialog.__init__(self, _('Printing, this will take a while, please wait...'), _('&Cancel'), 0, 0, parent) self.show_file = show_file self.setWindowTitle(_('Printing...')) self.setWindowIcon(QIcon(I('print.png'))) self.thread = thread self.timer = t = QTimer(self) t.timeout.connect(self.check) self.canceled.connect(self.do_cancel) t.start(100)
def __init__(self, parent, book_ids, output_format, queue, db, user_recs, args, use_saved_single_settings=True): QProgressDialog.__init__(self, '', None, 0, len(book_ids), parent) self.setWindowTitle(_('Queueing books for bulk conversion')) self.book_ids, self.output_format, self.queue, self.db, self.args, self.user_recs = \ book_ids, output_format, queue, db, args, user_recs self.parent = parent self.use_saved_single_settings = use_saved_single_settings self.i, self.bad, self.jobs, self.changed = 0, [], [], False QTimer.singleShot(0, self.do_book) self.exec_()
def __init__(self, report, parent=None): total = 2 + len(report.name_map) QProgressDialog.__init__( self, _('Losslessly optimizing images, please wait...'), _('&Abort'), 0, total, parent) self.setWindowTitle(self.labelText()) self.setWindowIcon(QIcon(I('lt.png'))) self.setMinimumDuration(0) self.update_signal.connect(self.do_update, type=Qt.ConnectionType.QueuedConnection) self.raw = self.prefix = None self.abort = Event() self.canceled.connect(self.abort.set) self.t = Thread(name='CompressIcons', target=self.run_compress, args=(report, )) self.t.daemon = False self.t.start()