Check-in [1b114f7fd0]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:1b114f7fd06c3cb398d36fd3a3a5dfb1349c982c
Date: 2012-02-10 08:58:37
User: BarryK
Comment:MoManager now manages XML files, bugfix finding owner pkg

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/momanager

@@ -11,10 +11,11 @@
 #120207 write translations to a folder in /root with full path, write.log, generate tarball.
 #120208 support SSS domains. (read comments in /usr/share/sss/menu_strings/menu_strings for more info)
 #120208 sync translated sss-file with master sss-file.
 #120209 desk_strings domain translates target files in-place, so need workaround when edit TRANSLATION variables in desk_strings.*
 #120209 ...ditto for script_strings
+#120210 add handling XML files.
 
 #***MOMANAGER IS ENGLISH ONLY (NOT GETTEXT'ED)***
 #it is for use by developers/translators with knowledge of english.
 
 PARAM1=""
@@ -104,13 +105,20 @@
  BASExAGTS="`basename "$xAGTS"`"
  xPTN=" ${BASExAGTS}$"
  PATHxAGTS="`dirname "$xAGTS"`"
  xxPTN="^${PATHxAGTS}$"
  zPTN="^${xAGTS}$"
- aPKGNAME="`grep "$xPTN" /root/.packages/builtin_files/* | head -n 1 | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev`" #test if pkg used in Woof build.
+ aPKGNAME="`grep "$xPTN" /root/.packages/builtin_files/* | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev`" #test if pkg used in Woof build.
  if [ "$aPKGNAME" ];then #confirm full path.
-  CONFIRM="`cat /root/.packages/builtin_files/${aPKGNAME} | sed -e 's%^ %/%' | tr -d '\n' | grep "$xAGTS"`"
+  for AAA in $aPKGNAME
+  do
+   CONFIRM="`cat /root/.packages/builtin_files/${AAA} | sed -e 's%^ %/%' | tr -d '\n' | grep "$xAGTS"`"
+   if [ "$CONFIRM" ];then
+    aPKGNAME="$AAA"
+    break
+   fi
+  done
   [ ! "$CONFIRM" ] && aPKGNAME=""
  fi
  [ ! "$aPKGNAME" ] && aPKGNAME="`grep "$zPTN" /root/.packages/*.files 2>/dev/null | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev | sed -e 's%\.files$%%'`" #test if user-installed pkg.
  #...return nothing if in Woof
  [ ! "$aPKGNAME" ] && [ -f "${PATHPREFIX}${xAGTS}" ] && aPKGNAME="WOOF" #file is in Woof.
@@ -258,10 +266,85 @@
 NOTOP_HELP_MSG="These are the top-level menu titles, or categories, that you see when you click on the 'Menu' button at bottom-left of the screen (or elsewhere in some puppies). The drop-down list is for those categories that do <i>not</i> have a translation for the <b>${ORIGLANG1}</b> locale (so they will display in English).
 If you wish to create a translation, select a file from the drop-down list, click the <b>Create</b> button. A text editor will open, then edit the <b>Name[${ORIGLANG1}]</b> entry, then save and quit the editor. Afterward, the menu will refresh and you will be able to see the change."
 export DLG_HELP_NOTOP="<window resizable=\"false\" title=\"MoManager: Help edit menu categories\" icon-name=\"${HELPICON}\" window_position=\"1\"><vbox><text use-markup=\"true\"><label>\"${NOTOP_HELP_MSG}\"</label><variable>VAR_HELP_NOTOP</variable></text><hbox><button><label>Close</label><action type=\"closewindow\">VAR_HELP_NOTOP</action></button></hbox></vbox></window>"
 NOTOPHELP_XML='<button><input file>/usr/local/lib/X11/mini-icons/mini-question.xpm</input><action type="launch">DLG_HELP_NOTOP</action></button>'
 
