So package selection in PPM is calling the installwindow.sh instead of installpreview.sh. The user then can select a second package etc.
Then installwindow.sh upon exit calls installpreview.sh.
The problem I have is that all the PPM scripts have dialogs that require user input so there is no real gain if the user must stay there and confirm for every single package what to do.
The question is can you pre-set defaults in gtkdialogs so the process can go on unattended?
The idea is instead of re-writting all the PPM scripts, to have installwindow.sh set some flags that the PPM script can read and proceed unattended.
BTW my current installwindow.sh looks like this
Code: Select all
#!/bin/bash
OLD_DIALOG=$(ps | grep INSTALL_PETS_DIALOG | grep program | cut -f 1 -d ' ')
kill -9 $OLD_DIALOG
export TEXTDOMAIN=petget__installwindow.sh
export OUTPUT_CHARSET=UTF-8
[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
[ "$TREE1" != "" ] && echo "$TREE1" >> /tmp/pkgs_to_install || exit 1
install_package () {
# Should set some flags here for PPM scripts to proceed unattended.
for LINE in $(cat /tmp/pkgs_to_install)
do
TREE1=$LINE
/usr/local/petget/installpreview.sh
[ $? -ne 0 ] && sed -i "/${TREE1}/d" /tmp/pkgs_to_install
done
rm /tmp/pkgs_to_install
}
export -f install_package
export INSTALL_PETS_DIALOG='<window title="'$(gettext 'Install Puppy Packages')'" icon-name="gtk-about" default_height="200" default_width="300">
<vbox>
<text><label>'$(gettext 'The following packages will be installed')'</label></text>
<tree column-resizeable="false">
<label>'$(gettext 'Packages to install')'</label>
<variable>TREE2</variable>
<input'${APPICONXMLINSERT}'>cat /tmp/pkgs_to_install</input>
<action>refresh:TREE2</action>
<action signal="button-release-event">refresh:TREE2</action>
</tree>
<hbox>
<button>
<label>'$(gettext 'Install packages')'</label>
<action>install_package &</action>
<action type="exit">echo exiting</action>
</button>
<button>
<label>'$(gettext 'Cancel')'</label>
<action>rm /tmp/pkgs_to_install</action>
<action type="exit">echo exiting</action>
</button>
</hbox>
</vbox>
</window>'
gtkdialog --program=INSTALL_PETS_DIALOG
(the buttons for example look "ugly" to me but my gtkdialog knowledge is rudimentary )