Exemplo n.º 1
0
    def __init__(self, progress_items):
        self.dialog = gtk.Dialog(
            "Connection scanner progress",
            flags=gtk.DIALOG_MODAL,
            buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK,
                     gtk.RESPONSE_OK),
        )
        ChildProcessDialog.__init__(self, self.dialog,
                                    self.dialog.action_area.get_children())

        table = gtk.Table(
            len(progress_items),
            2,
        )
        self.progress_bars = {}
        for index, (label, name) in enumerate(progress_items):
            l = gtk.Label("%s:" % name)
            l.set_alignment(0.0, 0.5)
            table.attach(l, 0, 1, index, index + 1)
            pb = gtk.ProgressBar()
            self.progress_bars[label] = pb
            table.attach(pb, 1, 2, index, index + 1)

        table.set_border_width(6)
        table.set_row_spacings(6)
        table.set_col_spacings(6)
        table.show_all()

        self.clear_gui()
        self.dialog.vbox.pack_start(table, expand=True, fill=True)
Exemplo n.º 2
0
 def __init__(self):
     GladeWrapper.__init__(self, "plugins/builder/gui.glade", "di_optimize",
                           "dialog")
     ChildProcessDialog.__init__(self, self.dialog,
                                 self.dialog.action_area.get_children())
     self.init_callbacks(OptimizationReportDialog)
     self.init_proxies(["la_num_iter", "la_rms_error", "progress_bar"])
     self.state_indices = None
Exemplo n.º 3
0
    def run(self, minimize, involved_frames, update_interval, update_steps,
            num_springs):
        self.la_num_iter.set_text("0")
        self.la_rms_error.set_text(express_measure(0.0, "Length"))
        self.progress_bar.set_fraction(0.0)
        self.progress_bar.set_text("0%")
        self.minimize = minimize
        self.involved_frames = [
            frame for frame in involved_frames if frame is not None
        ]
        self.update_interval = update_interval
        self.update_steps = update_steps
        self.num_springs = num_springs

        self.last_time = time.time()
        self.last_step = 0
        self.status = None

        result = ChildProcessDialog.run(
            self, [context.get_share_filename("helpers/iterative")],
            self.minimize,
            pickle=True)

        # just to avoid confusion
        del self.minimize
        del self.involved_frames
        del self.update_interval
        del self.update_steps
        del self.last_time
        del self.last_step
        del self.num_springs
        del self.status

        return result
Exemplo n.º 4
0
    def run(self, minimize, auto_close, involved_frames, update_interval, update_steps, num_springs):
        self.la_num_iter.set_text("0")
        self.la_rms_error.set_text(express_measure(0.0, "Length"))
        self.progress_bar.set_fraction(0.0)
        self.progress_bar.set_text("0%")
        self.minimize = minimize
        self.involved_frames = [frame for frame in involved_frames if frame is not None]
        self.update_interval = update_interval
        self.update_steps = update_steps
        self.num_springs = num_springs

        self.last_time = time.time()
        self.last_step = 0
        self.status = None

        result = ChildProcessDialog.run(self,
            [context.get_share_filename("helpers/iterative")],
            self.minimize, auto_close, pickle=True
        )

        # just to avoid confusion
        del self.minimize
        del self.involved_frames
        del self.update_interval
        del self.update_steps
        del self.last_time
        del self.last_step
        del self.num_springs
        del self.status

        return result
Exemplo n.º 5
0
 def run(self, inp):
     self.clear_gui()
     self.connections = []
     response = ChildProcessDialog.run(
         self, [context.get_share_filename("helpers/conscan")],
         inp,
         pickle=True)
     if response == gtk.RESPONSE_OK:
         result = self.connections
         del self.connections
         return result
Exemplo n.º 6
0
 def run(self, inp):
     self.clear_gui()
     self.connections = []
     response = ChildProcessDialog.run(self,
         [context.get_share_filename("helpers/conscan")],
         inp, pickle=True
     )
     if response == gtk.RESPONSE_OK:
         result = self.connections
         del self.connections
         return result
Exemplo n.º 7
0
    def __init__(self, progress_items):
        self.dialog = gtk.Dialog(
            "Connection scanner progress", flags=gtk.DIALOG_MODAL,
            buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK),
        )
        ChildProcessDialog.__init__(self, self.dialog, self.dialog.action_area.get_children())

        table = gtk.Table(len(progress_items), 2, )
        self.progress_bars = {}
        for index, (label, name) in enumerate(progress_items):
            l = gtk.Label("%s:" % name)
            l.set_alignment(0.0, 0.5)
            table.attach(l, 0, 1, index, index+1)
            pb = gtk.ProgressBar()
            self.progress_bars[label] = pb
            table.attach(pb, 1, 2, index, index+1)

        table.set_border_width(6)
        table.set_row_spacings(6)
        table.set_col_spacings(6)
        table.show_all()

        self.clear_gui()
        self.dialog.vbox.pack_start(table, expand=True, fill=True)
Exemplo n.º 8
0
 def on_done(self):
     ChildProcessDialog.on_done(self)
     self.update_gui()
Exemplo n.º 9
0
 def on_done(self):
     ChildProcessDialog.on_done(self)
     self.update_gui()
Exemplo n.º 10
0
 def __init__(self):
     GladeWrapper.__init__(self, "plugins/builder/gui.glade", "di_optimize", "dialog")
     ChildProcessDialog.__init__(self, self.dialog, self.dialog.action_area.get_children())
     self.init_callbacks(OptimizationReportDialog)
     self.init_proxies(["la_num_iter", "la_rms_error", "progress_bar"])
     self.state_indices = None