[SOLVED] Convert gtkdialog3 progressbar script: ' to "

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

[SOLVED] Convert gtkdialog3 progressbar script: ' to "

#1 Post by Argolance »

Hello,
:oops: ... Tried in vain to convert this script (simple quotes):

Code: Select all

[...]
export PPalb_splash='
<window decorated="false" title="2Palb" icon-name="gtk-dialog-info">
<vbox>
 <frame  $Loc_bs_frame >
  <text><input file>/root/.2Palb/2Palb-splashtext</input></text>
  <progressbar>
   <input>while [ "$I" != "100" ]; do I=`cat /root/.2Palb/2Palb-splash`; echo $I; usleep 500000; done</input>
   <action type="exit">Ready</action>
  </progressbar>
 </frame>
</vbox>
</window>'

gtkdialog3 --program=PPalb_splash --center
to this (double quotes):

Code: Select all

[...]
export PPalb_splash="
<window decorated=\"false\" title=\"2Palb\" icon-name="gtk-dialog-info">
<vbox>
 <frame  $Loc_bs_frame >
  <text><input file>/root/.2Palb/2Palb-splashtext</input></text>
  _______________ ?
<progressbar>
   <input>while [ "$I" != "100" ]; do I=`cat /root/.2Palb/2Palb-splash`; echo $I; usleep 500000; done</input>
   <action type="exit">Ready</action>
  </progressbar>
  _______________ ?
 </frame>
</vbox>
</window>"

gtkdialog3 --program=PPalb_splash --center
Thanks for your attention!

Regards.
Last edited by Argolance on Tue 28 Jun 2011, 11:40, edited 2 times in total.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#2 Post by Argolance »

Hello,
Nobody to help?
I need this script to be converted because localization variables seem not working with gtkdialog export PPalb_splash=' [...] </window>
'(simple quote):

Code: Select all

#! /bin/bash

#-- simple localization for scripts by Shinobar based on MU. 
mo=2Palb.mo
# set locale
for lng in C $(echo $LANGUAGE|cut -d':' -f1) $LC_ALL $LANG;do :;done   # ex. ja_JP.UTF-8
# search locale file
lng1=$(echo $lng|cut -d'.' -f1)   # ex. ja_JP
lng2=$(echo $lng|cut -d'_' -f1)   # ex. ja
LOCALEDIR=/usr/share/locale
[ "$mo" ] || mo=$(basename $0).mo
for D in C en $lng2 $lng1 $lng
do
   F="$LOCALEDIR/$D/LC_MESSAGES/$mo"
   [ -f "$F" ] && . "$F"
done

export PPalb_splash='
<window decorated="false" title="2Palb" icon-name="gtk-dialog-info">
<vbox>
 <frame  $Loc_bs_frame >
  <text><input file>/root/.2Palb/2Palb-splashtext</input></text>
  <progressbar>
   <input>while [ "$I" != "100" ]; do I=`cat /root/.2Palb/2Palb-splash`; echo $I; usleep 500000; done</input>
   <action type="exit">Ready</action>
  </progressbar>
 </frame>
</vbox></window>
'
gtkdialog3 --program=PPalb_splash --center
Merci!

Regards.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#3 Post by Argolance »

Hello,
I found the solution:

Code: Select all

<frame  '$Loc_bs_frame' > 
instead of

Code: Select all

<frame  $Loc_bs_frame > 
for the localization variable to be taken in account and the progressbar to run correctly!
Regards.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#4 Post by zigbert »

Code: Select all

export PPalb_splash='
<window decorated="false" title="2Palb" icon-name="gtk-dialog-info">
<vbox>
 <frame  '$Loc_bs_frame' >
  <text><input file>/root/.2Palb/2Palb-splashtext</input></text>
  <progressbar>
   <input>while [ "$I" != "100" ]; do I=`cat /root/.2Palb/2Palb-splash`; echo $I; usleep 500000; done</input>
   <action type="exit">Ready</action>
  </progressbar>
 </frame>
</vbox></window>
'
I changed line 4
<frame '$Loc_bs_frame' >

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#5 Post by Argolance »

Thanks a lot!

Post Reply