Skip to content
Snippets Groups Projects
Commit 5e74edce authored by André Machado's avatar André Machado
Browse files

SCRUM#273: Add le-control-panel.py

parent a0aa8ada
No related branches found
No related tags found
1 merge request!2Issue/273
Pipeline #
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<object class="GtkWindow" id="mainwindow"> <object class="GtkWindow" id="mainwindow">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="resizable">False</property> <signal name="destroy" handler="onDeleteWindow" swapped="no"/>
<child> <child>
<object class="GtkBox" id="mainbox"> <object class="GtkBox" id="mainbox">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="active">True</property> <property name="active">True</property>
<property name="state">True</property> <property name="state">True</property>
<signal name="state-set" handler="onToggleLocalFamilyShield" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -94,6 +95,7 @@ ...@@ -94,6 +95,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="active">True</property> <property name="active">True</property>
<property name="state">True</property> <property name="state">True</property>
<signal name="state-set" handler="onToggleNetworkFamilyShield" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -203,6 +205,7 @@ ...@@ -203,6 +205,7 @@
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">3</property> <property name="margin_top">3</property>
<property name="margin_bottom">3</property> <property name="margin_bottom">3</property>
<signal name="clicked" handler="onEpoptesButtonPressed" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -278,6 +281,7 @@ ...@@ -278,6 +281,7 @@
<property name="valign">start</property> <property name="valign">start</property>
<property name="active">True</property> <property name="active">True</property>
<property name="state">True</property> <property name="state">True</property>
<signal name="state-set" handler="onToggleAutoupgrade" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -338,6 +342,7 @@ ...@@ -338,6 +342,7 @@
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">start</property> <property name="valign">start</property>
<signal name="clicked" handler="onSharedFolderButtonPressed" swapped="no"/>
</object> </object>
</child> </child>
</object> </object>
...@@ -485,6 +490,7 @@ ...@@ -485,6 +490,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="active">True</property> <property name="active">True</property>
<property name="state">True</property> <property name="state">True</property>
<signal name="state-set" handler="onToggleEdubarP2P" swapped="no"/>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
......
#!/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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment