site  contact  subhomenews

welcome1stboot rewritten in BaCon

April 12, 2011 — BarryK
'welcome1stboot' is the initial help window the first time that you boot Puppy. In a standard Woof-built Puppy, a text message appears at the top of the screen at first boot, and mouse-over the message launches the help window.

It used to be, in older puppies, that this welcome help window was a HTML page opened in a web browser, which was slow if it had to be opened with SeaMonkey or Firefox on old hardware. So, we put faster HTML viewers into Puppy. Then I tried the help window as just a PNG image, then the most recent it is a shell script that uses gtkdialog.

Wary and Quirky and all recent standard Woof-built puppies have this gtkdialog script. It works well, startup is fast.

Well, I just can't leave this one alone, and have now rewritten it in BaCon. In Woof, the binary executable is now /usr/sbin/welcome1stboot, launched from /usr/sbin/delayedrun. Here is a snapshot:



In the 'devx' there will also be /usr/sbin/welcome1stboot.pot, welcome1stboot.bac and welcome1stboot.pupdev -- the latter is a text file that explains how to compile welcome1stboot.bac and how to create a language file for any country from welcome1stboot.pot.

Comparison with gtkdialog script
The gtkdialog script is much smaller, only about 7KB compared with the compiled executable 46KB.

The gtkdialog script used to be at /usr/share/doc/welcome1stboot, and it is 97 lines (some lines are very long), including blank lines and comments. welcome1stboot.bac is 148 lines. The BaCon program is a little bit more verbose, but does have some extra functionality, such as tooltips on the buttons.

The BaCon version has some major advantages over the gtkdialog version. One is precise placement and control of widgets in the window. Another is that although I wrote it using HUG (Highlevel Universal GUI) it can drop down to raw GTK functions at any time (and my program has one example of that, for the tooltips). I think that HUG offers more functionality than gtkdialog, but the raw GTK functions extends that dramatically.

The source code
I have uploaded the compiled welcome1stboot, and the .pot, .pupdev and .bac files as a tarball (19KB):
http://distro.ibiblio.org/quirky/test/welcome1stboot-20110412.tar.gz

You will need the latest 20110412 BaCon PETs to compile it, see my blog post:
http://bkhome.org/archive/blog2/201104/bacon-1022pre-20110407.html

International language support
I intend that all BaCon apps that I write will have support for international languages. If you would like to create a translation file for your country, the .pupdev file in the tarball explains how to create it.
What you would do is create a file, say 'de.po' for German, then you can email it to me at bkaulerATgmailDOTcom and I will put it into Woof.

.pot, .pupdev, .bac
For all executables written in BaCon, I intend to also provide .pot, .pupdev and .bac files in the 'devx' sfs (in the same directory as the binary executable):
.bac BaCon source code
.pot International language file
.pupdev instructions

Comments

Text editor for BaCon source
Username: BarryK
If you run Wary or Quirky, you will already have NicoEdit, which supports color highlighting of BaCon code. If you don't have it, install the PET. There is also a Vim PET. http://distro.ibiblio.org/quirky/pet_packages-quirky/nicoedit-2.5.3-q1.pet http://distro.ibiblio.org/quirky/pet_packages-wary5/vim-7.3-bk1-w5.pet Install the BaCon PETs last, as they have bacon.lang and bacon.vim files that are the most recent.

Existing gtkdialog scripts
Username: BarryK
"Note, this does not mean that I am going to rewrite some of my other scripts that use gtkdialog (or Xdialog, or anything else). The welcome1stboot gtkdialog script had layout problems -- such as the bottom text getting chopped off with certain screens, and a too-wide left margin. Gtkdialog has a bug, when the window contains markup text, it can miscalculate window dimensions -- I reported this to the developer years ago but gtkdialog is a dead project.

3builddistro
Username: BarryK
"Another note for developers who use Woof. What causes .bac, .pot and .pupdev files to end up in the 'devx' SFS is the '3builddistro' script. Your chosen packages get accumulated in sandbox3/rootfs-complete, and dev-components into sandbox3/devx. 3builddistro now search through rootfs-complete and moves all .bac, .pot, and .pupdev files to devx. 'cause, those files won't be needed for normal running, only for development purposes. So, if you create a PET yourself that has a program written in BaCon, put in those extra files alongside the binary executable. If the PET is included when Woof builds a Puppy system, then those extra files will get moved to the 'devx'.

bacon, nicoedit
Username: 01micko
"spup (one I'm working on) didn't use nicoedit because it always crashed. Today I recompiled it, mainly for the bacon syntax highlighting, works fine now. An interesting note, there is a script in there called "bk_package". Did you write that? (I don't think so). Anyway, it didn't work so I made it work and reuploaded the source. http://www.brainwavedesigncentral.net/micko01/stuff/puppy/src/nicoedit-2.5.3-1.tar.gz The script now needs a version number as an argument. Just neater IMO.

Re bk_package
Username: BarryK
"I don't remember it. I think there are some scripts in that source that I contributed, but they aren't needed. My memory on this is vague, but the 'waf' build system works fine.

widget dimensions
Username: L18L
"I am coming right now from from tweaking some widget dimensions, see http://www.murga-linux.com/puppy/viewtopic.php?p=512904 rodin.s, hope it will fit for Russion, too .

welcome1stboot update
Username: BarryK
"Here is the latest welcome1stboot: http://distro.ibiblio.org/quirky/test/welcome1stboot-20110414final.tar.gz Note, you must have my latest BaCon PETs for this app to display correctly. I have de and ru language translations, see: http://www.murga-linux.com/puppy/viewtopic.php?t=48901&start=300 This will be in the upcoming Quirky 1.5-beta1 and anyone is welcome to submit more translations.

welcome1stboot fr translation
Username: BarryK
"Thanks to JJM who has contributed a French translation for welcome1stboot: [img]http://distro.ibiblio.org/quirky/test/welcome1stboot-fr.png[/img] As BaCon HUG uses absolute-coordinate postioning of widgets, compared with the relative packing technique in gtkdialog, it will be up to the translators to create text that fills the widgets nicely. JJM commented that /usr/lib/hug.so is not in Wary, needed by welcome1stboot. Yes, that is in my BaCon PET package, and I expect that library to be in all future puppies.

Re latest BaCon
Username: BarryK
"rodin.s, Yeah, I widened some widgets for the fr translation, so ru should work. I posted a snapshot of ru translation here: http://murga-linux.com/puppy/viewtopic.php?p=513323#513323

Should Bacon be used for your Report-Video tool
Username: GCMartin
"Barry, @TazOC has [url=http://www.murga-linux.com/puppy/viewtopic.php?p=514571#514571]rearrange couple features of your tool. Adds additional help for analyzing issues with video. After thoughts your Bacon may be a candidate for its underpinning. I'm not sure, but i thought I ask, Would it be a candidate? Hope this helps.


Tags: woof