276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
}
if {![info exists ::eskil($top,pluginname)]} {
set ::eskil($top,pluginname) ""
}
if {![info exists ::eskil($top,plugininfo)]} {
set ::eskil($top,plugininfo) ""
}
set ::eskil($top,edit,pluginname) $::eskil($top,pluginname)
set ::eskil($top,edit,plugininfo) $::eskil($top,plugininfo)
set t 0
foreach {plugin info} $plugins {
set descr [dict get $info descr]
if {$dirdiff && ![dict get $info dir]} continue
ttk::radiobutton $w.rb$t -variable ::eskil($top,edit,pluginname) -value $plugin -text $plugin
ttk::label $w.l$t -text $descr -anchor "w"
grid $w.rb$t $w.l$t -sticky we -padx 3 -pady 3
incr t
}
ttk::radiobutton $w.rb$t -variable ::eskil($top,edit,pluginname) -value "" -text "No Plugin"
grid $w.rb$t -sticky we -padx 3 -pady 3
ttk::label $w.li -text "Info" -anchor "w"
ttk::entry $w.ei -textvariable ::eskil($top,edit,plugininfo)
grid $w.li $w.ei -sticky we -padx 3 -pady 3
ttk::frame $w.fb -padding 3
ttk::button $w.fb.b1 -text "Ok" -command [list EditPrefPluginsOk $top $w]
ttk::button $w.fb.b2 -text "Show" \
-command "ShowPlugin $w \$::eskil($top,edit,pluginname)"
ttk::button $w.fb.b3 -text "Cancel" -command [list destroy $w]
set ::widgets($top,prefPluginsOk) $w.fb.b1
grid $w.fb.b1 x $w.fb.b2 x $w.fb.b3 -sticky we
grid columnconfigure $w.fb {0 2 4} -uniform a
grid columnconfigure $w.fb {1 3} -weight 1
grid $w.fb - -sticky we
grid columnconfigure $w 1 -weight 1
}
proc EditPrefPluginsOk {top w} {
destroy $w
set ::eskil($top,pluginname) $::eskil($top,edit,pluginname)
set ::eskil($top,plugininfo) $::eskil($top,edit,plugininfo)
if {$::eskil($top,pluginname) ne ""} {
set pinterp [createPluginInterp $::eskil($top,pluginname) \
$::eskil($top,plugininfo) 0 pinfo]
} else {
set pinterp ""
set pinfo ""
}
set ::eskil($top,plugin) $pinterp
set ::eskil($top,pluginpinfo) $pinfo
}
|
>
>
>
|
>
|
>
|
>
>
>
>
>
>
>
>
|
>
>
|
>
|
>
|
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
}
if {![info exists ::eskil($top,pluginname)]} {
set ::eskil($top,pluginname) ""
}
if {![info exists ::eskil($top,plugininfo)]} {
set ::eskil($top,plugininfo) ""
}
if {![info exists ::eskil($top,pluginallow)]} {
set ::eskil($top,pluginallow) 0
}
set ::eskil($top,edit,pluginname) $::eskil($top,pluginname)
set ::eskil($top,edit,plugininfo) $::eskil($top,plugininfo)
set ::eskil($top,edit,pluginallow) $::eskil($top,pluginallow)
set t 0
foreach {plugin info} $plugins {
set descr [dict get $info descr]
if {$dirdiff && ![dict get $info dir]} continue
ttk::radiobutton $w.rb$t -variable ::eskil($top,edit,pluginname) \
-value $plugin -text $plugin
ttk::label $w.l$t -text $descr -anchor "w"
grid $w.rb$t $w.l$t -sticky we -padx 3 -pady 3
incr t
}
ttk::radiobutton $w.rb$t -variable ::eskil($top,edit,pluginname) \
-value "" -text "No Plugin"
grid $w.rb$t -sticky we -padx 3 -pady 3
ttk::label $w.li -text "Info" -anchor "w"
addBalloon $w.li "Info passed to plugin. Plugin specific."
ttk::entry $w.ei -textvariable ::eskil($top,edit,plugininfo)
grid $w.li $w.ei -sticky we -padx 3 -pady 3
ttk::checkbutton $w.cb -text "Privilege" \
-variable ::eskil($top,edit,pluginallow)
addBalloon $w.cb "Run plugin with raised privileges"
grid $w.cb - -sticky w -padx 3 -pady 3
ttk::frame $w.fb -padding 3
ttk::button $w.fb.b1 -text "Ok" \
-command [list EditPrefPluginsOk $top $w]
ttk::button $w.fb.b2 -text "Show" \
-command "ShowPlugin $w \$::eskil($top,edit,pluginname)"
addBalloon $w.fb.b2 "Show plugin source code."
ttk::button $w.fb.b3 -text "Cancel" -command [list destroy $w]
set ::widgets($top,prefPluginsOk) $w.fb.b1
grid $w.fb.b1 x $w.fb.b2 x $w.fb.b3 -sticky we
grid columnconfigure $w.fb {0 2 4} -uniform a
grid columnconfigure $w.fb {1 3} -weight 1
grid $w.fb - -sticky we
grid columnconfigure $w 1 -weight 1
}
proc EditPrefPluginsOk {top w} {
destroy $w
set ::eskil($top,pluginname) $::eskil($top,edit,pluginname)
set ::eskil($top,plugininfo) $::eskil($top,edit,plugininfo)
set ::eskil($top,pluginallow) $::eskil($top,edit,pluginallow)
if {$::eskil($top,pluginname) ne ""} {
set pinterp [createPluginInterp $::eskil($top,pluginname) \
$::eskil($top,plugininfo) \
$::eskil($top,pluginallow) pinfo]
} else {
set pinterp ""
set pinfo ""
}
set ::eskil($top,plugin) $pinterp
set ::eskil($top,pluginpinfo) $pinfo
}
|