philroberts / FPDB-for-OSX

Free Poker DataBase development, with a focus on OSX.
http://fpdb.sf.net
56 stars 21 forks source link

GuiHandViewer: Original room format "Copy to clipboard" #29

Open astephane opened 7 years ago

astephane commented 7 years ago

Add an "Copy to clipboard (original room format)" feature

astephane commented 7 years ago

I think that the current design of having writeHand(), writeGameLine(), writeGameTable() in the Hand class and derive the Hand class for variants severly limits extensibility of the program.

IMHO, there should be a HandWriter class which would be initialized with the given Hand as reference which should be derived by room. But, the different variant supported would add some complexity by using multiple inheritance to factorize the code (crossref between HandWriter derivation for rooms and for variants).

That said, I'm only implementing export for PartyPoker. So, I add some writePartyPoker*() functions in the Hand class to limit the redesign of the code. But, if more work has to be done on this topic (e.g. export for other rooms), I think a re-design should be decided before added more code.

ChazDazzle commented 7 years ago

Instead of writing site specific code to re-assemble hands histories, we could add an option for saving the entire text of each hand during import. I believe that was the original intent with the table RawHands.

astephane commented 7 years ago

That would be a very nice feature. Especially if there were an option like "bulk export".

My problem is that I've lost some HH files which are in my FPDB database. I then need to re-create the original file.

astephane commented 7 years ago

Currently, Hand.handText exists but, unfortunately, its value is None.

ChazDazzle commented 7 years ago

Yes, we'd have to add an option to populate that table

astephane commented 7 years ago

I've finished (99%) PartyPoker export. It's pushed in my GitHub.

if a field is added to the database and the original hand text is stored and retrived via Hand.handText, the copy-to-clipboard feature could be rewritten outputing Hand.handText.