From 3422d13851f4874c448874627bca777713ec5e4a Mon Sep 17 00:00:00 2001 From: ahrenholz Date: Wed, 22 Oct 2014 19:33:32 +0000 Subject: [PATCH] added "Reload" entry to the File menu (Boeing r1888) --- gui/filemgmt.tcl | 7 +++---- gui/initgui.tcl | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gui/filemgmt.tcl b/gui/filemgmt.tcl index b1db54ae..1f4f51be 100755 --- a/gui/filemgmt.tcl +++ b/gui/filemgmt.tcl @@ -475,8 +475,7 @@ proc mrufile { f args } { # if it exists already, remove it from the list, add to the front; also limit # the length of this list; if no file specified, erase the list proc addFileToMrulist { f } { - global g_mrulist g_prefs - set MRUI 14 ;# index of MRU list -- update when adding to File menu! + global g_mrulist g_prefs g_mru_index set oldlength [llength $g_mrulist] set maxlength $g_prefs(num_recent) @@ -489,7 +488,7 @@ proc addFileToMrulist { f } { # clear the MRU list menu if { $oldlength > 0 } { set end_of_menu [.menubar.file index end] - .menubar.file delete $MRUI [expr {$end_of_menu - 2}] + .menubar.file delete $g_mru_index [expr {$end_of_menu - 2}] } if { $f == "" } { ;# used to reset MRU list set g_mrulist {} @@ -499,7 +498,7 @@ proc addFileToMrulist { f } { set g_mrulist [linsert $g_mrulist 0 "$f"] set g_mrulist [lrange $g_mrulist 0 [expr {$maxlength - 1}]] - set i $MRUI + set i $g_mru_index foreach f $g_mrulist { .menubar.file insert $i command -label "$f" -command "mrufile $f" incr i 1 diff --git a/gui/initgui.tcl b/gui/initgui.tcl index 2f965f15..8eb72e11 100755 --- a/gui/initgui.tcl +++ b/gui/initgui.tcl @@ -228,6 +228,9 @@ bind . "fileNewDialogBox" -accelerator "Ctrl+O" -command { fileOpenDialogBox } bind . "fileOpenDialogBox" +.menubar.file add command -label "Reload" -underline 0 \ + -command { openFile } + .menubar.file add command -label Save -underline 0 \ -accelerator "Ctrl+S" -command { fileSaveDialogBox "" } bind . "fileSaveDialogBox {}" @@ -277,7 +280,6 @@ bind . "fileSaveDialogBox {}" $w.e1 insert 0 "lpr" pack $w.e1 -side top -pady 5 -padx 10 -fill x } -# Boeing: added "Save Screenshot" function and most-recently-used file list .menubar.file add command -label "Save screenshot..." -command { global currentFile set initialfile [file tail $currentFile] @@ -295,10 +297,10 @@ bind . "fileSaveDialogBox {}" } } .menubar.file add separator +set g_mru_index 15 ;# index of first MRU list item foreach f $g_mrulist { .menubar.file add command -label "$f" -command "mrufile {$f}" } -# end Boeing changes .menubar.file add separator .menubar.file add command -label Quit -underline 0 -command { exit }