git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitk: Failure of new tabbed preferences dialog
@ 2012-03-29 17:31 Ramsay Jones
  2012-04-01 22:00 ` Pat Thoyts
  0 siblings, 1 reply; 8+ messages in thread
From: Ramsay Jones @ 2012-03-29 17:31 UTC (permalink / raw)
  To: patthoyts; +Cc: Junio C Hamano, GIT Mailing-list

Hi Pat,

I just tried the new gitk (master @fae9d76) and, since I don't have
themed widgets, the preferences menu item uses the emulated tabbed
dialog code, which fails like so:

    can't read "col": no such variable
    can't read "col": no such variable
        (reading value of variable to increment)
        invoked from within
    "incr col"
        (procedure "doprefs" line 36)
        invoked from within
    "doprefs"
        (menu invoke)

I tried the following (maybe *too* obvious) fix:

-- >8 --
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 651b740..68cd1a1 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11012,6 +11012,7 @@ proc doprefs {} {
     lappend pages [prefspage_general $notebook] [mc "General"]
     lappend pages [prefspage_colors $notebook] [mc "Colors"]
     lappend pages [prefspage_fonts $notebook] [mc "Fonts"]
+    set col 0
     foreach {page title} $pages {
 	if {$use_notebook} {
 	    $notebook add $page -text $title
-- 8< --

which seems to work.

HTH

ATB,
Ramsay Jones

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: gitk: Failure of new tabbed preferences dialog
  2012-03-29 17:31 gitk: Failure of new tabbed preferences dialog Ramsay Jones
@ 2012-04-01 22:00 ` Pat Thoyts
  2012-04-01 22:00   ` [PATCH 1/2] gitk: fix tabbed preferences construction when using tcl 8.4 Pat Thoyts
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pat Thoyts @ 2012-04-01 22:00 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git, Ramsay Jones


> I just tried the new gitk (master @fae9d76) and, since I don't have
> themed widgets, the preferences menu item uses the emulated tabbed
> dialog code, which fails like so:
>
>     can't read "col": no such variable
>

The issue here is that the incr command has changed between tcl 8.4
and 8.5 and in more recent versions automatically creates the named
variable if it did not exist. The fix you suggest is correct. I've
also included another that I realised had been applied to msysGit and
was not posted upstream.

Pat Thoyts.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] gitk: fix tabbed preferences construction when using tcl 8.4
  2012-04-01 22:00 ` Pat Thoyts
@ 2012-04-01 22:00   ` Pat Thoyts
  2012-04-01 22:00   ` [PATCH 2/2] gitk: fix setting font display with new tabbed dialog layout Pat Thoyts
  2012-04-02 16:19   ` gitk: Failure of new tabbed preferences dialog Junio C Hamano
  2 siblings, 0 replies; 8+ messages in thread
From: Pat Thoyts @ 2012-04-01 22:00 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git, Ramsay Jones, Pat Thoyts

In 8.5 the incr command creates the target variable if it does not exist
but in 8.4 using incr on a non-existing variable raises an error. Ensure
we have created our counter variable when creating the tabbed dialog for
non-themed preferences.

Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index 651b740..68cd1a1 100755
--- a/gitk
+++ b/gitk
@@ -11012,6 +11012,7 @@ proc doprefs {} {
     lappend pages [prefspage_general $notebook] [mc "General"]
     lappend pages [prefspage_colors $notebook] [mc "Colors"]
     lappend pages [prefspage_fonts $notebook] [mc "Fonts"]
+    set col 0
     foreach {page title} $pages {
 	if {$use_notebook} {
 	    $notebook add $page -text $title
-- 
1.7.9.msysgit.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] gitk: fix setting font display with new tabbed dialog layout.
  2012-04-01 22:00 ` Pat Thoyts
  2012-04-01 22:00   ` [PATCH 1/2] gitk: fix tabbed preferences construction when using tcl 8.4 Pat Thoyts
@ 2012-04-01 22:00   ` Pat Thoyts
  2012-04-02 16:19   ` gitk: Failure of new tabbed preferences dialog Junio C Hamano
  2 siblings, 0 replies; 8+ messages in thread
From: Pat Thoyts @ 2012-04-01 22:00 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git, Ramsay Jones, Pat Thoyts

The changes to the dialog window tree broke the preview of the selected
font on the button. This corrects that issue.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 gitk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitk b/gitk
index 68cd1a1..22270ce 100755
--- a/gitk
+++ b/gitk
@@ -10795,7 +10795,7 @@ proc fontok {} {
     if {$fontparam(slant) eq "italic"} {
 	lappend fontpref($f) "italic"
     }
-    set w $prefstop.$f
+    set w $prefstop.notebook.fonts.$f
     $w conf -text $fontparam(family) -font $fontpref($f)
 
     fontcan
-- 
1.7.9.msysgit.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: gitk: Failure of new tabbed preferences dialog
  2012-04-01 22:00 ` Pat Thoyts
  2012-04-01 22:00   ` [PATCH 1/2] gitk: fix tabbed preferences construction when using tcl 8.4 Pat Thoyts
  2012-04-01 22:00   ` [PATCH 2/2] gitk: fix setting font display with new tabbed dialog layout Pat Thoyts
