On Friday, February 11, 2011 12:18:12 pm Johannes Meixner wrote:
> Hello,
>
> On Feb 11 11:39 Thomas Goettlicher wrote (excerpt):
> > We should design YaST in a similar way. Adding a new module
> > e.g. flux capacitor configuration _must_ be easy!
>
> As an example assume there is a software which provides
> a horrible stack of any kind of scripts to install it
> plus any kind of GUI programs to configure it.
>
> Aassume that for this software plain "rpm" is insufficient
> to install it (e.g. assume this software needs a special
> kind of activation or authentication by its end-user).
>
> Now a single user of this software (not the developer team
> of this software - but perhaps an user who provides
> this software "as is" via the openSUSE build service)
> likes to contribute a YaST module to install and configure
> this software.
>
> What he wants to implement is a YaST module which provides
> a frontend that asks for particular installation parameters
> and calls each of the scripts one by one to get it installed
> and then the YaST module runs the software's GUI programs
> which configure the software.
>
> Would it be easy to implement such a YaST module?
I hope I understood your use case correctly. Please correct me if I'm wrong.
You have some shell scripts that need be be called with parameters and the
return code indicates if everything went fine. You create a plugin for the
commonlib or in Robert's notation a "configuration module" that abstracts
these shell scripts. Let's say this module provides an api function bool
flux::first_time_installation(parameter) it calls your shell script and
returns its exit value.
The whole business logic is implemented now. If you don't add anything else
your yast offers automatically a configuration module for flux that shows an
input field for first_time_installation(). You can test whether your business
logic works. That's a poor ui and you want to improve it. Your next step is to
polish the ui and replace the automatically generated ui module with your code
that represents your workflow.
> Basically such a YaST module would have a simple
> straightfoward workflow where YaST GUI dialogs
> which ask for particular installation parameters
> run intermixed with code which changes the system
> (the scripts and the software's GUI programs).
>
> I would be more than happy if it was possible to implement
> such a YaST module in a single YaST source code file like:
> ------------------------------------------------------------------
> import basic yast stuff
> import yast gui elements
> import run external non-gui programs
> import run external gui programs
>
> repeat
> { show dialog which asks for parameters for first script
> } until check of parameters for first script is o.k.
>
> run first script
>
> if first script results failure
> then show error popup and exit 1
>
> ...
>
> repeat
> { show dialog which asks for parameters for last script
> } until check of parameters for last script is o.k.
>
> run last script
>
> if last script results failure
> then show error popup and exit 1
>
> show popup that installation is completed
>
> show feedback that first GUI program is launched
>
> run first GUI program
>
> close feedback that first GUI program is launched
>
> if first GUI program results failure
> then show error popup and exit 1
>
> ...
>
> show feedback that last GUI program is launched
>
> run last GUI program
>
> close feedback that last GUI program is launched
>
> if last GUI program results failure
> then show error popup and exit 1
>
> show popup that configuration is completed
>
> exit 0
> ------------------------------------------------------------------
>
>
> Kind Regards
> Johannes Meixner
--
Thomas Goettlicher
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]