| 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_crons = {} |
| 15 |
_helptext = """ |
| 16 |
<b><u>Logging Daemon</u></b> |
| 17 |
|
| 18 |
Pick a cron. The most common choice is syslog-ng. This option is not \ |
| 19 |
available in Networkless mode. |
| 20 |
""" |
| 21 |
crons = [ "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 cron daemon will be %s</b>' % crons[0]) |
| 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 cron daemon</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 cron in self.crons: |
| 42 |
hbox = gtk.HBox(False, 0) |
| 43 |
if cron == self.crons[0]: |
| 44 |
self.radio_crons[cron] = gtk.RadioButton(None, cron) |
| 45 |
else: |
| 46 |
self.radio_crons[cron] = gtk.RadioButton(self.radio_crons[self.crons[0]], cron) |
| 47 |
self.radio_crons[cron].set_name(cron) |
| 48 |
self.radio_crons[cron].connect("toggled", self.cron_selected, cron) |
| 49 |
hbox.pack_start(self.radio_crons[cron], 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 cron_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_cron_daemon_pkg() or self.crons[0] |
| 63 |
self.radio_crons[self.active_selection].set_active(True) |
| 64 |
|
| 65 |
def next(self): |
| 66 |
if self.controller.install_type == "networkless": |
| 67 |
self.controller.install_profile.set_cron_daemon_pkg(None, self.crons[0], None) |
| 68 |
else: |
| 69 |
self.controller.install_profile.set_cron_daemon_pkg(None, self.active_selection, None) |
| 70 |
progress = ProgressDialog(self.controller, ('install_logging_daemon', 'install_cron_daemon', 'install_filesystem_tools'), self.progress_callback) |
| 71 |
progress.run() |
| 72 |
|
| 73 |
def progress_callback(self, result, data=None): |
| 74 |
if result == PROGRESS_DONE: |
| 75 |
self.controller.load_screen("Bootloader") |
| 76 |
else: |
| 77 |
GLIScreen.progress_callback(self, result, data) |