Skip to content

Commit

Permalink
Merge branch 'issue-fixes' of github.com:zdia/gorilla into issue-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zdia committed Feb 14, 2012
2 parents 39dcd46 + ff4216c commit 25fe6d8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
30 changes: 25 additions & 5 deletions sources/gorilla.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ if {[catch {package require Tk 8.5} oops]} {
exit 1
}

# Fix the issue of TTk widgets having different default background colors
# from Tk widgets (esp. toplevel widgets) by automatically placing a TTk
# frame in each toplevel when the toplevel is created - this way when
# widgets are positioned in the toplevel, what should show through behind
# them is the ::ttk::frame background color, not the ::tk::toplevel
# background color.

rename toplevel _toplevel
proc toplevel {path args} {
_toplevel $path {*}$args
::ttk::frame $path.ttkbkg
place $path.ttkbkg -in $path -anchor nw -x 0 -y 0 -bordermode outside \
-relheight 1.0 -relwidth 1.0
# this lower should be redundant, but do it just to be sure
lower $path.ttkbkg
return $path
}

option add *Dialog.msg.wrapLength 6i

if {[catch {package require Tcl 8.5}]} {
Expand Down Expand Up @@ -1920,7 +1938,7 @@ namespace eval ::gorilla::LoginDialog {
password [ mc Password ] entry ] {
grid [ make-label $top $label ] \
[ set widget($child) [ ttk::$w $top.e-$child -width 40 -textvariable ${pvns}::$child ] ] \
-sticky news -ipady 5
-sticky news -pady 5
} ; # end foreach {child label}

# password should show "*" by default
Expand All @@ -1941,7 +1959,7 @@ namespace eval ::gorilla::LoginDialog {

grid [ make-label $top [mc Notes] ] \
$textframe \
-sticky news -ipady 5
-sticky news -pady 5

grid rowconfigure $top $textframe -weight 1
grid columnconfigure $top $textframe -weight 1
Expand All @@ -1951,7 +1969,7 @@ namespace eval ::gorilla::LoginDialog {
foreach {child label} $lastChangeList {
grid [ make-label $top $label ] \
[ ttk::label $top.e-$child -textvariable ${pvns}::$child -width 40 -anchor w ] \
-sticky news -ipady 5
-sticky news -pady 5
}

# bias the lengths of the labels to a slightly larger size than the average
Expand Down Expand Up @@ -7751,7 +7769,9 @@ proc gorilla::get-selected-tree-data { {returninfo {}} } {

proc gorilla::LaunchBrowser { rn } {

set URL [ dbget url $rn ]
# add quotes around the URL value to protect it from most issues
# with {*} expansion
set URL \"[ dbget url $rn ]\"
if { $URL eq "" } {
set ::gorilla::status [ mc "The selected login does not contain a URL value." ]
} elseif { $::gorilla::preference(browser-exe) eq "" } {
Expand All @@ -7766,7 +7786,7 @@ proc gorilla::LaunchBrowser { rn } {
return
}
}
if { [ catch { exec $::gorilla::preference(browser-exe) $URL & } mesg ] } {
if { [ catch { exec $::gorilla::preference(browser-exe) {*}$URL & } mesg ] } {
tk_dialog .errorurl [ mc "Error" ] "[ mc "Error launching browser, the OS error message is:" ]\n\n$mesg" "" "" [ mc "Oh well..." ]
} else {
set ::gorilla::status "[ mc "Launched browser:" ] $::gorilla::preference(browser-exe)"
Expand Down
5 changes: 5 additions & 0 deletions sources/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@ for various browsers is beyond the scope of Password Gorilla. Please
consult your browser documentation to determine if any special command line
parameters are required to launch directly to a URL.

| If any parameter contains spaces, you must surround that parameter with
double quotes (") to ensure that the spaces are properly passed through to
the browser during the launch process. I.e., C:\Documents and Settings\
would be entered as: "C:\Documents and Settings\".

'''Also copy username to clipboard'''

| If this checkbox is selected, then as part of the launch browser sequence
Expand Down

0 comments on commit 25fe6d8

Please sign in to comment.