Commit 2c3b6628 authored by legton's avatar legton

Merge branch 'issue/582' into 'develop'

SCRUM#582: Disable autoupdate controls when disabled and organize object IDs

See merge request !75
parents bb66bb44 bcbe2360
Pipeline #18795 passed with stages
in 6 minutes and 28 seconds
le-control-panel (1.0.8) unstable; urgency=medium
* Disable autoupdate controls when disabled and organize object IDs (Closes: #582)
-- Guilherme Becker Agge <lesuporte@c3sl.ufpr.br> Fri, 07 Dec 2018 09:37:18 -0200
le-control-panel (1.0.7) unstable; urgency=medium
* Change control panel error messages regarding the family-shield
......
......@@ -110,11 +110,21 @@ class Handler:
"/etc/apt/apt.conf.d/20auto-upgrades")
os.system("sed -i s/\\\"0\\\"/\\\"1\\\"/ "
"/etc/apt/apt.conf.d/99le6-auto-upgrade.conf")
# Ativa a parte de configuração do autoupdate
builder.get_object("iconAutoUpdateStatus").set_sensitive(True)
builder.get_object("spinHour").set_sensitive(True)
builder.get_object("spinMinute").set_sensitive(True)
builder.get_object("applyUpdateButton").set_sensitive(True)
else:
os.system("sed -i s/\\\"1\\\"/\\\"0\\\"/ "
"/etc/apt/apt.conf.d/20auto-upgrades")
os.system("sed -i s/\\\"1\\\"/\\\"0\\\"/ "
"/etc/apt/apt.conf.d/99le6-auto-upgrade.conf")
# Desativa a parte de configuração do autoupdate
builder.get_object("iconAutoUpdateStatus").set_sensitive(False)
builder.get_object("spinHour").set_sensitive(False)
builder.get_object("spinMinute").set_sensitive(False)
builder.get_object("applyUpdateButton").set_sensitive(False)
return True
def onEpoptesButtonPressed(self, button):
......@@ -146,8 +156,8 @@ class Handler:
messageDialog.connect("response", self.rebootMessageResponse)
messageDialog.run()
messageDialog.destroy()
builder.get_object("multiterminal_reboot_label").show()
builder.get_object("multiterminalButton").hide()
builder.get_object("labelMultiterminalReboot").show()
builder.get_object("buttonMultiterminal").hide()
except Exception as e:
print(e)
pass
......@@ -236,9 +246,9 @@ class Handler:
def timeout():
iconEpoptesStatus = builder.get_object("epoptesstatusicon")
boxEpoptesStatus = builder.get_object("boxepoptesstatus")
labelEpoptesStatus = builder.get_object("labelepoptesstatus")
iconEpoptesStatus = builder.get_object("iconEpoptesStatus")
boxEpoptesStatus = builder.get_object("boxEpoptesStatus")
labelEpoptesStatus = builder.get_object("labelEpoptesStatus")
if (statusEpoptes(labelEpoptesStatus) == 2):
iconEpoptesStatus.set_from_stock("gtk-yes", Gtk.IconSize.MENU)
boxEpoptesStatus.set_tooltip_text("O Epoptes está ativo")
......@@ -260,9 +270,9 @@ def handler(signum, frame):
labelEdubarStorage.set_label(getEdubarStorage())
# lcpmonitor detected changes at unattended-upgrades
elif signum == 35:
iconAutoUpdateStatus = builder.get_object("autoupdatestatusicon")
boxAutoUpdateStatus = builder.get_object("boxautoupdatestatus")
labelAutoUpdateStatus = builder.get_object("labelautoupdatestatus")
iconAutoUpdateStatus = builder.get_object("iconAutoUpdateStatus")
boxAutoUpdateStatus = builder.get_object("boxAutoupdateStatus")
labelAutoUpdateStatus = builder.get_object("labelAutoupdateStatus")
if (statusAutoUpdate(labelAutoUpdateStatus)):
iconAutoUpdateStatus.set_from_stock("gtk-yes", Gtk.IconSize.MENU)
boxAutoUpdateStatus.set_tooltip_text("Os pacotes estão em "
......@@ -540,7 +550,7 @@ def getShieldLocalState():
try:
output, err = runShellCommand("family-shield --status")
if len(err) > 0:
builder.get_object("family_shield_frame").set_sensitive(False)
builder.get_object("frameFamilyShield").set_sensitive(False)
return False
if output.find("enabled") != -1:
return True
......@@ -548,7 +558,7 @@ def getShieldLocalState():
return False
except Exception as e:
print(e)
builder.get_object("family_shield_frame").set_sensitive(False)
builder.get_object("frameFamilyShield").set_sensitive(False)
return False
......@@ -572,7 +582,7 @@ def getShieldNetworkState():
return current_state
except Exception as e:
print(e)
builder.get_object("family_shield_frame").set_sensitive(False)
builder.get_object("frameFamilyShield").set_sensitive(False)
return current_state
......@@ -625,13 +635,13 @@ def usingMultiterminal():
def setPermissions(uid):
groups = [grp.getgrgid(g).gr_name for g in os.getgroups()]
familyShield = builder.get_object("family_shield_frame")
autoUpdate = builder.get_object("autoupdate_frame")
epoptes = builder.get_object("epoptes_frame")
familyShield = builder.get_object("frameFamilyShield")
autoUpdate = builder.get_object("frameAutoUpdate")
epoptes = builder.get_object("frameEpoptes")
epoptesSwitch = builder.get_object("switchEpoptes")
users = builder.get_object("new_user_frame")
multiterminal = builder.get_object("multiterminal_frame")
unlock = builder.get_object("unlock_button")
users = builder.get_object("frameNewUser")
multiterminal = builder.get_object("frameMultiterminal")
unlock = builder.get_object("buttonUnlock")
allGroups = []
with open("/etc/group", "r") as f:
......@@ -664,10 +674,10 @@ def setPermissions(uid):
def configureMultiterminal():
if not usingMultiterminal():
multiterminal_frame = builder.get_object("multiterminal_frame")
multiterminal_separator = builder.get_object("multiterminal_separator")
multiterminal_frame = builder.get_object("frameMultiterminal")
separatorMultiterminal = builder.get_object("separatorMultiterminal")
multiterminal_frame.hide()
multiterminal_separator.hide()
separatorMultiterminal.hide()
else:
if os.path.isfile("/etc/le-multiterminal/configurado"):
widget_to_hide = builder.get_object("multiterminal_reboot_label")
......@@ -732,9 +742,9 @@ if __name__ == "__main__":
labelEdubarStorage = builder.get_object("labelArmazenamentoEdubar")
labelEdubarStorage.set_label(getEdubarStorage())
iconEpoptesStatus = builder.get_object("epoptesstatusicon")
boxEpoptesStatus = builder.get_object("boxepoptesstatus")
labelEpoptesStatus = builder.get_object("labelepoptesstatus")
iconEpoptesStatus = builder.get_object("iconEpoptesStatus")
boxEpoptesStatus = builder.get_object("boxEpoptesStatus")
labelEpoptesStatus = builder.get_object("labelEpoptesStatus")
if (statusEpoptes(labelEpoptesStatus) == 2):
iconEpoptesStatus.set_from_stock("gtk-yes", Gtk.IconSize.MENU)
boxEpoptesStatus.set_tooltip_text("O Epoptes está ativo")
......@@ -744,15 +754,15 @@ if __name__ == "__main__":
switchShield = builder.get_object("familyShield")
newUserButton = builder.get_object("newUserButton")
newUserDialog = builder.get_object("newUserDialog")
newUserButton = builder.get_object("buttonNewUser")
newUserDialog = builder.get_object("dialogNewUser")
newUserButton.connect("clicked", onNewUserButtonPressed, newUserDialog)
switchUpdate = builder.get_object("switchAutoUpdate")
switchEpoptes = builder.get_object("switchEpoptes")
SpinHour = builder.get_object("incrementa_hora")
SpinMin = builder.get_object("incrementa_minuto")
SpinHour = builder.get_object("spinHour")
SpinMin = builder.get_object("spinMinute")
# uid = os.getuid()
setPermissions(uid)
......@@ -761,7 +771,7 @@ if __name__ == "__main__":
signal.signal(34, handler)
signal.signal(35, handler)
window = builder.get_object("mainwindow")
window = builder.get_object("mainWindow")
window.show_all()
configureMultiterminal()
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment