def __init__(self): ui.Window.__init__(self) self.set_title(_("Progress")) self.globalbox = ui.VBox() self.nextupdate = 0 self.fmax_max = 1.0 # Scaling deformation progress frame self.scalebox = ui.VBox() self.scaleframe = ui.Frame(_("Scaling deformation:")) vbox = ui.VBox() self.scaleframe.add(vbox) pack(self.scalebox, [self.scaleframe]) pack(self.scalebox, ui.Label("")) self.label_scale_stepno_format = _("Step number %s of %s.") self.label_scale_stepno = ui.Label(self.label_scale_stepno_format % ("-", "-")) pack(vbox, [self.label_scale_stepno]) self.scale_progress = ui.ProgressBar() self.scale_progress.modify_bg(ui.STATE_PRELIGHT, '#00AA00') pack(vbox, [self.scale_progress]) vbox.show() self.scaleframe.show() self.globalbox.pack_start(self.scalebox) # Minimization progress frame self.minbox = ui.VBox() # Box containing frame and spacing self.minframe = ui.Frame(_("Energy minimization:")) vbox = ui.VBox() # Box containing the frames content. self.minframe.add(vbox) pack(self.minbox, [self.minframe]) pack(self.minbox, ui.Label("")) self.label_min_stepno = ui.Label("-") pack(vbox, [ui.Label(_("Step number: ")), self.label_min_stepno]) lbl = ui.Label() lbl.set_markup(_("F<sub>max</sub>: ")) self.minimize_progress = ui.ProgressBar() pack(vbox, [lbl, self.minimize_progress]) self.label_min_fmax = ui.Label("-") lbl = ui.Label() lbl.set_markup(_("Convergence criterion: F<sub>max</sub> = ")) pack(vbox, [lbl, self.label_min_fmax]) self.label_min_maxsteps = ui.Label("-") pack(vbox, [ui.Label(_("Max. number of steps: ")), self.label_min_maxsteps]) vbox.show() self.minframe.show() self.globalbox.pack_start(self.minbox) self.globalbox.show() self.add(self.globalbox) # Make the cancel button self.cancelbut = ui.Button('Cancel') self.cancelbut.connect('clicked', self.cancel) pack(self.globalbox, [self.cancelbut], end=True, bottom=True)
def packimageselection(self, outerbox, txt1=_(" (rerun simulation)"), txt2=_(" (continue simulation)")): "Make the frame for selecting starting config if more than one." self.startframe = ui.Frame(_("Select starting configuration:")) pack(outerbox, [self.startframe]) vbox = ui.VBox() self.startframe.add(vbox) vbox.show() self.numconfig_format = _("There are currently %i " "configurations loaded.") self.numconfig_label = ui.Label("") pack(vbox, [self.numconfig_label]) lbl = ui.Label( _("Choose which one to use as the " "initial configuration")) pack(vbox, [lbl]) self.start_radio_first = ui.RadioButton( None, _("The first configuration %s.") % txt1) pack(vbox, [self.start_radio_first]) self.start_radio_nth = ui.RadioButton(self.start_radio_first, _("Configuration number ")) self.start_nth_adj = ui.Adjustment(0, 0, 1, 1) self.start_nth_spin = ui.SpinButton(self.start_nth_adj, 0, 0) self.start_nth_spin.set_sensitive(False) pack(vbox, [self.start_radio_nth, self.start_nth_spin]) self.start_radio_last = ui.RadioButton( self.start_radio_first, _("The last configuration %s.") % txt2) self.start_radio_last.set_active(True) pack(vbox, self.start_radio_last) self.start_radio_nth.connect("toggled", self.start_radio_nth_toggled) self.setupimageselection()
def packtext(self, vbox, text, label=None): "Pack an text frame into the window." pack(vbox, ui.Label("")) txtframe = ui.Frame(label) txtlbl = ui.Label(text) txtframe.add(txtlbl) txtlbl.show() pack(vbox, txtframe) pack(vbox, ui.Label(""))
def makeoutputfield(self, box, label=_("Output:"), heading=None): frame = ui.Frame(label) if box is not None: box.pack_start(frame, True, True, 0) box2 = ui.VBox() frame.add(box2) if heading is not None: pack(box2, [ui.Label(heading)]) scrwin = ui.ScrolledWindow() scrwin.set_policy(ui.POLICY_AUTOMATIC, ui.POLICY_AUTOMATIC) self.output = ui.TextBuffer() txtview = ui.TextView(self.output) txtview.set_editable(False) scrwin.add(txtview) scrwin.show_all() box2.pack_start(scrwin, True, True, 0) self.savebutton = ui.Button('Save') self.savebutton.connect('clicked', self.saveoutput) self.savebutton.set_sensitive(False) pack(box2, [self.savebutton]) box2.show() frame.show() return frame
def __init__(self): DefaultProgressIndicator.__init__(self) # GPAW progress frame self.gpawframe = ui.Frame("GPAW progress:") vbox = self.gpawvbox = ui.VBox() self.gpawframe.add(vbox) self.table = ui.Table(1, 2) self.tablerows = 0 pack(vbox, self.table) self.status = ui.Label("-") self.tablepack([ui.Label(_("Status: ")), self.status]) self.iteration = ui.Label("-") self.tablepack([ui.Label(_("Iteration: ")), self.iteration]) self.tablepack([ui.Label("")]) lbl = ui.Label() lbl.set_markup(_("log<sub>10</sub>(change):")) self.tablepack([ui.Label(""), lbl]) self.wfs_progress = ui.ProgressBar() self.tablepack([ui.Label(_("Wave functions: ")), self.wfs_progress]) self.dens_progress = ui.ProgressBar() self.tablepack([ui.Label(_("Density: ")), self.dens_progress]) self.energy_progress = ui.ProgressBar() self.tablepack([ui.Label(_("Energy: ")), self.energy_progress]) self.tablepack([ui.Label("")]) self.versionlabel = ui.Label("") self.tablepack([ui.Label(_("GPAW version: ")), self.versionlabel]) self.natomslabel = ui.Label("") self.tablepack([ui.Label(_("Number of atoms: ")), self.natomslabel]) self.memorylabel = ui.Label(_("N/A")) self.tablepack([ui.Label(_("Memory estimate: ")), self.memorylabel]) self.globalbox.pack_start(self.gpawframe) self.gpawframe.show() vbox.show() self.active = False