Eskil

Diff
Login

Differences From Artifact [1dbdb17171]:

To Artifact [78f6f77662]:


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
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
348
349
350
351
352
353
354
355


356
357
358
359
360
361
362
363
364







+
+
+
+







-
+




-
+
+
+
+




-
+




+
+
+
+
+
+
+
+
-
+














+
+
+
-
-
+
+







    }
    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)

    ttk::labelframe $wt.lfs -text "Select"
    grid columnconfigure $wt.lfs 1 -weight 1

    set t 0
    foreach {plugin info} $plugins {
        set descr [dict get $info descr]
        if {$dirdiff && ![dict get $info dir]} continue
        ttk::radiobutton $wt.rb$t -variable ::eskil($top,edit,pluginname) \
                -value $plugin -text $plugin
        ttk::label $wt.l$t -text $descr -anchor w
        grid $wt.rb$t $wt.l$t -sticky we -padx 3 -pady 3
        grid $wt.rb$t $wt.l$t -in $wt.lfs -sticky we -padx 3 -pady 3
        incr t
    }
    ttk::radiobutton $wt.rb$t -variable ::eskil($top,edit,pluginname) \
            -value "" -text "No Plugin"
    grid $wt.rb$t -sticky we -padx 3 -pady 3
    grid $wt.rb$t -in $wt.lfs -sticky we -padx 3 -pady 3

    ttk::labelframe $wt.lfgc -text "Generic Configuration"
    grid columnconfigure $wt.lfgc 1 -weight 1

    ttk::label $wt.li -text "Info" -anchor w
    addBalloon $wt.li "Info passed to plugin. Plugin specific."
    ttk::entry $wt.ei -textvariable ::eskil($top,edit,plugininfo)
    grid $wt.li $wt.ei -sticky we -padx 3 -pady 3
    grid $wt.li $wt.ei -in $wt.lfgc -sticky we -padx 3 -pady 3

    ttk::checkbutton $wt.cb -text "Privilege" \
            -variable ::eskil($top,edit,pluginallow)
    addBalloon $wt.cb "Run plugin with raised privileges"
    grid $wt.cb -  -in $wt.lfgc -sticky w -padx 3 -pady 3

    ttk::labelframe $wt.lfsc -text "Specific Configuration"
    grid columnconfigure $wt.lfgc 1 -weight 1

    ttk::label $wt.lfsc.l -text "Not implemented yet" -anchor w
    addBalloon $wt.lfsc.l "The plan is to make selected plugin's specific\
                           options available here"
    grid $wt.cb - -sticky w -padx 3 -pady 3
    grid $wt.lfsc.l -sticky w -padx 3 -pady 3

    ttk::frame $wt.fb -padding 3
    ttk::button $wt.fb.b1 -text "Ok"   \
            -command [list EditPrefPluginsOk $top $wt]
    ttk::button $wt.fb.b2 -text "Show" \
            -command "ShowPlugin $wt \$::eskil($top,edit,pluginname)"
    addBalloon $wt.fb.b2 "Show plugin source code."
    ttk::button $wt.fb.b3 -text "Cancel" -command [list destroy $wt]
    set ::widgets($top,prefPluginsOk) $wt.fb.b1

    grid $wt.fb.b1 x $wt.fb.b2 x $wt.fb.b3 -sticky we
    grid columnconfigure $wt.fb {0 2 4} -uniform a
    grid columnconfigure $wt.fb {1 3} -weight 1

    grid $wt.lfs  -sticky we -padx 3 -pady 3
    grid $wt.lfgc -sticky we -padx 3 -pady 3
    grid $wt.lfsc -sticky we -padx 3 -pady 3
    grid $wt.fb - -sticky we
    grid columnconfigure $wt 1 -weight 1
    grid $wt.fb   -sticky we -padx 3 -pady 3
    grid columnconfigure $wt 0 -weight 1
}

proc EditPrefPluginsOk {top wt} {
    destroy $wt
    set ::eskil($top,pluginname) $::eskil($top,edit,pluginname)
    set ::eskil($top,plugininfo) $::eskil($top,edit,plugininfo)
    set ::eskil($top,pluginallow) $::eskil($top,edit,pluginallow)