@ 2012-04-02 16:19   ` Junio C Hamano
  2012-04-02 22:03     ` Junio C Hamano
  2012-04-03 12:19     ` Paul Mackerras
  2 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-04-02 16:19 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Paul Mackerras, git, Ramsay Jones

Pat Thoyts <patthoyts@users.sourceforge.net> writes:

>> I just tried the new gitk (master @fae9d76) and, since I don't have
>> themed widgets, the preferences menu item uses the emulated tabbed
>> dialog code, which fails like so:
>>
>>     can't read "col": no such variable
>
> The issue here is that the incr command has changed between tcl 8.4
> and 8.5 and in more recent versions automatically creates the named
> variable if it did not exist. The fix you suggest is correct. I've
> also included another that I realised had been applied to msysGit and
> was not posted upstream.

This seems severe enough that we should put it in the coming release.
I can queue them directory to gitk tree (and later ask Paul to pull it
from me), and merge the result to expedite the roundtrip.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gitk: Failure of new tabbed preferences dialog
  2012-04-02 16:19   ` gitk: Failure of new tabbed preferences dialog Junio C Hamano
@ 2012-04-02 22:03     ` Junio C Hamano
  2012-04-03 12:19     ` Paul Mackerras
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-04-02 22:03 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Pat Thoyts, git, Ramsay Jones

Paul, Ramsay and Pat noticed and fixed two buglets that made the "Font"
setting dialog unusable in the version in 1.7.10-rc3.  I've queued the
fixes below, tested them (before and after applying the patches) locally.

I would like to merge them and tag 1.7.10-rc4 tonight.

In order to keep us in sync, could you please pull back from me?  The
branch "pt/gitk" corresponds to your repository (i.e. without the rest of
git.git, and gitk-git/Makefile as the top-level Makefile).

Thanks.

-- -- --

The following changes since commit b2b76d10696d945bf19318831b64d009d119e051:

  gitk: Teach gitk to respect log.showroot (2012-03-24 16:44:12 +1100)

are available in the git repository at:

  git://github.com/gitster/git.git pt/gitk

for you to fetch changes up to 39ddf99c1db8b230ec7bdefc6ce3c769d1cf4ab6:

  gitk: fix setting font display with new tabbed dialog layout. (2012-04-02 10:21:10 -0700)

----------------------------------------------------------------
Pat Thoyts (2):
      gitk: fix tabbed preferences construction when using tcl 8.4
      gitk: fix setting font display with new tabbed dialog layout.

 gitk |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gitk b/gitk
index 651b740..22270ce 100755
--- a/gitk
+++ b/gitk
@@ -10795,7 +10795,7 @@ proc fontok {} {
     if {$fontparam(slant) eq "italic"} {
 	lappend fontpref($f) "italic"
     }
-    set w $prefstop.$f
+    set w $prefstop.notebook.fonts.$f
     $w conf -text $fontparam(family) -font $fontpref($f)
 
     fontcan
@@ -11012,6 +11012,7 @@ proc doprefs {} {
     lappend pages [prefspage_general $notebook] [mc "General"]
     lappend pages [prefspage_colors $notebook] [mc "Colors"]
     lappend pages [prefspage_fonts $notebook] [mc "Fonts"]
+    set col 0
     foreach {page title} $pages {
 	if {$use_notebook} {
 	    $notebook add $page -text $title

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: gitk: Failure of new tabbed preferences dialog
  2012-04-02 16:19   ` gitk: Failure of new tabbed preferences dialog Junio C Hamano
  2012-04-02 22:03     ` Junio C Hamano
@ 2012-04-03 12:19     ` Paul Mackerras
  2012-04-03 16:53       ` Junio C Hamano
  1 sibling, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2012-04-03 12:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Pat Thoyts, git, Ramsay Jones

On Mon, Apr 02, 2012 at 09:19:00AM -0700, Junio C Hamano wrote:
> Pat Thoyts <patthoyts@users.sourceforge.net> writes:
> 
> >> I just tried the new gitk (master @fae9d76) and, since I don't have
> >> themed widgets, the preferences menu item uses the emulated tabbed
> >> dialog code, which fails like so:
> >>
> >>     can't read "col": no such variable
> >
> > The issue here is that the incr command has changed between tcl 8.4
> > and 8.5 and in more recent versions automatically creates the named
> > variable if it did not exist. The fix you suggest is correct. I've
> > also included another that I realised had been applied to msysGit and
> > was not posted upstream.
> 
> This seems severe enough that we should put it in the coming release.
> I can queue them directory to gitk tree (and later ask Paul to pull it
> from me), and merge the result to expedite the roundtrip.

OK; the patches look fine to me.  If that's what you're doing, I won't
apply them to my tree, to avoid duplication.

Paul.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gitk: Failure of new tabbed preferences dialog
  2012-04-03 12:19     ` Paul Mackerras
@ 2012-04-03 16:53       ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-04-03 16:53 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Pat Thoyts, git, Ramsay Jones

Paul Mackerras <paulus@samba.org> writes:

> On Mon, Apr 02, 2012 at 09:19:00AM -0700, Junio C Hamano wrote:
>> 
>> This seems severe enough that we should put it in the coming release.
>> I can queue them directory to gitk tree (and later ask Paul to pull it
>> from me), and merge the result to expedite the roundtrip.
>
> OK; the patches look fine to me.  If that's what you're doing, I won't
> apply them to my tree, to avoid duplication.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-04-03 16:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29 17:31 gitk: Failure of new tabbed preferences dialog Ramsay Jones
2012-04-01 22:00 ` Pat Thoyts
2012-04-01 22:00   ` [PATCH 1/2] gitk: fix tabbed preferences construction when using tcl 8.4 Pat Thoyts
2012-04-01 22:00   ` [PATCH 2/2] gitk: fix setting font display with new tabbed dialog layout Pat Thoyts
2012-04-02 16:19   ` gitk: Failure of new tabbed preferences dialog Junio C Hamano
2012-04-02 22:03     ` Junio C Hamano
2012-04-03 12:19     ` Paul Mackerras
2012-04-03 16:53       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).