+#######XML#######
+#search $PATHPREFIX to avoid devx files...
+YESXML_XML='' ; NOXML_XML=''
+XMLFILES="`find ${PATHPREFIX}/usr/local -type f -name '*.xml' | sed "s%^${PATHPREFIX}%%" | sed -e 's% %SPACECHAR%g' | tr '\n' ' '`" #ex: /usr/local/apps/Connect/AppInfo.xml
+aPTN="xml:lang=\"${ORIGLANG1}\""  #ex: xml:lang="de"
+bPTN="xml:lang=\"${ORIGLANG12}\"" #ex: xml:lang="de_DE"
+for AXMLFILE in $XMLFILES
+do
+ AXMLFILE="`echo -n "$AXMLFILE" | sed -e 's%SPACECHAR% %g'`"
+
+ #want to know if from Woof or a builtin pkg or later-installed pkg...
+ BASEAXMLFILE="`basename "$AXMLFILE"`"
+ xPTN=" ${BASEAXMLFILE}$"
+ PATHAXMLFILE="`dirname "$AXMLFILE"`"
+ xxPTN="^${PATHAXMLFILE}$"
+ zPTN="^${AXMLFILE}$"
+ aPKGNAME="`grep "$xPTN" /root/.packages/builtin_files/* | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev`" #test if pkg used in Woof build.
+ if [ "$aPKGNAME" ];then #confirm full path.
+  for AAA in $aPKGNAME
+  do
+   CONFIRM="`cat /root/.packages/builtin_files/${AAA} | sed -e 's%^ %/%' | tr -d '\n' | grep "$AXMLFILE"`"
+   if [ "$CONFIRM" ];then
+    aPKGNAME="$AAA"
+    break
+   fi
+  done
+  [ ! "$CONFIRM" ] && aPKGNAME=""
+ fi
+ [ ! "$aPKGNAME" ] && aPKGNAME="`grep "$zPTN" /root/.packages/*.files 2>/dev/null | cut -f 1 -d ':' | rev | cut -f 1 -d '/' | rev | sed -e 's%\.files$%%'`" #test if user-installed pkg.
+ #...return nothing if in Woof
+ [ ! "$aPKGNAME" ] && [ -f "${PATHPREFIX}${AXMLFILE}" ] && aPKGNAME="WOOF" #file is in Woof.
+ [ ! "$aPKGNAME" ] && aPKGNAME="UNKNOWN"
+
+ FNDFLAG=''
+ FNDFLAG="`grep "$aPTN" "$AXMLFILE"`"
+ [ ! "$FNDFLAG" ] && FNDFLAG="`grep "$bPTN" "$AXMLFILE"`"
+ if [ "$FNDFLAG" ];then
+  #there is already a translation.
+  YESXML_XML="${YESXML_XML}
+<item>${AXMLFILE} (${aPKGNAME})</item>"
+ else
+  NOXML_XML="${NOXML_XML}
+<item>${AXMLFILE} (${aPKGNAME})</item>"
+ fi
+done
+if [ "$YESXML_XML" ];then
+ YESXML_XML="<combobox width-request=\"310\"><variable>YESXML_COMBO</variable>${YESXML_XML}</combobox>"
+else
+ YESXML_XML="<combobox width-request=\"310\"><variable>EMPTYYESXML_COMBO</variable><item>--empty--</item></combobox>"
+fi
+if [ "$NOXML_XML" ];then
+ NOXML_XML="<combobox width-request=\"330\"><variable>NOXML_COMBO</variable>${NOXML_XML}</combobox>"
+else
+ NOXML_XML="<combobox width-request=\"330\"><variable>EMPTYNOXML_COMBO</variable><item>--empty--</item></combobox>"
+fi
+#help buttons...
+XML_COM_HELP="XML files are a form of structured data that applications (such as ROX-Filer) may use, and they may contain text that the application displays on-screen. The XML specification has a standard notation for text strings in different languages, using the <b>xml:lang</b> attribute. For example:
+
+ &lt;Label&gt;Connect to the Internet now&lt;/Label&gt;
+ &lt;Label xml:lang="ru"&gt;Подключиться к Интернет сейчас&lt;/Label&gt;
+ &lt;Label xml:lang="ja"&gt;インターネット接続ウィザードを実行&lt;/Label&gt;
+ &lt;Label xml:lang="zh_CN"&gt;运行互联网连接向导&lt;/Label&gt;"
+YESXML_HELP_MSG="${XML_COM_HELP}
+
+The XML files in the drop-down list already have xml:lang translations for your <b>${ORIGLANG12}</b> locale, however they might not be correct or complete so should be reviewed. Please select a file, then click the <b>Edit</b> button.
+Note, the brackets alongside each filename in the drop-down list contains the name of the package that the file comes from -- WOOF means that the file comes from Woof."
+export DLG_HELP_YESXML="<window resizable=\"false\" title=\"MoManager: Help edit XML files\" icon-name=\"${HELPICON}\" window_position=\"1\"><vbox><text use-markup=\"true\" width-chars=\"70\"><label>\"${YESXML_HELP_MSG}\"</label><variable>VAR_HELP_YESXML</variable></text><hbox><button><label>Close</label><action type=\"closewindow\">VAR_HELP_YESXML</action></button></hbox></vbox></window>"
+YESXMLHELP_XML='<button><input file>/usr/local/lib/X11/mini-icons/mini-question.xpm</input><action type="launch">DLG_HELP_YESXML</action></button>'
+NOXML_HELP_MSG="${XML_COM_HELP}
+
+The XML files in the drop-down list do <i>not</i> have xml:lang translations for your <b>${ORIGLANG12}</b> locale. You will need to determine where the translations are to be inserted. Please select a file, then click the <b>Create</b> button.
+Note, the brackets alongside each filename in the drop-down list contains the name of the package that the file comes from -- WOOF means that the file comes from Woof."
+export DLG_HELP_NOXML="<window resizable=\"false\" title=\"MoManager: Help edit XML files\" icon-name=\"${HELPICON}\" window_position=\"1\"><vbox><text use-markup=\"true\" width-chars=\"70\"><label>\"${NOXML_HELP_MSG}\"</label><variable>VAR_HELP_NOXML</variable></text><hbox><button><label>Close</label><action type=\"closewindow\">VAR_HELP_NOXML</action></button></hbox></vbox></window>"
+NOXMLHELP_XML='<button><input file>/usr/local/lib/X11/mini-icons/mini-question.xpm</input><action type="launch">DLG_HELP_NOXML</action></button>'
+
 #######SSS#######
 #Simple String Substitution
 #manage translations in many non-executable data files.
 #translations are kept in /usr/share/sss/$SSSDOMAIN/$SSSDOMAIN.$ORIGLANG1 ex: SSSDOMAIN=menu_strings ORIGLANG1=de
 YESSSS_XML=""; NOSSS_XML=""
