Commit fd25701d authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*refined recent files menu logic to avoid buggy addition of additional breaks...

*refined recent files menu logic to avoid buggy addition of additional breaks as well as provide more verbose info to the user
parent 2c0d129d
......@@ -1591,11 +1591,12 @@ match_linux_wm [list .mbar.file add separator]
# update recent files
match_linux_wm [list .mbar.file add separator]
.mbar.file add command -label "No Recent Files" -state disabled
#if {[llength $::recentfiles_list] > 0} {
# ::pd_menus::update_recentfiles_menu .mbar.file false
#}
match_linux_wm [list .mbar.file add separator]
match_linux_wm [list .mbar.file add separator]
.mbar.file add command -label Close -accelerator [accel_munge "Ctrl+w"] \
-state disabled
......@@ -2841,6 +2842,7 @@ proc pdtk_canvas_new {name width height geometry editable} {
}
# update recent files
match_linux_wm [list $name.m.file add separator]
$name.m.file add command -label "No Recent Files" -state disabled
#match_linux_wm [list $name.m.file add separator]
#if {[llength $::recentfiles_list] > 0} {
# ::pd_menus::update_recentfiles_menu $name.m.file false
......
......@@ -81,10 +81,13 @@ proc ::pd_menus::update_recentfiles_on_menu {mymenu {write}} {
$mymenu insert [expr $top_separator+1] command \
-label [file tail $filename] -command "open_file {$filename}"
}
set filename [lindex $::recentfiles_list 0]
$mymenu insert [expr $top_separator+1] command \
-label [file tail $filename] -command "open_file {$filename}"
if { [llength $::recentfiles_list] > 0 } {
set filename [lindex $::recentfiles_list 0]
$mymenu insert [expr $top_separator+1] command \
-label [file tail $filename] -command "open_file {$filename}"
} else {
$mymenu insert [expr $top_separator+1] command -label "No Recent Files" -state disabled
}
# write to config file
if {$write == true} { ::pd_guiprefs::write_recentfiles }
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment