author | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 21 Feb 2008 03:34:11 +0000 (22:34 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 21 Feb 2008 05:22:06 +0000 (00:22 -0500) | ||
commit | de83f8cc4cd97c52a0b8a1b1ff4e949129e3a947 | |
tree | 5a5bc6e470c95d080b7a26d1592050d9a555130c | tree | snapshot |
parent | 35d04b3b110f9adcd485c8470d8048394f586018 | commit | diff |
git-gui: Catch and display aspell startup failures to the user
If we feed a bad dictionary name to aspell on startup it may appear
to start (as Tcl found the executable in our $PATH) but it fails to
give us the version string. In such a case the close of the pipe
will report the exit status of the process (failure) and that is
an error in Tcl.
We now trap the subprocess failure and display the stderr message
from it, letting the user know why the failure is happening. We then
disable the spell checker, but keep our object instance so the user
can alter their preferred dictionary through the options dialog, and
possibly restart the spell checker.
I was also originally wrong to use "error" here for the display
of the problem to the user. I meant to use "error_popup", which
will open a message box and show the failure in a GUI context,
rather than killing git-gui and showing the message on the console.
Noticed by Ilari on #git.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
If we feed a bad dictionary name to aspell on startup it may appear
to start (as Tcl found the executable in our $PATH) but it fails to
give us the version string. In such a case the close of the pipe
will report the exit status of the process (failure) and that is
an error in Tcl.
We now trap the subprocess failure and display the stderr message
from it, letting the user know why the failure is happening. We then
disable the spell checker, but keep our object instance so the user
can alter their preferred dictionary through the options dialog, and
possibly restart the spell checker.
I was also originally wrong to use "error" here for the display
of the problem to the user. I meant to use "error_popup", which
will open a message box and show the failure in a GUI context,
rather than killing git-gui and showing the message on the console.
Noticed by Ilari on #git.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/spellcheck.tcl | diff | blob | history |