lib / about.tclon commit Merge branch 'maint' (f4d9348)
   1# git-gui about git-gui dialog
   2# Copyright (C) 2006, 2007 Shawn Pearce
   3
   4proc do_about {} {
   5        global appvers copyright oguilib
   6        global tcl_patchLevel tk_patchLevel
   7        global ui_comm_spell
   8
   9        set w .about_dialog
  10        toplevel $w
  11        wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
  12
  13        pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
  14        label $w.header -text [mc "About %s" [appname]] \
  15                -font font_uibold
  16        pack $w.header -side top -fill x
  17
  18        frame $w.buttons
  19        button $w.buttons.close -text {Close} \
  20                -default active \
  21                -command [list destroy $w]
  22        pack $w.buttons.close -side right
  23        pack $w.buttons -side bottom -fill x -pady 10 -padx 10
  24
  25        label $w.desc \
  26                -text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
  27                -padx 5 -pady 5 \
  28                -justify left \
  29                -anchor w \
  30                -borderwidth 1 \
  31                -relief solid
  32        pack $w.desc -side top -fill x -padx 5 -pady 5
  33
  34        set v {}
  35        append v "git-gui version $appvers\n"
  36        append v "[git version]\n"
  37        append v "\n"
  38        if {$tcl_patchLevel eq $tk_patchLevel} {
  39                append v "Tcl/Tk version $tcl_patchLevel"
  40        } else {
  41                append v "Tcl version $tcl_patchLevel"
  42                append v ", Tk version $tk_patchLevel"
  43        }
  44        if {[info exists ui_comm_spell]} {
  45                append v "\n"
  46                append v [$ui_comm_spell version]
  47        }
  48
  49        set d {}
  50        append d "git wrapper: $::_git\n"
  51        append d "git exec dir: [gitexec]\n"
  52        append d "git-gui lib: $oguilib"
  53
  54        label $w.vers \
  55                -text $v \
  56                -padx 5 -pady 5 \
  57                -justify left \
  58                -anchor w \
  59                -borderwidth 1 \
  60                -relief solid
  61        pack $w.vers -side top -fill x -padx 5 -pady 5
  62
  63        label $w.dirs \
  64                -text $d \
  65                -padx 5 -pady 5 \
  66                -justify left \
  67                -anchor w \
  68                -borderwidth 1 \
  69                -relief solid
  70        pack $w.dirs -side top -fill x -padx 5 -pady 5
  71
  72        menu $w.ctxm -tearoff 0
  73        $w.ctxm add command \
  74                -label {Copy} \
  75                -command "
  76                clipboard clear
  77                clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
  78        "
  79
  80        bind $w <Visibility> "grab $w; focus $w.buttons.close"
  81        bind $w <Key-Escape> "destroy $w"
  82        bind $w <Key-Return> "destroy $w"
  83        bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
  84        wm title $w "About [appname]"
  85        tkwait window $w
  86}