Changeset 949 for trunk/expgui


Ignore:
Timestamp:
Mar 10, 2010 3:02:01 PM (11 years ago)
Author:
toby
Message:

add update menu entry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    r944 r949  
    41684168        -command {console show}
    41694169}
     4170# add update commands to buffer
     4171if [CheckUpdateImplemented $scriptdir] {
     4172    $expgui(fm).help.menu add command -command CheckAndDoUpdate -label "Update GSAS/CMPR"
     4173#    $expgui(fm).help.menu add cascade -menu $expgui(fm).help.menu.track \
     4174#       -label "Select EXPGUI version"
     4175#    menu $expgui(fm).help.menu.track
     4176#    $expgui(fm).help.menu.track add radiobutton -command {SetSVNbranch trunk} -label Development -value trunk \
     4177#       -variable expgui(SVNversion)
     4178#    $expgui(fm).help.menu.track add radiobutton -command {SetSVNbranch stable} -label Standard -value stable \
     4179#       -variable expgui(SVNversion)
     4180    # get info about the current CMPR version on the server. Someday we might want to compare this
     4181    # say every month and notify when there is a new version to update
     4182    set repos [GetSVNrepository $scriptdir]
     4183    # send a "p" to accept the server fingerprint in case needed on 1st access
     4184    catch {set out [exec echo "p" | svn info $repos]} err
     4185    set expgui(SVNversion) [lindex [split $repos '/'] end]
     4186    # cleanup batch file from a previous update
     4187    if {$::tcl_platform(platform) == "windows" && $::tcl_platform(os) != "Windows 95"} {
     4188        catch {
     4189            file delete [file normalize ~/cmpr_update.bat]
     4190        }
     4191    }
     4192} else {
     4193    $expgui(fm).help.menu add command -label "Show update problem" -command {
     4194        if {! [file exists [file join $scriptdir .svn]]} {
     4195            MyMessageBox -parent . -title "No .svn" \
     4196                -message "Unable to update because the gsas/.svn directory is not present." \
     4197                -icon warning
     4198        } else {
     4199            MyMessageBox -parent . -title "No .svn" \
     4200                -message "Unable to update because the subversion (svn) program is not in the path." \
     4201                -icon warning
     4202        }
     4203    }
     4204}
    41704205foreach c {h H} {bind . <Alt-$c> [list showhelp]}
    41714206# define help actions
Note: See TracChangeset for help on using the changeset viewer.