alterator-wizardface-2.0.1/000075500000000000000000000000001222061354500156225ustar00rootroot00000000000000alterator-wizardface-2.0.1/Makefile000064400000000000000000000005201222061354500172570ustar00rootroot00000000000000NAME=wizard all: clean: install: install-module install-sbin install-data include /usr/share/alterator/build/module.mak install-sbin: for i in sbin/* ;do install -Dpm755 $$i $(sbindir)/`basename $$i` ; done install-data: install -d $(datadir)/install2 for i in initinstall.d postinstall.d ;do cp -a $$i $(datadir)/install2 ;done alterator-wizardface-2.0.1/backend3/000075500000000000000000000000001222061354500172745ustar00rootroot00000000000000alterator-wizardface-2.0.1/backend3/step-list000075500000000000000000000017771222061354500211620ustar00rootroot00000000000000#!/bin/sh alterator_api_version=1 default_steps_file=/usr/share/install2/installer-steps old_step_dir=/usr/share/install2/steps new_step_dir=/usr/share/alterator/steps #turn off auto expansion set -f . alterator-sh-functions print_step() { while read uri help icon name;do write_table_item \ name "$uri" \ label "$name" \ help "$help" \ icon "$icon" done } on_message() { case "$in_action" in list) [ -n "$in_steps_file" ] || in_steps_file="$default_steps_file" if [ ! -s "$in_steps_file" ];then write_error "Step file \"$in_steps_file\" not found" return fi local p= while read f; do p="$(find -L $old_step_dir $new_step_dir -type f -name "$f.desktop" -print -quit)" [ -n "$p" ] || continue alterator-dump-desktop \ -v lang="$in_language" \ -v out="X-Alterator-URI;X-Alterator-Help;Icon;Name" \ -v def="/notfound;notfound;altlinux;" \ "$p" done<"$in_steps_file"| print_step ;; esac } message_loop alterator-wizardface-2.0.1/initinstall.d/000075500000000000000000000000001222061354500203765ustar00rootroot00000000000000alterator-wizardface-2.0.1/initinstall.d/90-alteratord.sh000075500000000000000000000001171222061354500233230ustar00rootroot00000000000000#!/bin/sh -efu . install2-init-functions service alteratord start >/dev/null alterator-wizardface-2.0.1/postinstall.d/000075500000000000000000000000001222061354500204205ustar00rootroot00000000000000alterator-wizardface-2.0.1/postinstall.d/01-wizard-log.sh000075500000000000000000000004261222061354500232560ustar00rootroot00000000000000#!/bin/sh -efu . install2-init-functions logfile="/tmp/wizard.log" logdir="$destdir/root/.install-log" [ -d "$destdir/root" -a -f "$logfile" ] || exit 0 mkdir -p -m700 -- "$logdir" sed -r 's;( passwd_?([12]|auto) ")([^"]|[\\]["])*";\1*";g' <"$logfile" >"$logdir/wizard.log" alterator-wizardface-2.0.1/sbin/000075500000000000000000000000001222061354500165555ustar00rootroot00000000000000alterator-wizardface-2.0.1/sbin/alterator-wizard000075500000000000000000000024721222061354500220030ustar00rootroot00000000000000#!/usr/bin/guile18 -s !# (use-modules (ice-9 getopt-long) (alterator common) (alterator telegraph) (alterator transport pipe-channel) (alterator lookout) (alterator logfile) (alterator d)) (define cmdline (command-line)) (define progname (car cmdline)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (usage progname) (format #t "Usage: ~A [-l]~%" progname) (format #t " -h, --help display help screen~%") (format #t " -f, --file file with list of steps~%") (format #t " -l,--local try to use local files (maps,po,layout,etc.) if available ~%~%") (format #t " Report bugs to ~%") (quit)) (define option-spec '((help (single-char #\h) (value #f)) (file (single-char #\f) (value #t)) (local (single-char #\l) (value #f)))) (define options (getopt-long cmdline option-spec)) (and (option-ref options 'help #f) (usage progname)) (if (option-ref options 'local #f) (begin (alterator-init-local) (d-init-local)) (alterator-init-global)) (and (option-ref options 'help #f) (usage progname)) (define *steps-file* (option-ref options 'file "/usr/share/install2/installer-steps")) (telegraph (pipe-in "/usr/bin/alterator-browser-qt" "/tmp") (lookout "/wizard" 'steps-file *steps-file*) (logfile "/tmp/wizard.log") (d)) (telegraph-start) alterator-wizardface-2.0.1/ui/000075500000000000000000000000001222061354500162375ustar00rootroot00000000000000alterator-wizardface-2.0.1/ui/wizard/000075500000000000000000000000001222061354500175375ustar00rootroot00000000000000alterator-wizardface-2.0.1/ui/wizard/index.scm000064400000000000000000000065341222061354500213620ustar00rootroot00000000000000(document:surround "/std/frame") (document:insert "/std/functions") (define wizardface (make-widget "wizardface")) (define *steps-file* (global 'steps-file)) ;;; Functions (define *step* (make-cell 0)) (define *step-list* (make-cell '())) (define (step) (cell-ref *step*)) (define (++step) (cell-set! *step* (+ (step) 1)) (step)) (define (--step) (cell-set! *step* (- (step) 1)) (step)) (define (last) (- (length (cell-ref *step-list*)) 1)) (define (url) (car (list-ref (cell-ref *step-list*) (step)))) (define (topic) (cdr (list-ref (cell-ref *step-list*) (step)))) (define (sure-yes key name list) (or (member key list) (wizard-id action-add (vector key name)))) (define (sure-no key name list) (and (member key list) (wizard-id action-remove key))) (define (action-name x) (vector-ref x 0)) (define (check-buttons step last) (with-translation _ "alterator-wizard" (let ((buttons (map action-name (wizard-id actions)))) (cond ((= step 0) (sure-yes 'forward (_ "Next") buttons) (sure-no 'backward (_ "Previous") buttons) (sure-no 'finish (_ "Finish") buttons)) ((< 0 step last) (sure-yes 'forward (_ "Next") buttons) (sure-yes 'backward (_ "Previous") buttons) (sure-no 'finish (_ "Finish") buttons)) ((= step last) (sure-no 'forward (_ "Next") buttons) (sure-yes 'backward (_ "Previous") buttons) (sure-yes 'finish (_ "Finish") buttons)))) #t)) (define (wizard:replace direction) (check-buttons (step) (last)) (frame:replace (url) 'frame:direction direction) (document:root help (woo-get-option (woo-read-first "/help/" 'topic (topic)) 'url))) (define (go-next light) (and (< (step) (last)) (or light (not (eq? (wizard-call "next") 'cancel))) (wizard-id current-step (++step)) (wizard:replace 'next))) (define (go-back light) (and (> (step) 0) (or light (not (eq? (wizard-call "previous") 'cancel))) (wizard-id current-step (--step)) (wizard:replace 'back))) (define (go-end light) (and (or light (not (eq? (wizard-call "next") 'cancel))) (document:end))) (define (name+help x) (cons (woo-get-option x 'name) (woo-get-option x 'help))) (define (label+icon x) (cons (woo-get-option x 'label) (woo-get-option x 'icon))) ;;; UI (frame:set-next (lambda() (go-next #t))) (frame:set-back (lambda() (go-back #t))) (frame:set-end (lambda() (go-end #t))) title (_ "Installation") (document:id wizard-id (frame:set-wizard (wizardface title (_ "Installation") name "wizardface" (frame:page) (when clicked (case (wizard-id current-action) ((finish) (go-end #f)) ((forward) (go-next #f)) ((backward) (go-back #f))))))) ;;; Logic (document:root (when loaded (catch/message (lambda() (wizardface-context-set!) (let ((step-list (woo-list "/step-list" 'steps_file *steps-file*))) (cell-set! *step-list* (map name+help step-list)) (wizard-id steps (map label+icon step-list) current-step 0) (wizard-id action-add 'help (_ "Help")) (wizard:replace 'next))))))