History log of /haiku/src/apps/pairs/PairsWindow.cpp
Revision Date Author Comments
# 2398586d 28-Feb-2022 Dale Cieslak <dcieslak@yahoo.com>

Pairs: reset IsFirstClick to true for New game

Reset the value of IsFirstClick to true whenever a new game is
started. Without this fix the board gets confused if there is
a card flipped when a game is restarted.

I can't reproduce any of the other oddities in the ticket but
this fixes the egregious repro case mentioned.

Fixes #6932

Change-Id: Ie5cedd7fc2ca411db722d3c24f68fe9aa48f7b5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5038
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 93c53000 03-Oct-2020 Murai Takashi <tmurai01@gmail.com>

pairs: remove more dead nested assignment

Pointed out by clang static analyzer.

Change-Id: I21cd0a779a50f26d713ae1203024b2b0f2f4bd49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3288
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# d7093b24 24-Sep-2020 Murai Takashi <tmurai01@gmail.com>

pairs: Remove dead code

Pointed out by clang static analyzer.

Change-Id: I72fe5dc823f96b49446d1e5a1d9a71600a585053
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3272
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 7457ccb4 13-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

BMessageFormat: Rename to BStringFormat.

The ICU class is named MessageFormat, but on Haiku, it sounds too much
like something related to BMessage (which it isn't in the slightest)
and not part of the Locale system. It works almost entirely with BStrings,
so naming it BStringFormat makes much more sense.

OK'ed by PulkoMandy and Humdinger.


# 961fdd8c 08-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessageFormat: parse the pattern at construction

* Instead of parsing the pattern everytime Format() is called, parse it
only once when the object is created.
* Adjust all callers to make use of the feature and reuse the instance
as much as possible. This also allows calling B_TRANSLATE only once
instead of everytime the formatting needs to be done. We use either a
static instance (when the message pattern is constant) or a field (when
it is not known to be constant).
* Since the BMessageFormat instances are now reused, add locking to
avoid race conditions (ICU itself is thread safe, but the format pattern
is recreated when the locale is changed)


# 53382a8a 07-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Start making use of BMessageFormat.


# fdc05529 27-Jan-2014 John Scipione <jscipione@gmail.com>

IconSaver: add authors to authors list

…already in copyright statements


# 97e1b053 27-Jan-2014 John Scipione <jscipione@gmail.com>

Pairs: store vector icons, new size menu

* Search for vector icons from MIME database once at start,
limit to application super-type, this fulfills a TODO in the code
* Use a std::map keyed by a hash to avoid duplicate icons
eliminating _HasBitmap()
* Store the vector representation and then only build bitmaps
when needed
* Convert uses of int to int32
* Convert from using BList to BObjectList, simplified cleanup
* Rename variables and methods to not abbreviate/be more clear
e.g. fPosX, fPosY => fPositionX, fPositionY
e.g. _GenerateCardPos() => _GenerateCardPositions()
* Renamed PairsTopButton to PairsButton
* Integrate Size submenu into New menu item.
Size menu item goes away, you can select New to get a new game at
the current difficulty, or, you can drill down in the New menu to
choose from Beginner, Intermediate, or Expert.
* Add new Size menu to set the icon size: Small (32x32), Medium (64x64),
or Large (128x128). Default is medium
* Rename MENU_SIZE message constant to MENU_DIFFICULTY for clarity
* Eliminate PairsGlobal.h, distribute constants to appropriate files.


# c6b0a589 21-Jan-2014 John Scipione <jscipione@gmail.com>

Pairs: Style fixes and update copyright headers.

Update long description in rdef


# 546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# 5b264395 30-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Karvjorm (#7348): localize Pairs application name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42993 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 560ff447 25-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71302e7c 16-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Further localization. Making use of B_TRANSLATE_APP_NAME, AboutWindow. Cleanups. Please review/test changes in Terminal.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b97c5149 15-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Making use of B_TRANSLATE_APP_NAME, BAboutMenuItem, BAboutWindow. Clean-up. Removal of some ellipsis. ('About Haiku' in Deskbar.)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40968 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8eff03f5 25-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fixed all build warnings by collectcatkeys that I found
* automatic whitespace cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37747 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4eb0cbb0 07-May-2010 Matt Madia <mattmadia@gmail.com>

Updated TR_CONTEXT to be B_TRANSLATE_CONTEXT, relating to #5408.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36733 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 99d126bd 06-May-2010 Matt Madia <mattmadia@gmail.com>

Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36671 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 420557d0 06-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Jorma Karvonen with a fix by myself to remove string composition.
Add four missing localizations. Closes ticket #5484.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36643 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b9dd3b0 14-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix localization of the about window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36270 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c587ade 05-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Adam Smith. Extended the Pairs application to support arbitrary board
sizes. Thanks a lot! Fixes ticket #5615.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36032 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84df7867 27-Feb-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by stargater : localize pairs. Thanks !


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35630 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95087bc5 20-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Center window on screen on start.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33680 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4a89dc95 02-Sep-2008 Alexandre Deckner <alex@zappotek.com>

- Don't leak the message given to BMessageRunner, thanks stippi!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27285 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0eb592d7 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed off by one error in the number of clicks to finish the game (it can
hardly be odd).
* Fixed spelling error Genarate -> Generate.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26941 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7187dd0 25-Apr-2008 Stephan Aßmus <superstippi@gmx.de>

* Removed no longer needed work around when Showing buttons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 69e62e48 23-Apr-2008 Stephan Aßmus <superstippi@gmx.de>

