#!/usr/bin/env python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk # Esta classe armazena as funcoes que sao executadas # quando o usuario interage com os componentes da GUI class Handler: def onDeleteWindow(self, *args): Gtk.main_quit(*args) def onToggleLocalFamilyShield(self, switch, args): if(switch.get_active()): print("Family Shield ligado localmente") else: print("Family Shield desligado localmente") def onToggleNetworkFamilyShield(self, switch, args): if(switch.get_active()): print("Family Shield ligado na rede") else: print("Family Shield desligado na rede") def onEpoptesButtonPressed(self, button): print("Botao Epoptes pressionado!") def onToggleAutoupgrade(self, switch, args): if(switch.get_active()): print("le-autoupgrade ligado") else: print("le-autoupgrade desligado") def onSharedFolderButtonPressed(self, button): print("Botao Pasta compartilhada pressionado!") def onToggleEdubarP2P(self, switch, args): if(switch.get_active()): print("P2P ligado") else: print("P2P desligado") if __name__ == "__main__": builder = Gtk.Builder() builder.add_from_file("le-control-panel.glade") builder.connect_signals(Handler()) window = builder.get_object("mainwindow") window.show_all() Gtk.main()