git-gui: Display error dialog on Mac OS X when no .git found.
If we can't locate a .git directory for the given directory we need to show a message to the user to let them know the directory wasn't found. But since this is before we have shown our main application window we cannot use that as the parent for the error popup; on Mac OS X this causes an error and prevents the dialog from showing. Instead only add -parent . to the popup call if we have mapped (shown) the main window. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Nov 18, 2006 at 01:20 UTC
cbbaa28bc0a2b607b0f5e2e23f910d1619b52b0f
1 file changed
+6
-3
git-gui
+6
-3
@@ -130,12 +130,15 @@ proc error_popup {msg} {
130
end]
131
append title {)}
132
}
133
- tk_messageBox \
134
- -parent . \
133
+ set cmd [list tk_messageBox \
134
-icon error \
135
-type ok \
136
-title "$title: error" \
138
- -message $msg
137
+ -message $msg]
138
+ if {[winfo ismapped .]} {
139
+ lappend cmd -parent .
140
+ }
141
+ eval $cmd
142
}
143
144
proc info_popup {msg} {