From 42191726e37c9da11caca46119a6c877ab28319c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 9 Jun 2004 10:17:52 +0000 Subject: Allow 3rd parties wizards to be added to mcc. --- README.adding_wizard | 25 +++++++++++++++++++++++++ drakwizard.pl | 9 +++++++++ 2 files changed, 34 insertions(+) create mode 100644 README.adding_wizard diff --git a/README.adding_wizard b/README.adding_wizard new file mode 100644 index 00000000..5bca8c5c --- /dev/null +++ b/README.adding_wizard @@ -0,0 +1,25 @@ +Since the cvs version of 09/06/2004, third parties may add a wizard to the +mcc. + +First thing to do is to write the wizard, based on interactive, like +a normal wizard ( see the source code of the ones currently used, +on http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/wizard_perl/ ). +In short, it should be a perl module, placed in perl search path, in MDK/Wizard/ +hierarchy. You need to fill a special structure that describe the wizard. + +Then, you need to place a file in /etc/wizard.d/, called +mywizard.conf, containing : + +NAME="module" +DESCRIPTION="the description" + + +DESCRIPTION is the description, in any language, there is nothing for translation +at the moment. This will be the description showed on the first page of the mcc. + +NAME is the same of the perl module to load, without the pm. +The line loading is equivalent to : + +require "MDK/Wizard/$NAME.pm"; + + diff --git a/drakwizard.pl b/drakwizard.pl index b8ce3f29..1823cb86 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -34,6 +34,7 @@ $::isWizard = 1; $::Wizard_no_previous = 1; $::Wizard_title = "Drakwizard"; $::Wiz_dir = '/usr/share/wizards/'; +$::Wiz_more_dir = "/etc/wizard.d/"; my $in = interactive->vnew; my %wiz = ( @@ -54,6 +55,14 @@ my %wiz = ( kolab => ['Kolab', N("Kolab server")], ); + +foreach my $file (glob_("$::Wiz_more_dir/*.conf")) +{ + next unless -f "$file"; + %tmp=getVarsFromSh($file); + $wiz{lc($file)}= [ %tmp{'NAME'}, %tmp{'DESCRIPTION'} ]; +} + @ARGV = grep { ! /^--/ } @ARGV; if (!defined($wiz{$ARGV[0]})) { $in->ask_from( -- cgit v1.2.1