[ Thread Index |
Date Index
| More lists.tuxfamily.org/slitaz Archives
]
Hello all,
First I'm sorry for my bad english ;)
Short version : I need some help to understand gtkdialog; I need to
know what do you thing about this work :
I work on a generic tool to display the progression of a script as
SliTaz tools do, named report. Actually it display the progression in
the terminal and create html log with hilighted errors. I want to add
some new options, like generate colored text log, set the level of
verbosity, use a debug mode or generate gui progress box.
The goal is to code a generic report tool wich can be used as a library
by all others SliTaz tools. An exemple of how it works :
Sample script :
report start
report step "Step 1"
some code
report step "Step 2"
report open-bloc
report step "Step 2.1"
some code
report step "Step 2.2"
some code
report stop
Sample output :
Step 1 [ Ok/Warning/Failed ]
Step 2 ...
===============================================
Step 2.1 [ Ok/Warning/Failed ]
Step 2.2 [ Ok/Warning/Failed ]
===============================================
.... Step 2 [ Ok/Warning/Failed ]
By default, the output only print the errors of 'some code', and the
log contain all informations about the progression (steps, code output
and hilighted errors). By exemple, if there was error in step 2.1, we
will see in the term :
Step 1 [ Ok ]
Step 2 ...
===============================================
Step 2.1 [ Failed ]
~~~~~~~~~~~ Errors ~~~~~~~~~~~~~~~
> Error 1
> Error 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step 2.2 [ Ok ]
===============================================
.... Step 2 [ Warning ]
Many options will be avaible to customize the look and the content of
the output and the logfile. Now here's my problem : How can I generate
a GTK GUI with gtkdialog wich look like Gdebi (little package installer
in Debian). I hope someone can give me some examples or advice because
gtkdialog seems hard to use and I'm lost with it. Here's an example of
what I want to do :
GUI during run without details :
________________________________________________
| Command launched |
| |
| Current step (dynamic) |
| |
| > Details |
| |
| [ Abord ] |
|_______________________________________________|
GUI during run with details :
________________________________________________
| Command launched |
| |
| Current step (dynamic) |
| |
| || Details |
| ________________________________ |
| | | |
| | * Step 1 OK | |
| | * Step 2 Running | |
| | Step 2.1 Failed | |
| | Step 2.2 Running | |
| |_______________________________| |
| |
| [ Abord ] |
|_______________________________________________|
Gui at the end, without details :
________________________________________________
| Command launched |
| |
| Finished: Status |
| |
| > Details |
| |
| [ Show Log ] [ OK ] |
|_______________________________________________|
As result, a command like 'tazpkg get-install pkg' will show the normal
output, but tazpkgbox will use a command to launch the report in GUI
mode, by exemple : 'tazpkg get-install pkg -X' where -X is the generic
option to configure report in GTK GUI mode. With this we can easily
replace xterm box by GUI box in all the SliTaz GUI tools.
Note : I've called this library libtaz and actually it contains also
some generics functions like status, check_dir, check_root; a generic
tool to handle options in command (like -X for GUI, -D for debug, -S
for silent, -V for verbose, -L for logfile, etc.); some generic css and
pictures wich can be used by SliTaz html docs/logs and tazbb/mercurial
reports and an /etc/slitaz/slitaz.conf with some generic variable. I
started this project because I find that we can save some Ko and
simplify scripting while deleting duplicates function in SliTaz scripts.
It's designed to be easily integred in already existent tools and I
code it in parallel of a new tool : tazhack. I use this tool to keep
packages/sources/wok synchonized with online repos and to manage them.
The final goal with it is to release a tool wich can be used to easily
maintain fork of SliTaz (like aircrack, ophcrack, joomla, etc.)
If someone give me an access in SliTaz peoples I will send my work on
for testing purposes, but note that's alpha versions. My roadmap is to
release beta version in the middle of the release cycle
(september/october), this way everybody can include report in the other
scripts, and a final stable version before 4.0 release (let's say
december - before the feature freeze). The beta will use the definitive
syntax for report tool then I will just add some new options if needed,
work on others functions and fix bugs.
--
GoKhlaYeh <gokhlayeh@xxxxxxxxxx>
---
SliTaz GNU/Linux Mailing list - http://www.slitaz.org/