ui_Classic 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. #!/bin/bash
  2. #default user interface.
  3. #120203 rodin.s: internationalized.
  4. #120224 handle translated help.htm
  5. #120504 some files moved into /tmp/petget
  6. #120515 calls to /tmp/petget/filterpkgs.results.postfilter.sh replace by /usr/local/petget/postfilterpkgs.sh.
  7. #120527 first column of tree now an icon.
  8. #120529 app icons in tree. variable FLG_APPICONS created in pkg_chooser.sh
  9. #120811 category field now supports sub-category |category;subcategory|, use as icon in ppm main window.
  10. #121113 "Calculate" is old name, top-level menu category is now "Business".
  11. #130330 GUI filter. see also filterpkgs.sh, pkg_chooser.sh, ui_Ziggy.
  12. #130331 more GUI filter options.
  13. export TEXTDOMAIN=petget___pkg_chooser.sh
  14. export OUTPUT_CHARSET=UTF-8
  15. # Remove any 'auto' flags
  16. rm -f /tmp/{install,remove}{,_pets}_quietly
  17. APPICONXMLINSERT=' icon-column="1"' #120811 each line is format: abiword0-1.2.3|subcategory|description of abiword|stuff
  18. if [ 0 -eq 1 ];then #w020 disable this choice.
  19. #filter pkgs by first letter, for more speed. must start with ab...
  20. echo "ab" > /tmp/petget_pkg_first_char
  21. FIRSTCHARS="
  22. <radiobutton><label>a,b</label><action>echo ab > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  23. <radiobutton><label>c,d</label><action>echo cd > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  24. <radiobutton><label>e,f</label><action>echo ef > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  25. <radiobutton><label>g,h</label><action>echo gh > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  26. <radiobutton><label>i,j</label><action>echo ij > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  27. <radiobutton><label>k,l</label><action>echo kl > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  28. <radiobutton><label>m,n</label><action>echo mn > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  29. <radiobutton><label>o,p</label><action>echo op > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  30. <radiobutton><label>q,r</label><action>echo qr > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  31. <radiobutton><label>s,t</label><action>echo st > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  32. <radiobutton><label>u,v</label><action>echo uv > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  33. <radiobutton><label>w,x</label><action>echo wx > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  34. <radiobutton><label>y,z</label><action>echo yz > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  35. <radiobutton><label>0-9</label><action>echo 0123456789 > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  36. <radiobutton><label>ALL</label><action>echo ALL > /tmp/petget_pkg_first_char</action><action>/usr/local/petget/filterpkgs.sh</action><action>refresh:TREE1</action></radiobutton>
  37. "
  38. xFIRSTCHARS="<hbox>
  39. ${FIRSTCHARS}
  40. </hbox>"
  41. else
  42. #do not dispay the alphabetic radiobuttons...
  43. echo "ALL" > /tmp/petget_pkg_first_char
  44. FIRSTCHARS=""
  45. xFIRSTCHARS=""
  46. fi
  47. touch /var/local/petget/bb_category
  48. if [ "`cat /var/local/petget/bb_category`" = "true" ]; then
  49. BBCATEGORY="<radiobutton><label>$(gettext 'BuildingBlock')</label><action>/usr/local/petget/filterpkgs.sh BuildingBlock</action><action>refresh:TREE1</action></radiobutton>"
  50. else
  51. BBCATEGORY=""
  52. fi
  53. #120224 handle translated help.htm
  54. LANG1="${LANG%_*}" #ex: de
  55. HELPFILE="/usr/local/petget/help.htm"
  56. [ -f /usr/local/petget/help-${LANG1}.htm ] && HELPFILE="/usr/local/petget/help-${LANG1}.htm"
  57. DEFGUIFILTER="$(cat /var/local/petget/gui_filter 2>/dev/null)" #130330 see pkg_chooser.sh, and below.
  58. ALLCATEGORY=''
  59. if [ "$DISTRO_BINARY_COMPAT" = "puppy" ];then #v424 reintroduce the 'ALL' category.
  60. ALLCATEGORY="<radiobutton><label>$(gettext 'ALL')</label><action>/usr/local/petget/filterpkgs.sh ALL</action><action>refresh:TREE1</action></radiobutton>"
  61. fi
  62. #100513 also for 't2' (quirky) builds...
  63. if [ "$DISTRO_BINARY_COMPAT" = "t2" ];then #reintroduce the 'ALL' category.
  64. ALLCATEGORY="<radiobutton><label>$(gettext 'ALL')</label><action>/usr/local/petget/filterpkgs.sh ALL</action><action>refresh:TREE1</action></radiobutton>"
  65. fi
  66. #120515 ditto for gentoo build...
  67. if [ "$DISTRO_BINARY_COMPAT" = "gentoo" ];then #reintroduce the 'ALL' category.
  68. ALLCATEGORY="<radiobutton><label>$(gettext 'ALL')</label><action>/usr/local/petget/filterpkgs.sh ALL</action><action>refresh:TREE1</action></radiobutton>"
  69. fi
  70. DB_ORDERED="$REPOS_RADIO" #120831
  71. #130330 $GUIONLYSTR $ANYTYPESTR are exported from pkg_chooser.sh. 130331 also $GUIEXCSTR $NONGUISTR
  72. export PPM_GUI="<window title=\"$(gettext 'Puppy Package Manager')\" icon-name=\"gtk-about\" width-request=\"780\" hight-request=\"560\">
  73. <vbox>
  74. <hbox scrollable=\"true\" shadow-type=\"0\">
  75. <text><label>$(gettext 'Repo:')</label></text>
  76. ${DB_ORDERED}
  77. <height>48</height>
  78. </hbox>
  79. ${xFIRSTCHARS}
  80. <hbox>
  81. <vbox>
  82. <radiobutton><label>$(gettext 'Desktop')</label><action>/usr/local/petget/filterpkgs.sh Desktop</action><action>refresh:TREE1</action></radiobutton>
  83. <radiobutton><label>$(gettext 'System')</label><action>/usr/local/petget/filterpkgs.sh System</action><action>refresh:TREE1</action></radiobutton>
  84. <radiobutton><label>$(gettext 'Setup')</label><action>/usr/local/petget/filterpkgs.sh Setup</action><action>refresh:TREE1</action></radiobutton>
  85. <radiobutton><label>$(gettext 'Utility')</label><action>/usr/local/petget/filterpkgs.sh Utility</action><action>refresh:TREE1</action></radiobutton>
  86. <radiobutton><label>$(gettext 'Filesystem')</label><action>/usr/local/petget/filterpkgs.sh Filesystem</action><action>refresh:TREE1</action></radiobutton>
  87. <radiobutton><label>$(gettext 'Graphic')</label><action>/usr/local/petget/filterpkgs.sh Graphic</action><action>refresh:TREE1</action></radiobutton>
  88. <radiobutton><label>$(gettext 'Document')</label><action>/usr/local/petget/filterpkgs.sh Document</action><action>refresh:TREE1</action></radiobutton>
  89. <radiobutton><label>$(gettext 'Business')</label><action>/usr/local/petget/filterpkgs.sh Business</action><action>refresh:TREE1</action></radiobutton>
  90. <radiobutton><label>$(gettext 'Personal')</label><action>/usr/local/petget/filterpkgs.sh Personal</action><action>refresh:TREE1</action></radiobutton>
  91. <radiobutton><label>$(gettext 'Network')</label><action>/usr/local/petget/filterpkgs.sh Network</action><action>refresh:TREE1</action></radiobutton>
  92. <radiobutton><label>$(gettext 'Internet')</label><action>/usr/local/petget/filterpkgs.sh Internet</action><action>refresh:TREE1</action></radiobutton>
  93. <radiobutton><label>$(gettext 'Multimedia')</label><action>/usr/local/petget/filterpkgs.sh Multimedia</action><action>refresh:TREE1</action></radiobutton>
  94. <radiobutton><label>$(gettext 'Fun')</label><action>/usr/local/petget/filterpkgs.sh Fun</action><action>refresh:TREE1</action></radiobutton>
  95. ${ALLCATEGORY}
  96. </vbox>
  97. <vbox>
  98. <tree column-resizeable=\"false|false\">
  99. <label>$(gettext 'Package|Description')</label>
  100. <height>280</height><width>668</width>
  101. <variable>TREE1</variable>
  102. <input${APPICONXMLINSERT}>cat /tmp/petget/filterpkgs.results.post</input>
  103. <action>/usr/local/petget/installpreview.sh</action>
  104. <action>/usr/local/petget/finduserinstalledpkgs.sh</action>
  105. <action>/usr/local/petget/filterpkgs.sh</action>
  106. <action>refresh:TREE1</action>
  107. <action>refresh:TREE2</action>
  108. <action signal=\"button-release-event\">/usr/local/petget/installpreview.sh</action>
  109. <action signal=\"button-release-event\">/usr/local/petget/finduserinstalledpkgs.sh</action>
  110. <action signal=\"button-release-event\">/usr/local/petget/filterpkgs.sh</action>
  111. <action signal=\"button-release-event\">refresh:TREE1</action>
  112. <action signal=\"button-release-event\">refresh:TREE2</action>
  113. </tree>
  114. </vbox>
  115. </hbox>
  116. <hbox>
  117. <vbox>
  118. <hbox>
  119. <text><label>$(gettext 'Show:')</label></text>
  120. <checkbox><default>${DEF_CHK_EXE}</default><label>EXE</label><variable>CHK_EXE</variable><action>/usr/local/petget/postfilterpkgs.sh EXE \$CHK_EXE</action><action>refresh:TREE1</action></checkbox>
  121. <checkbox><default>${DEF_CHK_DEV}</default><label>DEV</label><variable>CHK_DEV</variable><action>/usr/local/petget/postfilterpkgs.sh DEV \$CHK_DEV</action><action>refresh:TREE1</action></checkbox>
  122. <checkbox><default>${DEF_CHK_DOC}</default><label>DOC</label><variable>CHK_DOC</variable><action>/usr/local/petget/postfilterpkgs.sh DOC \$CHK_DOC</action><action>refresh:TREE1</action></checkbox>
  123. <checkbox><default>${DEF_CHK_NLS}</default><label>NLS</label><variable>CHK_NLS</variable><action>/usr/local/petget/postfilterpkgs.sh NLS \$CHK_NLS</action><action>refresh:TREE1</action></checkbox>
  124. </hbox>
  125. <hbox>
  126. <comboboxtext width-request=\"140\">
  127. <variable>FILTERCOMBOBOX</variable>
  128. <default>$DEFGUIFILTER</default>
  129. <item>$ANYTYPESTR</item>
  130. <item>$GUIONLYSTR</item>
  131. <item>GTK+2 $GUIONLYSTR</item>
  132. <item>GTK+3 $GUIONLYSTR</item>
  133. <item>Qt4 $GUIONLYSTR</item>
  134. <item>Qt4 $GUIEXCSTR KDE</item>
  135. <item>Qt5 $GUIONLYSTR</item>
  136. <item>Qt5 $GUIEXCSTR KDE</item>
  137. <item>$NONGUISTR</item>
  138. <action>echo -n \"\$FILTERCOMBOBOX\" > /var/local/petget/gui_filter</action>
  139. <action>/usr/local/petget/filterpkgs.sh</action>
  140. <action>refresh:TREE1</action>
  141. </comboboxtext>
  142. <text><label>\" \"</label></text>
  143. <text><label>$(gettext 'Help:')</label></text>
  144. <button><input file>/usr/local/lib/X11/mini-icons/mini-question.xpm</input><action>defaulthtmlviewer file://${HELPFILE} & </action></button>
  145. </hbox>
  146. <hbox>
  147. <text><label>$(gettext 'Find:')</label></text>
  148. <entry activates-default=\"true\">
  149. <variable>ENTRY1</variable>
  150. </entry>
  151. <button can-default=\"true\" has-default=\"true\" use-stock=\"true\">
  152. <label>$(gettext 'Go')</label>
  153. <action>/usr/local/petget/findnames.sh</action>
  154. <action>refresh:TREE1</action>
  155. <action>/usr/local/petget/show_installed_version_diffs.sh & </action>
  156. </button>
  157. </hbox>
  158. <button>
  159. <input file icon=\"gtk-preferences\"></input>
  160. <label>$(gettext 'Configure package manager')</label>
  161. <action>/usr/local/petget/configure.sh</action>
  162. <action>/usr/local/petget/filterpkgs.sh</action>
  163. <action>refresh:TREE1</action>
  164. </button>
  165. <button type=\"exit\">
  166. <input file icon=\"mini-exit\"></input>
  167. <label>$(gettext 'Exit package manager')</label>
  168. </button>
  169. </vbox>
  170. <text><label>\" \"</label></text>
  171. <frame $(gettext 'Installed packages')>
  172. <tree column-resizeable=\"false|false\">
  173. <label>$(gettext 'Package|Description')</label>
  174. <height>100</height><width>480</width>
  175. <variable>TREE2</variable>
  176. <input${APPICONXMLINSERT}>cat /tmp/petget/installedpkgs.results.post</input>
  177. <action>/usr/local/petget/removepreview.sh</action>
  178. <action>/usr/local/petget/finduserinstalledpkgs.sh</action>
  179. <action>/usr/local/petget/filterpkgs.sh</action>
  180. <action>refresh:TREE2</action>
  181. <action>refresh:TREE1</action>
  182. <action signal=\"button-release-event\">/usr/local/petget/removepreview.sh</action>
  183. <action signal=\"button-release-event\">/usr/local/petget/finduserinstalledpkgs.sh</action>
  184. <action signal=\"button-release-event\">/usr/local/petget/filterpkgs.sh</action>
  185. <action signal=\"button-release-event\">refresh:TREE2</action>
  186. <action signal=\"button-release-event\">refresh:TREE1</action>
  187. </tree>
  188. </frame>
  189. </hbox>
  190. </vbox>
  191. <action signal=\"show\">kill -9 $SPID</action>
  192. </window>
  193. "
  194. export TEXTDOMAIN=petget___pkg_chooser.sh
  195. RETPARAMS="`gtkdialog -p PPM_GUI`"
  196. # Run indexgen after we exit the GUI
  197. /usr/sbin/indexgen.sh