Skip to content

Commit

Permalink
Disable Look for update if downloads.txt not found
Browse files Browse the repository at this point in the history
Packaged versions of the software shouldn't contain this
file, which will disable the option altogether.

Users of a packaged version of password gorilla shouldn't
be able to use the software's internal update mechanism.
They should rely on their distro's package manager instead.
  • Loading branch information
ajraymond committed Jan 30, 2013
1 parent 3f9b9ff commit ee876bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sources/gorilla.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ foreach package {Itcl pwsafe tooltip PWGprogress} {

catch {package require uuid}

# Detect whether or not the file containing download sites exists
set ::gorilla::hasDownloadsFile [ file exists [ file join $::gorilla::Dir downloads.txt ] ]

#
# ----------------------------------------------------------------------
# Prepare and hide main window
Expand Down Expand Up @@ -488,7 +491,7 @@ proc gorilla::InitGui {} {

"[ mc Help ]" help {"[ mc Help ] ..." mac gorilla::Help ""
"[ mc License ] ..." "" gorilla::License ""
"[ mc "Look for Update"]" "" gorilla::versionLookup ""
"[ mc "Look for Update"]" dld gorilla::versionLookup ""
separator mac "" ""
"[ mc About ] ..." mac tkAboutDialog ""
}
Expand Down Expand Up @@ -4770,6 +4773,10 @@ proc gorilla::UpdateMenu {} {
} else {
setmenustate $::gorilla::widgets(main) conflict disabled
}

if { ! $::gorilla::hasDownloadsFile } {
setmenustate $::gorilla::widgets(main) dld disabled
}

}

Expand Down

0 comments on commit ee876bb

Please sign in to comment.