@@ -345,10 +428,25 @@
      </frame>
     </vbox>
     <vbox>
      <frame Menu entries without a ${ORIGLANG1} translation>
      <hbox>${NODESK_XML}<button><label>Create</label><action>EXIT:create_desk</action></button>${NODESKHELP_XML}</hbox>
+     </frame>
+    </vbox>
+   </hbox>
+  </frame>
+
+  <frame XML files>
+   <hbox>
+    <vbox>
+     <frame XML files with a ${ORIGLANG1} translation>
+      <hbox>${YESXML_XML}<button><label>Edit</label><action>EXIT:edit_xml</action></button>${YESXMLHELP_XML}</hbox>
+     </frame>
+    </vbox>
+    <vbox>
+     <frame XML files without a ${ORIGLANG1} translation>
+     <hbox>${NOXML_XML}<button><label>Create</label><action>EXIT:create_xml</action></button>${NOXMLHELP_XML}</hbox>
      </frame>
     </vbox>
    </hbox>
   </frame>
 
@@ -817,9 +915,63 @@
   pupdialog --background green --colors --backtitle "MoManager: SSS edit completed" --msgbox "You have edited \Zb${SSSFILE}.${ORIGLANG1}\ZB and the menu has been refreshed.
 ${TARBALLMSG}
 ${DONEMSG}" 0 0
   export LANG=$ORIGLANG
   exec momanager reenter