Added Pairs game contributed by Ralf Schuelke to the image! (Demo folder)
Thanks a lot, Ralf!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25114 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 961fdd8cc3a4f138449895445e0b4531e98b1eb2 08-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessageFormat: parse the pattern at construction

* Instead of parsing the pattern everytime Format() is called, parse it
only once when the object is created.
* Adjust all callers to make use of the feature and reuse the instance
as much as possible. This also allows calling B_TRANSLATE only once
instead of everytime the formatting needs to be done. We use either a
static instance (when the message pattern is constant) or a field (when
it is not known to be constant).
* Since the BMessageFormat instances are now reused, add locking to
avoid race conditions (ICU itself is thread safe, but the format pattern
is recreated when the locale is changed)


# 53382a8aa7d12cc7d72e36acd6ac7c70429eddf0 07-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Start making use of BMessageFormat.


# fdc055299718951a44e0fcd2dce7cda075190eec 27-Jan-2014 John Scipione <jscipione@gmail.com>

IconSaver: add authors to authors list

…already in copyright statements


# 97e1b053b63ba10e037388a4e21bcb93a3220210 27-Jan-2014 John Scipione <jscipione@gmail.com>

Pairs: store vector icons, new size menu

* Search for vector icons from MIME database once at start,
limit to application super-type, this fulfills a TODO in the code
* Use a std::map keyed by a hash to avoid duplicate icons
eliminating _HasBitmap()
* Store the vector representation and then only build bitmaps
when needed
* Convert uses of int to int32
* Convert from using BList to BObjectList, simplified cleanup
* Rename variables and methods to not abbreviate/be more clear
e.g. fPosX, fPosY => fPositionX, fPositionY
e.g. _GenerateCardPos() => _GenerateCardPositions()
* Renamed PairsTopButton to PairsButton
* Integrate Size submenu into New menu item.
Size menu item goes away, you can select New to get a new game at
the current difficulty, or, you can drill down in the New menu to
choose from Beginner, Intermediate, or Expert.
* Add new Size menu to set the icon size: Small (32x32), Medium (64x64),
or Large (128x128). Default is medium
* Rename MENU_SIZE message constant to MENU_DIFFICULTY for clarity
* Eliminate PairsGlobal.h, distribute constants to appropriate files.


# c6b0a589df98b29405084ccb4a1d67dddd693648 21-Jan-2014 John Scipione <jscipione@gmail.com>

Pairs: Style fixes and update copyright headers.

Update long description in rdef


# 546208a53940a26c6379c48a7854ade1a8250fc5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# 5b264395c068fa5a9b22121bafc5ae58197710e6 30-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Karvjorm (#7348): localize Pairs application name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42993 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 560ff4478d5c85455ea3e5ed5e392ef93132d545 25-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71302e7c6dbf98040eb000175a2545d0de63fdc8 16-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Further localization. Making use of B_TRANSLATE_APP_NAME, AboutWindow. Cleanups. Please review/test changes in Terminal.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b97c51490af2a4e3a20d6baf7d31e59b63924e99 15-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Making use of B_TRANSLATE_APP_NAME, BAboutMenuItem, BAboutWindow. Clean-up. Removal of some ellipsis. ('About Haiku' in Deskbar.)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40968 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8eff03f5705966c294c96a4e249bb525069b8e78 25-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fixed all build warnings by collectcatkeys that I found
* automatic whitespace cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37747 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4eb0cbb044cf538f18c0d252934a5bcaa33bfd34 07-May-2010 Matt Madia <mattmadia@gmail.com>

Updated TR_CONTEXT to be B_TRANSLATE_CONTEXT, relating to #5408.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36733 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 99d126bd7c6ec5cf4745677f6b50a34a67c7083e 06-May-2010 Matt Madia <mattmadia@gmail.com>

Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36671 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 420557d0ce8aa1b24644c172457c2ac3f10292b3 06-May-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Jorma Karvonen with a fix by myself to remove string composition.
Add four missing localizations. Closes ticket #5484.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36643 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0b9dd3b0adeef14a19481a4d6984bad19f6c37ff 14-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix localization of the about window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36270 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4c587ade77bcb200752de38521ebcad77b37fee8 05-Apr-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Adam Smith. Extended the Pairs application to support arbitrary board
sizes. Thanks a lot! Fixes ticket #5615.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36032 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 84df7867f804b4d4aa9a591bb078c2d1332242e3 27-Feb-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by stargater : localize pairs. Thanks !


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35630 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95087bc5322a284e327ffaae09441d87d14a8233 20-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Center window on screen on start.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33680 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4a89dc95cb40586a64d621a12b428c83416e2956 02-Sep-2008 Alexandre Deckner <alex@zappotek.com>

- Don't leak the message given to BMessageRunner, thanks stippi!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27285 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0eb592d7feea6c1c77f7b361823e5c66fb96079e 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed off by one error in the number of clicks to finish the game (it can
hardly be odd).
* Fixed spelling error Genarate -> Generate.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26941 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7187dd0f060706350d30efb0e02abc35b47766d 25-Apr-2008 Stephan Aßmus <superstippi@gmx.de>

* Removed no longer needed work around when Showing buttons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 69e62e48b96dc6382c64b07cfd86106fa7953a2e 23-Apr-2008 Stephan Aßmus <superstippi@gmx.de>

Added Pairs game contributed by Ralf Schuelke to the image! (Demo folder)
Thanks a lot, Ralf!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25114 a95241bf-73f2-0310-859d-f6bbb57e9c96