ui_Ziggy 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. touch /var/local/petget/bb_category
  23. if [ "`cat /var/local/petget/bb_category`" = "true" ]; then
  24. BBITEM="<item stock=\"gtk-BB\">$(gettext 'BuildingBlock')</item>"
  25. else
  26. BBITEM=""
  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. BuildingBlock:$(gettext 'BuildingBlock')
  48. ALL:$(gettext 'ALL')"
  49. echo "#!/bin/sh
  50. CATTRANSTABLE='${CATTRANSTABLE}'" > /tmp/ppm-ui-ziggy-fix
  51. echo 'CATEGORY="`echo "$CATTRANSTABLE" | grep "$1" | head -n 1 | cut -f 1 -d ':'`"
  52. [ ! "$CATEGORY" ] && CATEGORY="Desktop"
  53. echo "$CATEGORY"
  54. ' >> /tmp/ppm-ui-ziggy-fix
  55. chmod 755 /tmp/ppm-ui-ziggy-fix
  56. DEFGUIFILTER="$(cat /var/local/petget/gui_filter)" #130330 see pkg_chooser.sh, and below.
  57. #130330 $GUIONLYSTR $ANYTYPESTR are exported from pkg_chooser.sh. 130331 also $GUIEXCSTR $NONGUISTR
  58. export MAIN_DIALOG="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\" default_height=\"${WINHEIGHT}\" default_width=\"680\">
  59. <hbox>
  60. <vbox>
  61. <hbox>
  62. <button tooltip-text=\"$(gettext 'Uninstall packages')\">
  63. <label>$(gettext 'Uninstall')</label>
  64. <input file icon=\"mini-trash\"></input>
  65. <action>launch:INSTALLED_DIALOG</action>
  66. </button>
  67. <button tooltip-text=\"$(gettext 'Configure package manager')\">
  68. <input file stock=\"gtk-preferences\"></input>
  69. <action>/usr/local/petget/configure.sh</action>
  70. <action>/usr/local/petget/filterpkgs.sh</action>
  71. <action>refresh:TREE1</action>
  72. </button>
  73. <button tooltip-text=\"$(gettext 'Help')\">
  74. <input file stock=\"gtk-help\"></input>
  75. <action>defaulthtmlviewer file://${HELPFILE} & </action>
  76. </button>
  77. <button type=\"exit\" tooltip-text=\"$(gettext 'Quit package manager')\">
  78. <input file stock=\"gtk-quit\"></input>
  79. </button>
  80. </hbox>
  81. <frame $(gettext 'Repositories')>
  82. <vbox scrollable=\"true\">
  83. ${DB_ORDERED}
  84. <height>128</height>
  85. </vbox>
  86. </frame>
  87. <frame $(gettext 'Package types')>
  88. <hbox>
  89. <vbox>
  90. <checkbox>
  91. <default>${DEF_CHK_EXE}</default>
  92. <label>EXE</label>
  93. <variable>CHK_EXE</variable>
  94. <action>/usr/local/petget/postfilterpkgs.sh EXE \$CHK_EXE</action>
  95. <action>refresh:TREE1</action>
  96. </checkbox>
  97. <checkbox>
  98. <default>${DEF_CHK_DEV}</default>
  99. <label>DEV</label>
  100. <variable>CHK_DEV</variable>
  101. <action>/usr/local/petget/postfilterpkgs.sh DEV \$CHK_DEV</action>
  102. <action>refresh:TREE1</action>
  103. </checkbox>
  104. <checkbox>
  105. <default>${DEF_CHK_DOC}</default>
  106. <label>DOC</label>
  107. <variable>CHK_DOC</variable>
  108. <action>/usr/local/petget/postfilterpkgs.sh DOC \$CHK_DOC</action>
  109. <action>refresh:TREE1</action>
  110. </checkbox>
  111. <checkbox>
  112. <default>${DEF_CHK_NLS}</default>
  113. <label>NLS</label>
  114. <variable>CHK_NLS</variable>
  115. <action>/usr/local/petget/postfilterpkgs.sh NLS \$CHK_NLS</action>
  116. <action>refresh:TREE1</action>
  117. </checkbox>
  118. </vbox>
  119. <vbox>
  120. <comboboxtext width-request=\"140\">
  121. <variable>FILTERCOMBOBOX</variable>
  122. <default>$DEFGUIFILTER</default>
  123. <item>$ANYTYPESTR</item>
  124. <item>$GUIONLYSTR</item>
  125. <item>GTK+2 $GUIONLYSTR</item>
  126. <item>GTK+3 $GUIONLYSTR</item>
  127. <item>Qt4 $GUIONLYSTR</item>
  128. <item>Qt4 $GUIEXCSTR KDE</item>
  129. <item>Qt5 $GUIONLYSTR</item>
  130. <item>Qt5 $GUIEXCSTR KDE</item>
  131. <item>$NONGUISTR</item>
  132. <action>echo -n \"\$FILTERCOMBOBOX\" > /var/local/petget/gui_filter</action>
  133. <action>/usr/local/petget/filterpkgs.sh</action>
  134. <action>refresh:TREE1</action>
  135. </comboboxtext>
  136. </vbox>
  137. </hbox>
  138. </frame>
  139. <hbox width-request=\"100\">
  140. <text><label>$(gettext 'Find:')</label></text>
  141. <entry activates-default=\"true\">
  142. <variable>ENTRY1</variable>
  143. </entry>
  144. <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
  145. <label>$(gettext 'Go')</label>
  146. <action>/usr/local/petget/findnames.sh</action>
  147. <action>refresh:TREE1</action>
  148. <action>/usr/local/petget/show_installed_version_diffs.sh & </action>
  149. </button>
  150. </hbox>
  151. </vbox>
  152. <vbox>
  153. <tree>
  154. <label>$(gettext 'Category')</label>
  155. <variable>CATEGORY</variable>
  156. <item stock=\"gtk-Desktop\">$(gettext 'Desktop')</item>
  157. <item stock=\"gtk-System\">$(gettext 'System')</item>
  158. <item stock=\"gtk-Setup\">$(gettext 'Setup')</item>
  159. <item stock=\"gtk-Utility\">$(gettext 'Utility')</item>
  160. <item stock=\"gtk-Filesystem\">$(gettext 'Filesystem')</item>
  161. <item stock=\"gtk-Graphic\">$(gettext 'Graphic')</item>
  162. <item stock=\"gtk-Document\">$(gettext 'Document')</item>
  163. <item stock=\"gtk-Business\">$(gettext 'Business')</item>
  164. <item stock=\"gtk-Personal\">$(gettext 'Personal')</item>
  165. <item stock=\"gtk-Network\">$(gettext 'Network')</item>
  166. <item stock=\"gtk-Internet\">$(gettext 'Internet')</item>
  167. <item stock=\"gtk-Multimedia\">$(gettext 'Multimedia')</item>
  168. <item stock=\"gtk-Fun\">$(gettext 'Fun')</item>
  169. ${BBITEM}
  170. ${ALLITEM}
  171. <width>140</width><height>${CATHEIGHT}</height>
  172. <action signal=\"changed\">/tmp/ppm-ui-ziggy-fix \$CATEGORY | xargs -I CATINSERT /usr/local/petget/filterpkgs.sh CATINSERT</action>
  173. <action signal=\"changed\">refresh:TREE1</action>
  174. </tree>
  175. </vbox>
  176. <tree column-resizeable=\"false|false\">
  177. <label>$(gettext 'Package|Description')</label>
  178. <variable>TREE1</variable>
  179. <input${APPICONXMLINSERT}>cat /tmp/petget/filterpkgs.results.post</input>
  180. <action>/usr/local/petget/installpreview.sh</action>
  181. <action>/usr/local/petget/finduserinstalledpkgs.sh</action>
  182. <action>refresh:TREE2</action>
  183. <action signal=\"button-release-event\">/usr/local/petget/installpreview.sh</action>
  184. <action signal=\"button-release-event\">/usr/local/petget/finduserinstalledpkgs.sh</action>
  185. <action signal=\"button-release-event\">refresh:TREE2</action>
  186. </tree>
  187. </hbox>
  188. </window>"
  189. export INSTALLED_DIALOG='<window title="'$(gettext 'Uninstall Puppy Package')'" icon-name="gtk-about" default_height="380" default_width="450">
  190. <vbox>
  191. <text><label>'$(gettext 'Click on an item in the list to uninstall package')'</label></text>
  192. <tree column-resizeable="false|false">
  193. <label>'$(gettext 'Installed Package|Description')'</label>
  194. <variable>TREE2</variable>
  195. <input'${APPICONXMLINSERT}'>cat /tmp/petget/installedpkgs.results.post</input>
  196. <action>/usr/local/petget/removepreview.sh</action>
  197. <action>/usr/local/petget/finduserinstalledpkgs.sh</action>
  198. <action>refresh:TREE2</action>
  199. <action signal="button-release-event">/usr/local/petget/removepreview.sh</action>
  200. <action signal="button-release-event">/usr/local/petget/finduserinstalledpkgs.sh</action>
  201. <action signal="button-release-event">refresh:TREE2</action>
  202. </tree>
  203. </vbox>
  204. </window>'
  205. mkdir -p /tmp/puppy_package_manager
  206. ln -s /usr/local/lib/X11/pixmaps/*48.png /tmp/puppy_package_manager 2>/dev/null
  207. echo 'style "icon-style" {
  208. stock["gtk-Desktop"] = {{ "x48.png", *, *, *}}
  209. stock["gtk-System"] = {{ "pc48.png", *, *, *}}
  210. stock["gtk-Setup"] = {{ "configuration48.png", *, *, *}}
  211. stock["gtk-Utility"] = {{ "utility48.png", *, *, *}}
  212. stock["gtk-Filesystem"] = {{ "folder48.png", *, *, *}}
  213. stock["gtk-Graphic"] = {{ "paint48.png", *, *, *}}
  214. stock["gtk-Document"] = {{ "word48.png", *, *, *}}
  215. stock["gtk-Business"] = {{ "spread48.png", *, *, *}}
  216. stock["gtk-Personal"] = {{ "date48.png", *, *, *}}
  217. stock["gtk-Network"] = {{ "connect48.png", *, *, *}}
  218. stock["gtk-Internet"] = {{ "www48.png", *, *, *}}
  219. stock["gtk-Multimedia"] = {{ "multimedia48.png", *, *, *}}
  220. stock["gtk-Fun"] = {{ "games48.png", *, *, *}}
  221. stock["gtk-BB"] = {{ "pet48.png", *, *, *}}
  222. '${ALLSTOCK}'}
  223. class "GtkWidget" style "icon-style"' > /tmp/puppy_package_manager/gtkrc_ppm
  224. export GTK2_RC_FILES=/root/.gtkrc-2.0:/tmp/puppy_package_manager/gtkrc_ppm
  225. export TEXTDOMAIN=petget___pkg_chooser.sh