/[gli]/branches/overhaul/src/fe/gtk/StartupServices.py
Gentoo

Contents of /branches/overhaul/src/fe/gtk/StartupServices.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1623 - (show annotations) (download) (as text)
Fri Jan 19 10:19:38 2007 UTC (7 years, 7 months ago) by agaffney
File MIME type: text/x-python
File size: 4052 byte(s)
remove Help button
rearrange Stage screen
1 # Copyright 1999-2005 Gentoo Foundation
2 # This source code is distributed under the terms of version 2 of the GNU
3 # General Public License as published by the Free Software Foundation, a copy
4 # of which can be found in the main directory of this project.
5
6 import gtk
7 import gobject
8 import GLIScreen
9 from gettext import gettext as _
10
11 class Panel(GLIScreen.GLIScreen):
12
13 title = _("Startup Services")
14 _helptext = """
15 <b><u>Startup Services</u></b>
16
17 If you installed gnome, kde, or another graphical desktop, be sure to select xdm
18 if you want to startup into your graphical environment.
19
20 sshd is also a recommended service already installed in the base system.
21 """
22
23 def __init__(self, controller):
24 GLIScreen.GLIScreen.__init__(self, controller)
25 vert = gtk.VBox(False, 0)
26 vert.set_border_width(10)
27
28 self.services = None
29 self.choice_list = [("alsasound", _(u"Loads ALSA modules and restores mixer levels")),
30 ("apache", _(u"Common web server (version 1.x)")),
31 ("apache2", _(u"Common web server (version 2.x)")),
32 ("distccd", _(u"Allows your system to help other systems compile")),
33 ("hdparm", _(u"Makes it easy to set drive parameters automatically at boot")),
34 ("portmap", _(u"Necessary for mounting NFS shares")),
35 ("proftpd", _(u"Common FTP server")),
36 ("sshd", _(u"OpenSSH server (allows remote logins)")),
37 ("xfs", _(u"X Font Server (available if xorg-x11 compiled with USE=font-server)")),
38 ("xdm", _(u"Gives you a graphical login which then starts X"))]
39
40 content = """
41 On this screen, you can select services that you would like to startup at boot.
42 Common choices are sshd (remote access) and xdm (graphical login...choose this
43 for kdm, gdm, and entrance, as well). Adding a service here does not
44 automatically emerge the corresponding package. You will need to add it on the
45 Extra Packages screen yourself.
46 """
47 content_label = gtk.Label(content)
48 vert.pack_start(content_label, expand=False, fill=False, padding=0)
49
50 self.treedata = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING)
51 self.treeview = gtk.TreeView(self.treedata)
52 self.toggle_renderer = gtk.CellRendererToggle()
53 self.toggle_renderer.set_property("activatable", True)
54 self.toggle_renderer.connect("toggled", self.flag_toggled)
55 self.columns = []
56 self.columns.append(gtk.TreeViewColumn("", self.toggle_renderer, active=0))
57 self.columns.append(gtk.TreeViewColumn("Service", gtk.CellRendererText(), text=1))
58 self.columns.append(gtk.TreeViewColumn("Description", gtk.CellRendererText(), text=2))
59 for column in self.columns:
60 # column.set_resizable(True)
61 self.treeview.append_column(column)
62 self.treewindow = gtk.ScrolledWindow()
63 self.treewindow.set_size_request(-1, 180)
64 self.treewindow.set_shadow_type(gtk.SHADOW_IN)
65 self.treewindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
66 self.treewindow.add(self.treeview)
67 vert.pack_start(self.treewindow, expand=False, fill=False, padding=10)
68
69 self.add_content(vert)
70
71 def flag_toggled(self, cell, path):
72 model = self.treeview.get_model()
73 model[path][0] = not model[path][0]
74 service = model[path][1]
75 if model[path][0]:
76 if not service in self.services:
77 self.services.append(service)
78 else:
79 if service in self.services:
80 self.services.pop(self.services.index(service))
81
82 def deactivate(self):
83 self.controller.install_profile.set_services(None, ",".join(self.services), None)
84 return True
85
86 def activate(self):
87 self.controller.SHOW_BUTTON_EXIT = True
88 # self.controller.SHOW_BUTTON_HELP = True
89 self.controller.SHOW_BUTTON_BACK = True
90 self.controller.SHOW_BUTTON_FORWARD = True
91 self.controller.SHOW_BUTTON_FINISH = False
92
93 self.services = self.controller.install_profile.get_services()
94 if self.services:
95 if isinstance(self.services, str):
96 self.services = self.services.split(',')
97 else:
98 self.services = list(self.services)
99 else:
100 self.services = []
101 self.treedata.clear()
102 for choice in self.choice_list:
103 self.treedata.append([(choice[0] in self.services), choice[0], choice[1]])

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20