Advertisement
KosIvantsov

Updated OmegaT kaptain script

May 25th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.49 KB | None | 0 0
  1. #!/usr/bin/kaptain
  2.  
  3. # This version of the Kaptain OmegaT Launcher: 2013-04-26
  4.  
  5. start "OmegaT Launcher" -> omticon top bottom ;
  6.   top :tabbed  -> locs mem langs connect appearance about ;
  7.   bottom :horizontal -> button_bar ;
  8.  
  9. omticon -> @icon("images/OmegaT.png") ;
  10.  
  11. ### Locations tab
  12.  
  13. locs :framed :vertical "Locations" -> javaloc jarfileloc optloc ;
  14. #mandloc :vertical "Mandatory locations" -> javaloc jarfileloc ;
  15.  
  16. # Location of the Java runtime environment
  17.  
  18. javaloc "Java runtime environment" -> java_list |! java_pick ;
  19. java_list "System-wide Java installation" ->  @combow (`ls /usr/lib/jvm/*/jre/bin/java`) ;
  20. java_pick :horizontal "Custom Java installation" -> @infile("java")="/opt/omegat/jre/bin/java" javaloc_help ;
  21. javaloc_help :dialog "Help" -> javaloc_m javaloc_hc ;
  22. javaloc_m :horizontal ->  javaloc_t ;
  23. javaloc_t "The current default assumes that you have used the linux-install.sh \n installation script and are using a local version of the JRE (i.e. \n you have installed OmegaT with JRE).\n If you are using a system-wide version of Java that is in your \n execution path, replace /opt/omegat/jre/bin/java with java.\n If you are using a system-wide version of Java that is NOT in your \n execution path, replace /opt/omegat/jre/bin/java with the full path of your \n java executable (in quotes). " -> @ ;
  24. javaloc_hc :horizontal -> @close="Close";
  25.  
  26.  
  27. # Location of the OmegaT.jar file (OmegaT version)
  28. # To make a particular OmegaT.jar file the default, replace =""
  29. # with ="<full path of OmegaT.jar file>"
  30.  
  31. jarfileloc "Location of OmegaT.jar" -> jarlist | ! jarpick ;
  32. jarlist "System-wide OmegaT installation" -> @combow(`find -L /opt/omegat -name "OmegaT.*jar"`);
  33. jarpick :horizontal "Custom OmegaT installation"-> @infile("OmegaT.jar")="/opt/omegat/OmegaT-default/OmegaT.jar" jarfileloc_help ;
  34. jarfileloc_help :dialog "Help" -> jarfileloc_m jarfileloc_hc ;
  35. jarfileloc_m :horizontal ->  jarfileloc_t ;
  36. jarfileloc_t "Location of the OmegaT program. Use this menu item to \nselect a different (installed) version of OmegaT, for example for testing." -> @ ;
  37. jarfileloc_hc :horizontal -> @close="Close" ;
  38.  
  39. # Optional file locations
  40.  
  41. optloc "Optional locations" -> configloc projectloc ;
  42.  
  43. # Specify non-default configuration files
  44.  
  45. configloc :horizontal "Directory containing non-default configuration files" -> @directory configloc_help ;
  46. configloc_help :dialog "Help" -> configloc_m configloc_hc ;
  47. configloc_m :horizontal ->  configloc_t ;
  48. configloc_t "Use a different set of configuration files to those in your \nsystem. Useful for example if you wish to use a colleague's \nsegmentation rules rather than your own." -> @ ;
  49. configloc_hc :horizontal -> @close="Close" ;
  50.  
  51. # Open a specific project at launch
  52.  
  53. #projectloc :horizontal "Open specified project immediately" -> @directory projectloc_help ;
  54. projectloc :horizontal "Open specified project immediately" -> @combow("", `IFS=$(echo "\n\b") && for i in $(find $HOME/Documents $HOME/Desktop -name "omegat.project" -type f); do echo "\"$(dirname $i)\""; done`) projectloc_help ;
  55. projectloc_help :dialog "Help" -> projectloc_m projectloc_hc ;
  56. projectloc_m :horizontal ->  projectloc_t ;
  57. projectloc_t "Open a specific project immediately after launching OmegaT. \nUsualy superfluous in GUI mode." -> @ ;
  58. projectloc_hc :horizontal -> @close="Close" ;
  59.  
  60. # fillloc -> @fill ;
  61.  
  62.  
  63. ### Memory tab
  64.  
  65. mem :framed "Memory" -> memory ;
  66.  
  67. memory "Assign memory limit for OmegaT" -> defm | halfg | oneg | twog | memory_help ;
  68. defm "Default" -> "" ;
  69. halfg "512 MB" -> " -Xmx512M" ;
  70. oneg "1 GB" -> " -Xmx1024M" ;
  71. twog "2 GB" -> " -Xmx2048M" ;
  72. memory_help :dialog "Help" -> memory_m memory_hc ;
  73. memory_m :horizontal ->  memory_t ;
  74. memory_t "Determine how much RAM OmegaT is allowed to make use of. \nToo low a value will make large projects slow or impossible to open; too high a value \nwill prevent OmegaT from launching." -> @ ;
  75. memory_hc :horizontal -> @close="Close" ;
  76.  
  77.  
  78. ### languages tab
  79.  
  80. # Selection of the user interface language
  81. # Add language codes (that OmegaT has) or delete them.
  82. # The first one on the list becomes the default
  83.  
  84. langs :framed "Languages" -> UI ;
  85.  
  86. UI "User interface" -> UIlang country languages_help ;
  87.  
  88. UIlang "User interface language (nn)" -> @combow("en", "ar", "be", "ca", "cs", "cy", "da", "de", "el", "eo", "es", "eu", "fr", "gl", "hu", "id", "it", "ja", "nl", "pl", "pt", "ru", "sh", "sk", "sl", "sq", "sv", "tr", "uk", "zh") ;
  89.  
  90. # Selection of the user country
  91.  
  92. country "User country (NN)" -> @string(2) ;
  93.  
  94. languages_help :dialog "Help" -> languages_m languages_hc ;
  95. languages_m :horizontal ->  languages_t ;
  96. languages_t "Select the language of OmegaT's user interface. If no language \nis specified or a language is not available, OmegaT defaults first to the operating \nsystem language, then to English. Different country variants for the same language are not \nused at present." -> @ ;
  97. languages_hc :horizontal -> @close="Close" ;
  98.  
  99. ### Connectivity tab
  100.  
  101. connect :framed "Connectivity" -> proxy gt ms ;
  102.  
  103. proxy "Proxy settings" -> proxyhost proxyport ;
  104.  
  105.  
  106. # Enter proxy host IP address
  107.  
  108. proxyhost "IP address of your proxy server, if your system uses a proxy" -> @string ;
  109.  
  110. # Proxy Server Port Number
  111.  
  112. proxyport "Port number used by your system to access the proxy server" -> @string ;
  113.  
  114. # Google Translate API key
  115.  
  116. gt "Google Translate API key" -> @password gt_help ;
  117.  
  118. gt_help :dialog "Help" -> gt_m gt_hc ;
  119. gt_m :horizontal ->  gt_t ;
  120. gt_t "To use Google Translate within OmegaT, you must order \na password from Google and enter it here." -> @ ;
  121. gt_hc :horizontal -> @close="Close";
  122.  
  123.  
  124. # Microsoft Translator API key
  125.  
  126. ms "Microsoft Translator settings" -> msi msk ms_help ;
  127. msi "Microsoft Translator API Client ID" -> @password="" ;
  128. msk "Microsoft Translator API Secret Key" -> @password="" ;
  129.  
  130.  
  131. ms_help :dialog "Help" -> ms_m ms_hc ;
  132. ms_m :horizontal ->  ms_t ;
  133. ms_t "To use Mircrosoft Translator within OmegaT, you must order \na client ID and a secret key from Microsoft Azure Marketplace \n(see https://datamarket.azure.com/dataset/bing/microsofttranslator) \nand enter them here." -> @ ;
  134. ms_hc :horizontal -> @close="Close";
  135.  
  136. ### Appearance settings tab
  137.  
  138. appearance :framed "Appearance" -> fontaa laf ;
  139.  
  140. # Font anti-aliasing settings
  141.  
  142. fontaa :double "Anti-aliasing settings" -> on | false | defaultaa | off | gasp | lcd_hrgb | lcd_hbgr | lcd_vrgb | lcd_vbgr | aa_help ;
  143. on "Anti-aliasing on" -> "on " ;
  144. false "Anti-aliasing false" -> "false " ;
  145. defaultaa "Anti-aliasing default" -> "default " ;
  146. off "Anti-aliasing off" -> "off " ;
  147. gasp "Use font's built-in hinting instructions" -> "gasp " ;
  148. lcd_hrgb "LCD monitor setting HRGB" -> "lcd_hrgb " ;
  149. lcd_hbgr "LCD monitor setting HBGR" -> "lcd_hbgr " ;
  150. lcd_vrgb "LCD monitor setting VRGB" -> "lcd_vrgb " ;
  151. lcd_vbgr "LCD monitor setting VBGR" -> "lcd_vbgr " ;
  152.  
  153. aa_help :dialog "Help" -> aa_m aa_hc ;
  154. aa_m :horizontal ->  aa_t ;
  155. aa_t "Fonts in Java on Linux can be very unattractive unless the optimum settings are selected. \nThe optimum settings depend upon the font type and size, your hardware, and the anti-aliasing \nsettings. The best anti-aliasing settings may differ according to the selected font \nand size and are best found by trial and error. It is worth taking time to experiment \nwith these." -> @ ;
  156. aa_hc :horizontal -> @close="Close";
  157.  
  158. # Look and feel settings
  159.  
  160. laf "Look and Feel" -> deflaf | gtk | motif | laf_help ;
  161. deflaf "Default" -> " " ;
  162. #gtk "GTK" -> " -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel " ;
  163. gtk "GTK" -> " -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel ";
  164. motif "Motif" -> " -Dswing.defaultlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel " ;
  165. laf_help :dialog "Help" -> laf_m laf_hc ;
  166. laf_m :horizontal ->  laf_t ;
  167. laf_t "Modern Linux distributions attempt to create \na uniform look and feel, and you may notice little or no difference with these settings." -> @ ;
  168. laf_hc :horizontal -> @close="Close";
  169.  
  170.  
  171. ### About tab
  172.  
  173. about :framed "About" -> general_t ;
  174. general_t "About the Kaptain OmegaT Launcher" -> @text="Certain functions and settings of OmegaT are activated or configured at runtime, \ni.e. when OmegaT is launched, by means of command-line options. The Kaptain \nOmegaT Launcher is intended to make the use of these functions and settings easier \nfor Linux users by providing a user-friendly user interface. Information on Kaptain \nand its syntax can be found at: kaptain.sourceforge.net.\n\nThe Kaptain OmegaT Launcher is free software; you can redistribute it and/or modify it \nunder the terms of the GNU General Public License as published by the Free Software \nFoundation; either version 2 of the License, or (at your option) any later version.\n\n(c) Marc Prior, 2012\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; \nwithout even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \nThe text of the GNU General Public License is provided within OmegaT itself, with which \nthis script is intended to be supplied." ;
  175.  
  176.  
  177. ### Button bar
  178.  
  179. button_bar :horizontal -> launch_button close_button ;
  180. launch_button -> @exec(omt)="Launch" ;
  181. close_button -> @close="Cancel" ;
  182.  
  183.  
  184. ### Launch command
  185.  
  186. omt -> javaloc " -jar " memory " -Duser.language=" UIlang " -Duser.country=" country " -Dgoogle.api.key=" gt " -Dmicrosoft.api.client_secret=" msk " -Dmicrosoft.api.client_id=" msi " -Dhttp.proxyHost=" proxyhost " -Dhttp.proxyPort=" proxyport " -Dawt.useSystemAAFontSettings=" fontaa laf " " jarfileloc " " projectloc " --config-dir=" configloc ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement