GNOME Bugzilla – Bug 437309
support comments
Last modified: 2013-11-07 17:33:41 UTC
First, I'm mexican, so my english could be approximate... I attempt to implement pgn comments.
Created attachment 87919 [details] [review] implement pgn comment
Created attachment 87920 [details] pgn game with comments a simple game with a comment
Thanks Miguel, I'll look at this this weekend
Hi Miguel, Can you send me your versions of glade/chess_view.glade and glade/glchess.glade as they haven't diffed properly. Thanks
Created attachment 88053 [details] chess_view.glade and glchess.glade
This is a very simple pathc, I want to improve comments like ??(error) or !(good move) maybe change the icon dialog. And show the icon for the piece, like a bishop, when the comment conten some like Bb5. I expect to get time in the next days to do this.
Hi Miguel, Just an update about your patch: - I've committed the GUI changes to subversion but disabled them for now. This should make an updated patch easier - I'm going to update pgn.py to have a PGNMove object - this way the comments will be attached to the move and not require your comment dictionary. - Did you make this patch against the sourceforge.net version of glChess? If so can you please check out the latest version from svn://svn.gnome.org/svn/gnome-games/trunk/glchess and make the patch from this. Thanks, --Robert
Created attachment 88404 [details] pgnview widget
hi, oh, yes, I use the sourcefoge version, sorry I don't see that. well, in this moment work around the PGNMove, and have some like this: class PGNMove: comment = None NAG = None #Numeric Annotation Glyphs number = None move = None And rework another widget, attach a screenshot. Let sync with gnome subversion and send another patch, maybe in the weekend By the way, what is the form that I can run glchess (from the svn) if i don't have all gnome-games? And again, sorry for my poor English.
I wrote a blog post on how to install and run gnome games: http://bobthegnome.blogspot.com/2007/04/beginners-guide-to-gnome-python-games.html It is more complex than the sourceforge.net version however, let me know if you have any problems.
Created attachment 88574 [details] [review] sync whit gnome-games hi, Now acept a multiline comment (need change gtkentry) and $1 to $6 NAG, changed clicking in the icon image. Maybe need some love to icon image, I use the gtk stock and not represent at all the intention of NAG.
Hi Miguel, I've committed the PGN part of the patch with a few minor changes. Again please attach the Glade files as they aren't making good diffs - The GUI editor you are using is changing the whitespace/layout. I don't like the idea of the separate widget you're suggesting. glChess is a simple chess UI, I much prefer the original idea. Other chess programs (e.g. Pychess pychess.sourceforge.net) are aiming to provide more advanced analysis/editing tools. I've committed some changes to make multi-line comment editing possible in the display area (see svn for details). There are some details that must work before this change can be fully used: - Comments must be enabled/disabled from the menu (disabled by default so first time users have the simplest interface) - The comments must work with the end game information, i.e. when the game ends the usual game result (e.g. "Checkmate") must be displayed. - If a player moves while a comment is being edited the board must not move and but the player informed their opponent has moved. Keep up the good work!
hi Robert, I use glade-3, what editor use you? Yes that widget see ugly and complex, I use them like the AI window, to test my pgn advance work. I agree with put by default disable the comments, I think that is better put out of gcong and only use the value that have the check menu. The game result sould append (but not save) to the last comment if exist, you have a better idea? Why do you use the tab?, is not enough with a TextView (instead the label) in editable on/off?, I never have used that widget, but i think is more complex than a simple label, but may be, in the future it could represent the king color that win or another information in a grafical form. The last point is more complex, you have a variable __inCallback, Do you use for pause the game? or Do you use for stop it waiting for some event? By the way I use this info about pgn standar: http://www.very-best.de/pgn-spec.htm
Created attachment 88749 [details] chess_view.glade
The existing files have been done with Glade-2. I tried using Glade-3 a while ago but it caused some corruption with the files (it may work better now). If possible use Glade-2 for now. If only a text view was used when comments were being edited there would be the white background and black border around the TextView. Switching between a label and a TextView means there is the minimum of visual clutter. (See how Nautilus renames files) __inCallback is to stop event loops, for example an AI player moving while in the move notification callback (which could cause the other AI player to move... stack overflow)
About the end-game information: panel_description_label, panel_title_label and the information panel visibility are modified by both the comment system and the end-game event. These two systems need to be synchronised so they don't fight for the labels. e.g. comments are disabled. The game ends and the information panel appears showing "White Wins". Comments are enabled. The information panel is replaced with comment info. The end game information will never be redisplayed. So we need to modify __changeInfoPanel to have knowledge of the end game information too. p.s. I hope that my English is not too slang. I'm trying to be as readable as possible :)
Created attachment 89216 [details] [review] another aproach hi Robert, Thanks a lot for that (for be readable and the effort to read me). I think that this patch complete all the requeriments, but I don't know if I use the appropriate methods. I probe this patch only with 2D rendering, I put a method to do the board darker when starter a comment, I don't know if occur the same in 3D P.D. I use glade-2, tell me if you found a problem
The .glade files diff well now, thanks. The patch still didn't work with the end-game information. I've made the changes on svn head so it will be easier for you. See GtkView.updateInfoPanel() in chessview.py. Also editing the comments shouldn't pause the game - it should just stop the view from changing. See what stops this in GtkView.addMove(). I'll attach the diff so you can see the changes I made. You will need to add in the NAG information etc.
Created attachment 89268 [details] [review] Changes to synchronise panel usage Changes to synchronise panel usage
We can track comments/annotations in Bug #523368.