Posted to tcl by saedelaere at Sat Aug 22 11:18:36 GMT 2009view raw

  1. # config_interface.tcl
  2. # © Copyright 2007-2009 Christian Rapp <saedelaere@arcor.de>
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. # MA 02110-1301, USA.
  18.  
  19. proc option_screen_6 {} {
  20. puts $::main(debug_msg) "\033\[0;1;33mDebug: option_screen_6 \033\[0m"
  21.  
  22. # Setting up the interface
  23.  
  24. foreach tab [split [.config_wizard.frame_configoptions.nb tabs]] {
  25. .config_wizard.frame_configoptions.nb hide $tab
  26. }
  27.  
  28. if {[winfo exists .config_wizard.frame_configoptions.nb.f_interface]} {
  29. .config_wizard.frame_configoptions.nb add $::window(interface_nb1)
  30. .config_wizard.frame_configoptions.nb add $::window(interface_nb2)
  31. .config_wizard.frame_configoptions.nb add $::window(interface_nb3)
  32. .config_wizard.frame_configoptions.nb select $::window(interface_nb1)
  33. .config_wizard.frame_buttons.b_default configure -command [list stnd_opt6 $::window(interface_nb1) $::window(interface_nb2) $::window(interface_nb3)]
  34. bind $::window(interface_nb3_cont) <Map> {
  35. $::window(interface_nb3_cont) itemconfigure cont_int_nb3 -width [winfo width $::window(interface_nb3_cont)] -height [winfo reqheight $::window(interface_nb3_cont).f_osd2]
  36. $::window(interface_nb3_cont) configure -scrollregion [$::window(interface_nb3_cont) bbox all]
  37. $::window(interface_nb3_cont) yview moveto 0
  38. }
  39. } else {
  40. puts $::logf_tv_open_append "# \[[clock format [clock scan now] -format {%H:%M:%S}]\] Setting up interface section in preferences"
  41. flush $::logf_tv_open_append
  42. set w .config_wizard.frame_configoptions.nb
  43. set ::window(interface_nb1) [ttk::frame $w.f_interface]
  44. $w add $::window(interface_nb1) -text [mc "Interface Settings"] -padding 2
  45. ttk::labelframe $::window(interface_nb1).lf_theme \
  46. -text [mc "Theme"]
  47. ttk::menubutton $::window(interface_nb1).mb_lf_theme \
  48. -menu $::window(interface_nb1).mbTheme \
  49. -textvariable choice(mbTheme)
  50. menu $::window(interface_nb1).mbTheme \
  51. -tearoff 0 \
  52. -background $::option(theme_$::option(use_theme))
  53. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip \
  54. -text [mc "Enable Tooltips"] \
  55. -variable choice(cb_tooltip) \
  56. -command [list config_interfaceChangeTooltips $::window(interface_nb1)]
  57. ttk::labelframe $::window(interface_nb1).lf_tooltip \
  58. -labelwidget $::window(interface_nb1).cb_lf_tooltip
  59. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip_main \
  60. -text [mc "Main Gui"] \
  61. -variable choice(cb_tooltip_main)
  62. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip_wizard \
  63. -text [mc "Preferences"] \
  64. -variable choice(cb_tooltip_wizard)
  65. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip_station \
  66. -text [mc "Station Editor"] \
  67. -variable choice(cb_tooltip_station)
  68. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip_videocard \
  69. -text [mc "Color Management"] \
  70. -variable choice(cb_tooltip_colorm)
  71. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip_player \
  72. -text [mc "Video player"] \
  73. -variable choice(cb_tooltip_player)
  74. ttk::checkbutton $::window(interface_nb1).cb_lf_tooltip_record \
  75. -text [mc "Record Wizard"] \
  76. -variable choice(cb_tooltip_record)
  77. ttk::labelframe $::window(interface_nb1).lf_splash \
  78. -text [mc "Splash Screen"]
  79. ttk::checkbutton $::window(interface_nb1).cb_lf_splash \
  80. -text [mc "Show Splash Screen on initialization."] \
  81. -variable choice(cb_splash)
  82. ttk::labelframe $::window(interface_nb1).lf_showslist \
  83. -text [mc "Station List"]
  84. ttk::checkbutton $::window(interface_nb1).cb_lf_showslist \
  85. -text [mc "Show Station List on initialization."] \
  86. -variable choice(cb_slist)
  87.  
  88. set ::window(interface_nb2) [ttk::frame $w.f_windowprop]
  89. $w add $::window(interface_nb2) -text [mc "Window Properties"] -padding 2
  90. ttk::labelframe $::window(interface_nb2).lf_tvattach \
  91. -text [mc "Video window"]
  92. ttk::checkbutton $::window(interface_nb2).cb_lf_tvattach \
  93. -text [mc "Attach video window to main window"] \
  94. -variable choice(cb_tvattach)
  95. ttk::checkbutton $::window(interface_nb2).cb_lf_tvfullscr \
  96. -text [mc "Start in full-screen mode"] \
  97. -variable choice(cb_tvfullscr)
  98. ttk::labelframe $::window(interface_nb2).lf_systray \
  99. -text [mc "System Tray"]
  100. ttk::checkbutton $::window(interface_nb2).cb_lf_systray_tv \
  101. -text [mc "Dock video window"] \
  102. -variable choice(cb_systray_tv)
  103. ttk::checkbutton $::window(interface_nb2).cb_lf_systray_dock \
  104. -text [mc "Dock TV-Viewer after initialization"] \
  105. -variable choice(cb_systray_start)
  106. ttk::checkbutton $::window(interface_nb2).cb_lf_systray_mini \
  107. -text [mc "Minimize to Tray"] \
  108. -variable choice(cb_systray_mini)
  109.  
  110. set ::window(interface_nb3) [ttk::frame $w.f_osd]
  111. $w add $::window(interface_nb3) -text [mc "On screen Display"] -padding 2
  112. set ::window(interface_nb3_cont) [canvas $::window(interface_nb3).c_cont \
  113. -yscrollcommand [list $::window(interface_nb3).scrollb_cont set] \
  114. -highlightthickness 0]
  115. ttk::scrollbar $::window(interface_nb3).scrollb_cont \
  116. -command [list $::window(interface_nb3).c_cont yview]
  117. $::window(interface_nb3_cont) create window 0 0 -window [ttk::frame $::window(interface_nb3_cont).f_osd2] -anchor w -tags cont_int_nb3
  118. set frame_nb3 "$::window(interface_nb3_cont).f_osd2"
  119.  
  120. ttk::labelframe $frame_nb3.lf_osd_station \
  121. -text [mc "Station"]
  122. ttk::checkbutton $frame_nb3.cb_osd_station_w \
  123. -variable config_int(cb_osd_station_w) \
  124. -text [mc "Windowed mode"] \
  125. -command {set ::choice(osd_station_w) [lreplace $::choice(osd_station_w) 0 0 $::config_int(cb_osd_station_w)]}
  126. ttk::button $frame_nb3.b_osd_station_fnt_w \
  127. -command [list font_chooserUi $frame_nb3.b_osd_station_fnt_w osd_station_w]
  128. ttk::checkbutton $frame_nb3.cb_osd_station_f \
  129. -variable config_int(cb_osd_station_f) \
  130. -text [mc "Full-screen mode"] \
  131. -command {set ::choice(osd_station_f) [lreplace $::choice(osd_station_f) 0 0 $::config_int(cb_osd_station_f)]}
  132. ttk::button $frame_nb3.b_osd_station_fnt_f \
  133. -command [list font_chooserUi $frame_nb3.b_osd_station_fnt_f osd_station_f]
  134.  
  135. ttk::labelframe $frame_nb3.lf_osd_group \
  136. -text [mc "Volume | Video input | Pan&Scan"]
  137. ttk::checkbutton $frame_nb3.cb_osd_group_w \
  138. -variable config_int(cb_osd_group_w) \
  139. -text [mc "Windowed mode"] \
  140. -command {set ::choice(osd_group_w) [lreplace $::choice(osd_group_w) 0 0 $::config_int(cb_osd_group_w)]}
  141. ttk::button $frame_nb3.b_osd_group_fnt_w \
  142. -command [list font_chooserUi $frame_nb3.b_osd_group_fnt_w osd_group_w]
  143. ttk::checkbutton $frame_nb3.cb_osd_group_f \
  144. -variable config_int(cb_osd_group_f) \
  145. -text [mc "Full-screen mode"] \
  146. -command {set ::choice(osd_group_f) [lreplace $::choice(osd_group_f) 0 0 $::config_int(cb_osd_group_f)]}
  147. ttk::button $frame_nb3.b_osd_group_fnt_f \
  148. -command [list font_chooserUi $frame_nb3.b_osd_group_fnt_f osd_group_f]
  149.  
  150. ttk::labelframe $frame_nb3.lf_osd_key \
  151. -text [mc "Key Input"]
  152. ttk::checkbutton $frame_nb3.cb_osd_key_w \
  153. -variable config_int(cb_osd_key_w) \
  154. -text [mc "Windowed mode"] \
  155. -command {set ::choice(osd_key_w) [lreplace $::choice(osd_key_f) 0 0 $::config_int(cb_osd_key_w)]}
  156. ttk::button $frame_nb3.b_osd_key_fnt_w \
  157. -command [list font_chooserUi $frame_nb3.b_osd_key_fnt_w osd_key_w]
  158. ttk::checkbutton $frame_nb3.cb_osd_key_f \
  159. -variable config_int(cb_osd_key_f) \
  160. -text [mc "Full-screen mode"] \
  161. -command {set ::choice(osd_key_f) [lreplace $::choice(osd_key_f) 0 0 $::config_int(cb_osd_key_f)]}
  162. ttk::button $frame_nb3.b_osd_key_fnt_f \
  163. -command [list font_chooserUi $frame_nb3.b_osd_key_fnt_f osd_key_f]
  164.  
  165. ttk::labelframe $frame_nb3.lf_osd_mouse \
  166. -text [mc "OSD Station list mouse"]
  167. ttk::checkbutton $frame_nb3.cb_osd_mouse_w \
  168. -variable config_int(cb_osd_mouse_w) \
  169. -text [mc "Windowed mode"] \
  170. -command {set ::choice(osd_mouse_w) [lreplace $::choice(osd_mouse_w) 0 0 $::config_int(cb_osd_mouse_w)]}
  171. ttk::menubutton $frame_nb3.b_osd_mouse_aln_w \
  172. -menu $frame_nb3.mbOsd_mouse_w \
  173. -textvariable config_int(osd_mouse_w)
  174. menu $frame_nb3.mbOsd_mouse_w \
  175. -tearoff 0 \
  176. -background $::option(theme_$::option(use_theme))
  177. ttk::checkbutton $frame_nb3.cb_osd_mouse_f \
  178. -variable config_int(cb_osd_mouse_f) \
  179. -text [mc "Full-screen mode"] \
  180. -command {set ::choice(osd_mouse_f) [lreplace $::choice(osd_mouse_f) 0 0 $::config_int(cb_osd_mouse_f)]}
  181. ttk::menubutton $frame_nb3.b_osd_mouse_aln_f \
  182. -menu $frame_nb3.mbOsd_mouse_f \
  183. -textvariable config_int(osd_mouse_f)
  184. menu $frame_nb3.mbOsd_mouse_f \
  185. -tearoff 0 \
  186. -background $::option(theme_$::option(use_theme))
  187.  
  188. ttk::labelframe $frame_nb3.lf_osd_lirc \
  189. -text [mc "OSD Station list lirc"]
  190. ttk::label $frame_nb3.l_osd_lirc_fnt \
  191. -text [mc "Full-screen mode"]
  192. ttk::button $frame_nb3.b_osd_lirc_fnt \
  193. -command [list font_chooserUi $frame_nb3.b_osd_lirc_fnt osd_lirc]
  194.  
  195. grid columnconfigure $::window(interface_nb1) 0 -weight 1
  196. grid columnconfigure $::window(interface_nb1).lf_theme 0 -minsize 120
  197. grid columnconfigure $::window(interface_nb2) 0 -weight 1
  198. grid columnconfigure $::window(interface_nb2).lf_tvattach 1 -minsize 100
  199. grid columnconfigure $::window(interface_nb3) 0 -weight 1
  200. grid columnconfigure $::window(interface_nb3_cont).f_osd2 0 -weight 1
  201. grid rowconfigure $::window(interface_nb3) 0 -weight 1
  202.  
  203. grid $::window(interface_nb1).lf_theme -in $::window(interface_nb1) -row 0 -column 0 \
  204. -sticky ew \
  205. -padx 5 \
  206. -pady "5 0"
  207. grid $::window(interface_nb1).mb_lf_theme -in $::window(interface_nb1).lf_theme -row 0 -column 0 \
  208. -sticky ew \
  209. -padx 7 \
  210. -pady 3
  211. grid $::window(interface_nb1).lf_tooltip -in $::window(interface_nb1) -row 1 -column 0 \
  212. -sticky ew \
  213. -padx 5 \
  214. -pady "5 0"
  215. grid $::window(interface_nb1).cb_lf_tooltip_main -in $::window(interface_nb1).lf_tooltip -row 0 -column 0 \
  216. -sticky ew \
  217. -padx 7 \
  218. -pady 3
  219. grid $::window(interface_nb1).cb_lf_tooltip_wizard -in $::window(interface_nb1).lf_tooltip -row 0 -column 1 \
  220. -sticky ew \
  221. -pady 3
  222. grid $::window(interface_nb1).cb_lf_tooltip_station -in $::window(interface_nb1).lf_tooltip -row 0 -column 2 \
  223. -sticky ew \
  224. -padx "7 0" \
  225. -pady 3
  226. grid $::window(interface_nb1).cb_lf_tooltip_videocard -in $::window(interface_nb1).lf_tooltip -row 1 -column 0 \
  227. -sticky ew \
  228. -padx 7 \
  229. -pady "0 3"
  230. grid $::window(interface_nb1).cb_lf_tooltip_player -in $::window(interface_nb1).lf_tooltip -row 1 -column 1 \
  231. -sticky ew \
  232. -pady "0 3"
  233. grid $::window(interface_nb1).cb_lf_tooltip_record -in $::window(interface_nb1).lf_tooltip -row 1 -column 2 \
  234. -sticky ew \
  235. -padx "7 0" \
  236. -pady "0 3"
  237. grid $::window(interface_nb1).lf_splash -in $::window(interface_nb1) -row 2 -column 0 \
  238. -sticky ew \
  239. -padx 5 \
  240. -pady "5 0"
  241. grid $::window(interface_nb1).cb_lf_splash -in $::window(interface_nb1).lf_splash -row 0 -column 0 \
  242. -padx 7 \
  243. -pady 3
  244. grid $::window(interface_nb1).lf_showslist -in $::window(interface_nb1) -row 3 -column 0 \
  245. -sticky ew \
  246. -padx 5 \
  247. -pady "5 0"
  248. grid $::window(interface_nb1).cb_lf_showslist -in $::window(interface_nb1).lf_showslist -row 0 -column 0 \
  249. -padx 7 \
  250. -pady 3
  251.  
  252. grid $::window(interface_nb2).lf_tvattach -in $::window(interface_nb2) -row 0 -column 0 \
  253. -sticky ew \
  254. -padx 5 \
  255. -pady "5 0"
  256. grid $::window(interface_nb2).cb_lf_tvattach -in $::window(interface_nb2).lf_tvattach -row 0 -column 0 \
  257. -columnspan 2 \
  258. -sticky w \
  259. -padx 7 \
  260. -pady 3
  261. grid $::window(interface_nb2).cb_lf_tvfullscr -in $::window(interface_nb2).lf_tvattach -row 1 -column 0 \
  262. -columnspan 2 \
  263. -sticky w \
  264. -padx 7 \
  265. -pady "0 3"
  266. grid $::window(interface_nb2).lf_systray -in $::window(interface_nb2) -row 1 -column 0 \
  267. -sticky ew \
  268. -padx 5 \
  269. -pady "5 0"
  270. grid $::window(interface_nb2).cb_lf_systray_dock -in $::window(interface_nb2).lf_systray -row 0 -column 0 \
  271. -sticky w \
  272. -padx 7 \
  273. -pady 3
  274. grid $::window(interface_nb2).cb_lf_systray_tv -in $::window(interface_nb2).lf_systray -row 1 -column 0 \
  275. -sticky w \
  276. -padx 7 \
  277. -pady 3
  278. grid $::window(interface_nb2).cb_lf_systray_mini -in $::window(interface_nb2).lf_systray -row 2 -column 0 \
  279. -sticky w \
  280. -padx 7 \
  281. -pady 3
  282.  
  283. grid $::window(interface_nb3_cont) -in $::window(interface_nb3) -row 0 -column 0 \
  284. -sticky nesw
  285. grid $::window(interface_nb3).scrollb_cont -in $::window(interface_nb3) -row 0 -column 1 \
  286. -sticky ns
  287.  
  288. grid $frame_nb3.lf_osd_station -in $frame_nb3 -row 0 -column 0 \
  289. -sticky ew \
  290. -padx 5 \
  291. -pady "5 0"
  292. grid $frame_nb3.cb_osd_station_w -in $frame_nb3.lf_osd_station -row 0 -column 0 \
  293. -sticky w \
  294. -padx 7 \
  295. -pady 3
  296. grid $frame_nb3.b_osd_station_fnt_w -in $frame_nb3.lf_osd_station -row 0 -column 1 \
  297. -sticky ew \
  298. -padx "0 7" \
  299. -pady 3
  300. grid $frame_nb3.cb_osd_station_f -in $frame_nb3.lf_osd_station -row 1 -column 0 \
  301. -sticky w \
  302. -padx 7 \
  303. -pady "0 3"
  304. grid $frame_nb3.b_osd_station_fnt_f -in $frame_nb3.lf_osd_station -row 1 -column 1 \
  305. -sticky ew \
  306. -padx "0 7" \
  307. -pady "0 3"
  308.  
  309. grid $frame_nb3.lf_osd_group -in $frame_nb3 -row 1 -column 0 \
  310. -sticky ew \
  311. -padx 5 \
  312. -pady "5 0"
  313. grid $frame_nb3.cb_osd_group_w -in $frame_nb3.lf_osd_group -row 0 -column 0 \
  314. -sticky w \
  315. -padx 7 \
  316. -pady 3
  317. grid $frame_nb3.b_osd_group_fnt_w -in $frame_nb3.lf_osd_group -row 0 -column 1 \
  318. -sticky ew \
  319. -padx "0 7" \
  320. -pady 3
  321. grid $frame_nb3.cb_osd_group_f -in $frame_nb3.lf_osd_group -row 1 -column 0 \
  322. -sticky w \
  323. -padx 7 \
  324. -pady "0 3"
  325. grid $frame_nb3.b_osd_group_fnt_f -in $frame_nb3.lf_osd_group -row 1 -column 1 \
  326. -sticky ew \
  327. -padx "0 7" \
  328. -pady "0 3"
  329.  
  330. grid $frame_nb3.lf_osd_key -in $frame_nb3 -row 2 -column 0 \
  331. -sticky ew \
  332. -padx 5 \
  333. -pady "5 0"
  334. grid $frame_nb3.cb_osd_key_w -in $frame_nb3.lf_osd_key -row 0 -column 0 \
  335. -sticky w \
  336. -padx 7 \
  337. -pady 3
  338. grid $frame_nb3.b_osd_key_fnt_w -in $frame_nb3.lf_osd_key -row 0 -column 1 \
  339. -sticky ew \
  340. -padx "0 7" \
  341. -pady 3
  342. grid $frame_nb3.cb_osd_key_f -in $frame_nb3.lf_osd_key -row 1 -column 0 \
  343. -sticky w \
  344. -padx 7 \
  345. -pady "0 3"
  346. grid $frame_nb3.b_osd_key_fnt_f -in $frame_nb3.lf_osd_key -row 1 -column 1 \
  347. -sticky ew \
  348. -padx "0 7" \
  349. -pady "0 3"
  350.  
  351. grid $frame_nb3.lf_osd_mouse -in $frame_nb3 -row 3 -column 0 \
  352. -sticky ew \
  353. -padx 5 \
  354. -pady "5 0"
  355. grid $frame_nb3.cb_osd_mouse_w -in $frame_nb3.lf_osd_mouse -row 0 -column 0 \
  356. -sticky w \
  357. -padx 7 \
  358. -pady 3
  359. grid $frame_nb3.b_osd_mouse_aln_w -in $frame_nb3.lf_osd_mouse -row 0 -column 1 \
  360. -sticky w \
  361. -pady 3
  362. grid $frame_nb3.cb_osd_mouse_f -in $frame_nb3.lf_osd_mouse -row 1 -column 0 \
  363. -sticky w \
  364. -padx 7 \
  365. -pady "0 3"
  366. grid $frame_nb3.b_osd_mouse_aln_f -in $frame_nb3.lf_osd_mouse -row 1 -column 1 \
  367. -sticky w \
  368. -pady "0 3"
  369.  
  370. grid $frame_nb3.lf_osd_lirc -in $frame_nb3 -row 4 -column 0 \
  371. -sticky ew \
  372. -padx 5 \
  373. -pady 5
  374. grid $frame_nb3.l_osd_lirc_fnt -in $frame_nb3.lf_osd_lirc -row 0 -column 0 \
  375. -padx "23 7" \
  376. -pady "3"
  377. grid $frame_nb3.b_osd_lirc_fnt -in $frame_nb3.lf_osd_lirc -row 0 -column 1 \
  378. -sticky ew \
  379. -pady "3"
  380.  
  381. #Additional Code
  382.  
  383. .config_wizard.frame_buttons.b_default configure -command [list stnd_opt6 $::window(interface_nb1) $::window(interface_nb2) $::window(interface_nb3)]
  384.  
  385. foreach athemes [split [lsort [ttk::style theme names]]] {
  386. puts $::logf_tv_open_append "# \[[clock format [clock scan now] -format {%H:%M:%S}]\] Found theme: $athemes"
  387. flush $::logf_tv_open_append
  388. $::window(interface_nb1).mbTheme add radiobutton \
  389. -variable choice(mbTheme) \
  390. -command [list config_interfaceTheme $athemes] \
  391. -label $athemes
  392. }
  393. foreach scrollw [winfo children $::window(interface_nb3_cont).f_osd2] {
  394. bind $scrollw <Button-4> {config_interfaceMousew 120}
  395. bind $scrollw <Button-5> {config_interfaceMousew -120}
  396. }
  397. bind $::window(interface_nb3_cont).f_osd2 <Button-4> {config_interfaceMousew 120}
  398. bind $::window(interface_nb3_cont).f_osd2 <Button-5> {config_interfaceMousew -120}
  399. set avail_aligns [dict create {top left} 0 top 1 {top right} 2 left 3 right 5 {bottom left} 6 bottom 7 {bottom right} 8]
  400. foreach {key elem} [dict get $avail_aligns] {
  401. $frame_nb3.mbOsd_mouse_w add radiobutton \
  402. -label "$key" \
  403. -value "{$key} $elem" \
  404. -variable config_int(radiobutton_osd_mouse_w) \
  405. -command [list config_interfaceAlign "{$key} $elem" osd_mouse_w]
  406. $frame_nb3.mbOsd_mouse_f add radiobutton \
  407. -label "$key" \
  408. -value "{$key} $elem" \
  409. -variable config_int(radiobutton_osd_mouse_f) \
  410. -command [list config_interfaceAlign "{$key} $elem" osd_mouse_f]
  411. }
  412. # Subprocs
  413.  
  414. proc config_interfaceTheme {theme} {
  415. puts $::main(debug_msg) "\033\[0;1;33mDebug: config_interfaceTheme \033\[0m \{$theme\}"
  416. ttk::style theme use $theme
  417. .options_bar.mOptions configure -background $::option(theme_$theme)
  418. .options_bar.mHelp configure -background $::option(theme_$theme)
  419. }
  420.  
  421. proc config_interfaceChangeTooltips {w} {
  422. puts $::main(debug_msg) "\033\[0;1;33mDebug: config_interfaceChangeTooltips \033\[0m \{$w\}"
  423. if {$::choice(cb_tooltip) == 1} {
  424. $w.cb_lf_tooltip_main state !disabled
  425. $w.cb_lf_tooltip_wizard state !disabled
  426. $w.cb_lf_tooltip_station state !disabled
  427. $w.cb_lf_tooltip_videocard state !disabled
  428. $w.cb_lf_tooltip_player state !disabled
  429. $w.cb_lf_tooltip_record state !disabled
  430. } else {
  431. $w.cb_lf_tooltip_main state disabled
  432. $w.cb_lf_tooltip_wizard state disabled
  433. $w.cb_lf_tooltip_station state disabled
  434. $w.cb_lf_tooltip_videocard state disabled
  435. $w.cb_lf_tooltip_player state disabled
  436. $w.cb_lf_tooltip_record state disabled
  437. }
  438. }
  439. proc config_interfaceAlign {value cvar} {
  440. puts $::main(debug_msg) "\033\[0;1;33mDebug: config_interfaceAlign \033\[0m \{$value\} \{$cvar\}"
  441. set ::choice($cvar) [lreplace $::choice($cvar) 1 1 [lindex $value 1]]
  442. set ::config_int($cvar) [lindex $value 0]
  443. }
  444. proc config_interfaceMousew {delta} {
  445. puts $::main(debug_msg) "\033\[0;1;33mDebug: config_interfaceMousew \033\[0m \{$delta\}"
  446. $::window(interface_nb3_cont) yview scroll [expr {-$delta/120}] units
  447. }
  448. proc default_opt6 {w1 w2 w3} {
  449. puts $::main(debug_msg) "\033\[0;1;33mDebug: default_opt6 \033\[0m \{$w1\} \{$w2\} \{$w3\}"
  450. puts $::logf_tv_open_append "# \[[clock format [clock scan now] -format {%H:%M:%S}]\] Starting to collect data for interface section."
  451. flush $::logf_tv_open_append
  452. set ::choice(mbTheme) $::option(use_theme)
  453. set ::choice(cb_tooltip) $::option(tooltips)
  454. set ::choice(cb_tooltip_main) $::option(tooltips_main)
  455. set ::choice(cb_tooltip_wizard) $::option(tooltips_wizard)
  456. set ::choice(cb_tooltip_station) $::option(tooltips_editor)
  457. set ::choice(cb_tooltip_colorm) $::option(tooltips_colorm)
  458. set ::choice(cb_tooltip_player) $::option(tooltips_player)
  459. set ::choice(cb_tooltip_record) $::option(tooltips_record)
  460. set ::choice(cb_splash) $::option(show_splash)
  461. set ::choice(cb_slist) $::option(show_slist)
  462. set ::choice(cb_tvattach) $::option(vidwindow_attach)
  463. set ::choice(cb_tvfullscr) $::option(vidwindow_full)
  464. set ::choice(cb_systray_tv) $::option(systray_tv)
  465. set ::choice(cb_systray_start) $::option(systray_start)
  466. set ::choice(cb_systray_mini) $::option(systray_mini)
  467. set ::choice(osd_station_w) $::option(osd_station_w)
  468. set ::config_int(cb_osd_station_w) [lindex $::choice(osd_station_w) 0]
  469. if {"[lindex $::choice(osd_station_w) 2]" == "Regular"} {
  470. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_w configure -text "[lindex $::choice(osd_station_w) 1] | [lindex $::choice(osd_station_w) 3]"
  471. } else {
  472. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_w configure -text "[lindex $::choice(osd_station_w) 1] - [lindex $::choice(osd_station_w) 2] | [lindex $::choice(osd_station_w) 3]"
  473. }
  474. set ::choice(osd_station_f) $::option(osd_station_f)
  475. set ::config_int(cb_osd_station_f) [lindex $::choice(osd_station_f) 0]
  476. if {"[lindex $::choice(osd_station_f) 2]" == "Regular"} {
  477. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_f configure -text "[lindex $::choice(osd_station_f) 1] | [lindex $::choice(osd_station_f) 3]"
  478. } else {
  479. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_f configure -text "[lindex $::choice(osd_station_f) 1] - [lindex $::choice(osd_station_f) 2] | [lindex $::choice(osd_station_f) 3]"
  480. }
  481. set ::choice(osd_group_w) $::option(osd_group_w)
  482. set ::config_int(cb_osd_group_w) [lindex $::choice(osd_group_w) 0]
  483. if {"[lindex $::choice(osd_group_w) 2]" == "Regular"} {
  484. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_w configure -text "[lindex $::choice(osd_group_w) 1] | [lindex $::choice(osd_group_w) 3]"
  485. } else {
  486. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_w configure -text "[lindex $::choice(osd_group_w) 1] - [lindex $::choice(osd_group_w) 2] | [lindex $::choice(osd_group_w) 3]"
  487. }
  488. set ::choice(osd_group_f) $::option(osd_group_f)
  489. set ::config_int(cb_osd_group_f) [lindex $::choice(osd_group_f) 0]
  490. if {"[lindex $::choice(osd_group_f) 2]" == "Regular"} {
  491. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_f configure -text "[lindex $::choice(osd_group_f) 1] | [lindex $::choice(osd_group_f) 3]"
  492. } else {
  493. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_f configure -text "[lindex $::choice(osd_group_f) 1] - [lindex $::choice(osd_group_f) 2] | [lindex $::choice(osd_group_f) 3]"
  494. }
  495. set ::choice(osd_key_w) $::option(osd_key_w)
  496. set ::config_int(cb_osd_key_w) [lindex $::choice(osd_key_w) 0]
  497. if {"[lindex $::choice(osd_key_w) 2]" == "Regular"} {
  498. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_w configure -text "[lindex $::choice(osd_key_w) 1] | [lindex $::choice(osd_key_w) 3]"
  499. } else {
  500. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_w configure -text "[lindex $::choice(osd_key_w) 1] - [lindex $::choice(osd_key_w) 2] | [lindex $::choice(osd_key_w) 3]"
  501. }
  502. set ::choice(osd_key_f) $::option(osd_key_f)
  503. set ::config_int(cb_osd_key_f) [lindex $::choice(osd_key_f) 0]
  504. if {"[lindex $::choice(osd_key_f) 2]" == "Regular"} {
  505. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_f configure -text "[lindex $::choice(osd_key_f) 1] | [lindex $::choice(osd_key_f) 3]"
  506. } else {
  507. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_f configure -text "[lindex $::choice(osd_key_f) 1] - [lindex $::choice(osd_key_f) 2] | [lindex $::choice(osd_key_f) 3]"
  508. }
  509. set ::choice(osd_mouse_w) $::option(osd_mouse_w)
  510. set ::choice(osd_mouse_f) $::option(osd_mouse_f)
  511. set ::config_int(cb_osd_mouse_w) [lindex $::choice(osd_mouse_w) 0]
  512. set ::config_int(cb_osd_mouse_f) [lindex $::choice(osd_mouse_f) 0]
  513. $::window(interface_nb3_cont).f_osd2.mbOsd_mouse_w invoke [lindex $::choice(osd_mouse_w) 1]
  514. $::window(interface_nb3_cont).f_osd2.mbOsd_mouse_f invoke [lindex $::choice(osd_mouse_f) 1]
  515. set ::choice(osd_lirc) $::option(osd_lirc)
  516. if {"[lindex $::choice(osd_lirc) 2]" == "Regular"} {
  517. $::window(interface_nb3_cont).f_osd2.b_osd_lirc_fnt configure -text "[lindex $::choice(osd_lirc) 1] | [lindex $::choice(osd_lirc) 3]"
  518. } else {
  519. $::window(interface_nb3_cont).f_osd2.b_osd_lirc_fnt configure -text "[lindex $::choice(osd_lirc) 1] - [lindex $::choice(osd_lirc) 2] | [lindex $::choice(osd_lirc) 3]"
  520. }
  521. config_interfaceChangeTooltips $w1
  522. if {$::option(tooltips) == 1} {
  523. if {$::option(tooltips_wizard) == 1} {
  524. settooltip $::window(interface_nb1).mb_lf_theme [mc "Choose your preferred theme."]
  525. settooltip $::window(interface_nb1).cb_lf_tooltip [mc "Check this if you want to see tooltips."]
  526. settooltip $::window(interface_nb1).cb_lf_tooltip_main [mc "Tooltips for the main Interface."]
  527. settooltip $::window(interface_nb1).cb_lf_tooltip_wizard [mc "Tooltips for the preferences."]
  528. settooltip $::window(interface_nb1).cb_lf_tooltip_station [mc "Tooltips for the Station Editor."]
  529. settooltip $::window(interface_nb1).cb_lf_tooltip_videocard [mc "Tooltips for the Color Management."]
  530. settooltip $::window(interface_nb1).cb_lf_tooltip_player [mc "Tooltips for the Video Player."]
  531. settooltip $::window(interface_nb1).cb_lf_tooltip_record [mc "Tooltips for the Record Wizard."]
  532. settooltip $::window(interface_nb1).cb_lf_splash [mc "Check this if you want to see the splash screen at the start of TV-Viewer."]
  533. settooltip $::window(interface_nb1).cb_lf_showslist [mc "If enabled the station list will be shown after the start up."]
  534. settooltip $::window(interface_nb2).cb_lf_tvattach [mc "This option makes sure, that there will be no
  535. separate entry in taskbar for the video window.
  536. On the other hand it will be logically linked
  537. to the main window. For example the video window
  538. will also dock to the system tray regardless of
  539. the option \"Dock video window\".
  540. Requires a restart of TV-Viewer."]
  541. settooltip $::window(interface_nb2).cb_lf_tvfullscr [mc "Start TV-Viewer in full-screen mode."]
  542. settooltip $::window(interface_nb2).cb_lf_systray_tv [mc "With this option enabled, the video window will be
  543. docked to the system tray with the rest of TV-Viewer."]
  544. settooltip $::window(interface_nb2).cb_lf_systray_dock [mc "Enable this option if you want to dock TV-Viewer after initialization."]
  545. settooltip $::window(interface_nb2).cb_lf_systray_mini [mc "Docks the application into the system tray if the
  546. main window is minimized."]
  547. settooltip $w3.cb_osd_station_w [mc "OSD for station name in windowed mode."]
  548. settooltip $w3.cb_osd_station_f [mc "OSD for station name in full-screen mode."]
  549. settooltip $w3.b_osd_station_fnt_w [mc "Change font, color and alignment."]
  550. settooltip $w3.b_osd_station_fnt_f [mc "Change font, color and alignment."]
  551. settooltip $w3.cb_osd_group_w [mc "OSD for Volume; Pan&Scan; Video input in windowed mode."]
  552. settooltip $w3.cb_osd_group_f [mc "OSD for Volume; Pan&Scan; Video input in full-screen mode."]
  553. settooltip $w3.b_osd_group_fnt_w [mc "Change font, color and alignment."]
  554. settooltip $w3.b_osd_group_fnt_f [mc "Change font, color and alignment."]
  555. settooltip $w3.cb_osd_key_w [mc "OSD for change stations via numbers input in windowed mode."]
  556. settooltip $w3.cb_osd_key_f [mc "OSD for change stations via numbers input in full-screen mode."]
  557. settooltip $w3.b_osd_key_fnt_w [mc "Change font, color and alignment."]
  558. settooltip $w3.b_osd_key_fnt_f [mc "Change font, color and alignment."]
  559. settooltip $w3.cb_osd_mouse_w [mc "OSD station list invoked by the mouse cursor in windowed mode."]
  560. settooltip $w3.cb_osd_mouse_f [mc "OSD station list invoked by the mouse cursor in full-screen mode."]
  561. settooltip $w3.b_osd_mouse_aln_w [mc "Alignment of the station list. Specifies where the widget
  562. should popup and where you have to move the
  563. mouse cursor to invoke it."]
  564. settooltip $w3.b_osd_mouse_aln_f [mc "Alignment of the station list. Specifies where the widget
  565. should popup and where you have to move the
  566. mouse cursor to invoke it."]
  567. settooltip $w3.b_osd_lirc_fnt [mc "Change font, color and alignment."]
  568. } else {
  569. settooltip $::window(interface_nb1).mb_lf_theme {}
  570. settooltip $::window(interface_nb1).cb_lf_tooltip {}
  571. settooltip $::window(interface_nb1).cb_lf_tooltip_main {}
  572. settooltip $::window(interface_nb1).cb_lf_tooltip_wizard {}
  573. settooltip $::window(interface_nb1).cb_lf_tooltip_station {}
  574. settooltip $::window(interface_nb1).cb_lf_tooltip_videocard {}
  575. settooltip $::window(interface_nb1).cb_lf_tooltip_player {}
  576. settooltip $::window(interface_nb1).cb_lf_tooltip_record {}
  577. settooltip $::window(interface_nb1).cb_lf_splash {}
  578. settooltip $::window(interface_nb1).cb_lf_showslist {}
  579. settooltip $::window(interface_nb2).cb_lf_tvattach {}
  580. settooltip $::window(interface_nb2).cb_lf_tvfullscr {}
  581. settooltip $::window(interface_nb2).cb_lf_systray_tv {}
  582. settooltip $w3.cb_osd_station_w {}
  583. settooltip $w3.cb_osd_station_f {}
  584. settooltip $w3.b_osd_station_fnt_w {}
  585. settooltip $w3.b_osd_station_fnt_f {}
  586. settooltip $w3.cb_osd_group_w {}
  587. settooltip $w3.cb_osd_group_f {}
  588. settooltip $w3.b_osd_group_fnt_w {}
  589. settooltip $w3.b_osd_group_fnt_f {}
  590. settooltip $w3.cb_osd_key_w {}
  591. settooltip $w3.cb_osd_key_f {}
  592. settooltip $w3.b_osd_key_fnt_w {}
  593. settooltip $w3.b_osd_key_fnt_f {}
  594. settooltip $w3.cb_osd_mouse_w {}
  595. settooltip $w3.cb_osd_mouse_f {}
  596. settooltip $w3.b_osd_mouse_aln_w {}
  597. settooltip $w3.b_osd_mouse_aln_f {}
  598. settooltip $w3.b_osd_lirc_fnt {}
  599. }
  600. }
  601. }
  602. proc stnd_opt6 {w1 w2 w3} {
  603. puts $::main(debug_msg) "\033\[0;1;33mDebug: stnd_opt6 \033\[0m \{$w1\} \{$w2\} \{$w3\}"
  604. puts $::logf_tv_open_append "# \[[clock format [clock scan now] -format {%H:%M:%S}]\] Setting interface options to default."
  605. flush $::logf_tv_open_append
  606. set ::choice(mbTheme) $::stnd_opt(use_theme)
  607. set ::choice(cb_tooltip) $::stnd_opt(tooltips)
  608. set ::choice(cb_tooltip_main) $::stnd_opt(tooltips_main)
  609. set ::choice(cb_tooltip_wizard) $::stnd_opt(tooltips_wizard)
  610. set ::choice(cb_tooltip_station) $::stnd_opt(tooltips_editor)
  611. set ::choice(cb_tooltip_colorm) $::stnd_opt(tooltips_colorm)
  612. set ::choice(cb_tooltip_player) $::stnd_opt(tooltips_player)
  613. set ::choice(cb_tooltip_record) $::stnd_opt(tooltips_record)
  614. set ::choice(cb_splash) $::stnd_opt(show_splash)
  615. set ::choice(cb_slist) $::stnd_opt(show_slist)
  616. set ::choice(cb_tvattach) $::stnd_opt(vidwindow_attach)
  617. set ::choice(cb_tvfullscr) $::stnd_opt(vidwindow_full)
  618. set ::choice(cb_systray_tv) $::stnd_opt(systray_tv)
  619. set ::choice(cb_systray_start) $::stnd_opt(systray_start)
  620. set ::choice(cb_systray_mini) $::stnd_opt(systray_mini)
  621. set ::choice(osd_station_w) $::stnd_opt(osd_station_w)
  622. set ::config_int(cb_osd_station_w) [lindex $::choice(osd_station_w) 0]
  623. if {"[lindex $::choice(osd_station_w) 2]" == "Regular"} {
  624. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_w configure -text "[lindex $::choice(osd_station_w) 1] | [lindex $::choice(osd_station_w) 3]"
  625. } else {
  626. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_w configure -text "[lindex $::choice(osd_station_w) 1] - [lindex $::choice(osd_station_w) 2] | [lindex $::choice(osd_station_w) 3]"
  627. }
  628. set ::choice(osd_station_f) $::stnd_opt(osd_station_f)
  629. set ::config_int(cb_osd_station_f) [lindex $::choice(osd_station_f) 0]
  630. if {"[lindex $::choice(osd_station_f) 2]" == "Regular"} {
  631. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_f configure -text "[lindex $::choice(osd_station_f) 1] | [lindex $::choice(osd_station_f) 3]"
  632. } else {
  633. $::window(interface_nb3_cont).f_osd2.b_osd_station_fnt_f configure -text "[lindex $::choice(osd_station_f) 1] - [lindex $::choice(osd_station_f) 2] | [lindex $::choice(osd_station_f) 3]"
  634. }
  635. set ::choice(osd_group_w) $::stnd_opt(osd_group_w)
  636. set ::config_int(cb_osd_group_w) [lindex $::choice(osd_group_w) 0]
  637. if {"[lindex $::choice(osd_group_w) 2]" == "Regular"} {
  638. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_w configure -text "[lindex $::choice(osd_group_w) 1] | [lindex $::choice(osd_group_w) 3]"
  639. } else {
  640. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_w configure -text "[lindex $::choice(osd_group_w) 1] - [lindex $::choice(osd_group_w) 2] | [lindex $::choice(osd_group_w) 3]"
  641. }
  642. set ::choice(osd_group_f) $::stnd_opt(osd_group_f)
  643. set ::config_int(cb_osd_group_f) [lindex $::choice(osd_group_f) 0]
  644. if {"[lindex $::choice(osd_group_f) 2]" == "Regular"} {
  645. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_f configure -text "[lindex $::choice(osd_group_f) 1] | [lindex $::choice(osd_group_f) 3]"
  646. } else {
  647. $::window(interface_nb3_cont).f_osd2.b_osd_group_fnt_f configure -text "[lindex $::choice(osd_group_f) 1] - [lindex $::choice(osd_group_f) 2] | [lindex $::choice(osd_group_f) 3]"
  648. }
  649. set ::choice(osd_key_w) $::stnd_opt(osd_key_w)
  650. set ::config_int(cb_osd_key_w) [lindex $::choice(osd_key_w) 0]
  651. if {"[lindex $::choice(osd_key_w) 2]" == "Regular"} {
  652. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_w configure -text "[lindex $::choice(osd_key_w) 1] | [lindex $::choice(osd_key_w) 3]"
  653. } else {
  654. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_w configure -text "[lindex $::choice(osd_key_w) 1] - [lindex $::choice(osd_key_w) 2] | [lindex $::choice(osd_key_w) 3]"
  655. }
  656. set ::choice(osd_key_f) $::stnd_opt(osd_key_f)
  657. set ::config_int(cb_osd_key_f) [lindex $::choice(osd_key_f) 0]
  658. if {"[lindex $::choice(osd_key_f) 2]" == "Regular"} {
  659. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_f configure -text "[lindex $::choice(osd_key_f) 1] | [lindex $::choice(osd_key_f) 3]"
  660. } else {
  661. $::window(interface_nb3_cont).f_osd2.b_osd_key_fnt_f configure -text "[lindex $::choice(osd_key_f) 1] - [lindex $::choice(osd_key_f) 2] | [lindex $::choice(osd_key_f) 3]"
  662. }
  663. set ::choice(osd_mouse_w) $::stnd_opt(osd_mouse_w)
  664. set ::choice(osd_mouse_f) $::stnd_opt(osd_mouse_f)
  665. set ::config_int(cb_osd_mouse_w) [lindex $::choice(osd_mouse_w) 0]
  666. set ::config_int(cb_osd_mouse_f) [lindex $::choice(osd_mouse_f) 0]
  667. $::window(interface_nb3_cont).f_osd2.mbOsd_mouse_w invoke [lindex $::choice(osd_mouse_w) 1]
  668. $::window(interface_nb3_cont).f_osd2.mbOsd_mouse_f invoke [lindex $::choice(osd_mouse_f) 1]
  669. set ::choice(osd_lirc) $::stnd_opt(osd_lirc)
  670. if {"[lindex $::choice(osd_lirc) 2]" == "Regular"} {
  671. $::window(interface_nb3_cont).f_osd2.b_osd_lirc_fnt configure -text "[lindex $::choice(osd_lirc) 1] | [lindex $::choice(osd_lirc) 3]"
  672. } else {
  673. $::window(interface_nb3_cont).f_osd2.b_osd_lirc_fnt configure -text "[lindex $::choice(osd_lirc) 1] - [lindex $::choice(osd_lirc) 2] | [lindex $::choice(osd_lirc) 3]"
  674. }
  675. config_interfaceChangeTooltips $w1
  676. }
  677. default_opt6 $::window(interface_nb1) $::window(interface_nb2) $frame_nb3
  678. }
  679. }
  680.