From 30bcb60fc8fd230e8d2b618677996b88a41e2224 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Machado?= <alsm14@inf.ufpr.br>
Date: Wed, 20 Sep 2017 16:39:01 -0300
Subject: [PATCH] SCRUM#273: melhorias na IHC

---
 le-control-panel.glade | 196 +++++++++++++++++++++++++++++++++--------
 le-control-panel.py    |  23 +++++
 2 files changed, 181 insertions(+), 38 deletions(-)

diff --git a/le-control-panel.glade b/le-control-panel.glade
index 0b802ed..89df14e 100644
--- a/le-control-panel.glade
+++ b/le-control-panel.glade
@@ -4,6 +4,8 @@
   <requires lib="gtk+" version="3.12"/>
   <object class="GtkWindow" id="mainwindow">
     <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Painel de Controle do Linux Educacional</property>
+    <property name="resizable">False</property>
     <signal name="destroy" handler="onDeleteWindow" swapped="no"/>
     <child>
       <object class="GtkBox" id="mainbox">
@@ -31,17 +33,32 @@
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
                     <property name="homogeneous">True</property>
+                    <child>
+                      <object class="GtkLabel" id="label16">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;small&gt;Controla os conteúdos que podem ser acessados pelos computadores da rede&lt;/small&gt;</property>
+                        <property name="use_markup">True</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkBox" id="box3">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="tooltip_text" translatable="yes">habilitar o controle parental para este computador</property>
                         <property name="margin_top">3</property>
                         <property name="margin_bottom">3</property>
                         <child>
                           <object class="GtkLabel" id="label6">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Ligar/desligar localmente</property>
+                            <property name="label" translatable="yes">Habilitar localmente</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -68,20 +85,21 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkBox" id="box4">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="tooltip_text" translatable="yes">habilitar o controle parental para todos os computadores da rede</property>
                         <property name="margin_top">3</property>
                         <property name="margin_bottom">3</property>
                         <child>
                           <object class="GtkLabel" id="label7">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Ligar/desligar na rede</property>
+                            <property name="label" translatable="yes">Habilitar na rede</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -108,7 +126,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
@@ -119,7 +137,10 @@
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Family Shield</property>
+                <property name="label" translatable="yes">Controle parental</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
@@ -158,6 +179,21 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel" id="label17">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;small&gt;Ferramenta de gerenciamento de laboratório&lt;/small&gt;</property>
+                        <property name="use_markup">True</property>
+                        <property name="ellipsize">end</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkBox" id="box11">
                         <property name="visible">True</property>
@@ -193,7 +229,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
@@ -210,7 +246,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">False</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
@@ -222,6 +258,9 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Epoptes</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
@@ -256,37 +295,66 @@
                 <property name="can_focus">False</property>
                 <property name="left_padding">12</property>
                 <child>
-                  <object class="GtkBox" id="box5">
+                  <object class="GtkBox" id="box1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="margin_top">3</property>
-                    <property name="margin_bottom">3</property>
+                    <property name="orientation">vertical</property>
                     <child>
-                      <object class="GtkLabel" id="label8">
+                      <object class="GtkLabel" id="label18">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Ligar/desligar</property>
+                        <property name="label" translatable="yes">&lt;small&gt;Atualiza os pacotes do computador diáriamente&lt;/small&gt;</property>
+                        <property name="use_markup">True</property>
+                        <property name="ellipsize">end</property>
+                        <property name="xalign">0</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="fill">True</property>
+                        <property name="fill">False</property>
                         <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkSwitch" id="switch3">
+                      <object class="GtkBox" id="box5">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="halign">end</property>
-                        <property name="valign">start</property>
-                        <property name="active">True</property>
-                        <property name="state">True</property>
-                        <signal name="state-set" handler="onToggleAutoupgrade" swapped="no"/>
+                        <property name="can_focus">False</property>
+                        <property name="tooltip_text" translatable="yes">Habilitar atualização automática dos pacotes do sistema.
+A atualização ocorrerá uma vez por dia</property>
+                        <property name="margin_top">3</property>
+                        <property name="margin_bottom">3</property>
+                        <child>
+                          <object class="GtkLabel" id="label8">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Habilitar</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSwitch" id="switch3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="halign">end</property>
+                            <property name="valign">start</property>
+                            <property name="active">True</property>
+                            <property name="state">True</property>
+                            <signal name="state-set" handler="onToggleAutoupgrade" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="pack_type">end</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="pack_type">end</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
@@ -298,7 +366,10 @@
               <object class="GtkLabel" id="label3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">le-autoupgrade</property>
+                <property name="label" translatable="yes">Sistema de atualização automática</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
@@ -335,14 +406,41 @@
                 <property name="margin_bottom">3</property>
                 <property name="left_padding">12</property>
                 <child>
-                  <object class="GtkButton" id="button1">
-                    <property name="label" translatable="yes">Abrir Pasta compartilhada</property>
+                  <object class="GtkBox" id="box12">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                    <property name="halign">start</property>
-                    <property name="valign">start</property>
-                    <signal name="clicked" handler="onSharedFolderButtonPressed" swapped="no"/>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel" id="label19">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;small&gt;O conteúdo da pasta compartilhada poderá ser acessado pelos alunos&lt;/small&gt;</property>
+                        <property name="use_markup">True</property>
+                        <property name="ellipsize">end</property>
+                        <property name="xalign">0.10000000149011612</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="button1">
+                        <property name="label" translatable="yes">Abrir Pasta compartilhada</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="halign">start</property>
+                        <property name="valign">start</property>
+                        <signal name="clicked" handler="onSharedFolderButtonPressed" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
                   </object>
                 </child>
               </object>
@@ -352,6 +450,9 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Pasta compartilhada</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
@@ -390,10 +491,26 @@
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkLabel" id="label20">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">&lt;small&gt;Gerenciar conteúdos educacionais extraídos do Portal MEC&lt;/small&gt;</property>
+                        <property name="use_markup">True</property>
+                        <property name="ellipsize">end</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkBox" id="box7">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="tooltip_text" translatable="yes">Número de arquivos baixados do Portal MEC para este computador</property>
                         <property name="margin_top">3</property>
                         <property name="margin_bottom">3</property>
                         <child>
@@ -409,10 +526,9 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkLabel" id="label10">
+                          <object class="GtkLabel" id="labelArquivosEdubar">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">'numero de arquivos aqui'</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -425,13 +541,14 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkBox" id="box8">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="tooltip_text" translatable="yes">Espaço de armazenamento utilizado por arquivos baixados do Portal MEC neste computador</property>
                         <property name="margin_top">3</property>
                         <property name="margin_bottom">3</property>
                         <child>
@@ -447,10 +564,9 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkLabel" id="label12">
+                          <object class="GtkLabel" id="labelArmazenamentoEdubar">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">'tamanho do espaço aqui'</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -463,20 +579,21 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkBox" id="box9">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="tooltip_text" translatable="yes">Habilitar compartilhamento de conteúdo educacional na rede P2P</property>
                         <property name="margin_top">3</property>
                         <property name="margin_bottom">3</property>
                         <child>
                           <object class="GtkLabel" id="label13">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Ligar/desligar modo P2P</property>
+                            <property name="label" translatable="yes">Habilitar modo P2P</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -503,7 +620,7 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">2</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                   </object>
@@ -514,7 +631,10 @@
               <object class="GtkLabel" id="label5">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">le-edubar</property>
+                <property name="label" translatable="yes">Conteúdos educacionais</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
             </child>
           </object>
diff --git a/le-control-panel.py b/le-control-panel.py
index 33abbae..3afa8bc 100755
--- a/le-control-panel.py
+++ b/le-control-panel.py
@@ -12,40 +12,63 @@ class Handler:
 
     def onToggleLocalFamilyShield(self, switch, args):
         if(switch.get_active()):
+            # TODO: ativar Family Shield local
             print("Family Shield ligado localmente")
         else:
+            # TODO: desativar Family Shield local
             print("Family Shield desligado localmente")
 
     def onToggleNetworkFamilyShield(self, switch, args):
         if(switch.get_active()):
+            # TODO: ativar Family Shield na rede
             print("Family Shield ligado na rede")
         else:
+            # TODO: desativar Family Shield na rede
             print("Family Shield desligado na rede")
 
     def onEpoptesButtonPressed(self, button):
+        # TODO: abrir Epoptes
         print("Botao Epoptes pressionado!")
 
     def onToggleAutoupgrade(self, switch, args):
         if(switch.get_active()):
+            # TODO: ativar le-autoupgrade
             print("le-autoupgrade ligado")
         else:
+            # TODO: desativar le-autoupgrade
             print("le-autoupgrade desligado")
 
     def onSharedFolderButtonPressed(self, button):
+        # TODO: abrir a pasta compartilhada
         print("Botao Pasta compartilhada pressionado!")
 
     def onToggleEdubarP2P(self, switch, args):
         if(switch.get_active()):
+            # TODO: ativar P2P
             print("P2P ligado")
         else:
+            # TODO: desativar P2P
             print("P2P desligado")
 
+def getNumArquivosEdubar():
+    # TODO: retornar uma string contendo o numero de arquivos correto
+    return "10"
+
+def getArmazenamentoEdubar():
+    # TODO: retornar uma string contendo o espaco de armazenamento
+    return "15Mb"
+
+
 if __name__ == "__main__":
     builder = Gtk.Builder()
     builder.add_from_file("le-control-panel.glade")
     builder.connect_signals(Handler())
 
     window = builder.get_object("mainwindow")
+    labelNumArquivosEdubar = builder.get_object("labelArquivosEdubar")
+    labelNumArquivosEdubar.set_label(getNumArquivosEdubar())
+    labelArmazenamentoEdubar = builder.get_object("labelArmazenamentoEdubar")
+    labelArmazenamentoEdubar.set_label(getArmazenamentoEdubar())
     window.show_all()
 
     Gtk.main()
-- 
GitLab