[sabayon] Merged in latest pessulus from git.
- From: Scott Balneaves <sbalneav src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [sabayon] Merged in latest pessulus from git.
- Date: Thu, 17 Dec 2009 06:32:19 +0000 (UTC)
commit 7dcbcbd7a27927f16b28a20bdaf50bfe2a78dc95
Author: Scott Balneaves <sbalneav ltsp org>
Date: Thu Dec 17 00:31:45 2009 -0600
Merged in latest pessulus from git.
admin-tool/lockdown/Makefile.am | 12 +-
admin-tool/lockdown/disabledapplets.py | 44 +-
admin-tool/lockdown/globalvar.py | 1 -
admin-tool/lockdown/icons.py | 49 +-
admin-tool/lockdown/lockdownapplier.py | 3 +
admin-tool/lockdown/lockdownappliergconf.py | 224 +++++
admin-tool/lockdown/lockdownbutton.py | 10 +-
admin-tool/lockdown/lockdowncheckbutton.py | 12 +-
admin-tool/lockdown/maindialog.py | 198 +++--
admin-tool/lockdown/pessulus.glade | 1147 -------------------------
admin-tool/lockdown/pessulus.ui | 418 +++++++++
admin-tool/lockdown/safeprotocols.py | 6 -
admin-tool/lockdown/simpleeditabletreeview.py | 18 -
po/POTFILES.in | 2 +-
14 files changed, 789 insertions(+), 1355 deletions(-)
---
diff --git a/admin-tool/lockdown/Makefile.am b/admin-tool/lockdown/Makefile.am
index 4e1080a..107767d 100644
--- a/admin-tool/lockdown/Makefile.am
+++ b/admin-tool/lockdown/Makefile.am
@@ -1,5 +1,5 @@
PESSULUSDIR=../../../pessulus
-PESSULUSDATA=pessulus.glade
+PESSULUSDATA=pessulus.ui
PESSULUSPYTHON= \
disabledapplets.py \
icons.py \
@@ -7,7 +7,7 @@ PESSULUSPYTHON= \
lockdownapplier.py \
lockdownbutton.py \
lockdowncheckbutton.py \
- lockdowncombo.py \
+ lockdownappliergconf.py \
maindialog.py \
safeprotocols.py \
simpleeditabletreeview.py
@@ -22,15 +22,15 @@ update:
PYTHON_FILES = $(PESSULUSPYTHON) __init__.py config.py
-GLADE_FILES = pessulus.glade
+UI_FILES = pessulus.ui
-gladedir = $(pkgdatadir)/glade
-glade_DATA = $(GLADE_FILES)
+uidir = $(pkgdatadir)/ui
+ui_DATA = $(UI_FILES)
EXTRA_DIST = \
$(PYTHON_FILES) \
- $(GLADE_FILES)
+ $(UI_FILES)
sabayonlockdowndir = $(pyexecdir)/sabayon/lockdown
sabayonlockdown_PYTHON = $(PYTHON_FILES)
diff --git a/admin-tool/lockdown/disabledapplets.py b/admin-tool/lockdown/disabledapplets.py
index 537fb3f..1e5fa47 100644
--- a/admin-tool/lockdown/disabledapplets.py
+++ b/admin-tool/lockdown/disabledapplets.py
@@ -28,8 +28,6 @@ try:
except:
from sets import Set as set
-from sabayon import errors
-from sabayon import debuglog
import globalvar
import icons
@@ -116,33 +114,26 @@ class PessulusDisabledApplets:
COLUMN_IID,
COLUMN_NAME,
COLUMN_ICON_NAME,
- COLUMN_ICON,
COLUMN_DISABLED
- ) = range (5)
+ ) = range (4)
def __init__ (self, treeview, lockdownbutton):
self.notify_id = None
self.key = "/apps/panel/global/disabled_applets"
self.disabled_applets = None
- self.liststore = gtk.ListStore (str, str, str, gtk.gdk.Pixbuf, bool)
+ self.liststore = gtk.ListStore (str, str, str, bool)
self.liststore.set_sort_column_id (self.COLUMN_NAME, gtk.SORT_ASCENDING)
self.treeview = treeview
self.treeview.get_selection ().set_mode (gtk.SELECTION_SINGLE)
self.treeview.set_model (self.liststore)
- self.treeview.connect ("screen-changed", self.__on_screen_changed)
self.treeview.connect ("destroy", self.__on_destroyed)
self.lockdownbutton = lockdownbutton
self.lockdownbutton.connect ("toggled",
self.__on_lockdownbutton_toggled)
- screen = self.treeview.get_screen ()
- self.icon_theme = gtk.icon_theme_get_for_screen (screen)
-
- self.icon_theme.connect ("changed", self.__on_icontheme_changed)
-
self.__fill_liststore ()
self.__create_columns ()
@@ -154,20 +145,6 @@ class PessulusDisabledApplets:
self.notify_id = globalvar.applier.notify_add (self.key,
self.__on_notified)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
- def __on_screen_changed (self, widget, screen):
- self.icon_theme = gtk.icon_theme_get_for_screen (screen)
- self.__on_icontheme_changed (self.icon_theme)
-
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
- def __on_icontheme_changed (self, icontheme):
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
- def update_icon (model, path, iter, data):
- if model[iter][self.COLUMN_ICON_NAME] != "":
- model[iter][self.COLUMN_ICON] = icons.load_icon (self.icon_theme, model[iter][self.COLUMN_ICON_NAME])
-
- self.liststore.foreach (update_icon, self)
-
def __fill_liststore (self):
applets = bonobo.activation.query ("has_all (repo_ids, ['IDL:Bonobo/Control:1.0', 'IDL:GNOME/Vertigo/PanelAppletShell:1.0'])")
@@ -182,22 +159,23 @@ class PessulusDisabledApplets:
if prop.name[:5] == "name-" and prop.name[5:] in languages:
if bestname > languages.index (prop.name[5:]) or bestname == -1:
name = prop.v.value_string
+ bestname = languages.index (prop.name[5:])
elif prop.name == "name" and bestname == -1:
name = prop.v.value_string
elif prop.name == "panel:icon":
- icon = prop.v.value_string
- iter = self.liststore.append ()
+ icon = icons.fix_icon_name(prop.v.value_string)
if name == None:
name = applet.iid
else:
+ #FIXME needs to be translated
name = name + " (" + applet.iid + ")"
+ iter = self.liststore.append ()
self.liststore.set (iter,
self.COLUMN_IID, applet.iid,
self.COLUMN_NAME, name,
- self.COLUMN_ICON_NAME, icon,
- self.COLUMN_ICON, icons.load_icon (self.icon_theme, icon))
+ self.COLUMN_ICON_NAME, icon)
def __create_columns (self):
column = gtk.TreeViewColumn ()
@@ -214,19 +192,17 @@ class PessulusDisabledApplets:
cell = gtk.CellRendererPixbuf ()
column.pack_start (cell, False)
- column.set_attributes (cell, pixbuf = self.COLUMN_ICON)
+ column.set_attributes (cell, icon_name = self.COLUMN_ICON_NAME)
cell = gtk.CellRendererText ()
column.pack_start (cell, True)
column.set_attributes (cell, text = self.COLUMN_NAME)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_lockdownbutton_toggled (self, lockdownbutton, mandatory):
globalvar.applier.set_list (self.key, gconf.VALUE_STRING,
list (self.disabled_applets),
mandatory)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_toggled (self, toggle, path):
def toggle_value (model, iter, column):
model[iter][column] = not model[iter][column]
@@ -238,19 +214,16 @@ class PessulusDisabledApplets:
iid = self.liststore[iter][self.COLUMN_IID]
if active:
if iid not in self.disabled_applets:
- debuglog.uprint ('adding "%s" to list of disabled applets', iid)
self.disabled_applets.add (iid)
globalvar.applier.set_list (self.key, gconf.VALUE_STRING,
list (self.disabled_applets),
self.lockdownbutton.get ())
elif iid in self.disabled_applets:
- debuglog.uprint ('removing "%s" from list of disabled applets', iid)
self.disabled_applets.remove (iid)
globalvar.applier.set_list (self.key, gconf.VALUE_STRING,
list (self.disabled_applets),
self.lockdownbutton.get ())
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_notified (self, data):
(list, mandatory) = globalvar.applier.get_list (self.key,
gconf.VALUE_STRING)
@@ -270,7 +243,6 @@ class PessulusDisabledApplets:
self.liststore.foreach (update_toggle, self)
self.treeview.set_sensitive (globalvar.applier.key_is_writable (self.key))
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_destroyed (self, treeview):
if self.notify_id:
if globalvar.applier:
diff --git a/admin-tool/lockdown/globalvar.py b/admin-tool/lockdown/globalvar.py
index 9c50df9..f598272 100644
--- a/admin-tool/lockdown/globalvar.py
+++ b/admin-tool/lockdown/globalvar.py
@@ -19,4 +19,3 @@
#
applier = None
-tooltips = None
diff --git a/admin-tool/lockdown/icons.py b/admin-tool/lockdown/icons.py
index 6a7d9be..80630c1 100644
--- a/admin-tool/lockdown/icons.py
+++ b/admin-tool/lockdown/icons.py
@@ -20,48 +20,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
-import os
-import gtk
+def fix_icon_name (icon_name):
+ if not icon_name:
+ return None
-def load_icon_from_path (icon_path):
- if os.path.isfile (icon_path):
- try:
- return gtk.gdk.pixbuf_new_from_file_at_size (icon_path, 24, 24)
- except:
- pass
- return None
-
-def load_icon_from_data_dirs (icon_value):
- data_dirs = None
- if os.environ.has_key ("XDG_DATA_DIRS"):
- data_dirs = os.environ["XDG_DATA_DIRS"]
- if not data_dirs:
- data_dirs = "/usr/local/share/:/usr/share/"
-
- for data_dir in data_dirs.split (":"):
- retval = load_icon_from_path (os.path.join (data_dir, "pixmaps",
- icon_value))
- if retval:
- return retval
- retval = load_icon_from_path (os.path.join (data_dir, "icons",
- icon_value))
- if retval:
- return retval
-
- return None
-
-def load_icon (icon_theme, icon_value):
- if not icon_value:
- return
-
- if os.path.isabs (icon_value):
- icon = load_icon_from_path (icon_value)
- if icon:
- return icon
- icon_name = os.path.basename (icon_value)
- else:
- icon_name = icon_value
-
if icon_name.endswith (".png"):
icon_name = icon_name[:-len (".png")]
elif icon_name.endswith (".xpm"):
@@ -69,7 +31,4 @@ def load_icon (icon_theme, icon_value):
elif icon_name.endswith (".svg"):
icon_name = icon_name[:-len (".svg")]
- try:
- return icon_theme.load_icon (icon_name, 24, 0)
- except:
- return load_icon_from_data_dirs (icon_value)
+ return icon_name
diff --git a/admin-tool/lockdown/lockdownapplier.py b/admin-tool/lockdown/lockdownapplier.py
index 17b5279..02e06f8 100644
--- a/admin-tool/lockdown/lockdownapplier.py
+++ b/admin-tool/lockdown/lockdownapplier.py
@@ -22,6 +22,9 @@ class PessulusLockdownApplier:
def __init__ (self):
raise NotImplementedError
+ def supports_normal_settings (self):
+ raise NotImplementedError
+
def supports_mandatory_settings (self):
raise NotImplementedError
diff --git a/admin-tool/lockdown/lockdownappliergconf.py b/admin-tool/lockdown/lockdownappliergconf.py
new file mode 100644
index 0000000..b581341
--- /dev/null
+++ b/admin-tool/lockdown/lockdownappliergconf.py
@@ -0,0 +1,224 @@
+#!/usr/bin/env python
+
+# vim: set ts=4 sw=4 et:
+
+#
+# Copyright (C) 2005 Vincent Untz <vuntz gnome org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+#
+
+import gconf
+import gobject
+import lockdownapplier
+
+from config import *
+
+def can_edit_mandatory ():
+ try:
+ engine = gconf.engine_get_for_address (GCONF_MANDATORY_SOURCE)
+ except gobject.GError:
+ return False
+
+ if engine == None:
+ return False
+
+ try:
+ #entry = engine.get_entry ("/apps/gconf-editor/can_edit_source",
+ # None,
+ # False)
+ #gconf_engine_get_entry() is not wrapped. Ugly workaround:
+ client = gconf.client_get_for_engine (engine)
+ entry = client.get_entry ("/apps/gconf-editor/can_edit_source", "",
+ False)
+ except gobject.GError:
+ return False
+
+ if entry != None:
+ return entry.get_is_writable ()
+
+ return False
+
+# We have this safe class to be able to use gconf methods even if we don't have
+# any gconf access. In the future, we might have non-gconf sources, so it's
+# important to keep the gconf applier working (by being effectively disabled),
+# even when gconf is not working.
+class SafeGConfClient:
+ def __init__ (self):
+ self.client = gconf.client_get_default ()
+
+ try:
+ self.client.get_bool ("/apps/gconf-editor/can_edit_source")
+ self.can_use = True
+ except gobject.GError:
+ self.can_use = False
+
+ def really_works (self):
+ return self.can_use
+
+ def get_schema (self, key):
+ if not self.can_use:
+ return None
+ return self.client.get_schema (key)
+
+ def get_bool (self, key):
+ if not self.can_use:
+ return False
+ return self.client.get_bool (key)
+
+ def set_bool (self, key, value):
+ if not self.can_use:
+ return
+ self.client.set_bool (key, value)
+
+ def get_list (self, key, list_type):
+ if not self.can_use:
+ return []
+ return self.client.get_list (key, list_type)
+
+ def set_list (self, key, list_type, value):
+ if not self.can_use:
+ return
+ self.client.set_list (key, list_type, value)
+
+ def key_is_writable (self, key):
+ if not self.can_use:
+ return False
+ return self.client.key_is_writable (key)
+
+ def notify_add (self, key, handler, data = None):
+ if not self.can_use:
+ return None
+ return self.client.notify_add (key, handler, data)
+
+ def notify_remove (self, monitor):
+ if not self.can_use:
+ return
+ self.client.notify_remove (monitor)
+
+ def add_dir (self, dir, preloadtype):
+ if not self.can_use:
+ return
+ self.client.add_dir (dir, preloadtype)
+
+ def remove_dir (self, dir):
+ if not self.can_use:
+ return
+ self.client.remove_dir (dir)
+
+class PessulusLockdownApplierGconf (lockdownapplier.PessulusLockdownApplier):
+ def __init__ (self):
+ self.can_edit_mandatory = can_edit_mandatory ()
+ self.client_mandatory = None
+
+ if (self.can_edit_mandatory):
+ engine = gconf.engine_get_for_address (GCONF_MANDATORY_SOURCE)
+ self.client_mandatory = gconf.client_get_for_engine (engine)
+
+ self.client = SafeGConfClient ()
+
+ def supports_normal_settings (self):
+ return self.client.really_works ()
+
+ def supports_mandatory_settings (self):
+ return self.can_edit_mandatory
+
+ def get_schema (self, key):
+ return self.client.get_schema (key)
+
+ def get_bool (self, key):
+ value = None
+ is_mandatory = False
+
+ if self.supports_mandatory_settings ():
+ entry = self.client_mandatory.get_without_default (key)
+ if entry != None:
+ is_mandatory = True
+ value = entry.get_bool ()
+ else:
+ value = self.client.get_bool (key)
+ else:
+ value = self.client.get_bool (key)
+
+ return (value, is_mandatory)
+
+ def set_bool (self, key, value, mandatory):
+ if mandatory:
+ if self.supports_mandatory_settings ():
+ self.client_mandatory.set_bool (key, value)
+ else:
+ if self.supports_mandatory_settings ():
+ self.client_mandatory.unset (key)
+ self.client.set_bool (key, value)
+
+ def get_list (self, key, list_type):
+ value = None
+ is_mandatory = False
+
+ if self.supports_mandatory_settings ():
+ entry = self.client_mandatory.get_without_default (key)
+ if entry != None:
+ is_mandatory = True
+ list = entry.get_list ()
+ type = entry.get_list_type ()
+ value = []
+ for element in list:
+ if type == gconf.VALUE_STRING:
+ value.append (element.get_string ())
+ elif type == gconf.VALUE_BOOL:
+ value.append (element.get_bool ())
+ elif type == gconf.VALUE_INT:
+ value.append (element.get_int ())
+ elif type == gconf.VALUE_FLOAT:
+ value.append (element.get_float ())
+ else:
+ value = self.client.get_list (key, list_type)
+ else:
+ value = self.client.get_list (key, list_type)
+
+ return (value, is_mandatory)
+
+ def set_list (self, key, list_type, value, mandatory):
+ if mandatory:
+ if self.supports_mandatory_settings ():
+ self.client_mandatory.set_list (key, list_type, value)
+ else:
+ if self.supports_mandatory_settings ():
+ self.client_mandatory.unset (key)
+ self.client.set_list (key, list_type, value)
+
+ def key_is_writable (self, key):
+ if self.supports_mandatory_settings ():
+ return True
+
+ return self.client.key_is_writable (key)
+
+ def notify_add (self, key, handler, data = None):
+ def __gconf_notify_proxy (client, cnx_id, entry, monitor):
+ handler = monitor[0]
+ user_data = monitor[1]
+ handler (user_data)
+
+ return self.client.notify_add (key, __gconf_notify_proxy,
+ (handler, data))
+
+ def notify_remove (self, monitor):
+ self.client.notify_remove (monitor)
+
+ def add_dir (self, dir, preloadtype):
+ self.client.add_dir (dir, preloadtype)
+
+ def remove_dir (self, dir):
+ self.client.remove_dir (dir)
diff --git a/admin-tool/lockdown/lockdownbutton.py b/admin-tool/lockdown/lockdownbutton.py
index 30a8605..7f51921 100644
--- a/admin-tool/lockdown/lockdownbutton.py
+++ b/admin-tool/lockdown/lockdownbutton.py
@@ -21,8 +21,6 @@
import gobject
import gtk
-from sabayon import errors
-from sabayon import debuglog
import globalvar
def load_image (name):
@@ -60,7 +58,10 @@ class PessulusLockdownButton (gobject.GObject):
lockdownbutton = PessulusLockdownButton ()
lockdownbutton.button = button
- button.remove (button.get_child ())
+ child = button.get_child ()
+
+ if child is not None:
+ button.remove (child)
lockdownbutton.__connect_and_update ()
return lockdownbutton
@@ -100,7 +101,7 @@ class PessulusLockdownButton (gobject.GObject):
else:
tooltip = _("Click to make this setting mandatory")
- globalvar.tooltips.set_tip (self.button, tooltip)
+ self.button.set_tooltip_text (tooltip)
def __set_button_icon (self):
if self.locked:
@@ -114,7 +115,6 @@ class PessulusLockdownButton (gobject.GObject):
self.button.remove (child)
self.button.add (newimage)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_button_clicked (self, button):
self.locked = not self.locked
self.__update ()
diff --git a/admin-tool/lockdown/lockdowncheckbutton.py b/admin-tool/lockdown/lockdowncheckbutton.py
index baadb49..db3f559 100644
--- a/admin-tool/lockdown/lockdowncheckbutton.py
+++ b/admin-tool/lockdown/lockdowncheckbutton.py
@@ -23,8 +23,6 @@ import gtk
import gconf
import sys
-from sabayon import errors
-from sabayon import debuglog
import globalvar
import lockdownbutton
@@ -92,8 +90,8 @@ class PessulusLockdownCheckbutton:
try:
schema = globalvar.applier.get_schema ("/schemas" + self.key)
if schema:
- globalvar.tooltips.set_tip (self.checkbutton,
- schema.get_long_desc ())
+ tooltip = " ".join (schema.get_long_desc ().split ())
+ self.checkbutton.set_tooltip_text (tooltip)
except gobject.GError:
print >> sys.stderr, "Warning: Could not get schema for %s" % self.key
@@ -105,20 +103,15 @@ class PessulusLockdownCheckbutton:
self.checkbutton.set_active (active)
self.checkbutton.set_sensitive (globalvar.applier.key_is_writable (self.key))
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_notified (self, data):
(active, mandatory) = globalvar.applier.get_bool (self.key)
if active != self.checkbutton.get_active () or mandatory != self.lockdownbutton.get ():
self.__update_toggle ()
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_lockdownbutton_toggled (self, lockdownbutton, mandatory):
- debuglog.uprint ('lockdown button for "%s" set to %s', self.key, lockdownbutton.get ())
self.__do_change ()
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_check_toggled (self, checkbutton):
- debuglog.uprint ('option checkbutton for "%s" set to %s', self.key, checkbutton.get_active ())
self.__do_change ()
def __do_change (self):
@@ -127,7 +120,6 @@ class PessulusLockdownCheckbutton:
self.checkbutton.get_active (),
self.lockdownbutton.get ())
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_destroyed (self, checkbutton):
if self.notify_id:
if globalvar.applier:
diff --git a/admin-tool/lockdown/maindialog.py b/admin-tool/lockdown/maindialog.py
index 7c6368d..bc9a14f 100644
--- a/admin-tool/lockdown/maindialog.py
+++ b/admin-tool/lockdown/maindialog.py
@@ -23,24 +23,28 @@ import gconf
import gettext
import gobject
import gtk
-import gtk.glade
+
+from xml.sax.saxutils import escape as escape_pango
from config import *
-from sabayon import errors
-from sabayon import debuglog
import disabledapplets
import lockdownbutton
import lockdowncheckbutton
-import lockdowncombo
import globalvar
import safeprotocols
gettext.install (PACKAGE, LOCALEDIR)
+pages = (
+ ( _('General'), "gnome-logo-icon-transparent", "vbox7" ),
+ ( _('Panel'), "gnome-panel", "vbox12" ),
+ ( _('Epiphany Web Browser'), "web-browser", "vboxEpiphany" ),
+ ( _('GNOME Screensaver'), "preferences-desktop-screensaver", "vbox15" )
+)
+
gconfdirs = [
"/desktop/gnome/lockdown",
-"/apps/openoffice/lockdown",
"/apps/epiphany/lockdown",
"/apps/panel/global"
]
@@ -53,7 +57,6 @@ lockdownbuttons = (
( "/apps/panel/global/locked_down", _("_Lock down the panels"), "vbox8" ),
( "/apps/panel/global/disable_force_quit", _("Disable force _quit"), "vbox8" ),
- ( "/apps/panel/global/disable_lock_screen", _("Disable lock _screen"), "vbox8" ),
( "/apps/panel/global/disable_log_out", _("Disable log _out"), "vbox8" ),
( "/apps/epiphany/lockdown/disable_quit", _("Disable _quit"), "vbox9" ),
@@ -62,74 +65,35 @@ lockdownbuttons = (
( "/apps/epiphany/lockdown/disable_history", _("Disable _history"), "vbox9" ),
( "/apps/epiphany/lockdown/disable_javascript_chrome", _("Disable _javascript chrome"), "vbox9" ),
( "/apps/epiphany/lockdown/disable_toolbar_editing", _("Disable _toolbar editing"), "vbox9" ),
- ( "/apps/epiphany/lockdown/fullscreen", _("_Fullscreen"), "vbox9" ),
+ ( "/apps/epiphany/lockdown/fullscreen", _("Force _fullscreen mode"), "vbox9" ),
( "/apps/epiphany/lockdown/hide_menubar", _("Hide _menubar"), "vbox9" ),
- # Translators: OO.o normally saves personal information (name/email of author, etc.) to files.
- # This can be used to disable this, for when you don't want people to know you created the document.
- ( "/apps/openoffice/lockdown/remove_personal_info_on_save", _("Remove personal information from documents when saving them"), "ooosecurity" ),
- ( "/apps/openoffice/lockdown/warn_info_create_pdf", _("Warn if macro tries to create a PDF"), "ooosecurity" ),
- ( "/apps/openoffice/lockdown/warn_info_printing", _("Warn if macro tries to print a document"), "ooosecurity" ),
- ( "/apps/openoffice/lockdown/warn_info_saving", _("Warn if macro tries to save a document"), "ooosecurity" ),
- ( "/apps/openoffice/lockdown/warn_info_signing", _("Warn if macro tries to sign a document"), "ooosecurity" ),
- ( "/apps/openoffice/lockdown/recommend_password_on_save", _("Recommend password when saving a document"), "ooosecurity" ),
-
- ( "/apps/openoffice/auto_save", _("Enable auto-save"), "oooio" ),
-# ( "/apps/openoffice/auto_save_interval", _("Auto save interval"), "oooio" ),
- ( "/apps/openoffice/printing_modifies_doc", _("Printing should mark the document as modified"), "oooio" ),
- ( "/apps/openoffice/use_system_file_dialog", _("Use system's file dialog"), "oooio" ),
- ( "/apps/openoffice/create_backup", _("Create backup copy on save"), "oooio" ),
- ( "/apps/openoffice/warn_alien_format", _("Warn when saving non-OpenOffice.org formats"), "oooio" ),
-
- ( "/apps/openoffice/use_opengl", _("Use OpenGL"), "oooui" ),
- ( "/apps/openoffice/use_system_font", _("Use system font"), "oooui" ),
- ( "/apps/openoffice/use_font_anti_aliasing", _("Use anti-aliasing"), "oooui" ),
- ( "/apps/openoffice/lockdown/disable_ui_customization", _("Disable UI customization"), "oooui" ),
- ( "/apps/openoffice/show_menu_inactive_items", _("Show insensitive menu items"), "oooui" ),
- ( "/apps/openoffice/show_font_preview", _("Show font preview"), "oooui" ),
- ( "/apps/openoffice/show_font_history", _("Show font history") , "oooui" ),
- ( "/apps/openoffice/show_menu_icons", _("Show icons in menus"), "oooui" ),
-# Unclear / minority:
-# ( "/apps/openoffice/optimize_opengl", , "oooui" ),
-# ( "/apps/openoffice/font_anti_aliasing_min_pixel", , "oooui" ),
-)
-
-lockdowncombos = (
- ( "/apps/openoffice/lockdown/macro_security_level", "macroSecurityLevel", "int",
- [ "3", "2", "1", "0" ] ),
- ( "/apps/openoffice/writer_default_document_format", "writerDefaultFormat", "string",
- [ "writer8", "MS Word 97", "StarOffice XML (Writer)" ] ),
- ( "/apps/openoffice/calc_default_document_format", "calcDefaultFormat", "string",
- [ "calc8", "MS Excel 97", "StarOffice XML (Calc)" ] ),
- ( "/apps/openoffice/impress_default_document_format", "impressDefaultFormat", "string",
- [ "impress8", "MS PowerPoint 97", "StarOffice XML (Impress)" ] ),
- ( "/apps/openoffice/icon_size", "defaultIconSize", "int",
- [ "2", "1", "0" ] ),
- ( "/apps/openoffice/undo_steps", "undoSteps", "int",
- [ "5", "10", "25", "50" ] )
+ ( "/desktop/gnome/lockdown/disable_lock_screen", _("Disable lock _screen"), "vbox15" ),
+ ( "/apps/gnome-screensaver/lock_enabled", _("_Lock on activation"), "vbox15" ),
+ ( "/apps/gnome-screensaver/logout_enabled", _("Allow log _out"), "vbox15" ),
+ ( "/apps/gnome-screensaver/user_switch_enabled", _("Allow user _switching"), "vbox15" )
)
class PessulusMainDialog:
+ (
+ COLUMN_NAME,
+ COLUMN_ICON,
+ COLUMN_PAGENUMBER
+ ) = range (3)
+
def __init__ (self, applier, quit_on_close = True):
globalvar.applier = applier
- globalvar.tooltips = gtk.Tooltips ()
self.quit_on_close = quit_on_close
for gconfdir in gconfdirs:
globalvar.applier.add_dir (gconfdir, gconf.CLIENT_PRELOAD_NONE)
- self.glade_file = os.path.join (GLADEDIR, "pessulus.glade")
- self.xml = gtk.glade.XML (self.glade_file, "dialogEditor", PACKAGE)
+ self.builder = gtk.Builder()
+ self.builder.set_translation_domain(PACKAGE)
+ self.builder.add_from_file(os.path.join (BUILDERDIR, "pessulus.ui"))
- self.__init_combos ()
- self.__init_checkbuttons ()
- self.__init_disabledapplets ()
- self.__init_safeprotocols ()
-
- self.xml.get_widget ("helpbutton").set_sensitive (False)
-
- self.window = self.xml.get_widget ("dialogEditor")
+ self.window = self.builder.get_object ("dialogEditor")
self.window.connect ("response", self.__on_dialog_response)
if self.quit_on_close:
@@ -137,42 +101,41 @@ class PessulusMainDialog:
else:
self.window.connect ("delete-event", gtk.Widget.hide_on_delete)
+ self.__init_checkbuttons ()
+ self.__init_disabledapplets ()
+ self.__init_safeprotocols ()
+ self.__init_pageselector ()
+
self.window.show ()
def __init_checkbuttons (self):
for (key, string, box_str) in lockdownbuttons:
button = lockdowncheckbutton.PessulusLockdownCheckbutton.new (key,
string)
- box = self.xml.get_widget (box_str)
+ box = self.builder.get_object (box_str)
box.pack_start (button.get_widget (), False)
- def __init_combos (self):
- for (key, combo_str, type, value_list) in lockdowncombos:
- combo = self.xml.get_widget (combo_str)
- button = self.xml.get_widget (combo_str + "Button")
- lockdowncombo.PessulusLockdownCombo.attach (combo, button, key, type, value_list)
-
def __init_disabledapplets (self):
- treeview = self.xml.get_widget ("treeviewDisabledApplets")
- button = self.xml.get_widget ("buttonDisabledApplets")
+ treeview = self.builder.get_object ("treeviewDisabledApplets")
+ button = self.builder.get_object ("buttonDisabledApplets")
ldbutton = lockdownbutton.PessulusLockdownButton.new_with_widget (button)
self.disabledapplets = disabledapplets.PessulusDisabledApplets (treeview,
ldbutton)
def __init_safeprotocols (self):
- button = self.xml.get_widget ("buttonDisableUnsafeProtocols")
- checkbutton = self.xml.get_widget ("checkbuttonDisableUnsafeProtocols")
+ button = self.builder.get_object ("buttonDisableUnsafeProtocols")
+ checkbutton = self.builder.get_object ("checkbuttonDisableUnsafeProtocols")
lockdown = lockdowncheckbutton.PessulusLockdownCheckbutton.new_with_widgets (
"/apps/epiphany/lockdown/disable_unsafe_protocols",
button, checkbutton)
- hbox = self.xml.get_widget ("hboxSafeProtocols")
+ hbox = self.builder.get_object ("hboxSafeProtocols")
- treeview = self.xml.get_widget ("treeviewSafeProtocols")
- addbutton = self.xml.get_widget ("buttonSafeProtocolAdd")
- editbutton = self.xml.get_widget ("buttonSafeProtocolEdit")
- removebutton = self.xml.get_widget ("buttonSafeProtocolRemove")
+ treeview = self.builder.get_object ("treeviewSafeProtocols")
+ addbutton = self.builder.get_object ("buttonSafeProtocolAdd")
+ editbutton = self.builder.get_object ("buttonSafeProtocolEdit")
+ removebutton = self.builder.get_object ("buttonSafeProtocolRemove")
self.safeprotocols = safeprotocols.PessulusSafeProtocols (lockdown.get_lockdownbutton (),
treeview,
@@ -183,23 +146,98 @@ class PessulusMainDialog:
checkbutton.connect ("toggled", self.__on_unsafeprotocols_toggled, hbox)
self.__on_unsafeprotocols_toggled (checkbutton, hbox)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
+ def __init_pageselector (self):
+ use_tree = False
+ if use_tree:
+ store = gtk.TreeStore (str, str, int)
+ else:
+ store = gtk.ListStore (str, str, int)
+
+ notebook = self.builder.get_object ("notebook2")
+ children = notebook.get_children ()
+
+ for (name, icon, widgetname) in pages:
+ i = 0
+ found = False
+ for child in children:
+ if child == self.builder.get_object (widgetname):
+ found = True
+ break
+ i += 1
+
+ if not found:
+ continue
+
+ if use_tree:
+ iter = store.append (None)
+ else:
+ iter = store.append ()
+
+ store.set (iter,
+ self.COLUMN_ICON, icon,
+ self.COLUMN_NAME, name,
+ self.COLUMN_PAGENUMBER, i)
+
+ pageselector = self.builder.get_object ("pageselector")
+ pageselector.set_model (store)
+
+ col = gtk.TreeViewColumn ()
+ pageselector.append_column (col)
+
+ cell = gtk.CellRendererPixbuf ()
+ col.pack_start (cell, True)
+ col.add_attribute (cell, 'icon_name', self.COLUMN_ICON)
+
+ cell = gtk.CellRendererText ()
+ col.pack_start (cell, True)
+ col.add_attribute (cell, 'text', self.COLUMN_NAME)
+
+ pageselector.connect ("cursor-changed", self.__on_page_select,
+ notebook)
+ pageselector.set_cursor ((0,))
+
def __on_unsafeprotocols_toggled (self, checkbutton, hbox):
sensitive = checkbutton.get_active ()
- debuglog.uprint ("PessulusMainDialog: setting unsafe protocols toggle to %s", sensitive)
hbox.set_sensitive (sensitive)
self.safeprotocols.set_sensitive (sensitive)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
+ def __on_page_select (self, selector, notebook):
+ model = selector.get_model()
+ iter = model.get_iter (selector.get_cursor ()[0])
+ notebook.set_current_page (model[iter][self.COLUMN_PAGENUMBER])
+
+ def __error_dialog (self, primary, secondary = None):
+ def __on_response (dialog, response_id):
+ dialog.destroy ()
+
+ dialog = gtk.MessageDialog (parent = self.window,
+ flags = gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
+ type = gtk.MESSAGE_ERROR,
+ buttons = gtk.BUTTONS_CLOSE,
+ message_format = primary)
+ if secondary:
+ dialog.format_secondary_text (secondary)
+
+ dialog.connect ("response", __on_response)
+ dialog.show ()
+
def __on_dialog_response (self, dialog, response_id):
if dialog == self.window and response_id == gtk.RESPONSE_HELP:
+ doc_id = "system-admin-guide"
+ uri = "ghelp:%s#lockdown" % doc_id
+
+ try:
+ gtk.show_uri (self.window.get_screen(), uri,
+ gtk.get_current_event_time())
+ except gobject.GError, e:
+ primary = _("Could not display help document '%s'") % escape_pango (doc_id)
+ self.__error_dialog (primary, str (e))
return
dialog.hide ()
if self.quit_on_close:
dialog.destroy ()
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_dialog_destroy (self, dialog):
for gconfdir in gconfdirs:
globalvar.applier.remove_dir (gconfdir)
diff --git a/admin-tool/lockdown/pessulus.ui b/admin-tool/lockdown/pessulus.ui
new file mode 100644
index 0000000..c140ad7
--- /dev/null
+++ b/admin-tool/lockdown/pessulus.ui
@@ -0,0 +1,418 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkDialog" id="dialogEditor">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Lockdown Editor</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow5">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="pageselector">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkNotebook" id="notebook2">
+ <property name="visible">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <child>
+ <object class="GtkVBox" id="vbox7">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox12">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkVBox" id="vbox8">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox13">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="buttonDisabledApplets">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Disabled Applets</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="treeviewDisabledApplets">
+ <property name="width_request">375</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vboxEpiphany">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">18</property>
+ <child>
+ <object class="GtkVBox" id="vbox9">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox14">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Safe Protocols</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox10">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="buttonDisableUnsafeProtocols">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbuttonDisableUnsafeProtocols">
+ <property name="label" translatable="yes">Disable _unsafe protocols</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hboxSafeProtocols">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="treeviewSafeProtocols">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox11">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkButton" id="buttonSafeProtocolAdd">
+ <property name="label">gtk-add</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</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="buttonSafeProtocolEdit">
+ <property name="label">gtk-edit</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="buttonSafeProtocolRemove">
+ <property name="label">gtk-remove</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox15">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkButton" id="helpbutton">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</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="closebutton">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-11">helpbutton</action-widget>
+ <action-widget response="-7">closebutton</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/admin-tool/lockdown/safeprotocols.py b/admin-tool/lockdown/safeprotocols.py
index 1cc0822..245e87c 100644
--- a/admin-tool/lockdown/safeprotocols.py
+++ b/admin-tool/lockdown/safeprotocols.py
@@ -26,8 +26,6 @@ try:
except:
from sets import Set as set
-from sabayon import errors
-from sabayon import debuglog
import globalvar
import simpleeditabletreeview
@@ -62,7 +60,6 @@ class PessulusSafeProtocols:
self.sensitive = sensitive
self.__update_sensitivity ()
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_notified (self, data):
(list, mandatory) = globalvar.applier.get_list (self.key,
gconf.VALUE_STRING)
@@ -73,13 +70,11 @@ class PessulusSafeProtocols:
if mandatory != self.lockdownbutton.get ():
self.lockdownbutton.set (mandatory)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_lockdownbutton_toggled (self, lockdownbutton, mandatory):
globalvar.applier.set_list (self.key, gconf.VALUE_STRING,
list (self.safe_protocols),
mandatory)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_treeview_changed (self, simpleeditabletreeview, new_set):
if new_set != self.safe_protocols:
self.safe_protocols = new_set.copy ()
@@ -99,7 +94,6 @@ class PessulusSafeProtocols:
self.__update_sensitivity ()
self.simpleeditabletreeview.update_set (self.safe_protocols)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_PESSULUS)
def __on_destroyed (self, treeview):
if self.notify_id:
if globalvar.applier:
diff --git a/admin-tool/lockdown/simpleeditabletreeview.py b/admin-tool/lockdown/simpleeditabletreeview.py
index ec38671..04bfcbc 100644
--- a/admin-tool/lockdown/simpleeditabletreeview.py
+++ b/admin-tool/lockdown/simpleeditabletreeview.py
@@ -22,9 +22,6 @@ import gobject
import gtk
import sys
-from sabayon import errors
-from sabayon import debuglog
-
try:
set
except:
@@ -88,10 +85,7 @@ class PessulusSimpleEditableTreeview (gobject.GObject):
# and don't edit it, it shouldn't be really added
self.cell.connect("editing-canceled", self.__on_cell_editing_canceled)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_cell_edited (self, cell, path, new_text):
- debuglog.uprint ('PessulusSimpleEditableTreeview: edited cell; new contents: "%s"', new_text)
-
self.editing = False
self.__update_sensitivity ()
@@ -126,12 +120,10 @@ class PessulusSimpleEditableTreeview (gobject.GObject):
self.__update_model ()
self.emit ("changed", self.content_set)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_cell_editing_started (self, cell, editable, path):
self.editing = True
self.__update_sensitivity ()
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_cell_editing_canceled (self, cell):
self.editing = False
self.__update_sensitivity ()
@@ -140,20 +132,14 @@ class PessulusSimpleEditableTreeview (gobject.GObject):
del (self.liststore[self.new_edited_path])
self.new_edited_path = None
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_add_button_clicked (self, button):
- debuglog.uprint ("PessulusSimpleEditableTreeview: add button clicked")
-
# add a row and start editing it
iter = self.liststore.append ()
path = self.liststore.get_path (iter)
self.treeview.set_cursor_on_cell (path, self.column, self.cell, True)
self.new_edited_path = path
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_edit_button_clicked (self, button):
- debuglog.uprint ("PessulusSimpleEditableTreeview: edit button clicked")
-
model, iter = self.treeview.get_selection ().get_selected ()
# if nothing selected...
@@ -164,10 +150,7 @@ class PessulusSimpleEditableTreeview (gobject.GObject):
path = model.get_path (iter)
self.treeview.set_cursor_on_cell (path, self.column, self.cell, True)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_remove_button_clicked (self, button):
- debuglog.uprint ("PessulusSimpleEditableTreeview: remove button clicked")
-
model, iter = self.treeview.get_selection ().get_selected ()
# if nothing selected...
@@ -200,7 +183,6 @@ class PessulusSimpleEditableTreeview (gobject.GObject):
self.__update_model ()
self.emit ("changed", self.content_set)
- @errors.checked_callback (debuglog.DEBUG_LOG_DOMAIN_USER)
def __on_treeselection_changed (self, treeselection):
self.__update_sensitivity ()
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 97a1d71..940e9fa 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,7 +8,7 @@ admin-tool/gconfviewer.py
admin-tool/groupsdialog.py
admin-tool/lockdown/lockdownbutton.py
admin-tool/lockdown/maindialog.py
-admin-tool/lockdown/pessulus.glade
+[type: gettext/glade]admin-tool/lockdown/pessulus.ui
admin-tool/profilesdialog.py
admin-tool/sabayon
admin-tool/sabayon-apply
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]