+ ;;
+ edit_xml|create_xml) #XML data files.
+  if [ "$EXIT" "edit_xml" ];then
+   XMLFILE="`echo -n "$YESXML_COMBO" | cut -f 1 -d ' '`"
+   APKGNAME="`echo -n "$YESXML_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')'`"
+  else
+   XMLFILE="`echo -n "$NOXML_COMBO" | cut -f 1 -d ' '`"
+   APKGNAME="`echo -n "$NOXML_COMBO" | cut -f 2 -d '(' | cut -f 1 -d ')'`"
+  fi
+  sync
+  killall geany 2>/dev/null
+  echo '#!/bin/sh
+  sleep 3
+  yaf-splash -bg yellow -placement top -timeout 9 -text "The XML file is now open in a text editor. Edit, then Save, then Quit text editor..."
+  ' > /tmp/momanager/yafmsg7
+  chmod 755 /tmp/momanager/yafmsg7
+  /tmp/momanager/yafmsg7 & #msg has delay so will appear on top of text editor window.
+  ASTAT="`stat --format=%y "$XMLFILE" | cut -f 1 -d ' ' | tr -d '-' `" #so can check against file version in latest Woof.
+  [ -f "${PATHPREFIX}${XMLFILE}" ] && ASTAT="`stat --format=%y "${PATHPREFIX}${XMLFILE}" | cut -f 1 -d ' ' | tr -d '-' `" #get orig modify date.
+  xASTAT1="`stat --format=%Y "${XMLFILE}"`" #seconds since epoch.
+  defaulttexteditor "${XMLFILE}"
+  xASTAT2="`stat --format=%Y "${XMLFILE}"`" #seconds since epoch.
+  if [ "$xASTAT1" = "$xASTAT2" ];then
+   export LANG=$ORIGLANG
+   exec momanager reenter
+  fi
+  #add translation to tarball that user can email to pkg author...
+  cd /root
+  PATHXMLFILE="`dirname "$XMLFILE"`"
+  BASEXMLFILE="`basename "$XMLFILE"`"
+  mkdir -p /root/MoManager-${ORIGLANG12}-${APKGNAME}"${PATHXMLFILE}"
+  cp -f "$XMLFILE" /root/MoManager-${ORIGLANG12}-${APKGNAME}"${PATHXMLFILE}"/
+  echo "MACTION=${EXIT} TODAY_DATE=${ADATE} ORIG_DATE_FILE=${ASTAT} CATEGORY_FILE='${XMLFILE}' AUTHOR='${AUTHORSPECS}'" >> /root/MoManager-${ORIGLANG12}-${APKGNAME}/write.log
+  cd /root
+  mv -f MoManager-${ORIGLANG12}-${APKGNAME}.tar.gz MoManager-${ORIGLANG12}-${APKGNAME}.tar.gzOLD 2>/dev/null
+  dir2tgz MoManager-${ORIGLANG12}-${APKGNAME}/
+  TARBALLMSG="Translation files that you have created with MoManager have been copied into folder \Zb/root/MoManager-${ORIGLANG12}-${APKGNAME}\ZB, and a tarball has been created, \Zb/root/MoManager-${ORIGLANG12}-${APKGNAME}.tar.gz\ZB. Note, it contains \Zbwrite.log\ZB which records the details of each translation file."
+  case $APKGNAME in
+   WOOF)
+    DONEMSG="As this XML file is from Woof, please email the tarball to Barry Kauler \Zbbkauler@gmail.com\ZB, so that all future builds of Puppy may benefit from your translation!"
+   ;;
+   UNKNOWN)
+    DONEMSG="It is not known which package this XML file is from. However, if you can find out, please email the tarball to the maintainer of that package."
+   ;;
+   *)
+    DONEMSG="The XML file is part of package ${APKGNAME}. If you can find out the email address of the maintainer of that package, please email the tarball, it will be appreciated!"
+   ;;
+  esac
+  pupdialog --background green --colors --backtitle "MoManager: XML edit completed" --msgbox "You have edited \Zb${XMLFILE}\ZB. Any on-screen display strings might only display after X is restarted.
+${TARBALLMSG}
+${DONEMSG}" 0 0
+  export LANG=$ORIGLANG
+  exec momanager reenter
+
  ;;
 esac
 
 ###END###

Changes to woof-code/rootfs-skeleton/usr/sbin/pupdial_wizard_helper

@@ -5,10 +5,11 @@
 #also, offer to make pupdial the default when click 'connect' icon.
 #101017 checkbox to not run this dialog again.
 #101026 improve ppp0 active test.
 #101206 now called from pupdial after wvdial run.
 #120202 BK: internationalized.
+#120210 rodin.s: fix typo line 36.
 
 export TEXTDOMAIN=pupdial_wizard_helper
 export OUTPUT_CHARSET=UTF-8
 
 DEFAULTCONNECT="`cat /usr/local/bin/defaultconnect | tail -n 1 | tr -s " " | cut -f 2 -d " "`"
@@ -31,11 +32,11 @@
         <vbox>
          <pixmap><input file>/usr/local/lib/X11/pixmaps/ok.xpm</input></pixmap>
          <text><label>$(gettext 'It seems that you have successfully dialed the Internet!')</label></text>
          ${MSGFIREWALL}
          ${CHKFIREWALL}
-         <text><label>$(gettext "Recommend leave this checkbox ticked, so that Puppy will use PupDial to automatically connect to the Internet at bootup. Also clicking the 'connect' icon on the desktop will immediately launch PupDial..."</label></text>
+         <text><label>$(gettext "Recommend leave this checkbox ticked, so that Puppy will use PupDial to automatically connect to the Internet at bootup. Also clicking the 'connect' icon on the desktop will immediately launch PupDial...")</label></text>
          <checkbox><label>$(gettext 'Set PupDial as default network setup tool')</label><default>true</default><variable>CHK_SNSDEF</variable></checkbox>
          <text><label>$(gettext "If you sometimes connect with PupDial, sometimes by other means such as via a LAN or router, and you don't want to set PupDial as the default connection method and you don't want this dialog box to pop up everytime you run PupDial, then leave the above checkbox unticked and tick this box...")</label></text>
          <checkbox><label>$(gettext 'Do not display this dialog box again')</label><default>false</default><variable>CHK_NOASK</variable></checkbox>
          <hbox>
           <button ok></button>

Changes to woof-code/rootfs-skeleton/usr/share/sss/desk_strings/desk_strings

@@ -28,6 +28,10 @@
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='connect'   ; TRANSLATION=''
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='calc'      ; TRANSLATION=''
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='email'     ; TRANSLATION=''
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='install'   ; TRANSLATION=''
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='play'      ; TRANSLATION=''
+
+[_root_.jwmrc-tray]
+CODESTRING='<TrayButton label="INSERTMARKER"' ; ENGLISH='Menu'      ; TRANSLATION=''
+CODESTRING='popup="INSERTMARKER" icon="mini-desktop.xpm"' ; ENGLISH='Show Desktop'      ; TRANSLATION=''
 

Changes to woof-code/rootfs-skeleton/usr/share/sss/desk_strings/desk_strings.de

@@ -25,6 +25,9 @@
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='calc'      ; TRANSLATION='kalkul'
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='email'     ; TRANSLATION='e-mail'
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='install'   ; TRANSLATION='install'
 CODESTRING='label="INSERTMARKER"' ; ENGLISH='play'      ; TRANSLATION='play'
 
+[_root_.jwmrc-tray]
+CODESTRING='<TrayButton label="INSERTMARKER"'             ; ENGLISH='Menu'         ; TRANSLATION='Menü'
+CODESTRING='popup="INSERTMARKER" icon="mini-desktop.xpm"' ; ENGLISH='Show Desktop' ; TRANSLATION='Desktop anzeigen'
 

Changes to woof-distro/x86/Packages-puppy-common-official

@@ -353,11 +353,11 @@
 woo-ff-0.1.1|woo-ff|0.1.1||Multimedia|48K||woo-ff-0.1.1.pet|+ffmpeg,+gtkdialog3|woo-ff - multimedia converter||||
 xarchive-0.2.8-8-p4|xarchive|0.2.8-8-p4||Setup|212K||xarchive-0.2.8-8-p4.pet|+gtk+|XArchive archiver|puppy|4||
 xclip-0.10|xclip|0.10||BuildingBlock|60K||xclip-0.10.pet||copy/paste x-selection and clipboard from script|puppy|4||
 xcur2png-0.7.0-p4|xcur2png|0.7.0-p4||BuildingBlock|28K||xcur2png-0.7.0-p4.pet||converter cursor image to png|puppy|4||
 xdelta-30p-w5|xdelta|30p-w5||BuildingBlock|108K||xdelta-30p-w5.pet||Opensource binary diff deltadifferential compression tools|puppy|wary5||
-xdg_puppy-0.7.6-13-p4|xdg_puppy|0.7.6-13-p4||BuildingBlock|328K||xdg_puppy-0.7.6-13-p4.pet||essential XDG utilities developed by rarsa, -13 has internationalization support|puppy|4||
+xdg_puppy-0.7.6-14-p4|xdg_puppy|0.7.6-14-p4||BuildingBlock|328K||xdg_puppy-0.7.6-14-p4.pet||essential XDG utilities developed by rarsa, -13 has internationalization support|puppy|4||
 xdialog-2.3.1.pup2|xdialog|2.3.1.pup2||BuildingBlock|70K||xdialog-2.3.1.pup2.pet|+gtk+|gui frontend for scripts|puppy|||
 xlock_gui-0.2-4|xlock_gui|0.2-4||Desktop|60K||xlock_gui-0.2-4.pet|+xlockmore|screen lock and screensaver||||
 xlockmore-5.31-w1|xlockmore|5.31-w1||BuildingBlock|212K||xlockmore-5.31-w1.pet|+xorg_base|screen lock and screensaver|t2|8.0rc||
 xz-4.999.9beta-124-gb637-q1|xz|4.999.9beta-124-gb637-q1||BuildingBlock|280K|pet_packages-quirky|xz-4.999.9beta-124-gb637-q1.pet||file compression/decompression utilities|t2|8.0rc|official|
 xz_DEV-4.999.9beta-124-gb637-q1|xz_DEV|4.999.9beta-124-gb637-q1||BuildingBlock|968K|pet_packages-quirky|xz_DEV-4.999.9beta-124-gb637-q1.pet|+xz|file compression/decompression library|t2|8.0rc|official|