ui_Ziggy 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #alternate user interface designed by zigbert.
  2. #120203 rodin.s: internationalized.
  3. #120224 more gettext's required. icons were missing.
  4. #120224 handle translated help.htm
  5. #120225 fix for translated categories.
  6. #120504 some files moved into /tmp/petget
  7. #120508 01micko: bugfix. ref: http://murga-linux.com/puppy/viewtopic.php?p=625843#625843
  8. #120515 calls to /tmp/petget/filterpkgs.results.postfilter.sh replace by /usr/local/petget/postfilterpkgs.sh.
  9. #120529 app icons in tree. variable FLG_APPICONS created in pkg_chooser.sh
  10. #120811 category field now supports sub-category |category;subcategory|, use as icon in ppm main window.
  11. #130330 GUI filter. see also filterpkgs.sh, pkg_chooser.sh, ui_Ziggy.
  12. #130331 more GUI filter options.
  13. export TEXTDOMAIN=petget___ui_Ziggy
  14. export OUTPUT_CHARSET=UTF-8
  15. ALLITEM='' ; ALLSTOCK='' ; CATHEIGHT='100' ; WINHEIGHT='380'
  16. if [ "$ALLCATEGORY" != "" ];then
  17. ALLITEM="<item stock=\"gtk-ALL\">$(gettext 'ALL')</item>"
  18. ALLSTOCK='stock["gtk-ALL"] = {{ "pet24.png", *, *, *}}'
  19. CATHEIGHT='112'
  20. WINHEIGHT='388'
  21. fi
  22. ##120529
  23. #if [ "$FLG_APPICONS" = "true" ];then
  24. # APPICONXMLINSERT=' icon-column="0"'
  25. #else
  26. # APPICONXMLINSERT=''
  27. #fi
  28. APPICONXMLINSERT=' icon-column="1"' #120811 each line is format: abiword0-1.2.3|subcategory|description of abiword|stuff
  29. #120224 handle translated help.htm
  30. LANG1="${LANG%_*}" #ex: de
  31. HELPFILE="/usr/local/petget/help.htm"
  32. [ -f /usr/local/petget/help-${LANG1}.htm ] && HELPFILE="/usr/local/petget/help-${LANG1}.htm"
  33. #120225 fix translated categories...
  34. CATTRANSTABLE="Desktop:$(gettext 'Desktop')
  35. System:$(gettext 'System')
  36. Setup:$(gettext 'Setup')
  37. Utility:$(gettext 'Utility')
  38. Filesystem:$(gettext 'Filesystem')
  39. Graphic:$(gettext 'Graphic')
  40. Document:$(gettext 'Document')
  41. Business:$(gettext 'Business')
  42. Personal:$(gettext 'Personal')
  43. Network:$(gettext 'Network')
  44. Internet:$(gettext 'Internet')
  45. Multimedia:$(gettext 'Multimedia')
  46. Fun:$(gettext 'Fun')
  47. ALL:$(gettext 'ALL')"
  48. echo "#!/bin/sh
  49. CATTRANSTABLE='${CATTRANSTABLE}'" > /tmp/ppm-ui-ziggy-fix
  50. echo 'CATEGORY="`echo "$CATTRANSTABLE" | grep "$1" | head -n 1 | cut -f 1 -d ':'`"
  51. [ ! "$CATEGORY" ] && CATEGORY="Desktop"
  52. echo "$CATEGORY"
  53. ' >> /tmp/ppm-ui-ziggy-fix
  54. chmod 755 /tmp/ppm-ui-ziggy-fix
  55. DEFGUIFILTER="$(cat /var/local/petget/gui_filter)" #130330 see pkg_chooser.sh, and below.
  56. #130330 $GUIONLYSTR $ANYTYPESTR are exported from pkg_chooser.sh. 130331 also $GUIEXCSTR $NONGUISTR
  57. export MAIN_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\" default_height=\"${WINHEIGHT}\" default_width=\"680\">
  58. <hbox>
  59. <vbox>
  60. <hbox>
  61. <button tooltip-text=\"$(gettext 'Uninstall packages')\">
  62. <label>$(gettext 'Uninstall')</label>
  63. <input file icon=\"mini-trash\"></input>
  64. <action>launch:INSTALLED_DIALOG</action>
  65. </button>
  66. <button tooltip-text=\"$(gettext 'Configure package manager')\">
  67. <input file icon=\"gtk-preferences\"></input>
  68. <action>/usr/local/petget/configure.sh</action>
  69. <action>/usr/local/petget/filterpkgs.sh</action>
  70. <action>refresh:TREE1</action>
  71. </button>
  72. <button tooltip-text=\"$(gettext 'Help')\">
  73. <input file>/usr/local/lib/X11/pixmaps/help24.png</input>
  74. <action>defaulthtmlviewer file://${HELPFILE} & </action>
  75. </button>
  76. <button type=\"exit\" tooltip-text=\"$(gettext 'Quit package manager')\">
  77. <input file>/usr/local/lib/X11/pixmaps/shutdown24.png</input>
  78. </button>
  79. </hbox>
  80. <frame $(gettext 'Repositories')>
  81. <vbox>
  82. ${DB_ORDERED}
  83. </vbox>
  84. </frame>
  85. <frame $(gettext 'package types')>
  86. <hbox>
  87. <vbox>
  88. <checkbox>
  89. <default>${DEF_CHK_EXE}</default>
  90. <label>EXE</label>
  91. <variable>CHK_EXE</variable>
  92. <action>/usr/local/petget/postfilterpkgs.sh EXE \$CHK_EXE</action>
  93. <action>refresh:TREE1</action>
  94. </checkbox>
  95. <checkbox>
  96. <default>${DEF_CHK_DEV}</default>
  97. <label>DEV</label>
  98. <variable>CHK_DEV</variable>
  99. <action>/usr/local/petget/postfilterpkgs.sh DEV \$CHK_DEV</action>
  100. <action>refresh:TREE1</action>
  101. </checkbox>
  102. <checkbox>
  103. <default>${DEF_CHK_DOC}</default>
  104. <label>DOC</label>
  105. <variable>CHK_DOC</variable>
  106. <action>/usr/local/petget/postfilterpkgs.sh DOC \$CHK_DOC</action>
  107. <action>refresh:TREE1</action>
  108. </checkbox>
  109. <checkbox>
  110. <default>${DEF_CHK_NLS}</default>
  111. <label>NLS</label>
  112. <variable>CHK_NLS</variable>
  113. <action>/usr/local/petget/postfilterpkgs.sh NLS \$CHK_NLS</action>
  114. <action>refresh:TREE1</action>
  115. </checkbox>
  116. </vbox>
  117. <vbox>
  118. <comboboxtext width-request=\"140\">
  119. <variable>FILTERCOMBOBOX</variable>
  120. <default>$DEFGUIFILTER</default>
  121. <item>$ANYTYPESTR</item>
  122. <item>$GUIONLYSTR</item>
  123. <item>GTK+2 $GUIONLYSTR</item>
  124. <item>GTK+3 $GUIONLYSTR</item>
  125. <item>Qt4 $GUIONLYSTR</item>
  126. <item>Qt4 $GUIEXCSTR KDE</item>
  127. <item>Qt5 $GUIONLYSTR</item>
  128. <item>Qt5 $GUIEXCSTR KDE</item>
  129. <item>$NONGUISTR</item>
  130. <action>echo -n \"\$FILTERCOMBOBOX\" > /var/local/petget/gui_filter</action>
  131. <action>/usr/local/petget/filterpkgs.sh</action>
  132. <action>refresh:TREE1</action>
  133. </comboboxtext>
  134. </vbox>
  135. </hbox>
  136. </frame>
  137. <hbox width-request=\"100\">
  138. <text><label>$(gettext 'Find:')</label></text>
  139. <entry activates-default=\"true\">
  140. <variable>ENTRY1</variable>
  141. </entry>
  142. <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
  143. <label>$(gettext 'Go')</label>
  144. <action>/usr/local/petget/findnames.sh</action>
  145. <action>refresh:TREE1</action>
  146. <action>/usr/local/petget/show_installed_version_diffs.sh & </action>
  147. </button>
  148. </hbox>
  149. </vbox>
  150. <vbox>
  151. <tree>
  152. <label>$(gettext 'Category')</label>
  153. <variable>CATEGORY</variable>
  154. <item stock=\"gtk-Desktop\">$(gettext 'Desktop')</item>
  155. <item stock=\"gtk-System\">$(gettext 'System')</item>
  156. <item stock=\"gtk-Setup\">$(gettext 'Setup')</item>
  157. <item stock=\"gtk-Utility\">$(gettext 'Utility')</item>
  158. <item stock=\"gtk-Filesystem\">$(gettext 'Filesystem')</item>
  159. <item stock=\"gtk-Graphic\">$(gettext 'Graphic')</item>
  160. <item stock=\"gtk-Document\">$(gettext 'Document')</item>
  161. <item stock=\"gtk-Business\">$(gettext 'Business')</item>
  162. <item stock=\"gtk-Personal\">$(gettext 'Personal')</item>
  163. <item stock=\"gtk-Network\">$(gettext 'Network')</item>
  164. <item stock=\"gtk-Internet\">$(gettext 'Internet')</item>
  165. <item stock=\"gtk-Multimedia\">$(gettext 'Multimedia')</item>
  166. <item stock=\"gtk-Fun\">$(gettext 'Fun')</item>
  167. ${ALLITEM}
  168. <width>140</width><height>${CATHEIGHT}</height>
  169. <action signal=\"button-release-event\">/tmp/ppm-ui-ziggy-fix \$CATEGORY | xargs -I CATINSERT /usr/local/petget/filterpkgs.sh CATINSERT</action>
  170. <action signal=\"button-release-event\">refresh:TREE1</action>
  171. </tree>
  172. </vbox>
  173. <tree>
  174. <label>$(gettext 'Package|Description')</label>
  175. <variable>TREE1</variable>
  176. <input${APPICONXMLINSERT}>cat /tmp/petget/filterpkgs.results.post</input>
  177. <action signal=\"button-release-event\">/usr/local/petget/installpreview.sh</action>
  178. <action signal=\"button-release-event\">/usr/local/petget/finduserinstalledpkgs.sh</action>
  179. <action signal=\"button-release-event\">refresh:TREE2</action>
  180. </tree>
  181. </hbox>
  182. </window>"
  183. export INSTALLED_DIALOG='<window title="'$(gettext 'Uninstall Puppy Package')'" icon-name="gtk-about" default_height="380" default_width="450">
  184. <vbox>
  185. <text><label>'$(gettext 'Click on an item in the list to uninstall package')'</label></text>
  186. <tree>
  187. <label>'$(gettext 'Installed Package|Description')'</label>
  188. <variable>TREE2</variable>
  189. <input'${APPICONXMLINSERT}'>cat /tmp/petget/installedpkgs.results.post</input>
  190. <action signal="button-release-event">/usr/local/petget/removepreview.sh</action>
  191. <action signal="button-release-event">/usr/local/petget/finduserinstalledpkgs.sh</action>
  192. <action signal="button-release-event">refresh:TREE2</action>
  193. </tree>
  194. </vbox>
  195. </window>'
  196. mkdir -p /tmp/puppy_package_manager
  197. ln -s /usr/local/lib/X11/pixmaps/*24.png /tmp/puppy_package_manager 2>/dev/null
  198. echo 'style "icon-style" {
  199. stock["gtk-Desktop"] = {{ "x24.png", *, *, *}}
  200. stock["gtk-System"] = {{ "pc24.png", *, *, *}}
  201. stock["gtk-Setup"] = {{ "configuration24.png", *, *, *}}
  202. stock["gtk-Utility"] = {{ "utility24.png", *, *, *}}
  203. stock["gtk-Filesystem"] = {{ "folder24.png", *, *, *}}
  204. stock["gtk-Graphic"] = {{ "paint24.png", *, *, *}}
  205. stock["gtk-Document"] = {{ "word24.png", *, *, *}}
  206. stock["gtk-Business"] = {{ "spread24.png", *, *, *}}
  207. stock["gtk-Personal"] = {{ "date24.png", *, *, *}}
  208. stock["gtk-Network"] = {{ "connect24.png", *, *, *}}
  209. stock["gtk-Internet"] = {{ "www24.png", *, *, *}}
  210. stock["gtk-Multimedia"] = {{ "multimedia24.png", *, *, *}}
  211. stock["gtk-Fun"] = {{ "games24.png", *, *, *}}
  212. '${ALLSTOCK}'}
  213. class "GtkWidget" style "icon-style"' > /tmp/puppy_package_manager/gtkrc_ppm
  214. export GTK2_RC_FILES=/root/.gtkrc-2.0:/tmp/puppy_package_manager/gtkrc_ppm
  215. export TEXTDOMAIN=petget___pkg_chooser.sh