def run(self): # addFrame(self.dialog) # Need to do this differently if we want it self.dialog.set_position(gtk.WIN_POS_CENTER) self.dialog.show_all() rc = self.dialog.run() if (rc == gtk.RESPONSE_CANCEL or rc == gtk.RESPONSE_NO or rc == gtk.RESPONSE_CLOSE): self.rc = 0 self.dialog.destroy() gtk.main_iteration_do(True)
def setProgress(self, amount, total, speed = 0, secs = 0): if total: i = float(amount) / total else: i = 1 if i > 1: i = 1 if i > self.lastProgress + .01 or i == 1: self.xml.get_widget("progressBar").set_fraction(i) if i == 1: # reset i = 0 # gtk.gdk_flush() while gtk.events_pending(): gtk.main_iteration_do(False) self.lastProgress = i
def setProgress(self, amount, total, speed=0, secs=0): if total: i = float(amount) / total else: i = 1 if i > 1: i = 1 if i > self.lastProgress + .01 or i == 1: self.xml.get_widget("progressBar").set_fraction(i) if i == 1: # reset i = 0 # gtk.gdk_flush() while gtk.events_pending(): gtk.main_iteration_do(False) self.lastProgress = i
def destroy(self): while gtk.events_pending(): gtk.main_iteration_do(False) self.progressWindow.destroy()
def setStatusLabel(self, text): self.xml.get_widget("statusLabel").set_text(text) while gtk.events_pending(): gtk.main_iteration_do(False)
def setLabel(self, text): label = self.xml.get_widget("progressLabel") label.set_text(text) while gtk.events_pending(): gtk.main_iteration_do(False)
def hide(self): self.progressWindow.hide() while gtk.events_pending(): gtk.main_iteration_do(False) del self
def hide(self): self.dialog.hide() self.dialog.destroy() gtk.main_iteration_do(True)