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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1717 - (show annotations) (download) (as text)
Wed Feb 21 03:13:31 2007 UTC (8 years, 3 months ago) by agaffney
File MIME type: text/x-python
File size: 2874 byte(s)
split Daemons.py into Logger.py and CronDaemon.py and add both to gtkfe.py
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 from GLIScreen import *
8 from ProgressDialog import *
9
10 class Panel(GLIScreen):
11
12 title = "Logging Daemon"
13 active_selection = None
14 radio_loggers = {}
15 _helptext = """
16 <b><u>Logging Daemon</u></b>
17
18 Pick a logger. The most common choice is syslog-ng. This option is not \
19 available in Networkless mode.
20 """
21 loggers = [ "syslog-ng", "metalog", "sysklogd" ]
22
23 def __init__(self, controller):
24 GLIScreen.__init__(self, controller)
25 vert = gtk.VBox(False, 0)
26 vert.set_border_width(10)
27
28 if self.controller.install_type == "networkless":
29 hbox = gtk.HBox(False)
30 label = gtk.Label()
31 label.set_markup('<b>Your logger will be syslog-ng</b>')
32 hbox.pack_start(label, expand=False, fill=False, padding=0)
33 vert.pack_start(hbox, expand=False, fill=False, padding=20)
34 else:
35 hbox = gtk.HBox(False)
36 label = gtk.Label()
37 label.set_markup('<b>Choose your logger</b>')
38 hbox.pack_start(label, expand=False, fill=False, padding=0)
39 vert.pack_start(hbox, expand=False, fill=False, padding=20)
40
41 for logger in self.loggers:
42 hbox = gtk.HBox(False, 0)
43 if logger == self.loggers[0]:
44 self.radio_loggers[logger] = gtk.RadioButton(None, logger)
45 else:
46 self.radio_loggers[logger] = gtk.RadioButton(self.radio_loggers[self.loggers[0]], logger)
47 self.radio_loggers[logger].set_name(logger)
48 self.radio_loggers[logger].connect("toggled", self.logger_selected, logger)
49 hbox.pack_start(self.radio_loggers[logger], expand=False, fill=False, padding=20)
50 vert.pack_start(hbox, expand=False, fill=False, padding=20)
51
52 self.add_content(vert)
53 self.boot_devices = None
54
55 def logger_selected(self, widget, data=None):
56 self.active_selection = data
57
58 def activate(self):
59 self.controller.SHOW_BUTTON_BACK = True
60 self.controller.SHOW_BUTTON_FORWARD = True
61 if self.controller.install_type != "networkless":
62 self.active_selection = self.controller.install_profile.get_logging_daemon_pkg() or self.loggers[0]
63 self.radio_loggers[self.active_selection].set_active(True)
64
65 def next(self):
66 if self.controller.install_type == "networkless":
67 self.controller.install_profile.set_logging_daemon_pkg(None, self.loggers[0], None)
68 else:
69 self.controller.install_profile.set_logging_daemon_pkg(None, self.active_selection, None)
70 self.controller.load_screen("CronDaemon")
71 # progress = ProgressDialog(self.controller, ("install_logger", ), self.progress_callback)
72 # progress.run()
73
74 # def progress_callback(self, result, data=None):
75 # if result == PROGRESS_DONE:
76 # self.controller.load_screen("Timezone")
77 # else:
78 # GLIScreen.progress_callback(self, result, data)

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.20