diff options
author | Cecil Hugh Watson <knoppmyth@gmail.com> | 2010-08-28 21:23:23 (GMT) |
---|---|---|
committer | Cecil Hugh Watson <knoppmyth@gmail.com> | 2010-08-28 21:23:23 (GMT) |
commit | f83117d46d8fc1f6192783371a68607a192c3276 (patch) | |
tree | 21bf30aeb943fe6cb23eb9c62a0ba899de2af0d7 /build_tools/l7/larch0/gui/front/page_mediumprofile.py | |
parent | 69a0137390be9816d5ec5dc9e81d48817a817758 (diff) | |
download | linhes_dev-f83117d46d8fc1f6192783371a68607a192c3276.zip |
Larch 7
Diffstat (limited to 'build_tools/l7/larch0/gui/front/page_mediumprofile.py')
-rw-r--r-- | build_tools/l7/larch0/gui/front/page_mediumprofile.py | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/build_tools/l7/larch0/gui/front/page_mediumprofile.py b/build_tools/l7/larch0/gui/front/page_mediumprofile.py new file mode 100644 index 0000000..0ebb769 --- /dev/null +++ b/build_tools/l7/larch0/gui/front/page_mediumprofile.py @@ -0,0 +1,87 @@ +# page_mediumprofile.py - Handler for the project settings page +# +# (c) Copyright 2010 Michael Towers (larch42 at googlemail dot com) +# +# This file is part of the larch project. +# +# larch 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. +# +# larch 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 larch; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +#---------------------------------------------------------------------------- +# 2010.07.14 + + +class MediumProfile: + def __init__(self): + ui.widgetlist(fss('fetch_layout', 'page_mediumprofile.uim')) + + ui.connectlist( + (':bootlines*clicked', self.editbootlines), + (':grubtemplate*clicked', self.editgrub), + (':syslinuxtemplate*clicked', self.editsyslin), + (':cdroot*clicked', self.browsecdroot), + (':nosessionsave*toggled', self.nosessionsave), + ) + + + def enter(self): + """This is called when the page is entered/selected/shown. + It performs initializations which depend on the state. + """ + docviewer.gohome('gui_mediumprofile.html') + ui.command(':nosessionsave.set', fss('isfile', 'profile:nosave')) + + +# def data(self, key): +# return ui.command('mediumprofile_page_data.get', key) + + + def editbootlines(self): + edit('profile:bootlines', 'base:data/bootlines') + + + def editgrub(self): + f0 = 'profile:cd-root/grub0/menu.lst' + if not fss('isfile', f0): + f0 = 'base:cd-root/grub0/menu.lst' + edit('profile:cd-root/grub/menu.lst', f0) + + + def editsyslin(self): + f0 = 'profile:cd-root/isolinux0/isolinux.cfg' + if not fss('isfile', f0): + f0 = 'base:cd-root/isolinux0/isolinux.cfg' + edit('profile:cd-root/isolinux/isolinux.cfg', f0) + + + def browsecdroot(self): + fss('browse', 'profile:cd-root') + + + def nosessionsave(self, on): + """Whether session saving is available is firstly determined by + the writability of the boot device (assuming the extension + feature to allow the use of other devices is not being used). + The standard scripts will also not offer session saving if the + file larch/nosave is present on the boot medium. + """ + ns = fss('isfile', 'profile:nosave') + if on: + if not ns: + fss('savefile', 'profile:nosave', + "Suggestion to disable session saving" + " (can be overridden)") + else: + fss('rm_rf', 'profile:nosave') + |