aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2010-02-26 15:47:18 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2010-02-26 15:47:18 +0000
commit9819bdddec24c2ac8dcf48877ae06c69127ca987 (patch)
treef4c7e3d8f2634ee7001d147511df47b6d6c991a8 /src
parentd1fd096f74ac85e028d3787701623da159d5d3e1 (diff)
downloadmsec-9819bdddec24c2ac8dcf48877ae06c69127ca987.tar
msec-9819bdddec24c2ac8dcf48877ae06c69127ca987.tar.gz
msec-9819bdddec24c2ac8dcf48877ae06c69127ca987.tar.bz2
msec-9819bdddec24c2ac8dcf48877ae06c69127ca987.tar.xz
msec-9819bdddec24c2ac8dcf48877ae06c69127ca987.zip
Improved UI and descriptions
Diffstat (limited to 'src')
-rwxr-xr-xsrc/msec/msecgui.py63
1 files changed, 41 insertions, 22 deletions
diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py
index 678098b..643bbfb 100755
--- a/src/msec/msecgui.py
+++ b/src/msec/msecgui.py
@@ -56,14 +56,14 @@ to activate it, choose the appropriate security level: """)
# level descriptions
level_descriptions = {
- "standard": _("""This profile configures a reasonably safe set of security features. It activates several non-intrusive periodic system checks. This is the suggested level for Desktop."""),
- "netbook": _("""This profile is focused on netbook or low-end devices, which are only accessed by local users and run on batteries."""),
+ "standard": _("""This profile configures a reasonably safe set of security features. It is the suggested level for Desktop. If unsure which profile to use, use this one."""),
+ "netbook": _("""This profile is focused on netbooks, laptops or low-end devices, which are only accessed by local users and run on batteries."""),
- "secure": _("""This profile is configured to provide maximum security, even at the cost of limiting the remote access to the system. It also runs a wider set of periodic checks. This level is suggested for Servers and security-concerned systems . """),
+ "secure": _("""This profile is configured to provide maximum security, even at the cost of limiting the remote access to the system. This level is suggested for security-concerned systems and servers. """),
- "fileserver": _("""This profile is targeted on storage-oriented servers, such as FTP, SAMBA or NFS servers, or database servers, which do not receive accesses from unauthorized Internet users."""),
+ "fileserver": _("""This profile is targeted on local network servers, which do not receive accesses from unauthorized Internet users."""),
- "webserver": _("""This profile is similar to the 'Fileserver', but it assumes that the server receives connection from unauthorized Internet users."""),
+ "webserver": _("""This profile is provided for servers which are intended to be accessed by unauthorized Internet users."""),
"audit_daily": _("""This profile is intended for the users who do not rely on msec to change system settings, and use it for periodic checks only. It configures all periodic checks to run once a day."""),
"audit_weekly": _("""This profile is similar to the 'audit_daily' profile, but it runs all checks weekly."""),
}
@@ -545,7 +545,7 @@ class MsecGui:
"""Builds the security summary UI"""
vbox = gtk.VBox(homogeneous=False, spacing=20)
- def create_security_item(text, icon=None):
+ def create_security_item(text, icon=None, s1=None, s2=None):
"""Helper function to create security items"""
# show logo
banner = gtk.HBox(homogeneous=False, spacing=10)
@@ -556,42 +556,53 @@ class MsecGui:
pixbuf = gtk.gdk.pixbuf_new_from_file(icon)
image.set_from_pixbuf(pixbuf)
banner.pack_start(image, False, False)
+ if s1:
+ s1.add_widget(image)
except:
print "Unable to load icon %s: %s" % (icon, sys.exc_value)
label = gtk.Label(text)
+ label.set_property("xalign", 0.0)
label.modify_font(pango.FontDescription("12"))
banner.pack_start(label, False, False)
+ if s2:
+ s1.add_widget(image)
return banner
# size groups
sizegroup1 = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
sizegroup2 = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
+ sizegroup3 = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
+ sizegroup4 = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
# firewall
- item = create_security_item(_("Firewall"), "/usr/share/mcc/themes/default/firewall-mdk.png")
+ item = create_security_item(_("Firewall"), "/usr/share/mcc/themes/default/firewall-mdk.png", sizegroup1, sizegroup2)
# spacer
item.add(gtk.Label())
v = gtk.VBox(False, False)
firewall_status = tools.find_firewall_info(log)
label = gtk.Label(firewall_status)
- v.pack_start(label, False, False)
+ label.set_property("xalign", 0.0)
+ label.set_property("yalign", 0.5)
+ v.pack_start(label)
button = gtk.Button(_("Configure"))
button.connect('clicked', self.run_configure_app, tools.FIREWALL_CMD)
- v.pack_start(button, False, False)
# size groups
- sizegroup1.add_widget(label)
- sizegroup2.add_widget(button)
+ sizegroup3.add_widget(label)
+ sizegroup4.add_widget(button)
+ button_v = gtk.VBox(False, False)
+ button_v.pack_start(button, True, False)
item.pack_start(v, False, False, padding=12)
+ item.pack_start(button_v, False, False, padding=12)
vbox.pack_start(item, False, False)
# security
- item = create_security_item(_("System security"), "/usr/share/mcc/themes/default/security-mdk.png")
+ item = create_security_item(_("Security"), "/usr/share/mcc/themes/default/security-mdk.png", sizegroup1, sizegroup2)
# spacer
item.add(gtk.Label())
v = gtk.VBox(False, False)
baselevel = self.msecconfig.get("BASE_LEVEL")
if baselevel == config.NONE_LEVEL:
- msec_status = _("Msec is disabled")
+ msec_status = [_("Msec is disabled")]
else:
msec_status = []
msec_status.append(_("Msec is enabled"))
@@ -605,31 +616,39 @@ class MsecGui:
if custom_count > 0:
msec_status.append(_("Custom settings: %d") % custom_count)
label = gtk.Label("\n".join(msec_status))
- v.pack_start(label, False, False)
+ label.set_property("xalign", 0.0)
+ label.set_property("yalign", 0.5)
+ v.pack_start(label)
button = gtk.Button(_("Configure"))
button.connect('clicked', lambda x: self.main_notebook.set_current_page(1))
# size groups
- sizegroup1.add_widget(label)
- sizegroup2.add_widget(button)
- v.pack_start(button, False, False)
+ sizegroup3.add_widget(label)
+ sizegroup4.add_widget(button)
+ button_v = gtk.VBox(False, False)
+ button_v.pack_start(button, True, False)
item.pack_start(v, False, False, padding=12)
+ item.pack_start(button_v, False, False, padding=12)
vbox.pack_start(item, False, False)
# updates
- item = create_security_item(_("System updates"), "/usr/share/mcc/themes/default/mdkonline-mdk.png")
+ item = create_security_item(_("Updates"), "/usr/share/mcc/themes/default/mdkonline-mdk.png", sizegroup1, sizegroup2)
# spacer
item.add(gtk.Label())
v = gtk.VBox(False, False)
updates = tools.get_updates_status(log)
label = gtk.Label(updates)
- v.pack_start(label, False, False)
+ label.set_property("xalign", 0.0)
+ label.set_property("yalign", 0.5)
+ v.pack_start(label)
button = gtk.Button(_("Update now"))
button.connect('clicked', self.run_configure_app, tools.UPDATE_CMD)
# size groups
- sizegroup1.add_widget(label)
- sizegroup2.add_widget(button)
- v.pack_start(button)
+ sizegroup3.add_widget(label)
+ sizegroup4.add_widget(button)
+ button_v = gtk.VBox(False, False)
+ button_v.pack_start(button, True, False)
item.pack_start(v, False, False, padding=12)
+ item.pack_start(button_v, False, False, padding=12)
vbox.pack_start(item, False, False)