Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import checklist
import datacombo
import math
from pyanaconda import iutil
from pyanaconda.constants import *
from pyanaconda.partIntfHelpers import *
from pyanaconda.storage.formats import *
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
FLAG_FORMAT = 1
FLAG_MIGRATE = 2
class WideCheckList(checklist.CheckList):
def toggled_item(self, data, row):
rc = True
if self.clickCB:
rc = self.clickCB(data, row)
if rc:
checklist.CheckList.toggled_item(self, data, row)
def __init__(self, columns, store, clickCB=None, sensitivity=False):
checklist.CheckList.__init__(self, columns=columns,
custom_store=store,
sensitivity=sensitivity)
# make checkbox column wider
sep = gtk.HSeparator ()
vbox.pack_start (sep, False, 15)
label = gui.MnemonicLabel(_("Select _additional languages to install "
"on the system:"))
label.set_alignment (0.0, 0.5)
label.set_line_wrap (True)
label.set_size_request(400, -1)
vbox.pack_start (label, False)
hbox = gtk.HBox (False, 5)
# langs we want to support
self.languageList = checklist.CheckList(1)
label.set_mnemonic_widget(self.languageList)
self.maxrows = 0
list = []
for locale in self.languages:
if locale == self.defaultLang or (locale in self.supportedLangs):
self.languageList.append_row((locale, ""), True)
list.append(locale)
else:
self.languageList.append_row((locale, ""), False)
self.maxrows = self.maxrows + 1
self.setCurrent(self.defaultLang)
self.table = gtk.Table (2, 8)
box.pack_start (self.table, False, 5)
y = 0
label = gui.WrappingLabel (_("You can use a firewall to allow "
"access to specific services on your "
"computer from other computers. Which "
"services, if any, do you wish to "
"allow access to ?"))
label.set_size_request(400, -1)
label.set_alignment(0.0, 0.0)
self.table.attach(label, 0, 2, y, y + 1, gtk.EXPAND | gtk.FILL, gtk.FILL, 5, 5)
y = y + 1
hbox = gtk.HBox(False, 10)
self.incoming = checklist.CheckList(1)
self.incoming.set_size_request(-1, 125)
incomingSW = gtk.ScrolledWindow()
incomingSW.set_border_width(5)
incomingSW.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
incomingSW.set_shadow_type(gtk.SHADOW_IN)
incomingSW.add(self.incoming)
for serv in self.firewall.services:
self.incoming.append_row ( (_(serv.get_name()), serv),
serv.get_enabled() )
self.table.attach (incomingSW, 0, 2, y, y + 1, gtk.EXPAND|gtk.FILL, gtk.FILL, 5, 5)
if self.firewall.enabled == 0:
self.disabled_radio.set_active (True)
import gtk
import checklist
import datacombo
import iutil
from constants import *
from partIntfHelpers import *
from storage.formats import *
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
FLAG_FORMAT = 1
FLAG_MIGRATE = 2
class WideCheckList(checklist.CheckList):
def toggled_item(self, data, row):
rc = True
if self.clickCB:
rc = self.clickCB(data, row)
if rc:
checklist.CheckList.toggled_item(self, data, row)
def __init__(self, columns, store, clickCB=None, sensitivity=False):
checklist.CheckList.__init__(self, columns=columns,
custom_store=store,
sensitivity=sensitivity)
# make checkbox column wider