def OnButton4(self, widget, data): dialog = gtk.Dialog(title="Preferences", flags=gtk.DIALOG_MODAL) # Accessibility status setup hbox = gtk.HBox() dialog.vbox.pack_start(hbox) label = gtk.Label('accessibility status: ') hbox.pack_start(label, False, False, 0) label1 = gtk.Label('') hbox.pack_start(label1, False, False, 10) acc_button = gtk.Button('Enabled') hbox.pack_start(acc_button, True, True, 10) acc_status = e.acc_status() label1.set_label(acc_status) if acc_status == 'true': acc_button.set_sensitive(False) def OnAccButton(widget, data): e.acc_active('true') if e.acc_status() == 'true': label1.set_label('true') acc_button.set_sensitive(False) acc_button.connect('clicked', OnAccButton, 'Enabled') # at-spi-registryd process setup hbox1 = gtk.HBox() dialog.vbox.pack_start(hbox1) label = gtk.Label('at-spi-registryd process: ') hbox1.pack_start(label, False, False, 0) label2 = gtk.Label('') hbox1.pack_start(label2, False, False, 10) spi_button = gtk.Button('Enabled') hbox1.pack_start(spi_button, True, True, 10) spi_status = e.spi_status() label2.set_label(spi_status) if spi_status == 'running': spi_button.set_sensitive(False) def OnSpiButton(widget, data): e.spi_active() if e.spi_status() == 'running': label2.set_label('running') spi_button.set_sensitive(False) spi_button.connect('clicked', OnSpiButton, 'Enabled') dialog.add_button("Close", gtk.RESPONSE_CLOSE) dialog.set_border_width(20) dialog.show_all() dialog.run() dialog.destroy()
def OnAccButton(widget, data): e.acc_active('true') if e.acc_status() == 'true': label1.set_label('true') acc_button.set_sensitive(False)