removed not used gui plugins from trunk

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4902 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2012-02-08 08:28:23 +00:00
parent 886faa89ba
commit 5340e44981
1046 changed files with 0 additions and 376815 deletions

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,65 +0,0 @@
# -------------------------------------------------
# Project created by QtCreator 2009-06-24T21:25:25
# -------------------------------------------------
#=== this part is common (similar) for all plugin projects =====================
TEMPLATE = lib
CONFIG += plugin release
# this is directory, where PluginInterface.h is located
INCLUDEPATH += ../
# and, the result (*.so or *.dll) should appear in this directory
DESTDIR = ../bin
OBJECTS_DIR = temp/obj
RCC_DIR = temp/qrc
UI_DIR = temp/ui
MOC_DIR = temp/moc
# the name of the result file;
TARGET = $$qtLibraryTarget(colorcode_plugin)
HEADERS += ../PluginInterface.h \
ColorCodePlugin.h
SOURCES += ColorCodePlugin.cpp
#===============================================================================
# Input
HEADERS += about.h \
colorcode.h \
colorpeg.h \
msg.h \
pegrow.h \
rowhint.h \
ccsolver.h \
background.h \
solutionrow.h \
graphicsbtn.h \
settings.h \
prefdialog.h
FORMS += about.ui \
prefdialog.ui
SOURCES += about.cpp \
colorcode.cpp \
colorpeg.cpp \
main.cpp \
msg.cpp \
pegrow.cpp \
rowhint.cpp \
ccsolver.cpp \
background.cpp \
solutionrow.cpp \
graphicsbtn.cpp \
settings.cpp \
prefdialog.cpp
RESOURCES += resource.qrc
OTHER_FILES += docs/GPL.html
win32:RC_FILE = ColorCode.rc
TRANSLATIONS += trans_de.ts \
trans_en.ts \
trans_cs.ts \
trans_fr.ts \
trans_hu.ts
CODECFORTR = UTF-8
CODECFORSRC = UTF-8

View File

@ -1,28 +0,0 @@
# -------------------------------------------------
# Project created by QtCreator 2009-06-24T21:25:25
# -------------------------------------------------
TARGET = ColorCode
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
colorpeg.cpp \
rowhint.cpp \
pegrow.cpp \
msg.cpp \
about.cpp
HEADERS += mainwindow.h \
colorpeg.h \
rowhint.h \
pegrow.h \
msg.h \
about.h
RESOURCES += resource.qrc
FORMS += about.ui
OTHER_FILES += docs/GPL.html \
trans_en.ts \
trans_de.ts
RC_FILE = ColorCode.rc
TRANSLATIONS = trans_en.ts \
trans_de.ts
CODECFORTR = UTF-8
CODECFORSRC = UTF-8

View File

@ -1 +0,0 @@
IDI_ICON1 ICON DISCARDABLE "cc32.ico"

View File

@ -1,53 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2009 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
//#include <QApplication>
//#include <QString>
//#include <QPushButton>
#include "ColorCodePlugin.h"
#include "colorcode.h"
QString
ColorCodePlugin::pluginDescription() const
{
QString res;
res = "a ColorCode plugin" ;
return res;
}
QString
ColorCodePlugin::pluginName() const
{
return "ColorCode" ;
}
QWidget*
ColorCodePlugin::pluginWidget(QWidget * parent )
{
ColorCode* window = new ColorCode();
return window;
}
Q_EXPORT_PLUGIN2(colorcode_plugin, ColorCodePlugin)

View File

@ -1,48 +0,0 @@
/****************************************************************
* RetroShare is distributed under the following license:
*
* Copyright (C) 2009 RetroShare Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
****************************************************************/
#ifndef _COLORCODE_PLUGIN_H_
#define _COLORCODE_PLUGIN_H_
#include <QObject>
#include <QString>
#include <QWidget>
#include <PluginInterface.h>
#include <QDebug>
class ColorCodePlugin: public QObject, public PluginInterface
{
Q_OBJECT
Q_INTERFACES(PluginInterface)
public slots:
virtual QString pluginDescription() const ;
virtual QString pluginName() const ;
virtual QWidget* pluginWidget(QWidget * parent = 0) ;
};
#endif

View File

@ -1,11 +0,0 @@
# simply run:
qmake-qt4
make
# to install:
cp colorcode /usr/bin/
# to uninstall:
rm /usr/bin/colorcode

View File

@ -1,67 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include "about.h"
About::About(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f)
{
setupUi(this);
setWindowIcon(QIcon(QPixmap(":/img/help-about.png")));
mAuthorIcon->setPixmap(QPixmap(":/img/cc32.png"));
mLicenseIcon->setPixmap(QPixmap(":/img/GNU-icon32.png"));
mAuthorText->setText("<b>" + tr("ColorCode") + "</b><br>" +
tr("A needful game to train your brain ;-)") +
tr("<br><br>Free MasterMind clone including a built in,<br>rather intelligent solver.") +
"<br><br>" + tr("Version") + ": 0.6.1<br>" + tr("Author") + ": Dirk Laebisch");
QString license_file = ":/docs/GPL.html";
if (QFile::exists(license_file))
{
QFont fixed_font;
fixed_font.setStyleHint(QFont::TypeWriter);
fixed_font.setFamily("Courier");
mLicenseText->setFont(fixed_font);
QFile f(license_file);
if (f.open(QIODevice::ReadOnly))
{
mLicenseText->setText(QString::fromUtf8(f.readAll().constData()));
}
f.close();
}
else
{
mLicenseText->setText(
"<i>" +
tr("This program is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation; either version 2 of the License, or "
"(at your option) any later version.") + "</i>"
);
}
}
About::~About()
{
}
QSize About::sizeHint () const
{
return QSize(360, 270);
}

View File

@ -1,38 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ABOUT_H
#define ABOUT_H
#include "ui_about.h"
#include <QDialog>
#include <QFile>
class About : public QDialog, public Ui::About
{
Q_OBJECT
public:
About(QWidget* parent = 0, Qt::WindowFlags f = 0);
~About();
virtual QSize sizeHint () const;
};
#endif // ABOUT_H

View File

@ -1,185 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QDialog" name="About">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>360</width>
<height>270</height>
</rect>
</property>
<property name="windowTitle">
<string>About ColorCode</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="mAuthorTab">
<attribute name="title">
<string>&amp;Author</string>
</attribute>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="mAuthorIcon">
<property name="text">
<string>icon</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>111</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTextBrowser" name="mAuthorText">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="mLicenseTab">
<attribute name="title">
<string>&amp;License</string>
</attribute>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="mLicenseIcon">
<property name="text">
<string>icon</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>111</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTextBrowser" name="mLicenseText">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>mAuthorText</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>mLicenseText</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>About</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,141 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "background.h"
using namespace std;
BackGround::BackGround(QObject*)
{
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
setAcceptedMouseButtons(0);
QLinearGradient topgrad(0, 16, 0, 129);
topgrad.setColorAt(0.0, QColor(0xf8, 0xf8, 0xf8));
topgrad.setColorAt(0.6, QColor(0xb8, 0xb9, 0xbb));
topgrad.setColorAt(1, QColor(0xd4, 0xd5, 0xd7));
mTopGrad = QBrush(topgrad);
QLinearGradient botgrad(0, 530, 0, 557);
botgrad.setColorAt(0.0, QColor("#d4d5d7"));
botgrad.setColorAt(0.3, QColor("#cecfd1"));
botgrad.setColorAt(1.0, QColor("#b0b1b3"));
mBotGrad = QBrush(botgrad);
QLinearGradient lgrad(0, 190, 320, 370);
lgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xa0));
lgrad.setColorAt(0.49, QColor(0xff, 0xff, 0xff, 0xa0));
lgrad.setColorAt(0.50, QColor(0, 0, 0, 0x80));
lgrad.setColorAt(1.0, QColor(0, 0, 0, 0x80));
mFramePen = QPen(QBrush(lgrad), 1);
mPend = QColor("#646568");
mPenl = QColor("#ecedef");
mGrad0 = QColor("#cccdcf");
mGrad1 = QColor("#fcfdff");
mPend.setAlpha(0x32);
mPenl.setAlpha(0x50);
mGrad0.setAlpha(0x32);
mGrad1.setAlpha(0x32);
}
BackGround::~BackGround()
{
scene()->removeItem(this);
}
QRectF BackGround::boundingRect() const
{
const int margin = 1;
return outlineRect().adjusted(-margin, -margin, +margin, +margin);
}
QRectF BackGround::outlineRect() const
{
return QRectF(0.0, 0.0, 320.0, 560.0);
}
void BackGround::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /* widget */)
{
int i;
painter->setPen(Qt::NoPen);
QRectF cr = QRectF(3, 3, 314, 554);
QPainterPath cpath;
cpath.addRoundedRect(cr, 10.1, 10.1);
painter->setClipPath(cpath);
painter->setClipping(true);
painter->setBrush(mTopGrad);
painter->drawRect(QRect(4, 4, 312, 125));
painter->setBrush(QBrush(QColor("#707173")));
painter->drawRect(QRect(1, 129, 318, 1));
painter->setPen(Qt::NoPen);
for (i = 0; i < 10; ++i)
{
painter->setBrush(QBrush(QColor("#9e9fa0")));
painter->drawRect(QRect(1, i * 40 + 130, 318, 1));
QLinearGradient rowgrad(0, i * 40 + 131, 0, i * 40 + 169);
rowgrad.setColorAt(0.0, QColor("#9a9b9d"));
rowgrad.setColorAt(1.0, QColor("#949597"));
painter->setBrush(QBrush(rowgrad));
painter->drawRect(QRect(1, i * 40 + 131, 318, 38));
painter->setBrush(QBrush(QColor("#88898b")));
painter->drawRect(QRect(1, i * 40 + 169, 318, 1));
painter->setBrush(QBrush(mPenl));
painter->drawRect(QRectF(277, i * 40 + 130, 39, 1));
painter->drawRect(QRectF(277, i * 40 + 130, 1, 39));
painter->setBrush(QBrush(mPend));
painter->drawRect(QRectF(277, i * 40 + 130 + 39, 40, 1));
painter->drawRect(QRectF(277 + 39, i * 40 + 130, 1, 40));
QRadialGradient grad(QPointF(277 + 10, i * 40 + 130 + 10), 100);
grad.setColorAt(0, mGrad0);
grad.setColorAt(1, mGrad1);
painter->setBrush(QBrush(grad));
painter->drawRect(QRectF(277 + 1, i * 40 + 131, 38.0, 38.0));
painter->setBrush(Qt::NoBrush);
QPointF x0 = QPointF(279, i * 40 + 130 + 2);
QLinearGradient lgrad(x0, QPointF(x0.x() + 36, x0.y() + 36));
lgrad.setColorAt(0.0, QColor(0, 0, 0, 0x80));
lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0));
painter->setPen(QPen(QBrush(lgrad), 0.5));
painter->drawEllipse(QRectF(x0.x(), x0.y(), 36, 36));
painter->setPen(Qt::NoPen);
}
painter->setBrush(mBotGrad);
painter->drawRect(QRect(1, 531, 318, 27));
painter->setBrush(QBrush(QColor("#eff0f2")));
painter->drawRect(QRect(1, 530, 318, 1));
painter->setClipping(false);
QRectF r = QRectF(3.5, 3.5, 313, 553);
painter->setBrush(Qt::NoBrush);
painter->setPen(mFramePen);
painter->drawRoundedRect(r, 9.8, 9.8);
}

View File

@ -1,55 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BACKGROUND_H
#define BACKGROUND_H
#include <QGraphicsItem>
#include <QColor>
#include <QPen>
#include <QRadialGradient>
#include <iostream>
#include "colorcode.h"
class BackGround : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
BackGround(QObject* parent = 0);
~BackGround();
QRectF boundingRect() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
private:
QRectF outlineRect() const;
QBrush mTopGrad;
QBrush mBotGrad;
QPen mFramePen;
QColor mPend;
QColor mPenl;
QColor mGrad0;
QColor mGrad1;
};
#endif // BACKGROUND_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,677 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ccsolver.h"
#include <time.h>
using namespace std;
const int CCSolver::STRENGTH_LOW = 0;
const int CCSolver::STRENGTH_MEDIUM = 1;
const int CCSolver::STRENGTH_HIGH = 2;
const int CCSolver::mFGCnts[4][9][4] = {
{
{2, 0, 0, 0},
{2, 0, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0}
},
{
{3, 0, 0, 0},
{2, 1, 0, 0},
{1, 1, 1, 0},
{1, 1, 1, 0},
{1, 1, 1, 0},
{1, 1, 1, 0},
{1, 1, 1, 0},
{1, 1, 1, 0},
{1, 1, 1, 0}
},
{
{3, 1, 0, 0},
{3, 1, 0, 0},
{2, 1, 1, 0},
{2, 2, 0, 0},
{2, 2, 0, 0},
{1, 1, 1, 1},
{1, 1, 1, 1},
{1, 1, 1, 1},
{1, 1, 1, 1}
},
{
{4, 1, 0, 0},
{3, 2, 0, 0},
{3, 1, 1, 0},
{2, 2, 1, 0},
{2, 1, 1, 1},
{2, 2, 1, 0},
{2, 1, 1, 1},
{2, 1, 1, 1},
{2, 1, 1, 1}
}
};
CCSolver::CCSolver(ColorCode* cc)
{
mCc = cc;
mColorCnt = 0;
mPegCnt = 0;
mDoubles = -1;
mLevel = -1;
mMaxGuessCnt = 0;
mAllCnt = 0;
mPosCnt = 0;
mHistCnt = 0;
mGuessCnt = 0;
mMaxRes = 0;
mResCnt = 0;
mRestartCnt = 0;
mResTable = NULL;
mCascade = NULL;
mPossible = NULL;
mAllTable = NULL;
mHist = NULL;
mS = NULL;
mP = NULL;
mBusy = false;
}
CCSolver::~CCSolver()
{
FreeTables();
}
void CCSolver::NewGame(const int ccnt, const int pcnt, const int doubles, const int level, const int gcnt)
{
FreeTables();
mColorCnt = ccnt;
mPegCnt = pcnt;
mDoubles = doubles;
mLevel = level;
mMaxGuessCnt = gcnt;
mAllCnt = 0;
mPosCnt = 0;
mHistCnt = 0;
mGuessCnt = 0;
mMaxRes = 0;
mResCnt = 0;
mRestartCnt = 0;
mLastPosCnt = 0;
InitTables();
}
void CCSolver::RestartGame()
{
if (mGuessCnt > 0)
{
++mRestartCnt;
}
for (int i = 0 ; i < mMaxGuessCnt ; ++i)
{
mHist[i] = NULL;
}
mGuessCnt = 0;
}
void CCSolver::GuessIn(string str)
{
int ix = Row2Ix(str);
mHist[mGuessCnt] = new int[2];
mHist[mGuessCnt][0] = ix;
}
void CCSolver::GuessIn(const vector<int>* rowsol)
{
int ix = Row2Ix(rowsol);
mHist[mGuessCnt] = new int[2];
mHist[mGuessCnt][0] = ix;
}
int* CCSolver::GuessOut()
{
if (mPosCnt == mLastPosCnt && (mGuessCnt > 0 || mRestartCnt > 0))
{
return mAllTable[mLastGuess];
}
int g = Guess();
if (g < 0 || g >= mAllCnt)
{
return NULL;
}
mLastPosCnt = mPosCnt;
mLastGuess = g;
return mAllTable[g];
}
int CCSolver::ResIn(const vector<int>* res)
{
int r = 0;
int len = res->size();
int i;
for (i = 0; i < len; ++i)
{
if (res->at(i) == 2)
{
r += 10;
}
else if (res->at(i) == 1)
{
r += 1;
}
}
mHist[mGuessCnt][1] = r;
UpdPos(mHist[mGuessCnt][0], r);
++mGuessCnt;
return r;
}
void CCSolver::FreeTables()
{
int i;
delete [] mCascade;
mCascade = NULL;
delete [] mPossible;
mPossible = NULL;
for (i = 0 ; i < mAllCnt ; ++i)
{
delete [] mAllTable[i] ;
}
delete [] mAllTable;
mAllTable = NULL;
for (i = 0 ; i < mMaxGuessCnt ; ++i)
{
delete [] mHist[i] ;
}
delete [] mHist;
mHist = NULL;
delete [] mResTable;
mResTable = NULL;
delete [] mS;
mS = NULL;
delete [] mP;
mP = NULL;
}
void CCSolver::InitTables()
{
int i, j, k;
if (mDoubles != 1 && mColorCnt < mPegCnt)
{
return;
}
mCascade = new int [mPegCnt];
for (i = 0; i < mPegCnt; ++i)
{
mCascade[i] = IntPow(mColorCnt, mPegCnt - i - 1);
}
mAllCnt = 1;
for (i = 0; i < mPegCnt; ++i)
{
mAllCnt *= mColorCnt;
}
mAllTable = new int* [mAllCnt];
for (i = 0; i < mAllCnt; ++i)
{
mAllTable[i] = new int [mPegCnt];
}
mPossible = new int [mAllCnt];
for (i = 0; i < mAllCnt; ++i)
{
FillTable(i);
}
mHist = new int* [mMaxGuessCnt];
for (i = 0 ; i < mMaxGuessCnt ; ++i)
{
mHist[i] = NULL;
}
mS = new int [mColorCnt];
mP = new int [mColorCnt];
mMaxRes = mPegCnt * 10;
mResCnt = (IntFac(mPegCnt + 2)) / (IntFac(mPegCnt) * 2) - 1;
mResTable = new int[mResCnt];
k = 0;
for (i = 0; i <= mPegCnt; ++i)
{
for (j = 0; j <= mPegCnt - i; ++j, ++k)
{
if (i == mPegCnt - 1 && j == 1)
{
--k;
continue;
}
mResTable[k] = i * 10 + j;
}
}
}
void CCSolver::FillTable(const int ix)
{
int i;
int v = ix;
int pos = 1;
int j;
for (i = 0; i < mPegCnt; ++i)
{
mAllTable[ix][i] = 0;
}
for (i = 0; i < mPegCnt; ++i)
{
while (v >= mCascade[i])
{
++mAllTable[ix][i];
v -= mCascade[i];
}
if (mDoubles != 1 && pos == 1)
{
for (j = 0; j < i; j++)
{
if (mAllTable[ix][j] == mAllTable[ix][i])
{
pos = 0;
break;
}
}
}
}
mPosCnt += pos;
mPossible[ix] = pos;
}
int CCSolver::RowCmp(const int* sol, const int* pat)
{
int bl = 0;
int wh = 0;
int i;
for (i = 0; i < mColorCnt; ++i)
{
mS[i] = mP[i] = 0;
}
for (i = 0; i < mPegCnt; ++i)
{
if (sol[i] == pat[i])
{
++bl;
}
else
{
if (mP[sol[i]] > 0)
{
++wh;
--mP[sol[i]];
}
else
{
++mS[sol[i]];
}
if (mS[pat[i]] > 0)
{
++wh;
--mS[pat[i]];
}
else
{
++mP[pat[i]];
}
}
}
return (10 * bl + wh);
}
void CCSolver::UpdPos(const int ix, const int res)
{
int i;
for (i = 0; i < mAllCnt; ++i)
{
if (!mPossible[i])
{
continue;
}
if (RowCmp(mAllTable[i], mAllTable[ix]) != res)
{
mPossible[i] = 0;
--mPosCnt;
}
}
}
string CCSolver::FirstGuess()
{
int i, j, r;
int pegcnt = 0;
int diffcnt = 0;
const int* fg = mFGCnts[mPegCnt-2][mColorCnt-2];
char s[mPegCnt];
int t[mColorCnt];
for (i = 0; i < mColorCnt; ++i)
{
t[i] = 0;
}
if (mDoubles == 1)
{
for (i = 0; i < 4; ++i)
{
if (fg[i] == 0)
{
break;
}
do
{
r = rand() % mColorCnt;
}
while (t[r] > 0);
++t[r];
++diffcnt;
for (j = 0; j < fg[i]; ++j)
{
s[pegcnt++] = 'A' + r;
}
if (pegcnt == mPegCnt)
{
break;
}
}
if (pegcnt != mPegCnt)
{
//
}
if (mPegCnt > 2 && diffcnt > 1)
{
for (int i = 0; i < (mPegCnt - 1); ++i)
{
r = i + (rand() % (mPegCnt - i));
if (i != r)
{
char tmp = s[i];
s[i] = s[r];
s[r] = tmp;
}
}
}
}
else
{
for (i = 0; i < mPegCnt; ++i)
{
do
{
r = rand() % mColorCnt;
}
while (t[r] > 0);
++t[r];
s[i] = 'A' + r;
}
}
return string(s, mPegCnt);
}
int CCSolver::Guess()
{
clock_t start, finish;
start = clock();
if (mLevel > STRENGTH_LOW && mGuessCnt == 0 && mRestartCnt == 0)
{
return Row2Ix(FirstGuess());
}
mBusy = true;
int level = mLevel;
if (level == STRENGTH_HIGH && mPosCnt > 10000)
{
level = STRENGTH_MEDIUM;
}
int i, j;
if (level == STRENGTH_LOW)
{
for (i = 0; i < mAllCnt; ++i)
{
if (mPossible[i])
{
break;
}
}
}
else if (level == STRENGTH_MEDIUM)
{
int m = mPosCnt >> 1;
for (i = 0; i < mAllCnt; ++i)
{
if (mPossible[i])
{
if (--m <= 0)
{
break;
}
}
}
}
else
{
// Donald E. Knuth. The Computer as Master Mind. J. Recreational Mathematics, 9 (1976-77), 1-6.
// Kenji Koyama, Tony W. Lai. An optimal Mastermind Strategy. J. Recreational Mathematics, 1994.
// we'll only take the still possible ones into account, but ...
int solix = -1;
int shortest = 1000000;
int longest;
int res2pos[mMaxRes];
for (j = 0; j <= mMaxRes; ++j)
{
res2pos[j] = 0;
}
for (i = 0; i < mAllCnt; ++i)
{
if (!mPossible[i])
{
continue;
}
for (j = 0; j < mAllCnt; ++j)
{
if (!mPossible[j])
{
continue;
}
++res2pos[RowCmp(mAllTable[j], mAllTable[i])];
}
longest = 0;
for (j = 0; j < mResCnt; ++j)
{
if (res2pos[mResTable[j]] > longest)
{
longest = res2pos[mResTable[j]];
}
res2pos[mResTable[j]] = 0;
}
if (longest < shortest)
{
shortest = longest;
solix = i;
}
}
i = solix;
}
finish = clock();
mBusy = false;
return i;
}
string CCSolver::RowOut(const int* r)
{
char s[mPegCnt];
int i;
for (i = 0; i < mPegCnt; ++i)
{
s[i] = 'A' + r[i];
}
return string(s, mPegCnt);
}
int CCSolver::Row2Ix(const vector<int>* v)
{
int i;
int ix = 0;
int len = v->size();
if (len != mPegCnt)
{
return -1;
}
int j;
for (i = 0; i < mPegCnt; ++i)
{
j = v->at(i);
if (j >= mColorCnt)
{
ix = -1;
break;
}
ix += j * mCascade[i];
}
if (ix >= 0 && ix < mAllCnt)
{
return ix;
}
return -1;
}
int CCSolver::Row2Ix(const string str)
{
int i;
int ix = 0;
int len = int(str.size());
if (len != mPegCnt)
{
return -1;
}
int j;
for (i = 0; i < mPegCnt; ++i)
{
j = toupper(int(str[i])) - 'A';
if (j >= mColorCnt)
{
ix = -1;
break;
}
ix += j * mCascade[i];
}
if (ix >= 0 && ix < mAllCnt)
{
return ix;
}
return -1;
}
int CCSolver::IntPow(const int b, const int e)
{
int i;
int ret = 1;
for (i = 0; i < e; ++i)
{
ret *= b;
}
return ret;
}
int CCSolver::IntFac(const int n)
{
int fac = 1;
int i;
for (i = n; i > 1; --i)
{
fac *= i;
}
return fac;
}

View File

@ -1,94 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CCSOLVER_H
#define CCSOLVER_H
#include <iostream>
#include "colorcode.h"
using namespace std;
class CCSolver
{
public:
static const int STRENGTH_LOW;
static const int STRENGTH_MEDIUM;
static const int STRENGTH_HIGH;
CCSolver(ColorCode* cc);
~CCSolver();
void NewGame(const int ccnt, const int pcnt = 4, const int doubles = 1, const int level = 2, const int gcnt = 10);
void RestartGame();
string FirstGuess();
void GuessIn(string str);
void GuessIn(const vector<int>* rowsol);
int ResIn(const vector<int>* res);
int* GuessOut();
volatile bool mBusy;
private:
static const int mFGCnts[4][9][4];
ColorCode* mCc;
int mMaxGuessCnt;
int mColorCnt;
int mPegCnt;
int mDoubles;
int mLevel;
int mLastGuess;
int mLastPosCnt;
int mAllCnt;
int mPosCnt;
int mHistCnt;
int mGuessCnt;
int mMaxRes;
int mResCnt;
int mRestartCnt;
int* mResTable;
int* mCascade;
int* mPossible;
int** mAllTable;
int** mHist;
int* mS;
int* mP;
void FreeTables();
void InitTables();
void FillTable(const int ix);
int RowCmp(const int* sol, const int* pat);
void UpdPos(const int ix, const int res);
int Guess();
string RowOut(const int* r);
int Row2Ix(const string str);
int Row2Ix(const vector<int>* v);
int IntPow(const int b, const int e);
int IntFac(const int n);
};
#endif // CCSOLVER_H

View File

@ -1,113 +0,0 @@
* 0.6.1 released, February 16, 2010
* Translation
- Added french translation - thanks to Filippo Rusconi.
* 0.6.0 released, February 14, 2010
* Summary
- Second game mode (Computer vs. Human)
- Preferences dialog for persistent settings
- Additional settings options
* Preferences dialog
- To examine all available settings options, a preferences dialog has been introduced.
- The chosen preferences/settings are now persistent, so when starting the application,
the last used settings are applied.
* Settings options
- Game modes (Human vs Computer or Computer versus Human)
- To get a fair chance you may select a weaker solver strength level for your computer
opponent ;-)
- Let an impartial part :-) of your computer determine the corresponding hints for the
computer's guess. This option affects only Computer vs. Human games. If checked, you
only have to place your secret combination. Then the rest of the game runs automatically
until the end.
- To better watch your computer trying hard to break your code, you may
define a timeout between the guesses
- Select letters or numbers as text indicators and - if convenient - do
not use colors as indicators at all - but it's still ColorCode ;-)
* Layout/Design
- Some minor changes and new buttons for the second game mode.
* 0.5.5 released, October 31, 2009
* Summary
- Accessibility and usability improvements
* Settings options
- For the color sensitive of us ;-) the posibility to change the color order by drag and drop
has been added.
- Press CTRL while dragging to flip two colors or CTRL+SHIFT to cyclic shift the color order.
You can do this even while a game is running - the whole existing display will change.
- New 'Reset Color Order' option in the settings menu to revert your changes.
- Also - and more important - for the more text aimed a settings option has been added,
to toggle the display of letter indicators for the different peg colors.
- Make the documentations page accessible from the game's help menu.
* Layout/Design
- Some minor changes.
* 0.5 released, October 21, 2009
* Summary
- The number of columns in the game is now customizable. The column count can be any number
from 2 untill 5.
- Updated translation files
* Solver
- Changed how the solver determines the first guess. Also - for the following really calculated
guesses - if the number of possibilities is very high (mostly at the early phase of a 10 colors/
5 columns game) the solver will automatically fallback to a weaker algorithm until the number
of possibilities has been narrowed, to reduce calculating time
* Layout/Design
- Some minor changes to handle the variable number of columns. Added toolbar controls to enable
the change of all level related settings here. The statusbar now permanently shows the current
game's settings.
* 0.4 released, October 7, 2009
* Summary
- The GUI has been changed completely and the Usability was improved by adding some keyboard
shortcuts for often needed interactions.
- Added czech translation. Thanks to Pavel Fric.
* Fixes
- To avoid those 'QGraphicsItem::ungrabMouse: not a mouse grabber' warnings emit the mouse event
only if the hint button hasn't been disabled just before ...
* License
- The License had been changed from the GPL v2 to GPL v3.
* Layout/Design
- Complete Change, so all paint methods had to be changed and optimized. The background is now
drawn by its own class, no more brushed metall background image anymore.
* 0.3 released, September 26, 2009
* Summary
- Introduced a rather perfect MasterMind solver. It will watch any move you take and any hints
you have gotten, so you can at any time in a running game let your computer guess for you.
Of course you can change or discard it's suggestion :-) .
* Solver
- The solver has 3 built in levels of stregth. For the suggestions, currently only the most
powerfull is used. For the first guess it will use a reasonable random guess based on pre-
calculated combinations to reduce computation time.
* Layout/Design
- Make the solver's guess action accessible at the toolbar.
* 0.2 released, September 10, 2009
* Summary
- Added 3 levels of difficulty (Easy, Medium, Hard) based on the possibility to change the
available number of colors for a game. You can play games with 6, 8 or 10 colors.
* Layout/Design
- Added a combo-box (select) control to the toolbar, to easily access the level (color count)
settings.
- Enable hiding the menubar, toolbar and statusbar.
- Changed to a centered layout (message display and game board).
* 0.1 released, September 6, 2009
* Summary
- This is the initial release of ColorCode, a free MasterMind clone. Try to guess a combination
of 8 colors within at most 10 guesses.
- You may allow or not pegs of the same color. You can fill the rows by random or duplicate
a previous one.
* GUI
- English and German translations are available.

File diff suppressed because it is too large Load Diff

View File

@ -1,284 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COLORCODE_H
#define COLORCODE_H
#include <iostream>
#include <QMainWindow>
struct PegType
{
int ix;
char let;
QRadialGradient* grad;
QColor pencolor;
};
class QAction;
class QActionGroup;
class QComboBox;
class QLabel;
class QGraphicsItem;
class QGraphicsTextItem;
class QGraphicsScene;
class QGraphicsView;
class PrefDialog;
class Settings;
class CCSolver;
class ColorPeg;
class PegRow;
class RowHint;
class Msg;
class BackGround;
class SolutionRow;
class GraphicsBtn;
class ColorCode : public QMainWindow
{
Q_OBJECT
public:
ColorCode();
~ColorCode();
static const int STATE_RUNNING;
static const int STATE_WON;
static const int STATE_LOST;
static const int STATE_GAVE_UP;
static const int STATE_ERROR;
static const int MODE_HVM;
static const int MODE_MVH;
static const int MAX_COLOR_CNT;
static const int LEVEL_SETTINGS[5][3];
int ROW_CNT;
int ROW_Y0;
Settings* mSettings;
public slots:
void PegPressSlot(ColorPeg *cp);
void PegSortSlot(ColorPeg* cp);
void PegReleasedSlot(ColorPeg *cp);
void RowSolutionSlot(int ix);
void HintPressedSlot(int ix);
void ShowMsgSlot(QString msg);
void RemovePegSlot(ColorPeg* cp);
void DoneBtnPressSlot(GraphicsBtn* btn = NULL);
void ApplyPreferencesSlot();
protected :
void resizeEvent(QResizeEvent* e);
void contextMenuEvent(QContextMenuEvent* e);
void keyPressEvent(QKeyEvent *e);
private slots:
void InitRows();
void InitPegBtns();
void NewGameSlot();
void RestartGameSlot();
void GiveInSlot();
void ResetRows();
void OnlineHelpSlot();
void AboutSlot();
void AboutQtSlot();
void OpenPreferencesSlot();
void ShowToolbarSlot();
void ShowMenubarSlot();
void ShowStatusbarSlot();
void ResetColorsOrderSlot();
void SetIndicators();
void SameColorSlot(bool checked);
void SetSameColor(bool checked);
void AutoCloseSlot();
void AutoHintsSlot();
void SetLevelSlot();
void SetGameModeSlot();
void RandRowSlot();
void PrevRowSlot();
void ClearRowSlot();
void ColorCntChangedSlot();
void PegCntChangedSlot();
void UpdateRowMenuSlot();
void SetGuessSlot();
void SetHintsSlot();
void SetAutoHintsSlot();
void TestSlot();
private:
static const int LAYER_BG;
static const int LAYER_ROWS;
static const int LAYER_HINTS;
static const int LAYER_SOL;
static const int LAYER_MSG;
static const int LAYER_PEGS;
static const int LAYER_BTNS;
static const int LAYER_DRAG;
static int mGameMode;
static int mLevel;
static int mColorCnt;
static int mPegCnt;
static int mDoubles;
static int mMaxZ;
static int mXOffs;
volatile static bool mNoAct;
int mGameState;
int mGameId;
int mGuessCnt;
int mGameCnt;
bool mHideColors;
int mSolverStrength;
std::vector<int> mSolution;
QGraphicsScene* scene;
QGraphicsView* view;
QSize* mOrigSize;
CCSolver* mSolver;
Msg* mMsg;
BackGround* mBg;
GraphicsBtn* mDoneBtn;
GraphicsBtn* mOkBtn;
PrefDialog* mPrefDialog;
PegRow* mCurRow;
std::vector<ColorPeg *> mAllPegs;
std::vector<ColorPeg *> mPegBuff;
SolutionRow* mSolutionRow;
PegRow* mPegRows[10];
RowHint* mHintBtns[10];
PegType* mTypesMap[10];
QRadialGradient mGradMap[10];
QRadialGradient mGradBuff[10];
ColorPeg* mPegBtns[10];
QPoint mBtnPos[10];
QTimer* mHintsDelayTimer;
void InitTypesMap();
void InitSolution();
void InitActions();
void InitMenus();
void InitToolBars();
void CreatePrefDialog();
void ApplySettings();
bool NeedsRestart() const;
void TryNewGame();
void SetGameMode();
void SetPegCnt();
void SetColorCnt();
void ApplyGameMode();
void ApplyPegCnt();
void ApplyColorCnt();
void ApplySolverStrength();
void CheckLevel();
void CheckSameColorsSetting();
void SetState(const int s);
void ResetGame();
void NewGame();
void SetSolution();
void GetSolution();
void ShowSolution();
void NextRow();
void ResolveRow();
std::vector<int> RateSol2Guess(const std::vector<int> sol, const std::vector<int> guess);
void ResolveHints();
void ResolveGame();
bool GamesRunning();
void Scale();
ColorPeg* CreatePeg(int ix);
void RemovePeg(ColorPeg* cp);
QMenu* mMenuGame;
QMenu* mMenuRow;
QMenu* mMenuRowContext;
QMenu* mMenuSettings;
QMenu* mMenuModes;
QMenu* mMenuLevels;
QMenu* mMenuHelp;
QMenuBar* mMenuBar;
QToolBar* mGameToolbar;
QToolBar* mLevelToolbar;
QComboBox* mColorCntCmb;
QComboBox* mPegCntCmb;
QLabel* mStatusLabel;
QActionGroup* mActGroupLevels;
QActionGroup* mActGroupModes;
QAction* mActNewGame;
QAction* mActRestartGame;
QAction* mActGiveIn;
QAction* mActShowToolbar;
QAction* mActShowMenubar;
QAction* mActShowStatusbar;
QAction* mActSameColor;
QAction* mActResetColorsOrder;
QAction* mActShowLetter;
QAction* mActSameColorIcon;
QAction* mActAutoClose;
QAction* mActAutoHints;
QAction* mActPreferences;
QAction* mActAbout;
QAction* mActAboutQt;
QAction* mActExit;
QAction* mActSetPegCnt;
QAction* mActModeHvM;
QAction* mActModeMvH;
QAction* mActLevelEasy;
QAction* mActLevelClassic;
QAction* mActLevelMedium;
QAction* mActLevelChallenging;
QAction* mActLevelHard;
QAction* mLaunchHelpAction;
QAction* mActRandRow;
QAction* mActPrevRow;
QAction* mActClearRow;
QAction* mActSetGuess;
QAction* mActSetHints;
};
#endif // COLORCODE_H

View File

@ -1,340 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "colorpeg.h"
using namespace std;
const QFont ColorPeg::mFont = ColorPeg::GetLetterFont();
const QBrush ColorPeg::mShadowBrush = ColorPeg::GetShadowBrush();
const QBrush ColorPeg::mOutlineBrush = ColorPeg::GetOutlineBrush();
const QBrush ColorPeg::mGlossyBrush = ColorPeg::GetGlossyBrush();
const QBrush ColorPeg::mNeutralBrush = ColorPeg::GetNeutralBrush();
QFont ColorPeg::GetLetterFont()
{
QFont lf("Arial", 12, QFont::Bold, false);
lf.setStyleHint(QFont::SansSerif);
return lf;
}
QBrush ColorPeg::GetNeutralBrush()
{
QRadialGradient rgrad(20, 20, 40, 5, 5);
rgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xff));
rgrad.setColorAt(1.0, QColor(0x80, 0x80, 0x80, 0xff));
return QBrush(rgrad);
}
QBrush ColorPeg::GetShadowBrush()
{
QRadialGradient rgrad(22, 22, 22, 22, 22);
rgrad.setColorAt(0.3, QColor(0, 0, 0, 0xff));
rgrad.setColorAt(1.0, QColor(0, 0, 0, 0));
return QBrush(rgrad);
}
QBrush ColorPeg::GetOutlineBrush()
{
QLinearGradient lgrad(0, 0, 38, 38);
lgrad.setColorAt(0.0, QColor(0, 0, 0, 0xa0));
lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0));
return QBrush(lgrad);
}
QBrush ColorPeg::GetGlossyBrush()
{
QLinearGradient lgrad(20, 4, 20, 20);
lgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0x80));
lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0x00));
return QBrush(lgrad);
}
ColorPeg::ColorPeg(QObject*)
{
setFlags(QGraphicsItem::GraphicsItemFlags(0));
mPegType = NULL;
mPegRow = NULL;
SetBtn(true);
mIsDragged = false;
mShowIndicator = false;
mHideColor = false;
mSort = 0;
mId = -1;
}
ColorPeg::~ColorPeg()
{
}
void ColorPeg::SetPegType(PegType *pt)
{
mPegType = pt;
setFlags(ItemIsMovable | ItemIsSelectable);
}
void ColorPeg::SetPegRow(PegRow *pr)
{
mPegRow = pr;
}
PegType* ColorPeg::GetPegType()
{
return mPegType;
}
void ColorPeg::SetId(int id)
{
mId = id;
}
bool ColorPeg::IsBtn() const
{
return mIsBtn;
}
int ColorPeg::GetSort() const
{
return mSort;
}
void ColorPeg::SetBtn(bool b)
{
mIsBtn = b;
SetCursorShape();
}
int ColorPeg::GetType() const
{
return mType;
}
void ColorPeg::SetType(const int t)
{
mType = t;
}
void ColorPeg::Reset()
{
SetIsDragged(false);
setSelected(false);
if (mPegRow != NULL)
{
mPegRow->RemovePeg(this);
mPegRow = NULL;
}
}
void ColorPeg::SetIsDragged(bool b)
{
if (false == b)
{
update(boundingRect());
}
mIsDragged = b;
}
void ColorPeg::SetEnabled(const bool b)
{
setEnabled(b);
SetCursorShape();
}
void ColorPeg::SetIndicator(const bool b, const int t, const bool c)
{
if (mShowIndicator != b || mIndicatorType != t || mHideColor != c)
{
mShowIndicator = b;
mIndicatorType = t;
mHideColor = c;
update(boundingRect());
}
}
void ColorPeg::SetCursorShape(Qt::CursorShape shape, const bool force)
{
if (!force)
{
if (mIsDragged)
{
if (mSort == 0)
{
shape = Qt::ClosedHandCursor;
}
else if (mSort == 1)
{
shape = Qt::SizeVerCursor;
}
else
{
shape = Qt::SplitVCursor;
}
}
else if (isEnabled())
{
shape = Qt::OpenHandCursor;
}
}
if (cursor().shape() != shape)
{
setCursor(QCursor(shape));
}
}
QVariant ColorPeg::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged)
{
scene()->update(scene()->sceneRect());
}
return QGraphicsItem::itemChange(change, value);
}
void ColorPeg::mousePressEvent(QGraphicsSceneMouseEvent *e)
{
QGraphicsItem::mousePressEvent(e);
if (mPegType != NULL)
{
if (e->button() == Qt::LeftButton)
{
Reset();
SetIsDragged(true);
if (IsBtn() && (e->modifiers() & Qt::ControlModifier) != 0)
{
if ((e->modifiers() & Qt::ShiftModifier) == 0)
{
mSort = 1;
}
else
{
mSort = 2;
}
}
else
{
mSort = 0;
}
emit PegPressSignal(this);
SetCursorShape();
}
}
}
void ColorPeg::mouseReleaseEvent (QGraphicsSceneMouseEvent *e)
{
QGraphicsItem::mouseReleaseEvent(e);
if (mPegType != NULL)
{
if (e->button() == Qt::LeftButton)
{
SetIsDragged(false);
emit PegReleasedSignal(this);
SetCursorShape();
}
}
}
QPainterPath ColorPeg::shape() const
{
QPainterPath path;
path.addEllipse(boundingRect());
return path;
}
QRectF ColorPeg::boundingRect() const
{
int margin;
if (mIsDragged)
{
margin = 8;
}
else
{
margin = 1;
}
return outlineRect().adjusted(-margin, -margin, +margin, +margin);
}
QRectF ColorPeg::outlineRect() const
{
QRectF rect(0.0, 0.0, 36.0, 36.0);
return rect;
}
QRectF ColorPeg::GetColorRect() const
{
QRectF rect(1.0, 1.0, 34.0, 34.0);
return rect;
}
void ColorPeg::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget* /* widget */)
{
painter->setPen(Qt::NoPen);
if (!mIsDragged)
{
painter->setBrush(ColorPeg::mOutlineBrush);
painter->drawEllipse(outlineRect());
}
else
{
painter->translate(QPointF(-2, -2));
painter->setBrush(ColorPeg::mShadowBrush);
painter->drawEllipse(QRectF(0, 0, 44, 44));
painter->translate(QPointF(2, 2));
}
if (!mHideColor)
{
painter->setBrush(QBrush(*mPegType->grad));
painter->drawEllipse(GetColorRect());
}
else
{
painter->setBrush(mNeutralBrush);
painter->drawEllipse(GetColorRect());
}
painter->setBrush(mGlossyBrush);
painter->drawEllipse(QRectF(5, 3, 24, 20));
if (mShowIndicator)
{
painter->setPen(QPen(QColor("#303133")));
painter->setRenderHint(QPainter::TextAntialiasing, true);
painter->setFont(mFont);
QString ind;
if (mIndicatorType == Settings::INDICATOR_LETTER)
{
ind = QString(mPegType->let);
}
else
{
ind.setNum((mPegType->ix + 1));
}
painter->drawText(QRectF(1.5, 2.0, 32.0, 32.0), Qt::AlignCenter, ind);
}
}

View File

@ -1,109 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COLORPEG_H
#define COLORPEG_H
#include <QColor>
#include <QPen>
#include <QRadialGradient>
#include <QGraphicsItem>
#include <iostream>
#include <vector>
#include "colorcode.h"
#include "pegrow.h"
#include "rowhint.h"
#include "settings.h"
class ColorPeg : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
ColorPeg(QObject* parent = 0);
~ColorPeg();
int mId;
void SetId(int id);
void SetPegType(PegType* pt);
void SetPegRow(PegRow* pr);
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
void SetType(const int t);
void SetEnabled(const bool b);
void SetIndicator(const bool b, const int t, const bool c);
void SetCursorShape( Qt::CursorShape shape = Qt::ArrowCursor, const bool force = false);
PegType* GetPegType();
int GetType() const;
QColor GetPenColor() const;
QColor GetBrushColor() const;
bool IsBtn() const;
int GetSort() const;
void SetBtn(bool b);
void Reset();
signals:
void PegReleasedSignal(ColorPeg* cp);
void PegPressSignal(ColorPeg* cp);
void PegSortSignal(ColorPeg* cp);
protected:
PegType* mPegType;
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void mousePressEvent(QGraphicsSceneMouseEvent* e);
void mouseReleaseEvent(QGraphicsSceneMouseEvent* e);
private:
static const QFont mFont;
static QFont GetLetterFont();
static const QBrush mShadowBrush;
static QBrush GetShadowBrush();
static const QBrush mOutlineBrush;
static QBrush GetOutlineBrush();
static const QBrush mGlossyBrush;
static QBrush GetGlossyBrush();
static const QBrush mNeutralBrush;
static QBrush GetNeutralBrush();
QRectF GetColorRect() const;
QRectF outlineRect() const;
void SetIsDragged(bool b);
PegRow* mPegRow;
const QBrush mBrush;
int mType;
int mSort;
bool mIsBtn;
bool mIsDragged;
bool mShowIndicator;
int mIndicatorType;
bool mHideColor;
};
#endif // COLORPEG_H

View File

@ -1,694 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GNU General Public License - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml"
href="http://www.gnu.org/licenses/gpl-3.0.rdf" />
</head>
<body>
<h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 29 June 2007</p>
<p>Copyright &copy; 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;</p><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
<h3><a name="preamble"></a>Preamble</h3>
<p>The GNU General Public License is a free, copyleft license for
software and other kinds of works.</p>
<p>The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.</p>
<p>When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.</p>
<p>To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.</p>
<p>For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.</p>
<p>Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.</p>
<p>For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.</p>
<p>Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.</p>
<p>Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.</p>
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
<h3><a name="terms"></a>TERMS AND CONDITIONS</h3>
<h4><a name="section0"></a>0. Definitions.</h4>
<p>&ldquo;This License&rdquo; refers to version 3 of the GNU General Public License.</p>
<p>&ldquo;Copyright&rdquo; also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.</p>
<p>&ldquo;The Program&rdquo; refers to any copyrightable work licensed under this
License. Each licensee is addressed as &ldquo;you&rdquo;. &ldquo;Licensees&rdquo; and
&ldquo;recipients&rdquo; may be individuals or organizations.</p>
<p>To &ldquo;modify&rdquo; a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a &ldquo;modified version&rdquo; of the
earlier work or a work &ldquo;based on&rdquo; the earlier work.</p>
<p>A &ldquo;covered work&rdquo; means either the unmodified Program or a work based
on the Program.</p>
<p>To &ldquo;propagate&rdquo; a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.</p>
<p>To &ldquo;convey&rdquo; a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.</p>
<p>An interactive user interface displays &ldquo;Appropriate Legal Notices&rdquo;
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.</p>
<h4><a name="section1"></a>1. Source Code.</h4>
<p>The &ldquo;source code&rdquo; for a work means the preferred form of the work
for making modifications to it. &ldquo;Object code&rdquo; means any non-source
form of a work.</p>
<p>A &ldquo;Standard Interface&rdquo; means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.</p>
<p>The &ldquo;System Libraries&rdquo; of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
&ldquo;Major Component&rdquo;, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.</p>
<p>The &ldquo;Corresponding Source&rdquo; for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.</p>
<p>The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
<p>The Corresponding Source for a work in source code form is that
same work.</p>
<h4><a name="section2"></a>2. Basic Permissions.</h4>
<p>All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.</p>
<p>You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.</p>
<p>Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
<h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
<p>No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.</p>
<p>When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.</p>
<h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
<p>You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.</p>
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.</p>
<h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
<p>You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:</p>
<ul>
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.</li>
<li>b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
&ldquo;keep intact all notices&rdquo;.</li>
<li>c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.</li>
<li>d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.</li>
</ul>
<p>A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
&ldquo;aggregate&rdquo; if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.</p>
<h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
<p>You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:</p>
<ul>
<li>a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.</li>
<li>b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.</li>
<li>c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.</li>
<li>d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.</li>
<li>e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.</li>
</ul>
<p>A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.</p>
<p>A &ldquo;User Product&rdquo; is either (1) a &ldquo;consumer product&rdquo;, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, &ldquo;normally used&rdquo; refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.</p>
<p>&ldquo;Installation Information&rdquo; for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.</p>
<p>If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).</p>
<p>The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.</p>
<p>Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.</p>
<h4><a name="section7"></a>7. Additional Terms.</h4>
<p>&ldquo;Additional permissions&rdquo; are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.</p>
<p>When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.</p>
<p>Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:</p>
<ul>
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or</li>
<li>b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or</li>
<li>c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or</li>
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or</li>
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or</li>
<li>f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.</li>
</ul>
<p>All other non-permissive additional terms are considered &ldquo;further
restrictions&rdquo; within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.</p>
<p>If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.</p>
<p>Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.</p>
<h4><a name="section8"></a>8. Termination.</h4>
<p>You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).</p>
<p>However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.</p>
<p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.</p>
<p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.</p>
<h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
<p>You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.</p>
<h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
<p>Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.</p>
<p>An &ldquo;entity transaction&rdquo; is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.</p>
<p>You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.</p>
<h4><a name="section11"></a>11. Patents.</h4>
<p>A &ldquo;contributor&rdquo; is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's &ldquo;contributor version&rdquo;.</p>
<p>A contributor's &ldquo;essential patent claims&rdquo; are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, &ldquo;control&rdquo; includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.</p>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.</p>
<p>In the following three paragraphs, a &ldquo;patent license&rdquo; is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To &ldquo;grant&rdquo; such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.</p>
<p>If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. &ldquo;Knowingly relying&rdquo; means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.</p>
<p>If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.</p>
<p>A patent license is &ldquo;discriminatory&rdquo; if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.</p>
<p>Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.</p>
<h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
<p>If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p>
<h4><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
<p>Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.</p>
<h4><a name="section14"></a>14. Revised Versions of this License.</h4>
<p>The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.</p>
<p>Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License &ldquo;or any later version&rdquo; applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.</p>
<p>If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.</p>
<p>Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.</p>
<h4><a name="section15"></a>15. Disclaimer of Warranty.</h4>
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM &ldquo;AS IS&rdquo; WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
<h4><a name="section16"></a>16. Limitation of Liability.</h4>
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.</p>
<h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
<p>If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.</p>
<p>END OF TERMS AND CONDITIONS</p>
<h3><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
<p>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.</p>
<p>To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the &ldquo;copyright&rdquo; line and a pointer to where the full notice is found.</p>
<pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
</pre>
<p>Also add information on how to contact you by electronic and paper mail.</p>
<p>If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:</p>
<pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</pre>
<p>The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an &ldquo;about box&rdquo;.</p>
<p>You should also get your employer (if you work as a programmer) or school,
if any, to sign a &ldquo;copyright disclaimer&rdquo; for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
&lt;http://www.gnu.org/licenses/&gt;.</p>
<p>The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
&lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;.</p>
</body></html>

View File

@ -1,4 +0,0 @@
#ifndef GAMEBOARD_H
#define GAMEBOARD_H
#endif // GAMEBOARD_H

View File

@ -1,151 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include <QFontMetrics>
#include "graphicsbtn.h"
using namespace std;
GraphicsBtn::GraphicsBtn()
{
mWidth = 152;
setCursor(Qt::PointingHandCursor);
setAcceptHoverEvents (true);
mLabel = "";
mLabelWidth = 0;
mYOffs = 0;
InitGraphics();
SetShapes();
mFillBrush = &mFillOutBrush;
mFrameBrush = &mFrameOutBrush;
mFont = QFont("Arial", 12, QFont::Bold, false);
mFont.setStyleHint(QFont::SansSerif);
mFont.setStyleStrategy(QFont::PreferAntialias);
}
void GraphicsBtn::SetWidth(int w)
{
mWidth = w;
SetShapes();
}
void GraphicsBtn::SetLabel(QString str)
{
mLabel = str;
}
void GraphicsBtn::ShowBtn(bool b)
{
if (b)
{
mFillBrush = &mFillOutBrush;
mFrameBrush = &mFrameOutBrush;
}
setVisible(b);
}
void GraphicsBtn::hoverEnterEvent(QGraphicsSceneHoverEvent* e)
{
mFillBrush = &mFillOverBrush;
QGraphicsItem::hoverEnterEvent(e);
}
void GraphicsBtn::hoverLeaveEvent(QGraphicsSceneHoverEvent* e)
{
mFillBrush = &mFillOutBrush;
QGraphicsItem::hoverLeaveEvent(e);
}
void GraphicsBtn::mousePressEvent(QGraphicsSceneMouseEvent*)
{
mFrameBrush = &mFrameOverBrush;
mYOffs = 1;
update(mRect);
}
void GraphicsBtn::mouseReleaseEvent(QGraphicsSceneMouseEvent* e)
{
mFrameBrush = &mFrameOutBrush;
mYOffs = 0;
if ( e->pos().x() >= 0
&& e->pos().x() <= boundingRect().width()
&& e->pos().y() >= 0
&& e->pos().y() <= boundingRect().height() )
{
emit BtnPressSignal(this);
}
update(mRect);
}
void GraphicsBtn::InitGraphics()
{
QLinearGradient fillgrad(0, 2, 0, 36);
fillgrad.setColorAt(0.0, QColor("#f7f8fa"));
fillgrad.setColorAt(0.5, QColor("#b9babc"));
mFillOutBrush = QBrush(fillgrad);
QLinearGradient fillovergrad(0, 2, 0, 36);
fillovergrad.setColorAt(0.0, QColor("#f7f8fa"));
fillovergrad.setColorAt(1.0, QColor("#b9babc"));
mFillOverBrush = QBrush(fillovergrad);
QLinearGradient framegrad(0, 0, 0, 40);
framegrad.setColorAt(1.0, QColor(0, 0, 0, 0xa0));
framegrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xa0));
mFrameOutBrush = QBrush(framegrad);
QLinearGradient frameovergrad(0, 0, 0, 40);
frameovergrad.setColorAt(0.0, QColor(0, 0, 0, 0xa0));
frameovergrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0));
mFrameOverBrush = QBrush(frameovergrad);
}
void GraphicsBtn::SetShapes()
{
mRect = QRectF(0, 0, mWidth, 38);
mRectFill = QRectF(1, 1, mWidth - 2, 36);
}
QRectF GraphicsBtn::boundingRect() const
{
const double margin = 0.5;
return mRect.adjusted(-margin, -margin, 2 * margin, 2 * margin);
}
void GraphicsBtn::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget* /* widget */)
{
painter->setPen(Qt::NoPen);
painter->setBrush(*mFrameBrush);
painter->drawRoundedRect(mRect, 20, 20);
painter->setBrush(*mFillBrush);
painter->drawRoundedRect(mRectFill, 18, 18);
if (mLabel != "")
{
painter->setRenderHint(QPainter::TextAntialiasing, true);
painter->setPen(QPen(QColor("#303133")));
painter->setFont(mFont);
painter->drawText(mRectFill.adjusted(0, mYOffs, 0, mYOffs), Qt::AlignCenter, mLabel);
}
}

View File

@ -1,76 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRAPHICSBTN_H
#define GRAPHICSBTN_H
#include <QObject>
#include <QGraphicsItem>
#include <QColor>
#include <QPen>
#include <QFont>
#include <QRadialGradient>
#include <iostream>
class GraphicsBtn : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
GraphicsBtn();
void SetWidth(int w);
void SetLabel(QString str);
void ShowBtn(bool b);
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
QRectF boundingRect() const;
signals:
void BtnPressSignal(GraphicsBtn* btn);
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent* e);
void hoverLeaveEvent(QGraphicsSceneHoverEvent* e);
void mousePressEvent(QGraphicsSceneMouseEvent* e);
void mouseReleaseEvent(QGraphicsSceneMouseEvent* e);
virtual void InitGraphics();
virtual void SetShapes();
QString mLabel;
int mWidth;
int mLabelWidth;
int mYOffs;
QRectF mRect;
QRectF mRectFill;
QRectF mIconRect;
QBrush mFillOutBrush;
QBrush mFillOverBrush;
QBrush* mFillBrush;
QBrush mFrameOutBrush;
QBrush mFrameOverBrush;
QBrush* mFrameBrush;
QFont mFont;
};
#endif // GRAPHICSBTN_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,632 +0,0 @@
/* XPM */
static char * colorcode32_xpm[] = {
"32 32 597 2",
" c None",
". c #727272",
"+ c #574E49",
"@ c #52575C",
"# c #54606B",
"$ c #616D78",
"% c #757779",
"& c #86807B",
"* c #8B8B8B",
"= c #929292",
"- c #939393",
"; c #8F8F8E",
"> c #6D6E71",
", c #4D4D53",
"' c #656155",
") c #746E5D",
"! c #7C776D",
"~ c #737478",
"{ c #6D6E74",
"] c #4A4542",
"^ c #1E4C60",
"/ c #27ACDC",
"( c #20BDF8",
"_ c #1AB6F9",
": c #17A8F4",
"< c #1B97EA",
"[ c #338BD0",
"} c #768897",
"| c #8D8A88",
"1 c #9A9A9A",
"2 c #999999",
"3 c #848484",
"4 c #2E2D2F",
"5 c #9C954A",
"6 c #F5EA6B",
"7 c #FFF467",
"8 c #FFF15D",
"9 c #FDE855",
"0 c #F2D954",
"a c #C8B567",
"b c #838182",
"c c #322C2A",
"d c #23A1C1",
"e c #28DEFF",
"f c #25CCF8",
"g c #22C2F5",
"h c #20B7F2",
"i c #1EACEF",
"j c #1C9FEB",
"k c #1992E7",
"l c #1183E7",
"m c #568ABA",
"n c #94918D",
"o c #A0A0A0",
"p c #838383",
"q c #363520",
"r c #F9F67F",
"s c #FEFA80",
"t c #FBF474",
"u c #FAF06C",
"v c #F8EB62",
"w c #F8E65B",
"x c #F6E053",
"y c #F7DB4A",
"z c #F1D148",
"A c #9B9584",
"B c #4A4441",
"C c #23A0C1",
"D c #29DEFE",
"E c #27D5FB",
"F c #26CEF8",
"G c #23C4F6",
"H c #21B9F3",
"I c #1EAFF0",
"J c #1CA3EC",
"K c #1A96E9",
"L c #1789E4",
"M c #0F77E2",
"N c #5E89B5",
"O c #9D9C9B",
"P c #A5A5A5",
"Q c #A2A2A1",
"R c #2E2C21",
"S c #FFFF88",
"T c #FDFA85",
"U c #FDF87E",
"V c #FCF476",
"W c #FAF16D",
"X c #F9ED65",
"Y c #F8E75E",
"Z c #F7E156",
"` c #F5DC4E",
" . c #F4D547",
".. c #F3CE3F",
"+. c #8E8C83",
"@. c #737272",
"#. c #1E4C61",
"$. c #26D1F9",
"%. c #25CBF8",
"&. c #22C3F5",
"*. c #1FAFF0",
"=. c #1A98E9",
"-. c #188BE6",
";. c #177EE1",
">. c #0D6CDE",
",. c #8C949A",
"'. c #ADADAD",
"). c #505158",
"!. c #CCC764",
"~. c #FDFA81",
"{. c #FDF980",
"]. c #FCF77A",
"^. c #F9ED64",
"/. c #F9E85E",
"(. c #F7E257",
"_. c #F5DD50",
":. c #F4D649",
"<. c #F3CF40",
"[. c #E0C055",
"}. c #72757E",
"|. c #564E49",
"1. c #26ACDB",
"2. c #26CDF8",
"3. c #24C6F7",
"4. c #22BFF5",
"5. c #20B7F3",
"6. c #1EADF0",
"7. c #1CA2ED",
"8. c #1A97E9",
"9. c #167EE1",
"0. c #146FDD",
"a. c #517FBA",
"b. c #AAA9A8",
"c. c #AEAEAE",
"d. c #4F4C3C",
"e. c #FFFF78",
"f. c #FCF678",
"g. c #FBF36F",
"h. c #FAEF6B",
"i. c #F9EB63",
"j. c #F6E256",
"k. c #F6DC4F",
"l. c #F4D749",
"m. c #F2CF42",
"n. c #F4C831",
"o. c #948F82",
"p. c #52565B",
"q. c #20BCF8",
"r. c #22BEF5",
"s. c #21BAF3",
"t. c #1FB2F1",
"u. c #1EA8EE",
"v. c #1BA0EB",
"w. c #1A95E8",
"x. c #1788E4",
"y. c #157CE1",
"z. c #1570DC",
"A. c #256FCF",
"B. c #ABA8A3",
"C. c #9B9B9C",
"D. c #978F51",
"E. c #FDF26C",
"F. c #FAF270",
"G. c #FBF270",
"H. c #FBF16D",
"I. c #FAF06B",
"J. c #F9E960",
"K. c #F8E55A",
"L. c #F6E054",
"M. c #F3CE40",
"N. c #F3C838",
"O. c #B4A06A",
"P. c #53606B",
"Q. c #1AB7F9",
"R. c #1FB1F1",
"S. c #1EACF0",
"T. c #1DA3ED",
"U. c #1A9AEA",
"V. c #1990E7",
"W. c #1786E4",
"X. c #1678DF",
"Y. c #146EDC",
"Z. c #1161D4",
"`. c #B2AEA7",
" + c #8F8F91",
".+ c #B3A95C",
"++ c #F9EC64",
"@+ c #F9EE67",
"#+ c #FAEF69",
"$+ c #FAEE67",
"%+ c #F9EC65",
"&+ c #F9EB61",
"*+ c #F8E65C",
"=+ c #F7E357",
"-+ c #F6DE51",
";+ c #F5DA4C",
">+ c #F4D446",
",+ c #F2CD40",
"'+ c #F1C639",
")+ c #C8AD60",
"!+ c #626E78",
"~+ c #1FADF0",
"{+ c #1EA9EE",
"]+ c #1B9CEB",
"^+ c #1A93E8",
"/+ c #188BE5",
"(+ c #167FE2",
"_+ c #1575DE",
":+ c #136ADB",
"<+ c #125FD1",
"[+ c #B5B0AA",
"}+ c #9C9C9D",
"|+ c #B7AC61",
"1+ c #F9E75C",
"2+ c #F8E95F",
"3+ c #F9E95F",
"4+ c #F8E85F",
"5+ c #F7DF52",
"6+ c #F5DB4D",
"7+ c #F3D143",
"8+ c #F2CB3D",
"9+ c #F1C537",
"0+ c #C0A65E",
"a+ c #1783E3",
"b+ c #167AE0",
"c+ c #146FDC",
"d+ c #1265D9",
"e+ c #2D6BC5",
"f+ c #B9B6B2",
"g+ c #B2B2B2",
"h+ c #A89B6A",
"i+ c #F9E353",
"j+ c #F7E457",
"k+ c #F7E459",
"l+ c #F7E458",
"m+ c #F7E254",
"n+ c #F6DF52",
"o+ c #F4D849",
"p+ c #F4D345",
"q+ c #F2CE40",
"r+ c #F1C73A",
"s+ c #F3C231",
"t+ c #A9996C",
"u+ c #857F7B",
"v+ c #338CD0",
"w+ c #1991E8",
"x+ c #1A94E8",
"y+ c #1782E3",
"z+ c #167CE1",
"A+ c #1573DD",
"B+ c #0F5ED8",
"C+ c #5B7CAD",
"D+ c #C7C7C7",
"E+ c #C8C8C8",
"F+ c #8C8A84",
"G+ c #FADE4A",
"H+ c #F6DE50",
"I+ c #F6DF51",
"J+ c #F6DE52",
"K+ c #F6DD4F",
"L+ c #F5D849",
"M+ c #F3D346",
"N+ c #F3D041",
"O+ c #F2CA3D",
"P+ c #F1C538",
"Q+ c #EFBB2D",
"R+ c #8D8C89",
"S+ c #8C8C8D",
"T+ c #758796",
"U+ c #1182E7",
"V+ c #136ADA",
"W+ c #1263D8",
"X+ c #1158CC",
"Y+ c #B2B1AE",
"Z+ c #C9C9C9",
"`+ c #A5A7AB",
" @ c #CEB865",
".@ c #F5D846",
"+@ c #F5D94B",
"@@ c #F4D84A",
"#@ c #F3D447",
"$@ c #F3D244",
"%@ c #F3CE41",
"&@ c #F1C638",
"*@ c #F1C133",
"=@ c #C1A457",
"-@ c #8B8B8D",
";@ c #5689BB",
">@ c #0F78E2",
",@ c #1574DE",
"'@ c #0753D3",
")@ c #8493A8",
"!@ c #CBCBCB",
"~@ c #CACACA",
"{@ c #989899",
"]@ c #EAC84D",
"^@ c #F3D142",
"/@ c #F3D243",
"(@ c #F3D042",
"_@ c #F2CF41",
":@ c #F2CC3F",
"<@ c #F2C93B",
"[@ c #F1C539",
"}@ c #F1C234",
"|@ c #DCB13D",
"1@ c #8E8E91",
"2@ c #95918D",
"3@ c #1365D9",
"4@ c #1058CB",
"5@ c #8493A7",
"6@ c #CCCCCC",
"7@ c #9C9B9B",
"8@ c #DEBF55",
"9@ c #F5CB36",
"0@ c #F1C83B",
"a@ c #F0C338",
"b@ c #F2BE2C",
"c@ c #D1AB49",
"d@ c #949393",
"e@ c #9D9C9A",
"f@ c #527FBA",
"g@ c #1161D5",
"h@ c #1260D1",
"i@ c #2D6AC4",
"j@ c #5B7BAC",
"k@ c #B3B1AE",
"l@ c #CDCDCD",
"m@ c #CECECE",
"n@ c #CCCCCB",
"o@ c #AAABB0",
"p@ c #AFA382",
"q@ c #D5B65B",
"r@ c #E9BE3E",
"s@ c #EEBF33",
"t@ c #E6BB3B",
"u@ c #CFAD54",
"v@ c #A79B7E",
"w@ c #9A9CA0",
"x@ c #B3AEA7",
"y@ c #B5B0AB",
"z@ c #B8B6B2",
"A@ c #B1B2B5",
"B@ c #A9ABB2",
"C@ c #A6A9B1",
"D@ c #A3A5AB",
"E@ c #A8A9AB",
"F@ c #9B9C9C",
"G@ c #8F9191",
"H@ c #9C9E9E",
"I@ c #C8C7C7",
"J@ c #B4B4B4",
"K@ c #8F8F8F",
"L@ c #ABABAB",
"M@ c #A2A1A1",
"N@ c #515B5C",
"O@ c #4B3836",
"P@ c #8D362D",
"Q@ c #A63A30",
"R@ c #A83F38",
"S@ c #985652",
"T@ c #898080",
"U@ c #A7ACAC",
"V@ c #9F9F9F",
"W@ c #484848",
"X@ c #595959",
"Y@ c #A3A3A3",
"Z@ c #9C9C9C",
"`@ c #818181",
" # c #7B7B7B",
".# c #9B9B9B",
"+# c #838484",
"@# c #2D201E",
"## c #C6260C",
"$# c #FC2303",
"%# c #F02007",
"&# c #E8200B",
"*# c #E21D0D",
"=# c #DD170C",
"-# c #D5150E",
";# c #B24544",
"># c #979999",
",# c #616161",
"'# c #4D4D4D",
")# c #D7D7D7",
"!# c #F5F5F5",
"~# c #EFEFEF",
"{# c #EDEDED",
"]# c #EBEBEB",
"^# c #EAEAEA",
"/# c #D6D6D6",
"(# c #959595",
"_# c #888888",
":# c #351612",
"<# c #FF2A02",
"[# c #F92703",
"}# c #F52605",
"|# c #F02208",
"1# c #EA200A",
"2# c #E41F0C",
"3# c #DD1C0F",
"4# c #D61A11",
"5# c #CD1412",
"6# c #BF2526",
"7# c #9C9999",
"8# c #626262",
"9# c #717171",
"0# c #F3F3EF",
"a# c #F6F6EF",
"b# c #F6F6F0",
"c# c #F3F3F0",
"d# c #F0F0EF",
"e# c #E9E9E9",
"f# c #E3E3E3",
"g# c #868686",
"h# c #909090",
"i# c #2C2F30",
"j# c #F62904",
"k# c #FA2902",
"l# c #F82704",
"m# c #F52506",
"n# c #F12308",
"o# c #EA210A",
"p# c #E51F0D",
"q# c #DE1C0E",
"r# c #D81A10",
"s# c #CF1714",
"t# c #C71415",
"u# c #B53439",
"v# c #ABB2B2",
"w# c #4E4E4E",
"x# c #F5F5F0",
"y# c #F9F9F2",
"z# c #F9F9F5",
"A# c #F9F9F4",
"B# c #F8F8F2",
"C# c #F7F7F0",
"D# c #F1F1F0",
"E# c #E8E8E8",
"F# c #E1E1E1",
"G# c #8C8C8C",
"H# c #6D7272",
"I# c #932112",
"J# c #F92603",
"K# c #F72605",
"L# c #F22406",
"M# c #EF2209",
"N# c #E41E0D",
"O# c #DE1C0F",
"P# c #D01814",
"Q# c #C71615",
"R# c #BF0C10",
"S# c #A07679",
"T# c #F2F2EF",
"U# c #FCFCF9",
"V# c #FDFDFB",
"W# c #FAFAF6",
"X# c #F4F4EF",
"Y# c #EEEEEF",
"Z# c #E4E4E4",
"`# c #D3D3D3",
" $ c #4E5556",
".$ c #E7250C",
"+$ c #F22407",
"@$ c #F22506",
"#$ c #F02307",
"$$ c #EC2109",
"%$ c #E9200B",
"&$ c #D81A11",
"*$ c #BF1518",
"=$ c #AC4046",
"-$ c #B2B5B5",
";$ c #B5B5B5",
">$ c #FDFDFD",
",$ c #FBFBF6",
"'$ c #F8F8F0",
")$ c #F0F0F0",
"!$ c #E0E0E0",
"~$ c #615150",
"{$ c #F01E08",
"]$ c #EC2209",
"^$ c #EE2309",
"/$ c #EE2208",
"($ c #EC210A",
"_$ c #E61E0C",
":$ c #E11E0D",
"<$ c #DC1B10",
"[$ c #D61911",
"}$ c #CE1715",
"|$ c #C61516",
"1$ c #BE1419",
"2$ c #B11A23",
"3$ c #ACB3B3",
"4$ c #FCFCF8",
"5$ c #FAFAF5",
"6$ c #F2F2F0",
"7$ c #A8A8A8",
"8$ c #6D5856",
"9$ c #EC1806",
"0$ c #E71F0B",
"a$ c #E7200B",
"b$ c #E51E0D",
"c$ c #D21912",
"d$ c #CA1615",
"e$ c #C41616",
"f$ c #BB1419",
"g$ c #B00F19",
"h$ c #A9B3B2",
"i$ c #F9F9F3",
"j$ c #DFDFDF",
"k$ c #B1B1B1",
"l$ c #766866",
"m$ c #E2170A",
"n$ c #E11E0E",
"o$ c #E31E0D",
"p$ c #E21E0D",
"q$ c #E01D0E",
"r$ c #D91A10",
"s$ c #D41912",
"t$ c #CD1814",
"u$ c #C11517",
"v$ c #B8131A",
"w$ c #AC1824",
"x$ c #A6AEAD",
"y$ c #F8F8F1",
"z$ c #F7F7EF",
"A$ c #A4A4A4",
"B$ c #74797A",
"C$ c #D12019",
"D$ c #D91B11",
"E$ c #DB1B0F",
"F$ c #DC1B0F",
"G$ c #D71A11",
"H$ c #D31912",
"I$ c #CE1714",
"J$ c #C91615",
"K$ c #C31517",
"L$ c #BB1418",
"M$ c #B4121B",
"N$ c #A33D46",
"O$ c #A9ACAB",
"P$ c #828282",
"Q$ c #F4F4F0",
"R$ c #DEDEDE",
"S$ c #8D8D8D",
"T$ c #6F7777",
"U$ c #AF4A48",
"V$ c #D21610",
"W$ c #D51911",
"X$ c #D51912",
"Y$ c #D11813",
"Z$ c #CC1815",
"`$ c #BE1418",
" % c #B7131A",
".% c #AE0914",
"+% c #977478",
"@% c #F1F1EF",
"#% c #EEEEEE",
"$% c #737373",
"%% c #828181",
"&% c #C71A1A",
"*% c #CA1715",
"=% c #CB1615",
"-% c #BD1418",
";% c #B1101B",
">% c #A12F3A",
",% c #9DA1A1",
"'% c #949494",
")% c #E2E2E2",
"!% c #DCDCDC",
"~% c #937C7C",
"{% c #C21416",
"]% c #C41515",
"^% c #BA1319",
"/% c #B6131A",
"(% c #B10F19",
"_% c #A3202C",
":% c #939293",
"<% c #898989",
"[% c #A2A2A2",
"}% c #8A7F80",
"|% c #B6353A",
"1% c #BA0A10",
"2% c #B91016",
"3% c #B91319",
"4% c #B6121A",
"5% c #B30C16",
"6% c #AB0915",
"7% c #9B434C",
"8% c #CFCFCF",
"9% c #758180",
"0% c #8E7D7E",
"a% c #9B595E",
"b% c #A44D53",
"c% c #9E4C52",
"d% c #945E64",
"e% c #8B8889",
"f% c #8B8E8D",
" . + @ # $ % & * = = - - - - = = ; > , ' ) ! ~ { ",
" ] ^ / ( _ : < [ } | 1 2 2 2 2 1 3 4 5 6 7 8 9 0 a b ",
" c d e f g h i j k l m n o o o o p q r s t u v w x y z A ",
" B C D E F G H I J K L M N O P P Q R S T U V W X Y Z ` ...+. ",
"@.#.e E $.%.&.H *.J =.-.;.>.,.'.'.).!.~.{.].t W ^./.(._.:.<.[.}.",
"|.1.f 2.%.3.4.5.6.7.8.-.9.0.a.b.c.d.e.f.f.t g.h.i.Y j.k.l.m.n.o.",
"p.q.g G &.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.X J.K.L.` .M.N.O.",
"P.Q.h H H 5.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+",
"!+: i I *.~+{+T.]+^+/+(+_+:+<+[+}+|+1+2+J.3+4+w =+5+6+l.7+8+9+0+",
"% < j J J 7.v.U.^+-.a+b+c+d+e+f+g+h+i+j+k+l+j+m+n+` o+p+q+r+s+t+",
"u+v+w+K =.8.x+V./+y+z+A+:+B+C+D+E+F+G+H+I+n+J+K+6+L+M+N+O+P+Q+R+",
"S+T+U+L -.-.x.W.(+b+A+V+W+X+Y+Z+Z+`+ @.@o++@@@l.#@$@%@8+&@*@=@-@",
"= | ;@>@9.9.y.X.,@c+:+W+'@)@!@~@~@!@{@]@^@/@$@(@_@:@<@[@}@|@1@= ",
"= 1 2@N >.0.z.Y.V+3@B+4@5@Z+!@6@6@!@Z+7@8@9@8+O+0@'+a@b@c@d@1 = ",
"- 2 o e@,.f@A.g@h@i@j@k@!@!@l@m@m@l@!@n@o@p@q@r@s@t@u@v@w@o 2 - ",
"- 2 o P '.b.B.x@y@z@D+Z+~@6@m@m@m@m@6@~@Z+D+A@B@C@D@E@'.P o 2 - ",
"- 2 o P '.c.F@G@H@g+I@Z+~@6@m@m@m@m@6@~@Z+Z+J@2 K@1 L@'.P o 2 - ",
"- 2 o M@N@O@P@Q@R@S@T@U@6@!@l@m@m@l@!@6@V@W@X@K@Y@Z@`@ #.#o 2 - ",
"= 1 +#@###$#%#&#*#=#-#;#>#Z+!@6@6@!@6@,#'#)#!#~#{#]#^#/#(#_#1 = ",
"= p :#<#[#}#|#1#2#3#4#5#6#7#!@~@~@6@8#9#!#0#a#b#a#c#d#e#f#L@g#= ",
"h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#Z+Z+o w#!#x#y#z#A#B#C#c#D#E#F#1 G#",
"H#I#J#K#m#L#M#o#N#O#r#P#Q#R#S#D+Z+W@)#T#y#U#V#U#W#y#C#X#Y#Z#`#`@",
" $.$+$@$L##$$$%$N#3#&$s#Q#*$=$-$;$X@!#a#z#V#>$U#,$A#'$x#)$E#!$= ",
"~${$]$^$/$($%$_$:$<$[$}$|$1$2$3$2 K@~#b#A#U#U#4$5$A#C#x#6$^#!$7$",
"8$9$0$%$%$a$b$*#3#r#c$d$e$f$g$h$K@Y@{#a#B#W#,$5$5$i$C#x#D#^#j$k$",
"l$m$n$o$o$p$q$3#r$s$t$Q#u$v$w$x$1 Z@]#c#C#y#A#A#i$y$z$0#)$E#j$A$",
"B$C$D$E$E$F$r$G$H$I$J$K$L$M$N$O$L@P$^#d#Q$C#'$C#C#z$c#6${#Z#R$S$",
"T$U$V$s$W$X$H$Y$Z$J$e$`$ %.%+%'.'. #/#e#@%Q$x#x#x#c#D##%E#j$l@$%",
" %%&%*%Z$Z$=%J$|$K$-%v$;%>%,%P P .#'%f#E##%)$6$D#d#{#E#)%!%h# ",
" ~%{%]%e$e$u$*$^%/%(%_%:%o o o o <%L@F#Z#E#^#^#E#Z#j$!%[% ",
" }%|%1%2%3%4%5%6%7%G@1 2 2 2 2 1 g#1 `#!$!$j$j$R$8%K@ ",
" 9%0%a%b%c%d%e%f%= = - - - - = = * `@= 7$k$P S$. "};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

View File

@ -1,91 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
#include <QtGui/QApplication>
#include <QLibraryInfo>
#include <QLocale>
#include <QTranslator>
#include "colorcode.h"
int main(int argc, char* argv[])
{
using namespace std;
string lang("");
if (argc > 1)
{
string str;
for (int i = 1; i < argc; ++i)
{
str = argv[i];
if (str == "-h" || str == "--help")
{
cout << "usage: ColorCode [options]" << endl;
cout << " options:" << endl;
cout << " -l cc, --lang=cc use country code cc instead of system locale, accepted values for cc: en|de|cs|fr|hu" << endl;
cout << " -h, --help prints this message ;-)" << endl;
return 0;
}
else if (str == "-l" && i < argc - 1)
{
if (std::string(argv[i + 1]) == "de" || std::string(argv[i + 1]) == "en" || std::string(argv[i + 1]) == "cs" || std::string(argv[i + 1]) == "fr" || std::string(argv[i + 1]) == "hu")
{
std::string test(argv[i]);
lang = argv[i + 1];
cerr << "Lang: " << lang << endl;
}
}
else if ( str.size() == 9
&& str.find("--lang=") != string::npos
&& (str.substr(7) == "en" || str.substr(7) == "de" || str.substr(7) == "cs" || str.substr(7) == "fr" || str.substr(7) == "hu") )
{
lang = str.substr(7);
cerr << "Lang: " << lang << endl;
}
}
}
QApplication app(argc, argv);
QTranslator qtTranslator;
if (lang == "")
{
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
}
else
{
qtTranslator.load("qt_" + QString::fromStdString(lang), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
}
app.installTranslator(&qtTranslator);
QTranslator appTranslator;
if (lang == "")
{
appTranslator.load(":/trans_" + QLocale::system().name());
}
else
{
appTranslator.load(":/trans_" + QString::fromStdString(lang));
}
app.installTranslator(&appTranslator);
ColorCode w;
w.show();
return app.exec();
}

View File

@ -1,88 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "msg.h"
using namespace std;
Msg::Msg()
{
mFont = QFont("Arial", 12, QFont::Bold, false);
mFont.setStyleHint(QFont::SansSerif);
mFont.setPixelSize(16);
mLay = new QTextLayout();
mLay->setFont(mFont);
mLay->setTextOption(QTextOption(Qt::AlignHCenter));
mUpdateRect = QRectF(0, 0, 10, 10);
}
Msg::~Msg()
{
}
void Msg::ShowMsg(const QString str)
{
mUpdateRect = boundingRect();
mLay->setText(str);
int leading = -3;
qreal h = 0;
qreal maxw = 0;
qreal maxh = 0;
mLay->beginLayout();
while (1)
{
QTextLine line = mLay->createLine();
if (!line.isValid())
{
break;
}
line.setLineWidth(280);
h += leading;
line.setPosition(QPointF(0, h));
h += line.height();
maxw = qMax(maxw, line.naturalTextWidth());
}
mLay->endLayout();
float ypos = 4 + (70 - mLay->boundingRect().height()) / 2;
maxw = qMax(mUpdateRect.width(), mLay->boundingRect().width());
maxh = qMax(mUpdateRect.height(), mLay->boundingRect().height() + ypos);
mUpdateRect = QRectF(0, 0, maxw, maxh + ypos);
update(boundingRect());
}
QRectF Msg::boundingRect() const
{
return mUpdateRect;
}
void Msg::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /* widget */)
{
painter->setRenderHint(QPainter::TextAntialiasing, true);
painter->setPen(QPen(QColor("#303133")));
float ypos = 4 + (70 - mLay->boundingRect().height()) / 2;
mLay->draw(painter, QPointF(0, ypos));
}

View File

@ -1,45 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MSG_H
#define MSG_H
#include <QGraphicsTextItem>
#include <QFont>
#include <QTextDocument>
#include <QTextBlock>
#include <QAbstractTextDocumentLayout>
#include <iostream>
class Msg : public QGraphicsTextItem
{
public:
Msg();
~Msg();
void ShowMsg(const QString str);
QRectF boundingRect() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
private:
QTextLayout* mLay;
QFont mFont;
QRectF mUpdateRect;
};
#endif // MSG_H

View File

@ -1,374 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "colorpeg.h"
#include "pegrow.h"
#include "rowhint.h"
using namespace std;
PegRow::PegRow(QObject*)
{
setAcceptedMouseButtons(0);
mIx = -1;
mPegCnt = 0;
mXOffs = 0;
mPend = QColor("#646568");
mPenl = QColor("#ecedef");
mGrad0 = QColor("#cccdcf");
mGrad1 = QColor("#fcfdff");
mColorPegs = NULL;
Reset(0, 0);
}
PegRow::~PegRow()
{
for (int i = 0; i < mPegCnt; ++i)
{
delete mColorPegs[i];
}
delete [] mColorPegs;
mColorPegs = NULL;
}
bool PegRow::IsActive() const
{
return mIsActive;
}
void PegRow::Reset(const int pegcnt, const int gamemode)
{
ClearRow();
mSolution.clear();
SetActive(false);
mSolved = false;
SetPegCnt(pegcnt);
SetGameMode(gamemode);
}
void PegRow::ClearRow()
{
if (mColorPegs == NULL) { return; };
for (int i = 0; i < mPegCnt; ++i)
{
if (mColorPegs[i] != NULL)
{
emit(RemovePegSignal(mColorPegs[i]));
}
}
}
int PegRow::GetIx() const
{
return mIx;
}
void PegRow::SetIx(const int ix)
{
mIx = ix;
}
void PegRow::SetPegCnt(const int pegcnt)
{
ClearRow();
for (int i = 0; i < mPegCnt; ++i)
{
delete mColorPegs[i];
}
delete [] mColorPegs;
mColorPegs = NULL;
mPegCnt = pegcnt;
mColorPegs = new ColorPeg* [mPegCnt];
for (int i = 0; i < mPegCnt; ++i)
{
mColorPegs[i] = NULL;
}
SetXOffs();
}
void PegRow::SetGameMode(const int gamemode)
{
mGameMode = gamemode;
}
void PegRow::SetXOffs()
{
mXOffs = 100 - mPegCnt * 20;
}
int PegRow::GetPegCnt() const
{
if (mColorPegs == NULL) { return 0; };
int cnt = 0;
int i = 0;
for (i = 0; i < mPegCnt; ++i)
{
if (mColorPegs[i] != NULL)
{
++cnt;
}
}
return cnt;
}
ColorPeg** PegRow::GetPegs()
{
return mColorPegs;
}
void PegRow::SetActive(const bool b)
{
mIsActive = b;
update(boundingRect());
}
bool PegRow::SnapCP(ColorPeg *cp)
{
if (mColorPegs == NULL)
{
return false;
}
bool snapped = false;
if (mIsActive)
{
QPointF p = mapFromParent(cp->pos());
p.rx() += 18;
p.ry() += 18;
int ix = -1;
int i;
if (p.y() >= 0 && p.y() <= 40)
{
for (i = 0; i < mPegCnt; ++i)
{
if (p.x() >= mXOffs + i * 40 && p.x() < mXOffs + (i + 1) * 40)
{
if (mColorPegs[i] != NULL)
{
emit RemovePegSignal(mColorPegs[i]);
mColorPegs[i] = NULL;
}
mColorPegs[i] = cp;
cp->SetPegRow(this);
ix = i;
cp->setPos(mapToParent(mXOffs + i * 40 + 2, 2));
break;
}
}
}
snapped = ix > -1;
CheckSolution();
}
return snapped;
}
void PegRow::ForceSnap(ColorPeg* cp, int posix)
{
if (mColorPegs == NULL)
{
return;
}
if (posix > mPegCnt - 1)
{
return;
}
if (mIsActive)
{
if (mColorPegs[posix] != NULL)
{
emit RemovePegSignal(mColorPegs[posix]);
mColorPegs[posix] = NULL;
}
mColorPegs[posix] = cp;
cp->SetPegRow(this);
cp->setPos(mapToParent(mXOffs + posix * 40 + 2, 2));
CheckSolution();
}
}
void PegRow::CloseRow()
{
mSolved = true;
if (mColorPegs == NULL)
{
}
else
{
for (int i = 0; i < mPegCnt; ++i)
{
if (mColorPegs[i] != NULL)
{
mColorPegs[i]->SetEnabled(false);
}
}
}
SetActive(false);
}
void PegRow::OpenRow()
{
mSolved = false;
if (mColorPegs == NULL)
{
}
else
{
for (int i = 0; i < mPegCnt; ++i)
{
if (mColorPegs[i] != NULL)
{
mColorPegs[i]->SetEnabled(true);
}
}
}
SetActive(true);
}
void PegRow::CheckSolution()
{
mSolution.clear();
if (mColorPegs == NULL)
{
}
else
{
for (int i = 0; i < mPegCnt; ++i)
{
if (mColorPegs[i] != NULL)
{
mSolution.push_back(mColorPegs[i]->GetPegType()->ix);
}
}
}
emit RowSolutionSignal(mIx);
}
std::vector<int> PegRow::GetSolution() const
{
return mSolution;
}
void PegRow::RemovePeg(ColorPeg *cp)
{
if (mColorPegs == NULL)
{
return;
}
for (int i = 0; i < mPegCnt; ++i)
{
if (mColorPegs[i] == cp)
{
mColorPegs[i] = NULL;
if (mIsActive)
{
CheckSolution();
}
}
}
}
QVariant PegRow::itemChange(GraphicsItemChange change, const QVariant &value)
{
return QGraphicsItem::itemChange(change, value);
}
QPainterPath PegRow::shape() const
{
QPainterPath path;
path.addRect(boundingRect());
return path;
}
QRectF PegRow::boundingRect() const
{
const int Margin = 1;
return outlineRect().adjusted(-Margin, -Margin, +Margin, +Margin);
}
QRectF PegRow::outlineRect() const
{
return QRectF(0.0, 0.0, 200.0, 40.0);
}
void PegRow::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget* /* widget */)
{
if (mPegCnt == 0)
{
return;
}
if (mIsActive)
{
mPend.setAlpha(0xff);
mPenl.setAlpha(0xff);
mGrad0.setAlpha(0xff);
mGrad1.setAlpha(0xff);
}
else if (mSolved)
{
mPend.setAlpha(0xa0);
mPenl.setAlpha(0xa0);
mGrad0.setAlpha(0xa0);
mGrad1.setAlpha(0xa0);
}
else
{
mPend.setAlpha(0x32);
mPenl.setAlpha(0x50);
mGrad0.setAlpha(0x32);
mGrad1.setAlpha(0x32);
}
painter->setPen(Qt::NoPen);
int i;
for (i = 0; i < mPegCnt; i++)
{
painter->setBrush(QBrush(mPenl));
painter->drawRect(QRectF(mXOffs + i * 40, 0.0, 39, 1));
painter->drawRect(QRectF(mXOffs + i * 40, 0.0, 1, 39));
painter->setBrush(QBrush(mPend));
painter->drawRect(QRectF(mXOffs + i * 40, 39.0, 40, 1));
painter->drawRect(QRectF(mXOffs + i * 40 + 39, 0.0, 1, 40));
QRadialGradient grad(QPointF(mXOffs + i * 40 + 10, 10), 100);
grad.setColorAt(0, mGrad0);
grad.setColorAt(1, mGrad1);
painter->setBrush(QBrush(grad));
painter->drawRect(QRectF(mXOffs + i * 40 + 1, 1.0, 38.0, 38.0));
}
}

View File

@ -1,95 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PEGROW_H
#define PEGROW_H
#include <QObject>
#include <QColor>
#include <QPen>
#include <QRadialGradient>
#include <QGraphicsItem>
#include <iostream>
#include <vector>
#include "colorcode.h"
#include "colorpeg.h"
class PegRow : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
PegRow(QObject* parent = 0);
~PegRow();
int GetIx() const;
bool IsActive() const;
int GetPegCnt() const;
ColorPeg** GetPegs();
std::vector<int> GetSolution() const;
void SetIx(const int ix);
void SetPegCnt(const int pegcnt);
void SetGameMode(const int gamemode);
void SetActive(const bool b);
bool SnapCP(ColorPeg* cp);
void ForceSnap(ColorPeg* cp, int posix);
void RemovePeg(ColorPeg* cp);
void CloseRow();
void OpenRow();
void ClearRow();
void Reset(const int pegcnt, const int gamemode);
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
QRectF boundingRect() const;
QPainterPath shape() const;
signals:
void RowSolutionSignal(int ix);
void RemovePegSignal(ColorPeg* cp);
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
std::vector<int> mSolution;
QColor mPend;
QColor mPenl;
QColor mGrad0;
QColor mGrad1;
bool mIsActive;
bool mSolved;
int mIx;
int mPegCnt;
int mGameMode;
int mXOffs;
virtual void SetXOffs();
void CheckSolution();
ColorPeg** mColorPegs;
QRectF outlineRect() const;
private slots:
//void FillRandSlot();
private:
};
#endif // PEGROW_H

View File

@ -1,314 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include "prefdialog.h"
using namespace std;
PrefDialog::PrefDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f)
{
setupUi(this);
setSizeGripEnabled(false);
mSuppressSlots = false;
InitControls();
}
PrefDialog::~PrefDialog()
{
}
void PrefDialog::InitControls()
{
mLevelPresetsCmb->addItem(tr("... Select from predefined level settings"), -1);
mLevelPresetsCmb->addItem(tr("Beginner (2 Colors, 2 Slots, Doubles)"), 0);
mLevelPresetsCmb->addItem(tr("Easy (4 Colors, 3 Slots, No Doubles)"), 1);
mLevelPresetsCmb->addItem(tr("Classic (6 Colors, 4 Slots, Doubles)"), 2);
mLevelPresetsCmb->addItem(tr("Challenging (8 Colors, 4 Slots, Doubles)"), 3);
mLevelPresetsCmb->addItem(tr("Hard (10 Colors, 5 Slots, Doubles)"), 4);
mPegCntCmb->addItem("2 " + tr("Slots"), 2);
mPegCntCmb->addItem("3 " + tr("Slots"), 3);
mPegCntCmb->addItem("4 " + tr("Slots"), 4);
mPegCntCmb->addItem("5 " + tr("Slots"), 5);
mColorCntCmb->addItem("2 " + tr("Colors"), 2);
mColorCntCmb->addItem("3 " + tr("Colors"), 3);
mColorCntCmb->addItem("4 " + tr("Colors"), 4);
mColorCntCmb->addItem("5 " + tr("Colors"), 5);
mColorCntCmb->addItem("6 " + tr("Colors"), 6);
mColorCntCmb->addItem("7 " + tr("Colors"), 7);
mColorCntCmb->addItem("8 " + tr("Colors"), 8);
mColorCntCmb->addItem("9 " + tr("Colors"), 9);
mColorCntCmb->addItem("10 " + tr("Colors"), 10);
mGameModeCmb->addItem(tr("Human vs. Computer"), ColorCode::MODE_HVM);
mGameModeCmb->addItem(tr("Computer vs. Human"), ColorCode::MODE_MVH);
mStrengthCmb->addItem(tr("Low"), CCSolver::STRENGTH_LOW);
mStrengthCmb->addItem(tr("Medium"), CCSolver::STRENGTH_MEDIUM);
mStrengthCmb->addItem(tr("High"), CCSolver::STRENGTH_HIGH);
mDelaySb->setMaximum(10000);
mDelaySb->setMinimum(0);
mDelaySb->setSingleStep(100);
mRestoreBtn = mButtonBox->button(QDialogButtonBox::RestoreDefaults);
mOkBtn = mButtonBox->button(QDialogButtonBox::Ok);
mApplyBtn = mButtonBox->button(QDialogButtonBox::Apply);
mCancelBtn = mButtonBox->button(QDialogButtonBox::Cancel);
connect(mLevelPresetsCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(LevelPresetChangedSlot()));
connect(mColorCntCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(ColorCntChangedSlot()));
connect(mPegCntCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(PegCntChangedSlot()));
connect(mSameColorsCb, SIGNAL(stateChanged(int)), this, SLOT(SameColorsChangedSlot()));
connect(mShowIndicatorsCb, SIGNAL(stateChanged(int)), this, SLOT(ShowIndicatorsChangedSlot()));
connect(mResetColorOrderBtn, SIGNAL(clicked()), this, SLOT(ResetColorOrderSlot()));
connect(mRestoreBtn, SIGNAL(clicked()), this, SLOT(RestoreDefSlot()));
connect(mApplyBtn, SIGNAL(clicked()), this, SLOT(ApplySlot()));
connect(mCancelBtn, SIGNAL(clicked()), this, SLOT(CancelSlot()));
connect(mOkBtn, SIGNAL(clicked()), this, SLOT(OkSlot()));
}
void PrefDialog::InitSettings(Settings* set)
{
mSettings = set;
SetSettings();
}
void PrefDialog::SetSettings()
{
bool sup = SetSuppressSlots(true);
mMenuBarCb->setChecked(mSettings->mShowMenuBar);
mStatusBarCb->setChecked(mSettings->mShowStatusBar);
mToolBarCb->setChecked(mSettings->mShowToolBar);
mShowIndicatorsCb->setChecked(mSettings->mShowIndicators);
if (mSettings->mIndicatorType == Settings::INDICATOR_NUMBER)
{
mNumbersRb->setChecked(true);
}
else
{
mLettersRb->setChecked(true);
}
mHideColorsCb->setChecked(mSettings->mHideColors);
CheckIndicators();
int i;
i = mColorCntCmb->findData(mSettings->mColorCnt);
if (i != -1 && mColorCntCmb->currentIndex() != i)
{
mColorCntCmb->setCurrentIndex(i);
}
i = mPegCntCmb->findData(mSettings->mPegCnt);
if (i != -1 && mPegCntCmb->currentIndex() != i)
{
mPegCntCmb->setCurrentIndex(i);
}
mSameColorsCb->setChecked(mSettings->mSameColors);
CheckLevelPresets();
i = mGameModeCmb->findData(mSettings->mGameMode);
if (i != -1 && mGameModeCmb->currentIndex() != i)
{
mGameModeCmb->setCurrentIndex(i);
}
i = mStrengthCmb->findData(mSettings->mSolverStrength);
if (i != -1 && mStrengthCmb->currentIndex() != i)
{
mStrengthCmb->setCurrentIndex(i);
}
mAutoCloseCb->setChecked(mSettings->mAutoClose);
mAutoHintsCb->setChecked(mSettings->mAutoHints);
mDelaySb->setValue(mSettings->mHintsDelay);
if (sup)
{
SetSuppressSlots(false);
}
}
void PrefDialog::LevelPresetChangedSlot()
{
int ix, i;
ix = mLevelPresetsCmb->itemData(mLevelPresetsCmb->currentIndex()).toInt();
if (ix < 0 || ix > 4)
{
return;
}
bool sup = SetSuppressSlots(true);
i = mColorCntCmb->findData(ColorCode::LEVEL_SETTINGS[ix][0]);
if (i != -1 && mColorCntCmb->currentIndex() != i)
{
mColorCntCmb->setCurrentIndex(i);
}
i = mPegCntCmb->findData(ColorCode::LEVEL_SETTINGS[ix][1]);
if (i != -1 && mPegCntCmb->currentIndex() != i)
{
mPegCntCmb->setCurrentIndex(i);
}
mSameColorsCb->setChecked((ColorCode::LEVEL_SETTINGS[ix][2] == 1));
if (sup)
{
SetSuppressSlots(false);
}
}
void PrefDialog::CheckLevelPresets()
{
int ix = -1;
for (int i = 0; i < 5; ++i)
{
if ( ColorCode::LEVEL_SETTINGS[i][0] == mColorCntCmb->itemData(mColorCntCmb->currentIndex()).toInt()
&& ColorCode::LEVEL_SETTINGS[i][1] == mPegCntCmb->itemData(mPegCntCmb->currentIndex()).toInt()
&& ColorCode::LEVEL_SETTINGS[i][2] == (int) mSameColorsCb->isChecked() )
{
ix = i;
break;
}
}
mLevelPresetsCmb->setCurrentIndex(mLevelPresetsCmb->findData(ix));
}
void PrefDialog::ColorCntChangedSlot()
{
if (!mSuppressSlots)
{
CheckLevelPresets();
}
}
void PrefDialog::PegCntChangedSlot()
{
if (!mSuppressSlots)
{
CheckLevelPresets();
}
}
void PrefDialog::SameColorsChangedSlot()
{
if (!mSuppressSlots)
{
CheckLevelPresets();
}
}
void PrefDialog::ShowIndicatorsChangedSlot()
{
if (!mSuppressSlots)
{
CheckIndicators();
}
}
void PrefDialog::CheckIndicators()
{
}
void PrefDialog::ResetColorOrderSlot()
{
emit ResetColorOrderSignal();
}
void PrefDialog::RestoreDefSlot()
{
mSettings->RestoreDefSettings();
SetSettings();
}
void PrefDialog::ApplySlot()
{
ApplySettings();
setResult(QDialog::Accepted);
hide();
}
void PrefDialog::OkSlot()
{
ApplySettings();
setResult(QDialog::Accepted);
hide();
}
void PrefDialog::CancelSlot()
{
setResult(QDialog::Rejected);
hide();
}
bool PrefDialog::SetSuppressSlots(bool b, bool force)
{
if (mSuppressSlots == b && !force)
{
return false;
}
mSuppressSlots = b;
return true;
}
void PrefDialog::ApplySettings()
{
mSettings->mShowMenuBar = mMenuBarCb->isChecked();
mSettings->mShowStatusBar = mStatusBarCb->isChecked();
mSettings->mShowToolBar = mToolBarCb->isChecked();
mSettings->mShowIndicators = mShowIndicatorsCb->isChecked();
if (mNumbersRb->isChecked())
{
mSettings->mIndicatorType = Settings::INDICATOR_NUMBER;
}
else
{
mSettings->mIndicatorType = Settings::INDICATOR_LETTER;
}
mSettings->mHideColors = mHideColorsCb->isChecked();
mSettings->mColorCnt = mColorCntCmb->itemData(mColorCntCmb->currentIndex()).toInt();
mSettings->mPegCnt = mPegCntCmb->itemData(mPegCntCmb->currentIndex()).toInt();
mSettings->mSameColors = mSameColorsCb->isChecked();
mSettings->mGameMode = mGameModeCmb->itemData(mGameModeCmb->currentIndex()).toInt();
mSettings->mSolverStrength = mStrengthCmb->itemData(mStrengthCmb->currentIndex()).toInt();
mSettings->mAutoClose = mAutoCloseCb->isChecked();
mSettings->mAutoHints = mAutoHintsCb->isChecked();
mSettings->mHintsDelay = mDelaySb->value();
mSettings->Validate();
}
QSize PrefDialog::sizeHint () const
{
return QSize(500, 400);
}

View File

@ -1,75 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PREFDIALOG_H
#define PREFDIALOG_H
#include "ui_prefdialog.h"
#include "settings.h"
#include "colorcode.h"
#include "ccsolver.h"
#include <iostream>
#include <QDialog>
class PrefDialog : public QDialog, public Ui::PrefDialog
{
Q_OBJECT
public:
PrefDialog(QWidget* parent = 0, Qt::WindowFlags f = 0);
~PrefDialog();
void InitSettings(Settings* set);
void SetSettings();
virtual QSize sizeHint () const;
signals:
void ResetColorOrderSignal();
private slots:
void ApplySlot();
void RestoreDefSlot();
void CancelSlot();
void OkSlot();
void LevelPresetChangedSlot();
void ColorCntChangedSlot();
void PegCntChangedSlot();
void SameColorsChangedSlot();
void ShowIndicatorsChangedSlot();
void ResetColorOrderSlot();
private:
bool SetSuppressSlots(bool b, bool force = false);
void InitControls();
void CheckLevelPresets();
void CheckIndicators();
void ApplySettings();
QPushButton* mRestoreBtn;
QPushButton* mOkBtn;
QPushButton* mApplyBtn;
QPushButton* mCancelBtn;
Settings* mSettings;
bool mSuppressSlots;
};
#endif // PREFDIALOG_H

View File

@ -1,434 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PrefDialog</class>
<widget class="QDialog" name="PrefDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Preferences</string>
</property>
<property name="windowIcon">
<iconset resource="resource.qrc">
<normaloff>:/img/configure.png</normaloff>:/img/configure.png</iconset>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTabWidget" name="mTabsWg">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="mAppearanceTab">
<attribute name="title">
<string>Appearance</string>
</attribute>
<widget class="QGroupBox" name="mControlsGb">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>451</width>
<height>118</height>
</rect>
</property>
<property name="toolTip">
<string/>
</property>
<property name="title">
<string>Controls</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="mMenuBarCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show or hide the Menubar.</string>
</property>
<property name="text">
<string>Show Menubar</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mToolBarCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show or hide the Toolbar.</string>
</property>
<property name="text">
<string>Show Toolbar</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mStatusBarCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show or hide the Statusbar.</string>
</property>
<property name="text">
<string>Show Statusbar</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="mIndicatorsGb">
<property name="geometry">
<rect>
<x>10</x>
<y>140</y>
<width>451</width>
<height>171</height>
</rect>
</property>
<property name="title">
<string>Indicators</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="mShowIndicatorsCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>If this option is checked, an indicator
inside each peg is displayed.</string>
</property>
<property name="text">
<string>Show Indicators inside pegs</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>30</number>
</property>
<item>
<widget class="QRadioButton" name="mLettersRb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use unique letters as indicators.</string>
</property>
<property name="text">
<string>Letter Indicators</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="mNumbersRb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use unique numbers as indicators.</string>
</property>
<property name="text">
<string>Number Indicators</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mHideColorsCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use the same neutral background color for each peg,
when indicators are shown.</string>
</property>
<property name="text">
<string>Hide Colors</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="mResetColorOrderBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Click here if you have changed the color order
and now you want to revert it to it's initial state. </string>
</property>
<property name="text">
<string>Reset Color Order</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="mGameTab">
<attribute name="title">
<string>Game Settings</string>
</attribute>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>8</x>
<y>13</y>
<width>461</width>
<height>301</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="mLevelPresetsLbl">
<property name="text">
<string>Level Presets</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="mLevelPresetsCmb">
<property name="toolTip">
<string>Select from predefined combinations
of the three different level related settings,
the number of colors, the number of slots (columns)
and the possibility of pegs of the same color in one row. </string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mSlotCntLbl">
<property name="text">
<string>Number of Slots</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="mColorCntLbl">
<property name="text">
<string>Number of Colors</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QComboBox" name="mPegCntCmb">
<property name="toolTip">
<string>Number of pegs in a single row.
Higher values are harder to guess.</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="mColorCntCmb">
<property name="toolTip">
<string>Number of all possible colors.
Higher values are harder to guess.</string>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QCheckBox" name="mSameColorsCb">
<property name="toolTip">
<string>If this option is checked, the hidden combination
may contain one or more (even all would be possible)
pegs of the same color.
If checked, the combination is generally harder to guess.</string>
</property>
<property name="text">
<string>Allow Pegs of Same Color</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="mGameModeLbl">
<property name="text">
<string>Game Mode</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QComboBox" name="mGameModeCmb">
<property name="toolTip">
<string>Select from the different game modes.
In the 1. mode you have to to guess the hidden,
computer generated combination,
In the 2. mode your computer will try to guess your
own secret combination.</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="4">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3">
<widget class="QCheckBox" name="mAutoCloseCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>If checked, a row is closed as soon as you place the last peg
and your guess is submitted immediatly.
This option only affects the Human vs. Computer game mode.</string>
</property>
<property name="text">
<string>Close Rows when the last Peg is placed</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="mAutoHintsCb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>If checked, the computer will determine the corresponding hints for the solver's guess.
This option affects only Computer vs. Human games.
If checked, you only have to place your secret combination.
Then the rest of the game runs automatically until the end.
But you can set a delay between the guesses.</string>
</property>
<property name="text">
<string>Set Hints automatically</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QSpinBox" name="mDelaySb">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Adjust the delay (in ms) between two guesses.</string>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QLabel" name="mDelayLbl">
<property name="text">
<string>Delay in ms</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="4">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="mStrenghtLbl">
<property name="text">
<string>Solver Strength</string>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QComboBox" name="mStrengthCmb">
<property name="toolTip">
<string>Select from 3 different strength levels for your computer opponent.
This option only affects the Computer vs. Human game mode.
For the computer's guess in the Human vs. Computer mode
always the highest level will be used.</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="resource.qrc"/>
</resources>
<connections/>
<designerdata>
<property name="gridDeltaX">
<number>10</number>
</property>
<property name="gridDeltaY">
<number>10</number>
</property>
<property name="gridSnapX">
<bool>true</bool>
</property>
<property name="gridSnapY">
<bool>true</bool>
</property>
<property name="gridVisible">
<bool>true</bool>
</property>
</designerdata>
</ui>

View File

@ -1,33 +0,0 @@
<RCC>
<qresource prefix="/" >
<file>docs/GPL.html</file>
<file>img/application-exit.png</file>
<file>img/document-new.png</file>
<file>img/GNU-icon16.png</file>
<file>img/GNU-icon32.png</file>
<file>img/GNU-icon64.png</file>
<file>img/GNU-icon.png</file>
<file>img/help-about.png</file>
<file>img/qt.png</file>
<file>img/story-editor.png</file>
<file>img/view-refresh.png</file>
<file>trans_de.qm</file>
<file>img/face-sad.png</file>
<file>img/edit-clear.png</file>
<file>img/edit-copy.png</file>
<file>img/system-switch-user.png</file>
<file>img/cc16.png</file>
<file>img/cc32.png</file>
<file>img/cc64.png</file>
<file>cc32.ico</file>
<file>img/business_user.png</file>
<file>trans_cs.qm</file>
<file>img/same_color_0.png</file>
<file>img/same_color_1.png</file>
<file>img/help.png</file>
<file>img/icon_female16.png</file>
<file>img/configure.png</file>
<file>trans_fr.qm</file>
<file>trans_hu.qm</file>
</qresource>
</RCC>

View File

@ -1,310 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "rowhint.h"
using namespace std;
const int RowHint::mPegPos[4][5][3] = {
{
{ 6, 14, 12 },
{ 22, 14, 12 },
{ 0, 0, 0 },
{ 0, 0, 0 },
{ 0, 0, 0 },
},
{
{ 6, 6, 12 },
{ 22, 6, 12 },
{ 14, 22, 12 },
{ 0, 0, 0 },
{ 0, 0, 0 },
},
{
{ 6, 6, 12 },
{ 22, 6, 12 },
{ 6, 22, 12 },
{ 22, 22, 12 },
{ 0, 0, 0 },
},
{
{ 4, 4, 12 },
{ 24, 4, 12 },
{ 14, 14, 12 },
{ 4, 24, 12 },
{ 24, 24, 12 }
}
};
RowHint::RowHint(QObject*)
{
mIx = -1;
mPegCnt = 0;
mPen = QPen(QColor("#808080"));
mPen.setWidth(2);
QRadialGradient grad(QPointF(10, 10), 100);
grad.setColorAt(0, QColor("#d8d8d8"));
grad.setColorAt(1, QColor("#ffffff"));
mBrush1 = QBrush(grad);
grad.setColorAt(0, QColor(216, 216, 216, 51));
grad.setColorAt(1, QColor(255, 255, 255, 51));
mBrush0 = QBrush(grad);
Reset(0, 0);
}
RowHint::~RowHint()
{
scene()->removeItem(this);
}
void RowHint::Reset(const int pegcnt, const int gamemode)
{
mActive = true;
mSolved = false;
SetPegCnt(pegcnt);
mHints.clear();
mHints.assign(mPegCnt, 0);
SetGameMode(gamemode);
SetActive(false);
}
int RowHint::GetIx() const
{
return mIx;
}
void RowHint::SetIx(const int ix)
{
mIx = ix;
}
void RowHint::SetPegCnt(const int pegcnt)
{
mPegCnt = pegcnt;
}
void RowHint::SetGameMode(const int gamemode)
{
mGameMode = gamemode;
}
bool RowHint::IsActive() const
{
return mActive;
}
void RowHint::SetActive(bool b)
{
if (b == mActive)
{
return;
}
mActive = b;
setAcceptHoverEvents(b);
setEnabled(b);
if (b)
{
if (mGameMode == ColorCode::MODE_HVM)
{
setCursor(Qt::PointingHandCursor);
setToolTip(tr("Commit Your solution"));
}
else if (mGameMode == ColorCode::MODE_MVH)
{
mSolved = true;
mHints.assign(mPegCnt, 0);
setCursor(Qt::ArrowCursor);
setToolTip(tr("Click the circles to rate my guess.\nHit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)"));
}
}
else
{
setCursor(Qt::ArrowCursor);
setToolTip(QString(""));
}
update(boundingRect());
}
std::vector<int> RowHint::GetHints()
{
return mHints;
}
void RowHint::DrawHints(std::vector<int> res)
{
mHints.clear();
mHints.assign(mPegCnt, 0);
for (unsigned i = 0; i < res.size(); ++i)
{
mHints.at(i) = res.at(i);
}
mSolved = true;
update(boundingRect());
}
void RowHint::mousePressEvent(QGraphicsSceneMouseEvent* e)
{
if (mGameMode == ColorCode::MODE_HVM)
{
bool disabled = false;
if (mActive && !mSolved)
{
if (e->button() == Qt::LeftButton)
{
SetActive(false);
emit HintPressedSignal(mIx);
disabled = true;
}
}
if (!disabled)
{
QGraphicsItem::mousePressEvent(e);
}
}
else if (mGameMode == ColorCode::MODE_MVH)
{
qreal xm = e->pos().x();
qreal ym = e->pos().y();
int posix = mPegCnt - 2;
for (int i = 0; i < mPegCnt; i++)
{
if ( xm >= mPegPos[posix][i][0] && xm <= mPegPos[posix][i][0] + mPegPos[posix][i][2]
&& ym >= mPegPos[posix][i][1] && ym <= mPegPos[posix][i][1] + mPegPos[posix][i][2])
{
++mHints.at(i);
if (mHints.at(i) > 2)
{
mHints.at(i) = 0;
}
}
}
update(boundingRect());
}
}
QPainterPath RowHint::shape() const
{
QPainterPath path;
path.addRect(boundingRect());
return path;
}
QRectF RowHint::boundingRect() const
{
const int margin = 1;
return outlineRect().adjusted(-margin, -margin, 2 * margin, 2 * margin);
}
QRectF RowHint::outlineRect() const
{
return QRectF(0.0, 0.0, 40.0, 40.0);
}
void RowHint::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /* widget */)
{
if (mPegCnt == 0)
{
return;
}
int i;
QColor pend = QColor("#646568");
QColor penl = QColor("#ecedef");
QColor grad0 = QColor("#cccdcf");
QColor grad1 = QColor("#fcfdff");
if (mActive)
{
pend.setAlpha(0xff);
penl.setAlpha(0xff);
grad0.setAlpha(0xff);
grad1.setAlpha(0xff);
}
else if (mSolved)
{
pend.setAlpha(0xa0);
penl.setAlpha(0xa0);
grad0.setAlpha(0xa0);
grad1.setAlpha(0xa0);
}
else
{
pend.setAlpha(0x32);
penl.setAlpha(0x50);
grad0.setAlpha(0x32);
grad1.setAlpha(0x32);
}
painter->setPen(Qt::NoPen);
painter->setBrush(QBrush(penl));
painter->drawRect(QRectF(0.0, 0.0, 39, 1));
painter->drawRect(QRectF(0.0, 0.0, 1, 39));
painter->setBrush(QBrush(pend));
painter->drawRect(QRectF(0.0, 39.0, 40, 1));
painter->drawRect(QRectF(39, 0.0, 1, 40));
QRadialGradient grad(QPointF(10, 10), 100);
grad.setColorAt(0, grad0);
grad.setColorAt(1, grad1);
painter->setBrush(QBrush(grad));
painter->drawRect(QRectF(1, 1.0, 38.0, 38.0));
painter->setBrush(Qt::NoBrush);
int posix = mPegCnt - 2;
QPointF x0;
for (i = 0; i < mPegCnt; i++)
{
x0 = QPointF(mPegPos[posix][i][0], mPegPos[posix][i][1]);
QLinearGradient lgrad(x0, QPointF(x0.x() + 10, x0.y() + 10));
lgrad.setColorAt(0.0, QColor(0, 0, 0, 0xa0));
lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0));
painter->setPen(QPen(QBrush(lgrad), 0.5));
painter->drawEllipse(QRectF(mPegPos[posix][i][0], mPegPos[posix][i][1], mPegPos[posix][i][2], mPegPos[posix][i][2]));
}
if (mSolved)
{
painter->setPen(Qt::NoPen);
for (unsigned i = 0; i < mHints.size(); i++)
{
if (mHints.at(i) == 0)
{
continue;
}
if (mHints.at(i) == 2)
{
painter->setBrush(QBrush(Qt::black));
}
else
{
painter->setBrush(QBrush(Qt::white));
}
painter->drawEllipse(QRectF(mPegPos[posix][i][0], mPegPos[posix][i][1], mPegPos[posix][i][2], mPegPos[posix][i][2]));
}
}
}

View File

@ -1,76 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ROWHINT_H
#define ROWHINT_H
#include <QGraphicsItem>
#include <QColor>
#include <QPen>
#include <QRadialGradient>
#include <iostream>
#include <vector>
#include "colorcode.h"
class RowHint : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
RowHint(QObject* parent = 0);
~RowHint();
int mIx;
bool mActive;
bool mSolved;
std::vector<int> mHints;
int GetIx() const;
bool IsActive() const;
std::vector<int> GetHints();
void SetIx(const int ix);
void SetPegCnt(const int pegcnt);
void SetGameMode(const int gamemode);
void SetActive(bool b);
void DrawHints(std::vector<int> res);
void Reset(const int pegcnt, const int gamemode);
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
QRectF boundingRect() const;
QPainterPath shape() const;
signals:
void HintPressedSignal(int ix);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* e);
private:
static const int mPegPos[4][5][3];
int mPegCnt;
int mGameMode;
QPen mPen;
QBrush mBrush0;
QBrush mBrush1;
QRectF outlineRect() const;
};
#endif // ROWHINT_H

View File

@ -1,213 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include "settings.h"
#include "colorcode.h"
#include "ccsolver.h"
using namespace std;
const int Settings::INDICATOR_LETTER = 0;
const int Settings::INDICATOR_NUMBER = 1;
Settings::Settings()
{
mSettings.setDefaultFormat(QSettings::IniFormat);
mSettings.setFallbacksEnabled(false);
InitSettings();
SaveSettingsMap(mDefMap);
ReadSettings();
SaveSettingsMap(mLastMap);
}
Settings::~Settings()
{
}
void Settings::InitSettings()
{
mShowToolBar = true;
mShowMenuBar = true;
mShowStatusBar = true;
mShowIndicators = false;
mIndicatorType = INDICATOR_LETTER;
mHideColors = false;
mPegCnt = 4;
mColorCnt = 8;
mSameColors = true;
mGameMode = ColorCode::MODE_HVM;
mAutoClose = false;
mAutoHints = false;
mHintsDelay = 500;
mSolverStrength = CCSolver::STRENGTH_HIGH;
}
void Settings::SaveLastSettings()
{
SaveSettingsMap(mLastMap);
}
void Settings::RestoreLastSettings()
{
RestoreSettingsMap(mLastMap);
}
void Settings::RestoreDefSettings()
{
RestoreSettingsMap(mDefMap);
}
void Settings::RestoreSettingsMap(QMap<QString, QVariant> &map)
{
mShowToolBar = map["ShowToolBar"].toBool();
mShowMenuBar = map["ShowMenuBar"].toBool();
mShowStatusBar = map["ShowStatusBar"].toBool();
mShowIndicators = map["ShowIndicators"].toBool();
mIndicatorType = map["IndicatorType"].toInt();
mHideColors = map["HideColors"].toBool();
mPegCnt = map["ColumnCount"].toInt();
mColorCnt = map["ColorCount"].toInt();
mSameColors = map["SameColors"].toBool();
mGameMode = map["GameMode"].toInt();
mAutoClose = map["AutoClose"].toBool();
mAutoHints = map["AutoHints"].toBool();
mHintsDelay = map["HintsDelay"].toInt();
mSolverStrength = map["SolverStrength"].toInt();
Validate();
}
void Settings::SaveSettingsMap(QMap<QString, QVariant> &map)
{
map["ShowToolBar"] = mShowToolBar;
map["ShowMenuBar"] = mShowMenuBar;
map["ShowStatusBar"] = mShowStatusBar;
map["ShowIndicators"] = mShowIndicators;
map["IndicatorType"] = mIndicatorType;
map["HideColors"] = mHideColors;
map["ColumnCount"] = mPegCnt;
map["ColorCount"] = mColorCnt;
map["SameColors"] = mSameColors;
map["GameMode"] = mGameMode;
map["AutoClose"] = mAutoClose;
map["AutoHints"] = mAutoHints;
map["HintsDelay"] = mHintsDelay;
map["SolverStrength"] = mSolverStrength;
}
void Settings::ReadSettings()
{
mSettings.beginGroup("Appearance");
mShowToolBar = mSettings.value("ShowToolBar", mShowToolBar).toBool();
mShowMenuBar = mSettings.value("ShowMenuBar", mShowMenuBar).toBool();
mShowStatusBar = mSettings.value("ShowStatusBar", mShowStatusBar).toBool();
mShowIndicators = mSettings.value("ShowIndicators", mShowIndicators).toBool();
mIndicatorType = mSettings.value("IndicatorType", mIndicatorType).toInt();
mHideColors = mSettings.value("HideColors", mHideColors).toBool();
mSettings.endGroup();
mSettings.beginGroup("Game");
mPegCnt = mSettings.value("ColumnCount", mPegCnt).toInt();
mColorCnt = mSettings.value("ColorCount", mColorCnt).toInt();
mSameColors = mSettings.value("SameColors", mSameColors).toBool();
mGameMode = mSettings.value("GameMode", mGameMode).toInt();
mAutoClose = mSettings.value("AutoClose", mAutoClose).toBool();
mAutoHints = mSettings.value("AutoHints", mAutoHints).toBool();
mHintsDelay = mSettings.value("HintsDelay", mHintsDelay).toInt();
mSolverStrength = mSettings.value("SolverStrength", mSolverStrength).toInt();
mSettings.endGroup();
Validate();
}
void Settings::Validate()
{
if (mIndicatorType != INDICATOR_LETTER && mIndicatorType != INDICATOR_NUMBER)
{
mIndicatorType = INDICATOR_LETTER;
}
if (mPegCnt < 2 || mPegCnt > 5)
{
mPegCnt = 4;
}
if (mColorCnt < 2 || mColorCnt > 10)
{
mColorCnt = 8;
}
if (mGameMode != ColorCode::MODE_HVM && mGameMode != ColorCode::MODE_MVH)
{
mGameMode = ColorCode::MODE_HVM;
}
if (mSolverStrength < CCSolver::STRENGTH_LOW || mSolverStrength > CCSolver::STRENGTH_HIGH)
{
mSolverStrength = CCSolver::STRENGTH_HIGH;
}
if (mHintsDelay > 10000)
{
mHintsDelay = 10000;
}
else if (mHintsDelay < 0)
{
mHintsDelay = 0;
}
}
void Settings::WriteSettings()
{
mSettings.beginGroup("Appearance");
mSettings.setValue("ShowToolBar", mShowToolBar);
mSettings.setValue("ShowMenuBar", mShowMenuBar);
mSettings.setValue("ShowStatusBar", mShowStatusBar);
mSettings.setValue("ShowIndicators", mShowIndicators);
mSettings.setValue("IndicatorType", mIndicatorType);
mSettings.setValue("HideColors", mHideColors);
mSettings.endGroup();
mSettings.beginGroup("Game");
mSettings.setValue("ColumnCount", mPegCnt);
mSettings.setValue("ColorCount", mColorCnt);
mSettings.setValue("SameColors", mSameColors);
mSettings.setValue("GameMode", mGameMode);
mSettings.setValue("AutoClose", mAutoClose);
mSettings.setValue("AutoHints", mAutoHints);
mSettings.setValue("HintsDelay", mHintsDelay);
mSettings.setValue("SolverStrength", mSolverStrength);
mSettings.endGroup();
mSettings.sync();
}

View File

@ -1,67 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QSettings>
#include <iostream>
class Settings
{
public:
Settings();
~Settings();
static const int INDICATOR_LETTER;
static const int INDICATOR_NUMBER;
void InitSettings();
void ReadSettings();
void Validate();
void SaveLastSettings();
void RestoreLastSettings();
void RestoreDefSettings();
void WriteSettings();
QSettings mSettings;
bool mShowToolBar;
bool mShowMenuBar;
bool mShowStatusBar;
bool mShowIndicators;
int mIndicatorType;
bool mHideColors;
int mPegCnt;
int mColorCnt;
bool mSameColors;
int mGameMode;
bool mAutoClose;
bool mAutoHints;
int mSolverStrength;
int mHintsDelay;
private:
void RestoreSettingsMap(QMap<QString, QVariant> &map);
void SaveSettingsMap(QMap<QString, QVariant> &map);
QMap<QString, QVariant> mDefMap;
QMap<QString, QVariant> mLastMap;
};
#endif // SETTINGS_H

View File

@ -1,97 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "solrow.h"
using namespace std;
SolRow::SolRow()
{
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
mPegCnt = 0;
mSolved = false;
mRect = QRectF(0.5, 0.5, 219, 39);
mRectC = QRectF(2, 2, 216, 36);
QLinearGradient solgrad(0, 0, 0, 40);
solgrad.setColorAt(0.0, QColor("#9fa0a2"));
solgrad.setColorAt(1.0, QColor("#8c8d8f"));
mBgBrush = QBrush(solgrad);
QLinearGradient framegrad(0, 0, 0, 40);
framegrad.setColorAt(0.0, QColor("#4e4f51"));
framegrad.setColorAt(1.0, QColor("#ebecee"));
mFramePen = QPen(QBrush(framegrad), 1);
mFont = QFont("Arial", 22, QFont::Bold, false);
mFont.setStyleHint(QFont::SansSerif);
}
void SolRow::SetState(const int pegcnt, const bool solved)
{
mPegCnt = pegcnt;
mSolved = solved;
update(boundingRect());
}
QRectF SolRow::boundingRect() const
{
const double margin = 0.5;
return mRect.adjusted(-margin, -margin, 2 * margin, 2 * margin);
}
void SolRow::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget* /* widget */)
{
if (mPegCnt == 0)
{
return;
}
int i;
painter->setBrush(mBgBrush);
painter->setPen(mFramePen);
painter->drawRoundedRect(mRect, 20, 20);
QPainterPath cpath;
cpath.addRoundedRect(mRectC, 19, 19);
painter->setClipPath(cpath);
painter->setRenderHint(QPainter::TextAntialiasing, true);
int x0 = (220 - mPegCnt * 40) / 2;
int xpos;
for (i = 0; i <= mPegCnt; ++i)
{
xpos = x0 + i * 40;
painter->setPen(Qt::NoPen);
painter->setBrush(QBrush(QColor(0x7d, 0x7e, 0x80, 0x80)));
painter->drawRect(xpos - 1, 1, 1, 38);
painter->setBrush(QBrush(QColor(0xc3, 0xc4, 0xc6, 0x80)));
painter->drawRect(xpos, 1, 1, 38);
if (i < mPegCnt)
{
painter->setPen(QPen(QColor("#ff9933")));
painter->setFont(mFont);
painter->drawText(QRectF(xpos + 3.0, 3.0, 34.0, 34.0), Qt::AlignCenter, QString('?'));
}
}
}

View File

@ -1,45 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SOLROW_H
#define SOLROW_H
#include <QGraphicsItem>
#include <iostream>
class SolRow : public QGraphicsItem
{
public:
SolRow();
void SetState(const int pegcnt, const bool solved);
QRectF boundingRect() const;
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
private:
QRectF mRect;
QRectF mRectC;
QBrush mBgBrush;
QPen mFramePen;
QFont mFont;
int mPegCnt;
bool mSolved;
};
#endif // SOLROW_H

View File

@ -1,100 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include "solutionrow.h"
using namespace std;
SolutionRow::SolutionRow(QObject*)
{
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
InitGraphics();
}
SolutionRow::~SolutionRow()
{
}
void SolutionRow::InitGraphics()
{
mRect = QRectF(0.5, 0.5, 219, 39);
mRectC = QRectF(2, 2, 216, 36);
QLinearGradient solgrad(0, 0, 0, 40);
solgrad.setColorAt(0.0, QColor("#9fa0a2"));
solgrad.setColorAt(1.0, QColor("#8c8d8f"));
mBgBrush = QBrush(solgrad);
QLinearGradient framegrad(0, 0, 0, 40);
framegrad.setColorAt(0.0, QColor("#4e4f51"));
framegrad.setColorAt(1.0, QColor("#ebecee"));
mFramePen = QPen(QBrush(framegrad), 1);
mFont = QFont("Arial", 22, QFont::Bold, false);
mFont.setStyleHint(QFont::SansSerif);
}
void SolutionRow::SetXOffs()
{
mXOffs = 110 - mPegCnt * 20;
}
QRectF SolutionRow::boundingRect() const
{
const double margin = 0.5;
return mRect.adjusted(-margin, -margin, 2 * margin, 2 * margin);
}
void SolutionRow::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget* /* widget */)
{
if (mPegCnt == 0)
{
return;
}
int i;
painter->setBrush(mBgBrush);
painter->setPen(mFramePen);
painter->drawRoundedRect(mRect, 20, 20);
QPainterPath cpath;
cpath.addRoundedRect(mRectC, 19, 19);
painter->setClipPath(cpath);
painter->setRenderHint(QPainter::TextAntialiasing, true);
int x0 = (220 - mPegCnt * 40) / 2;
int xpos;
for (i = 0; i <= mPegCnt; ++i)
{
xpos = x0 + i * 40;
painter->setPen(Qt::NoPen);
painter->setBrush(QBrush(QColor(0x7d, 0x7e, 0x80, 0x80)));
painter->drawRect(xpos - 1, 1, 1, 38);
painter->setBrush(QBrush(QColor(0xc3, 0xc4, 0xc6, 0x80)));
painter->drawRect(xpos, 1, 1, 38);
if (i < mPegCnt)
{
painter->setPen(QPen(QColor("#ff9933")));
painter->setFont(mFont);
painter->drawText(QRectF(xpos + 3.0, 3.0, 34.0, 34.0), Qt::AlignCenter, QString('?'));
}
}
}

View File

@ -1,50 +0,0 @@
/* ColorCode, a free MasterMind clone with built in solver
* Copyright (C) 2009 Dirk Laebisch
* http://www.laebisch.com/
*
* ColorCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ColorCode is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ColorCode. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SOLUTIONROW_H
#define SOLUTIONROW_H
#include <QObject>
#include <QGraphicsItem>
#include <iostream>
#include "pegrow.h"
class SolutionRow : public PegRow
{
public:
SolutionRow(QObject* parent = 0);
~SolutionRow();
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
QRectF boundingRect() const;
protected:
void SetXOffs();
private:
void InitGraphics();
QRectF mRect;
QRectF mRectC;
QBrush mBgBrush;
QPen mFramePen;
QFont mFont;
};
#endif // SOLUTIONROW_H

Binary file not shown.

View File

@ -1,667 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="cs_CZ">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>About</name>
<message>
<source>&amp;Author</source>
<translation>&amp;Autor</translation>
</message>
<message>
<source>icon</source>
<translation>ikona</translation>
</message>
<message>
<source>&amp;License</source>
<translation>&amp;Povolení</translation>
</message>
<message>
<source>A needful game to train your brain ;-)</source>
<translation>Hra potřebná pro udržení bdělosti &lt;br&gt;vašeho mozku :-)</translation>
</message>
<message>
<source>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</source>
<translation>Tento program je svobodným. Můžete jej šířit a/nebo upravovat za podmínek GNU General Public License, jak jsou zveřejněny Free Software Foundation, buď podle verze 2 licence nebo (podle své volby) podle jakékoli pozdější verze.</translation>
</message>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>About ColorCode</source>
<translation>O ColorCode</translation>
</message>
<message>
<source>&lt;br&gt;&lt;br&gt;Free MasterMind clone including a built in,&lt;br&gt;rather intelligent solver.</source>
<translation>&lt;br&gt;&lt;br&gt;Klon Free MasterMind s vestavěným&lt;br&gt;celkem schopným řešitelem.</translation>
</message>
<message>
<source>Version</source>
<translation>Verze</translation>
</message>
<message>
<source>Author</source>
<translation>Autor</translation>
</message>
</context>
<context>
<name>ColorCode</name>
<message>
<source>New Game</source>
<translation>Nová hra</translation>
</message>
<message>
<source>Do you want to give in
and start a new Game?</source>
<translation>Chcete vzdát hru
a začít novou?</translation>
</message>
<message>
<source>About Qt</source>
<translation>O Qt</translation>
</message>
<message>
<source>&amp;New Game</source>
<translation>&amp;Nová hra</translation>
</message>
<message>
<source>Ctrl+N</source>
<translation>Ctrl+N</translation>
</message>
<message>
<source>&amp;Restart Game</source>
<translation>&amp;Začít hru znovu</translation>
</message>
<message>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<source>E&amp;xit</source>
<translation>&amp;Ukončit</translation>
</message>
<message>
<source>Ctrl+Q</source>
<translation>Ctrl+Q</translation>
</message>
<message>
<source>Ctrl+T</source>
<translation>Ctrl+T</translation>
</message>
<message>
<source>Ctrl+C</source>
<translation>Ctrl+C</translation>
</message>
<message>
<source>Ctrl+A</source>
<translation>Ctrl+A</translation>
</message>
<message>
<source>About &amp;Qt</source>
<translation>O &amp;Qt</translation>
</message>
<message>
<source>&amp;Game</source>
<translation>&amp;Hra</translation>
</message>
<message>
<source>&amp;Settings</source>
<translation>&amp;Nastavení</translation>
</message>
<message>
<source>&amp;Help</source>
<translation>&amp;Nápověda</translation>
</message>
<message>
<source>Game</source>
<translation>Hra</translation>
</message>
<message>
<source>Message</source>
<translation>Hlášení</translation>
</message>
<message>
<source>The changed settings will only apply to new games!
Do you want to give in the current and start a new Game?</source>
<translation>Změny v nastavení se projeví teprve po novém spuštění hry!
Chcete vzdát nynější hru a začít novou?</translation>
</message>
<message>
<source>Place Your pegs ...</source>
<translation>Umístěte své kameny...</translation>
</message>
<message>
<source>Congratulation! You have won!</source>
<translation>Blahopřejeme! Vyhrál jste!</translation>
</message>
<message>
<source>Sorry! You lost!</source>
<translation>Promiňte, ale nezvládl jste to!</translation>
</message>
<message>
<source>Ctrl+I</source>
<translation>Ctrl+I</translation>
</message>
<message>
<source>Give In</source>
<translation>Vzdát se</translation>
</message>
<message>
<source>Do you really want to give in?</source>
<translation>Skutečně chcete hru vzdát?</translation>
</message>
<message>
<source>&amp;Throw In The Towel</source>
<translation>&amp;Vhodit ručník</translation>
</message>
<message>
<source>Ctrl+G</source>
<translation>Ctrl+G</translation>
</message>
<message>
<source>Sure, You&apos;re too weak for me!</source>
<translation>Je jasné, že jste pro příliš slabý!</translation>
</message>
<message>
<source>Ctrl+Shift+R</source>
<translation>Ctrl+Shift+R</translation>
</message>
<message>
<source>Ctrl+Shift+C</source>
<translation>Ctrl+Shift+C</translation>
</message>
<message>
<source>Fill Row by Random</source>
<translation>Naplnit řádek náhodně</translation>
</message>
<message>
<source>Duplicate Previous Row</source>
<translation>Zdvojit předchozí řádek</translation>
</message>
<message>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<source>Clear Row</source>
<translation>Vyprázdnit řádek</translation>
</message>
<message>
<source>&amp;Row</source>
<translation>&amp;Řádek</translation>
</message>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>About &amp;ColorCode</source>
<translation>O &amp;ColorCode</translation>
</message>
<message>
<source>Ctrl+M</source>
<translation>Ctrl+M</translation>
</message>
<message>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Ukázat nástrojový pruh</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Ukázat pruh s hlavní nabídkou</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Ukázat stavový pruh</translation>
</message>
<message>
<source>Allow Pegs of the Same Color</source>
<translation>Povolit kameny se stejnou barvou</translation>
</message>
<message>
<source>Level</source>
<translation>Stupeň obtížnosti</translation>
</message>
<message>
<source>Computer&apos;s Guess</source>
<translation>Nechat počítač hádat</translation>
</message>
<message>
<source>Ctrl+H</source>
<translation>Ctrl+H</translation>
</message>
<message>
<source>Press the Hint Field or Key Enter if You&apos;re done.</source>
<translation>Pokud jste hotov, klepněte na pole s radou.</translation>
</message>
<message>
<source>Disallow Pegs of the Same Color</source>
<translation>Zákázat kameny stejné barvy</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Zavřít řádky po umístění posledního kamene</translation>
</message>
<message>
<source>Ctrl+L</source>
<translation>Ctrl+L</translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Začátečník (2 barvy, 2 pole, zdvojení)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Lehká hra (4 barvy, 3 pole, bez zdvojení)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Klasická hra (6 barev, 4 pole, zdvojení)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Náročná hra (8 barev, 4 pole, zdvojení)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Těžká hra (10 barev, 5 polí, zdvojení)</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Přednastavení stupně obtížnosti</translation>
</message>
<message>
<source>Colors</source>
<translation>barev</translation>
</message>
<message>
<source>Pegs of Same Color</source>
<translation>Kameny téže barvy</translation>
</message>
<message>
<source>Slots</source>
<translation>pole</translation>
</message>
<message>
<source>Yes</source>
<translation>Ano</translation>
</message>
<message>
<source>No</source>
<translation>Ne</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Znovu nastavit pořadí barev</translation>
</message>
<message>
<source>Ctrl+Shift+L</source>
<translation>Ctrl+Shift+L</translation>
</message>
<message>
<source>Online &amp;Help</source>
<translation>&amp;Nápověda po internetu</translation>
</message>
<message>
<source>F1</source>
<translation>F1</translation>
</message>
<message>
<source>Done</source>
<translation>Hotovo</translation>
</message>
<message>
<source>Ctrl+Shift+N</source>
<translation>Ctrl+Shift+N</translation>
</message>
<message>
<source>Rate it for me</source>
<translation>Ohodnoť to pro </translation>
</message>
<message>
<source>Human vs Computer</source>
<translation>Člověk proti počítači</translation>
</message>
<message>
<source>Computer vs Human</source>
<translation>Počítač proti člověku</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Herní režim</translation>
</message>
<message>
<source>Press the button below or Key Enter if You&apos;re done.</source>
<translation>Pokud jste hotov, použijte tlačítko dole nebo klávesu Enter.</translation>
</message>
<message>
<source>Place Your secret ColorCode ...</source>
<translation>Umístěte svůj tajný ColorCode...</translation>
</message>
<message>
<source>Please rate the guess. Press OK or Key Enter if You&apos;re done.</source>
<translation>Ohodnoťte, prosím, můj návrh. Pokud jste hotov, použijte tlačítko OK nebo klávesu Enter.</translation>
</message>
<message>
<source>The impossible happened, sorry.</source>
<translation>Bohužel se stalo nemožné.</translation>
</message>
<message>
<source>Yeah! I guessed it, man!</source>
<translation>Jo! to tušil!</translation>
</message>
<message>
<source>Embarrassing! I lost a game!</source>
<translation>Trapné! tu hru ztratil!</translation>
</message>
<message>
<source>Nope! Thats impossible! Did you gave me false hints?</source>
<translation>Ne! To není možné! Dal jste mi špatné rady?</translation>
</message>
<message>
<source>Don&apos;t you like to see me winning? ;-)</source>
<translation>Nelíbí se vám, když vyhrávám? :-)</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Nastavit rady automaticky</translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
<translation>Ctrl+Shift+H</translation>
</message>
<message>
<source>Preferences</source>
<translation>Nastavení</translation>
</message>
<message>
<source>Ctrl+P</source>
<translation>Ctrl+P</translation>
</message>
<message>
<source>Show Indicators</source>
<translation>Ukázat ukazatele</translation>
</message>
<message>
<source>The chosen settings do not allow pegs of the same color!</source>
<translation>Zvolená nastavení nedovolují kameny stejné barvy.</translation>
</message>
</context>
<context>
<name>PrefDialog</name>
<message>
<source>... Select from predefined level settings</source>
<translation>... Vybrat stupeň obtížnosti</translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Začátečník (2 barvy, 2 pole, zdvojení)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Lehká hra (4 barvy, 3 pole, bez zdvojení)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Klasická hra (6 barev, 4 pole, zdvojení)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Náročná hra (8 barev, 4 pole, zdvojení)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Těžká hra (10 barev, 5 polí, zdvojení)</translation>
</message>
<message>
<source>Slots</source>
<translation>pole</translation>
</message>
<message>
<source>Colors</source>
<translation>barev</translation>
</message>
<message>
<source>Human vs. Computer</source>
<translation>Člověk proti počítači</translation>
</message>
<message>
<source>Computer vs. Human</source>
<translation>Člověk proti počítači</translation>
</message>
<message>
<source>Low</source>
<translation>Nízká</translation>
</message>
<message>
<source>Medium</source>
<translation>Střední</translation>
</message>
<message>
<source>High</source>
<translation>Vysoká</translation>
</message>
<message>
<source>Preferences</source>
<translation>Nastavení</translation>
</message>
<message>
<source>Appearance</source>
<translation>Vzhled</translation>
</message>
<message>
<source>Controls</source>
<translation>Ovládací prvky</translation>
</message>
<message>
<source>Show or hide the Menubar.</source>
<translation>Ukázat nebo skrýt pruh s hlavní nabídkou.</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Ukázat pruh s hlavní nabídkou</translation>
</message>
<message>
<source>Show or hide the Toolbar.</source>
<translation>Ukázat nebo skrýt nástrojový pruh.</translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Ukázat nástrojový pruh</translation>
</message>
<message>
<source>Show or hide the Statusbar.</source>
<translation>Ukázat nebo skrýt stavový pruh.</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Ukázat stavový pruh</translation>
</message>
<message>
<source>Indicators</source>
<translation>Ukazatelé</translation>
</message>
<message>
<source>If this option is checked, an indicator
inside each peg is displayed.</source>
<translation>Když je zapnuta tato volba, je u každého
kamene zobrazen dodatečný ukazatel.</translation>
</message>
<message>
<source>Show Indicators inside pegs</source>
<translation>Ukázat dodatečné ukazatele pro kameny</translation>
</message>
<message>
<source>Use unique letters as indicators.</source>
<translation>Použít písmena jako ukazatele.</translation>
</message>
<message>
<source>Letter Indicators</source>
<translation>Písmenní ukazatelé</translation>
</message>
<message>
<source>Use unique numbers as indicators.</source>
<translation>Použít čísla jako ukazatele.</translation>
</message>
<message>
<source>Number Indicators</source>
<translation>Číselní ukazatelé</translation>
</message>
<message>
<source>Use the same neutral background color for each peg,
when indicators are shown.</source>
<translation>Pro všechny kameny použít, v případě že jsou zobrazováni ukazatelé,
stejnou nenápadnou barvu pozadí.</translation>
</message>
<message>
<source>Hide Colors</source>
<translation>Skrýt barvy</translation>
</message>
<message>
<source>Click here if you have changed the color order
and now you want to revert it to it&apos;s initial state. </source>
<translation>Klepněte sem, pokud jste změnil pořadí barev,
a nyní to chcete vrátit do počátečního stavu.</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Znovu nastavit pořadí barev</translation>
</message>
<message>
<source>Game Settings</source>
<translation>Herní nastavení</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Přednastavení stupně obtížnosti</translation>
</message>
<message>
<source>Select from predefined combinations
of the three different level related settings,
the number of colors, the number of slots (columns)
and the possibility of pegs of the same color in one row. </source>
<translation>Vyberte z přednastavených spojení tří různých
nastavení souvisejících se stupni obtížnosti:
počet barev, počet polí (sloupců) a možnost
kamenů stejné barvy v jednom řádku.</translation>
</message>
<message>
<source>Number of Slots</source>
<translation>Počet polí</translation>
</message>
<message>
<source>Number of Colors</source>
<translation>Počet barev</translation>
</message>
<message>
<source>Number of pegs in a single row.
Higher values are harder to guess.</source>
<translation>Počet kamenů v jednom řádku.
Vyšší hodnoty je těžší uhodnout.</translation>
</message>
<message>
<source>Number of all possible colors.
Higher values are harder to guess.</source>
<translation>Celkový počet všech možných barev.
Vyšší hodnoty je těžší uhodnout.</translation>
</message>
<message>
<source>If this option is checked, the hidden combination
may contain one or more (even all would be possible)
pegs of the same color.
If checked, the combination is generally harder to guess.</source>
<translation>Když je zapnuta tato volba, skryté spojení může
obsahovat jeden nebo více kamenů stejné barvy
(dokonce je možné, že všechny).
Je-li zaškrtnuto, je spojení obecně obtížněji uhodnutelné.</translation>
</message>
<message>
<source>Allow Pegs of Same Color</source>
<translation>Povolit kameny téže barvy</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Herní režim</translation>
</message>
<message>
<source>Select from the different game modes.
In the 1. mode you have to to guess the hidden,
computer generated combination,
In the 2. mode your computer will try to guess your
own secret combination.</source>
<translation>Vyberte z různých herních režimů.
V prvním režimu musíte uhodnout skryté,
počítačem vytvořené spojení.
Ve druhém režimu se počítač pokusí uhodnout
vaše vlastní tajné spojení.</translation>
</message>
<message>
<source>If checked, a row is closed as soon as you place the last peg
and your guess is submitted immediatly.
This option only affects the Human vs. Computer game mode.</source>
<translation>Když je zapnuta tato volba, je řádek uzavřen, jakmile umístíte poslední kámen
a váš herní tah je okamžitě vyhodnocen.
Tato volba účinkuje pouze v herním režimu, kdy hraje člověk proti počítači.</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Zavřít řádky po umístění posledního kamene</translation>
</message>
<message>
<source>If checked, the computer will determine the corresponding hints for the solver&apos;s guess.
This option affects only Computer vs. Human games.
If checked, you only have to place your secret combination.
Then the rest of the game runs automatically until the end.
But you can set a delay between the guesses.</source>
<translation>Je-li zapnuta tato volba, budou automaticky vyplněna pole s ödpovídajícími radami pro odhad počítače.
Tato volba účinkuje pouze při hře počítače proti člověku.
Je-li zaškrtnuta, musíte pouze umístit své tajné spojení.
Pak běží zbytek hry automaticky do konce.
Ovšem mezi herními tahy můžete nastavit zpoždění.</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Nastavit rady automaticky</translation>
</message>
<message>
<source>Adjust the delay (in ms) between two guesses.</source>
<translation>Upravit zpoždění v milisekundách mezi dvěma herními tahy.</translation>
</message>
<message>
<source>Delay in ms</source>
<translation>Zpoždění v ms</translation>
</message>
<message>
<source>Solver Strength</source>
<translation>Síla počítače</translation>
</message>
<message>
<source>Select from 3 different strength levels for your computer opponent.
This option only affects the Computer vs. Human game mode.
For the computer&apos;s guess in the Human vs. Computer mode
always the highest level will be used.</source>
<translation>Vyberte jednu ze tří různých herních sil pro vašeho počítačového protivníka.
Tato volba účinkuje pouze v herním režimu, kdy hraje počítač proti člověku.
Pro počítačův herní tah v režimu, kdy hraje člověk proti počítači se vždy použije
nejvyšší úroveň herní síly.</translation>
</message>
</context>
<context>
<name>RowHint</name>
<message>
<source>Commit Your solution</source>
<translation>Vyzkoušet své řešení</translation>
</message>
<message>
<source>Click the circles to rate my guess.
Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)</source>
<translation>Klepněte na kruhy pro vyhodnocení mého herního tahu.
Stiskněte Ctrl+H nebo odpovídající tlačítko v nástrojovém pruhu, abyste přenesl onu záležitost s vyhodnocením na tu moji část, která je v tomto případě zcela nestranná. :-)</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -1,664 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de_DE">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>About</name>
<message>
<source>&amp;Author</source>
<translation>&amp;Autor</translation>
</message>
<message>
<source>icon</source>
<translation></translation>
</message>
<message>
<source>&amp;License</source>
<translation>&amp;Lizenz</translation>
</message>
<message>
<source>A needful game to train your brain ;-)</source>
<translation>Ein Spiel, um den Verstand&lt;br&gt;wachzuhalten ;-)</translation>
</message>
<message>
<source>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</source>
<translation> Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren, entweder gemäß Version 2 der Lizenz oder (nach Ihrer Option) jeder späteren Version.</translation>
</message>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>About ColorCode</source>
<translation>Info ColorCode</translation>
</message>
<message>
<source>&lt;br&gt;&lt;br&gt;Free MasterMind clone including a built in,&lt;br&gt;rather intelligent solver.</source>
<translation>&lt;br&gt;&lt;br&gt;Freie MasterMind-Variante mit ziemlich &lt;br&gt;intelligentem Rechner-Spieler.</translation>
</message>
<message>
<source>Version</source>
<translation>Version</translation>
</message>
<message>
<source>Author</source>
<translation>Autor</translation>
</message>
</context>
<context>
<name>ColorCode</name>
<message>
<source>New Game</source>
<translation>Neues Spiel</translation>
</message>
<message>
<source>Do you want to give in
and start a new Game?</source>
<translation>Wollen Sie aufgeben und
ein neues Spiel beginnen?</translation>
</message>
<message>
<source>About Qt</source>
<translation>Info Qt</translation>
</message>
<message>
<source>&amp;New Game</source>
<translation>&amp;Neues Spiel</translation>
</message>
<message>
<source>Ctrl+N</source>
<translation></translation>
</message>
<message>
<source>&amp;Restart Game</source>
<translation>Spiel neu &amp;beginnen</translation>
</message>
<message>
<source>Ctrl+R</source>
<translation></translation>
</message>
<message>
<source>E&amp;xit</source>
<translation>B&amp;eenden</translation>
</message>
<message>
<source>Ctrl+Q</source>
<translation></translation>
</message>
<message>
<source>Ctrl+T</source>
<translation></translation>
</message>
<message>
<source>Ctrl+C</source>
<translation></translation>
</message>
<message>
<source>Ctrl+A</source>
<translation></translation>
</message>
<message>
<source>About &amp;Qt</source>
<translation>Info &amp;Qt</translation>
</message>
<message>
<source>&amp;Game</source>
<translation>&amp;Spiel</translation>
</message>
<message>
<source>&amp;Settings</source>
<translation>&amp;Einstellungen</translation>
</message>
<message>
<source>&amp;Help</source>
<translation>&amp;Hilfe</translation>
</message>
<message>
<source>Game</source>
<translation>Spiel</translation>
</message>
<message>
<source>Message</source>
<translation>Hinweis</translation>
</message>
<message>
<source>The changed settings will only apply to new games!
Do you want to give in the current and start a new Game?</source>
<translation>Die geänderten Einstellungen werden erst in neuen Spielen berücksichtigt!
Möchten Sie das gegenwärtige Spiel aufgeben und ein neues Spiel beginnen?</translation>
</message>
<message>
<source>Place Your pegs ...</source>
<translation>Setzen Sie Ihre Steine ...</translation>
</message>
<message>
<source>Congratulation! You have won!</source>
<translation>Glückwunsch! Sie haben gewonnen!</translation>
</message>
<message>
<source>Sorry! You lost!</source>
<translation>Schade, aber Sie haben es nicht vermocht!</translation>
</message>
<message>
<source>Ctrl+I</source>
<translation></translation>
</message>
<message>
<source>Give In</source>
<translation>Aufgeben</translation>
</message>
<message>
<source>Do you really want to give in?</source>
<translation>Wollen Sie wirklich aufgeben?</translation>
</message>
<message>
<source>&amp;Throw In The Towel</source>
<translation>&amp;Handtuch werfen</translation>
</message>
<message>
<source>Ctrl+G</source>
<translation></translation>
</message>
<message>
<source>Sure, You&apos;re too weak for me!</source>
<translation>Klar, Sie sind zu schwach für mich!</translation>
</message>
<message>
<source>Ctrl+Shift+R</source>
<translation></translation>
</message>
<message>
<source>Ctrl+Shift+C</source>
<translation></translation>
</message>
<message>
<source>Fill Row by Random</source>
<translation>Reihe zufällig füllen</translation>
</message>
<message>
<source>Duplicate Previous Row</source>
<translation>Vorherige Reihe duplizieren</translation>
</message>
<message>
<source>Ctrl+D</source>
<translation></translation>
</message>
<message>
<source>Clear Row</source>
<translation>Reihe leeren</translation>
</message>
<message>
<source>&amp;Row</source>
<translation>&amp;Reihe</translation>
</message>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>About &amp;ColorCode</source>
<translation>Info &amp;ColorCode</translation>
</message>
<message>
<source>Ctrl+M</source>
<translation></translation>
</message>
<message>
<source>Ctrl+S</source>
<translation></translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Werkzeugleiste anzeigen</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Menüleiste anzeigen</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Statusleiste anzeigen</translation>
</message>
<message>
<source>Allow Pegs of the Same Color</source>
<translation>Steine gleicher Farbe erlauben</translation>
</message>
<message>
<source>Level</source>
<translation>Schwierigkeitsgrad</translation>
</message>
<message>
<source>Computer&apos;s Guess</source>
<translation>Lassen Sie Ihren Rechner raten</translation>
</message>
<message>
<source>Ctrl+H</source>
<translation></translation>
</message>
<message>
<source>Press the Hint Field or Key Enter if You&apos;re done.</source>
<translation>Fertig? Benutzen Sie das Hinweis-Feld oder die Eingabetaste.</translation>
</message>
<message>
<source>Disallow Pegs of the Same Color</source>
<translation>Keine Steine gleicher Farbe erlauben</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Reihen nach Setzen des letzten Steins auswerten</translation>
</message>
<message>
<source>Ctrl+L</source>
<translation></translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Anfänger (2 Farben, 2 Slots, Doppelte)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Leicht (4 Farben, 3 Slots, Keine Doppelten)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Klassisch (6 Farben, 4 Slots, Doppelte)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Fordernd (8 Farben, 4 Slots, Doppelte)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Schwer (10 Farben, 5 Slots, Doppelte)</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Schwierigkeitsstufen</translation>
</message>
<message>
<source>Colors</source>
<translation>Farben</translation>
</message>
<message>
<source>Pegs of Same Color</source>
<translation>Steine gleicher Farbe</translation>
</message>
<message>
<source>Slots</source>
<translation>Felder</translation>
</message>
<message>
<source>Yes</source>
<translation>Ja</translation>
</message>
<message>
<source>No</source>
<translation>Nein</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Farbreihenfolge zurücksetzen</translation>
</message>
<message>
<source>Ctrl+Shift+L</source>
<translation></translation>
</message>
<message>
<source>Online &amp;Help</source>
<translation>Online-&amp;Hilfe</translation>
</message>
<message>
<source>F1</source>
<translation></translation>
</message>
<message>
<source>Done</source>
<translation>Fertig</translation>
</message>
<message>
<source>Ctrl+Shift+N</source>
<translation></translation>
</message>
<message>
<source>Rate it for me</source>
<translation>Bewerte für mich</translation>
</message>
<message>
<source>Human vs Computer</source>
<translation>Mensch gegen Rechner</translation>
</message>
<message>
<source>Computer vs Human</source>
<translation>Rechner gegen Mensch</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Spiel Modus</translation>
</message>
<message>
<source>Press the button below or Key Enter if You&apos;re done.</source>
<translation>Fertig? Benutzen Sie den Button oder die Eingabetaste.</translation>
</message>
<message>
<source>Place Your secret ColorCode ...</source>
<translation>Platzieren Sie den geheimen ColorCode ...</translation>
</message>
<message>
<source>Please rate the guess. Press OK or Key Enter if You&apos;re done.</source>
<translation>Bitte bewerten Sie meinen Vorschlag. Nutzen Sie Ok-Button oder Eingabetaste wenn fertig.</translation>
</message>
<message>
<source>The impossible happened, sorry.</source>
<translation>Das Unmögliche ist eingetreten, leider.</translation>
</message>
<message>
<source>Yeah! I guessed it, man!</source>
<translation>Ich hab&apos;s geahnt!</translation>
</message>
<message>
<source>Embarrassing! I lost a game!</source>
<translation>Peinlich! Ich hab ein Spiel verloren!</translation>
</message>
<message>
<source>Nope! Thats impossible! Did you gave me false hints?</source>
<translation>Nein! Das ist unmöglich! Haben Sie falsch bewertet?</translation>
</message>
<message>
<source>Don&apos;t you like to see me winning? ;-)</source>
<translation>Ertragen Sie es nicht, mich gewinnen zu sehen? ;-)</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Hinweise automatisch setzen</translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
<translation></translation>
</message>
<message>
<source>Preferences</source>
<translation>Einstellungen</translation>
</message>
<message>
<source>Ctrl+P</source>
<translation></translation>
</message>
<message>
<source>Show Indicators</source>
<translation>Bezeichner anzeigen</translation>
</message>
<message>
<source>The chosen settings do not allow pegs of the same color!</source>
<translation>Die gewählten Einstellungen erlauben keine Steine gleicher Farbe!</translation>
</message>
</context>
<context>
<name>PrefDialog</name>
<message>
<source>... Select from predefined level settings</source>
<translation>... Schwierigkeitsstufe auswählen</translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Anfänger (2 Farben, 2 Slots, Doppelte)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Leicht (4 Farben, 3 Slots, Keine Doppelten)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Klassisch (6 Farben, 4 Slots, Doppelte)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Fordernd (8 Farben, 4 Slots, Doppelte)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Schwer (10 Farben, 5 Slots, Doppelte)</translation>
</message>
<message>
<source>Slots</source>
<translation>Felder</translation>
</message>
<message>
<source>Colors</source>
<translation>Farben</translation>
</message>
<message>
<source>Human vs. Computer</source>
<translation>Mensch gegen Rechner</translation>
</message>
<message>
<source>Computer vs. Human</source>
<translation>Rechner gegen Mensch</translation>
</message>
<message>
<source>Low</source>
<translation>Schwach</translation>
</message>
<message>
<source>Medium</source>
<translation>Mittel</translation>
</message>
<message>
<source>High</source>
<translation>Stark</translation>
</message>
<message>
<source>Preferences</source>
<translation>Einstellungen</translation>
</message>
<message>
<source>Appearance</source>
<translation>Erscheinungsbild</translation>
</message>
<message>
<source>Controls</source>
<translation>Bedienelemente</translation>
</message>
<message>
<source>Show or hide the Menubar.</source>
<translation>Menüleiste anzeigen oder ausblenden.</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Menüleiste anzeigen</translation>
</message>
<message>
<source>Show or hide the Toolbar.</source>
<translation>Werkzeugleiste anzeigen oder ausblenden.</translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Werkzeugleiste anzeigen</translation>
</message>
<message>
<source>Show or hide the Statusbar.</source>
<translation>Statusleiste anzeigen oder ausblenden.</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Statusleiste anzeigen</translation>
</message>
<message>
<source>Indicators</source>
<translation>Bezeichner</translation>
</message>
<message>
<source>If this option is checked, an indicator
inside each peg is displayed.</source>
<translation>Wenn diese Option aktiv ist, wird ein
zusätzlicher Bezeichner für jeden Stein angezeigt.</translation>
</message>
<message>
<source>Show Indicators inside pegs</source>
<translation>Bezeichner für Steine anzeigen</translation>
</message>
<message>
<source>Use unique letters as indicators.</source>
<translation>Buchstaben als Bezeichner verwenden.</translation>
</message>
<message>
<source>Letter Indicators</source>
<translation>Buchstaben-Bezeichner</translation>
</message>
<message>
<source>Use unique numbers as indicators.</source>
<translation>Zahlen als Bezeichner verwenden.</translation>
</message>
<message>
<source>Number Indicators</source>
<translation>Zahlen-Bezeichner</translation>
</message>
<message>
<source>Use the same neutral background color for each peg,
when indicators are shown.</source>
<translation>Die gleiche, neutrale Farbe für alle Steine verwenden,
falls Bezeichner angezeigt werden.</translation>
</message>
<message>
<source>Hide Colors</source>
<translation>Farben ausblenden</translation>
</message>
<message>
<source>Click here if you have changed the color order
and now you want to revert it to it&apos;s initial state. </source>
<translation>Klicken Sie hier, falls Sie die Farben-Anordnung geändert haben,
um diese wieder in den ursprünglichen Zustand zurückzuversetzen.</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Farbreihenfolge zurücksetzen</translation>
</message>
<message>
<source>Game Settings</source>
<translation>Spiel-Einstellungen</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Schwierigkeitsstufen</translation>
</message>
<message>
<source>Select from predefined combinations
of the three different level related settings,
the number of colors, the number of slots (columns)
and the possibility of pegs of the same color in one row. </source>
<translation>Wählen Sie eine vordefinierte Kombination
der drei verschiedenen, den Schwierigkeitsgrad
beeinflussenden Einstellungen.</translation>
</message>
<message>
<source>Number of Slots</source>
<translation>Anzahl der Felder</translation>
</message>
<message>
<source>Number of Colors</source>
<translation>Anzahl der Farben</translation>
</message>
<message>
<source>Number of pegs in a single row.
Higher values are harder to guess.</source>
<translation>Die Anzahl der Steine in einer einzelnen
Reihe. Höhere Werte sind schwerer zu erraten.</translation>
</message>
<message>
<source>Number of all possible colors.
Higher values are harder to guess.</source>
<translation>Gesamtanzahl der möglichen Farben.
Höhere Werte sind schwerer zu erraten.</translation>
</message>
<message>
<source>If this option is checked, the hidden combination
may contain one or more (even all would be possible)
pegs of the same color.
If checked, the combination is generally harder to guess.</source>
<translation>Wenn diese Option aktiv ist, können Kombinationen
Steine gleicher Farbe enthalten. Solche Kombinationen
sind etwas schwerer zu erraten.</translation>
</message>
<message>
<source>Allow Pegs of Same Color</source>
<translation>Steine gleicher Farbe erlauben</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Spiel Modus</translation>
</message>
<message>
<source>Select from the different game modes.
In the 1. mode you have to to guess the hidden,
computer generated combination,
In the 2. mode your computer will try to guess your
own secret combination.</source>
<translation>Wählen Sie einen Spiel-Modus aus.
Im 1. Fall müssen Sie versuchen, die verborgene,
rechnergenerierte Kombination zu erraten.
Im 2. Fall wird Ihr Rechner versuchen, eine geheime
Kombination Ihrer Wahl zu erraten.</translation>
</message>
<message>
<source>If checked, a row is closed as soon as you place the last peg
and your guess is submitted immediatly.
This option only affects the Human vs. Computer game mode.</source>
<translation>Wenn aktiv, wird eine Reihe als geschlossen betrachtet, sobald
Sie den letzten Stein platziert haben, und Ihr Vorschlag wird sofort
ausgewertet. Diese Option hat nur Auswirkungen in Mensch-gegen-Rechner-Spielen.</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Reihen nach Setzen des letzten Steins auswerten</translation>
</message>
<message>
<source>If checked, the computer will determine the corresponding hints for the solver&apos;s guess.
This option affects only Computer vs. Human games.
If checked, you only have to place your secret combination.
Then the rest of the game runs automatically until the end.
But you can set a delay between the guesses.</source>
<translation>Wenn aktiv, werden die Hinweisfelder zu den Rechner-Schätzungen automatisch ausgefüllt.
Diese Option betrifft nur Rechner-gegen-Mensch-Spiele.
Falls aktiv, müssen Sie nur Ihre geheime Kombination anordnen. Der Rest des Spiels
läuft dann automatisch bis zum Ende ab. Sie können allerdings eine Verzögerung bestimmen.</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Hinweise automatisch setzen</translation>
</message>
<message>
<source>Adjust the delay (in ms) between two guesses.</source>
<translation>Verzögerung (in ms) zwischen den Spielzügen.</translation>
</message>
<message>
<source>Delay in ms</source>
<translation>Verzögerung in ms</translation>
</message>
<message>
<source>Solver Strength</source>
<translation>Rechner-Stärke</translation>
</message>
<message>
<source>Select from 3 different strength levels for your computer opponent.
This option only affects the Computer vs. Human game mode.
For the computer&apos;s guess in the Human vs. Computer mode
always the highest level will be used.</source>
<translation>Wählen Sie eine der 3 verschiedenen Spielstärken für Ihren Rechner-Gegner aus.
Diese Option hat nur Einfluß auf Rechner-gegen-Mensch-Spiele.
Für die Rechner-Rat-Funktion im Mensch-gegen-Rechner-Modus wird immer die
höchste Spielstärke verwendet.</translation>
</message>
</context>
<context>
<name>RowHint</name>
<message>
<source>Commit Your solution</source>
<translation>Kombination testen</translation>
</message>
<message>
<source>Click the circles to rate my guess.
Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)</source>
<translation>Klicken Sie die Kreise, um meinen Vorschlag zu bewerten.
Drücken Sie Strg+H oder die entsprechende Werkzeugleisten-Schaltfläche, um die Bewertung einem unparteiischen Teil von mir zu übertragen ;-)</translation>
</message>
</context>
</TS>

View File

@ -1 +0,0 @@
<クd<>箆!ソ`。スン

View File

@ -1,640 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>About</name>
<message>
<source>&amp;Author</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>icon</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;License</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>A needful game to train your brain ;-)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ColorCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About ColorCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;br&gt;&lt;br&gt;Free MasterMind clone including a built in,&lt;br&gt;rather intelligent solver.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Author</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ColorCode</name>
<message>
<source>New Game</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you want to give in
and start a new Game?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About Qt</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;New Game</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+N</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Restart Game</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>E&amp;xit</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+Q</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+T</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+C</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+A</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About &amp;Qt</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Game</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Game</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Message</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The changed settings will only apply to new games!
Do you want to give in the current and start a new Game?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Place Your pegs ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Congratulation! You have won!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sorry! You lost!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+I</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Give In</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want to give in?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Throw In The Towel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+G</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sure, You&apos;re too weak for me!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+Shift+R</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+Shift+C</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Fill Row by Random</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Previous Row</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+D</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Clear Row</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Row</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ColorCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About &amp;ColorCode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+M</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+S</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Menubar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Statusbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Allow Pegs of the Same Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer&apos;s Guess</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+H</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Press the Hint Field or Key Enter if You&apos;re done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Disallow Pegs of the Same Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+L</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Level Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Colors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Pegs of Same Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Slots</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset Color Order</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+Shift+L</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Online &amp;Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>F1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+Shift+N</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rate it for me</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Human vs Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer vs Human</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Game Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Press the button below or Key Enter if You&apos;re done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Place Your secret ColorCode ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Please rate the guess. Press OK or Key Enter if You&apos;re done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The impossible happened, sorry.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Yeah! I guessed it, man!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Embarrassing! I lost a game!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Nope! Thats impossible! Did you gave me false hints?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Don&apos;t you like to see me winning? ;-)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Ctrl+P</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Indicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The chosen settings do not allow pegs of the same color!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PrefDialog</name>
<message>
<source>... Select from predefined level settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Slots</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Colors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Human vs. Computer</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Computer vs. Human</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Low</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>High</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Appearance</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Controls</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show or hide the Menubar.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Menubar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show or hide the Toolbar.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show or hide the Statusbar.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Statusbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Indicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If this option is checked, an indicator
inside each peg is displayed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Indicators inside pegs</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use unique letters as indicators.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Letter Indicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use unique numbers as indicators.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Number Indicators</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Use the same neutral background color for each peg,
when indicators are shown.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Hide Colors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Click here if you have changed the color order
and now you want to revert it to it&apos;s initial state. </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset Color Order</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Game Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Level Presets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select from predefined combinations
of the three different level related settings,
the number of colors, the number of slots (columns)
and the possibility of pegs of the same color in one row. </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Number of Slots</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Number of Colors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Number of pegs in a single row.
Higher values are harder to guess.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Number of all possible colors.
Higher values are harder to guess.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If this option is checked, the hidden combination
may contain one or more (even all would be possible)
pegs of the same color.
If checked, the combination is generally harder to guess.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Allow Pegs of Same Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Game Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select from the different game modes.
In the 1. mode you have to to guess the hidden,
computer generated combination,
In the 2. mode your computer will try to guess your
own secret combination.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If checked, a row is closed as soon as you place the last peg
and your guess is submitted immediatly.
This option only affects the Human vs. Computer game mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>If checked, the computer will determine the corresponding hints for the solver&apos;s guess.
This option affects only Computer vs. Human games.
If checked, you only have to place your secret combination.
Then the rest of the game runs automatically until the end.
But you can set a delay between the guesses.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Adjust the delay (in ms) between two guesses.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delay in ms</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Solver Strength</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Select from 3 different strength levels for your computer opponent.
This option only affects the Computer vs. Human game mode.
For the computer&apos;s guess in the Human vs. Computer mode
always the highest level will be used.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RowHint</name>
<message>
<source>Commit Your solution</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Click the circles to rate my guess.
Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -1,660 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr_FR">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>About</name>
<message>
<source>&amp;Author</source>
<translation>&amp;Auteur</translation>
</message>
<message>
<source>icon</source>
<translation>icône</translation>
</message>
<message>
<source>&amp;License</source>
<translation>&amp;Licence</translation>
</message>
<message>
<source>A needful game to train your brain ;-)</source>
<translation>Un programme incontournable pour entraîner votre cerveau ;-)</translation>
</message>
<message>
<source>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</source>
<translation>Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier selon les termes de la GNU General Public License (licence générale publique du projet GNU), telle qu&apos;elle est publiée par la Free Software Foundation (Fondation pour le Logiciel Libre), soit sous sa version 2, soit (selon votre choix) sous n&apos;importe quelle version ultérieure.</translation>
</message>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>About ColorCode</source>
<translation>À propos de ColorCode</translation>
</message>
<message>
<source>&lt;br&gt;&lt;br&gt;Free MasterMind clone including a built in,&lt;br&gt;rather intelligent solver.</source>
<translation>&lt;br&gt;&lt;br&gt;Clone du logiciel MasterMind incluant un solveur plutôt malin.</translation>
</message>
<message>
<source>Version</source>
<translation>Version</translation>
</message>
<message>
<source>Author</source>
<translation>Auteur</translation>
</message>
</context>
<context>
<name>ColorCode</name>
<message>
<source>New Game</source>
<translation>Nouvelle partie</translation>
</message>
<message>
<source>Do you want to give in
and start a new Game?</source>
<translation>Voulez-vous abandonner
et démarrer une nouvelle partie ?</translation>
</message>
<message>
<source>About Qt</source>
<translation>À propos de Qt</translation>
</message>
<message>
<source>&amp;New Game</source>
<translation>&amp;Nouvelle partie</translation>
</message>
<message>
<source>Ctrl+N</source>
<translation></translation>
</message>
<message>
<source>&amp;Restart Game</source>
<translation>&amp;Redémarrer la partie</translation>
</message>
<message>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<source>E&amp;xit</source>
<translation>&amp;Quitter</translation>
</message>
<message>
<source>Ctrl+Q</source>
<translation></translation>
</message>
<message>
<source>Ctrl+T</source>
<translation></translation>
</message>
<message>
<source>Ctrl+C</source>
<translation></translation>
</message>
<message>
<source>Ctrl+A</source>
<translation></translation>
</message>
<message>
<source>About &amp;Qt</source>
<translation>À propos de &amp;Qt</translation>
</message>
<message>
<source>&amp;Game</source>
<translation>&amp;Partie</translation>
</message>
<message>
<source>&amp;Settings</source>
<translation>&amp;Préférences</translation>
</message>
<message>
<source>&amp;Help</source>
<translation>&amp;Aide</translation>
</message>
<message>
<source>Game</source>
<translation>Partie</translation>
</message>
<message>
<source>Message</source>
<translation></translation>
</message>
<message>
<source>The changed settings will only apply to new games!
Do you want to give in the current and start a new Game?</source>
<translation>Les préférences modifiées ne s&apos;appliqueront qu&apos;aux nouvelles parties !
Voulez-vous abandonner la partie et en démarrer une nouvelle ?</translation>
</message>
<message>
<source>Place Your pegs ...</source>
<translation>Placez vos fiches...</translation>
</message>
<message>
<source>Congratulation! You have won!</source>
<translation>Congratulations ! Vous gagnâtes !</translation>
</message>
<message>
<source>Sorry! You lost!</source>
<translation>Désolé ! Vous perdîtes !</translation>
</message>
<message>
<source>Ctrl+I</source>
<translation></translation>
</message>
<message>
<source>Give In</source>
<translation>Abandonner</translation>
</message>
<message>
<source>Do you really want to give in?</source>
<translation>Voulez-vous réellement abandonner ?</translation>
</message>
<message>
<source>&amp;Throw In The Towel</source>
<translation>&amp;Donner sa langue au chat</translation>
</message>
<message>
<source>Ctrl+G</source>
<translation></translation>
</message>
<message>
<source>Sure, You&apos;re too weak for me!</source>
<translation>Vous êtes trop faible pour moi ; c&apos;est sûr !</translation>
</message>
<message>
<source>Ctrl+Shift+R</source>
<translation></translation>
</message>
<message>
<source>Ctrl+Shift+C</source>
<translation></translation>
</message>
<message>
<source>Fill Row by Random</source>
<translation>Garnir la rangée au hasard</translation>
</message>
<message>
<source>Duplicate Previous Row</source>
<translation>Dupliquer la rangée précédente</translation>
</message>
<message>
<source>Ctrl+D</source>
<translation></translation>
</message>
<message>
<source>Clear Row</source>
<translation>Effacer la rangée</translation>
</message>
<message>
<source>&amp;Row</source>
<translation>&amp;Rangée</translation>
</message>
<message>
<source>ColorCode</source>
<translation></translation>
</message>
<message>
<source>About &amp;ColorCode</source>
<translation>À propos de &amp;ColorCode</translation>
</message>
<message>
<source>Ctrl+M</source>
<translation></translation>
</message>
<message>
<source>Ctrl+S</source>
<translation></translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Afficher la barre d&apos;outils</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Afficher la barre de menu</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Afficher la barre d&apos;état</translation>
</message>
<message>
<source>Allow Pegs of the Same Color</source>
<translation>Autoriser plusieurs fiches de même couleur</translation>
</message>
<message>
<source>Level</source>
<translation>Niveau</translation>
</message>
<message>
<source>Computer&apos;s Guess</source>
<translation>Essai de l&apos;ordinateur</translation>
</message>
<message>
<source>Ctrl+H</source>
<translation></translation>
</message>
<message>
<source>Press the Hint Field or Key Enter if You&apos;re done.</source>
<translation>Cliquer sur le champ des fiches d&apos;indices ou pressez &lt;Entrée&gt; quand vous êtes prêt.</translation>
</message>
<message>
<source>Disallow Pegs of the Same Color</source>
<translation>Interdire plusieurs fiches de même couleur</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Finaliser la rangée quand la dernière fiche est placée</translation>
</message>
<message>
<source>Ctrl+L</source>
<translation></translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Débutant (2 couleurs, 2 trous, doubles)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Facile (4 couleurs, 3 trous, pas de doubles)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Classique (6 couleurs, 4 trous, doubles)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Évolué (8 couleurs, 4 trous, doubles)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Difficile (10 couleurs, 5 trous, doubles)</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Niveaux</translation>
</message>
<message>
<source>Colors</source>
<translation>Couleurs</translation>
</message>
<message>
<source>Pegs of Same Color</source>
<translation>Fiches de même couleurs autorisées</translation>
</message>
<message>
<source>Slots</source>
<translation>Trous</translation>
</message>
<message>
<source>Yes</source>
<translation>Oui</translation>
</message>
<message>
<source>No</source>
<translation>Non</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Réinitialiser l&apos;ordre des couleurs</translation>
</message>
<message>
<source>Ctrl+Shift+L</source>
<translation></translation>
</message>
<message>
<source>Online &amp;Help</source>
<translation>&amp;Aide en ligne</translation>
</message>
<message>
<source>F1</source>
<translation></translation>
</message>
<message>
<source>Done</source>
<translation>Fait</translation>
</message>
<message>
<source>Ctrl+Shift+N</source>
<translation></translation>
</message>
<message>
<source>Rate it for me</source>
<translation>Évaluer pour moi</translation>
</message>
<message>
<source>Human vs Computer</source>
<translation>Humain contre Ordinateur</translation>
</message>
<message>
<source>Computer vs Human</source>
<translation>Ordinateur contre Humain</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Mode de jeu</translation>
</message>
<message>
<source>Press the button below or Key Enter if You&apos;re done.</source>
<translation>Cliquer le bouton ci-dessous ou presser &lt;Entrée&gt; quand vous êtes prêt.</translation>
</message>
<message>
<source>Place Your secret ColorCode ...</source>
<translation>Placez votre code couleur secret...</translation>
</message>
<message>
<source>Please rate the guess. Press OK or Key Enter if You&apos;re done.</source>
<translation>Veuillez évaluer l&apos;essai. Cliquer OK ou presser &lt;Entrée&gt; quand vous êtes prêt.</translation>
</message>
<message>
<source>The impossible happened, sorry.</source>
<translation>L&apos;impossible advint, désolé.</translation>
</message>
<message>
<source>Yeah! I guessed it, man!</source>
<translation>Youpi! Je l&apos;ai deviné !</translation>
</message>
<message>
<source>Embarrassing! I lost a game!</source>
<translation>Embarassant ! J&apos;ai perdu la partie !</translation>
</message>
<message>
<source>Nope! Thats impossible! Did you gave me false hints?</source>
<translation>Nenni ! Ceci est impossible ! M&apos;avez-vous donné de faux indices ?</translation>
</message>
<message>
<source>Don&apos;t you like to see me winning? ;-)</source>
<translation>Aimez-vous me voir gagner ? ;-)</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Afficher les indices automatiquement</translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
<translation></translation>
</message>
<message>
<source>Preferences</source>
<translation>Préférences</translation>
</message>
<message>
<source>Ctrl+P</source>
<translation></translation>
</message>
<message>
<source>Show Indicators</source>
<translation>Montrer les indicateurs sur les fiches</translation>
</message>
<message>
<source>The chosen settings do not allow pegs of the same color!</source>
<translation>Les préférences choisies ne permettent pas plusieurs fiches de même couleur !</translation>
</message>
</context>
<context>
<name>PrefDialog</name>
<message>
<source>... Select from predefined level settings</source>
<translation>... Sélectionner à partir des préférences de niveau</translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Débutant (2 couleurs, 2 trous, doubles)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Facile (4 couleurs, 3 trous, pas de doubles)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Classique (6 couleurs, 4 trous, doubles)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Évolué (8 couleurs, 4 trous, doubles)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Difficile (10 couleurs, 5 trous, doubles)</translation>
</message>
<message>
<source>Slots</source>
<translation>Trous</translation>
</message>
<message>
<source>Colors</source>
<translation>Couleurs</translation>
</message>
<message>
<source>Human vs. Computer</source>
<translation>Humain contre Ordinateur</translation>
</message>
<message>
<source>Computer vs. Human</source>
<translation>Ordinateur contre Humain</translation>
</message>
<message>
<source>Low</source>
<translation>Bas</translation>
</message>
<message>
<source>Medium</source>
<translation>Moyen</translation>
</message>
<message>
<source>High</source>
<translation>Élevé</translation>
</message>
<message>
<source>Preferences</source>
<translation>Préférences</translation>
</message>
<message>
<source>Appearance</source>
<translation>Apparence</translation>
</message>
<message>
<source>Controls</source>
<translation>Contrôles</translation>
</message>
<message>
<source>Show or hide the Menubar.</source>
<translation>Afficher ou cacher la barre de menu.</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Afficher la barre de menu</translation>
</message>
<message>
<source>Show or hide the Toolbar.</source>
<translation>Afficher ou cacher la barre d&apos;outils.</translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Afficher la barre d&apos;outils</translation>
</message>
<message>
<source>Show or hide the Statusbar.</source>
<translation>Afficher ou cacher la barre d&apos;état.</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Afficher la barre d&apos;état</translation>
</message>
<message>
<source>Indicators</source>
<translation>Indicateurs de fiche</translation>
</message>
<message>
<source>If this option is checked, an indicator
inside each peg is displayed.</source>
<translation>Si cette option est cochée, un indicateur
est affiché à l&apos;intérieur de chaque fiche.</translation>
</message>
<message>
<source>Show Indicators inside pegs</source>
<translation>Montrer les indicateurs sur les fiches</translation>
</message>
<message>
<source>Use unique letters as indicators.</source>
<translation>Utiliser des lettres uniques comme indicateurs.</translation>
</message>
<message>
<source>Letter Indicators</source>
<translation>Lettres indicateur</translation>
</message>
<message>
<source>Use unique numbers as indicators.</source>
<translation>Utiliser des chiffres uniques comme indicateurs.</translation>
</message>
<message>
<source>Number Indicators</source>
<translation>Chiffres indicateur</translation>
</message>
<message>
<source>Use the same neutral background color for each peg,
when indicators are shown.</source>
<translation>Utiliser la même couleur de fond neutre pour chaque fiche,
quand les indicateurs sont affichés.</translation>
</message>
<message>
<source>Hide Colors</source>
<translation>Cacher les couleurs</translation>
</message>
<message>
<source>Click here if you have changed the color order
and now you want to revert it to it&apos;s initial state. </source>
<translation>Cliquer ici si vous avez changé l&apos;ordre des couleurs
et que vous voulez revenir à son état initial.</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Réinitialiser l&apos;ordre des couleurs</translation>
</message>
<message>
<source>Game Settings</source>
<translation>Préférences de jeu</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Niveaux prédéfinis</translation>
</message>
<message>
<source>Select from predefined combinations
of the three different level related settings,
the number of colors, the number of slots (columns)
and the possibility of pegs of the same color in one row. </source>
<translation>Sélectionner un niveau à partir de
niveaux prédéfinis.</translation>
</message>
<message>
<source>Number of Slots</source>
<translation>Nombre de trous</translation>
</message>
<message>
<source>Number of Colors</source>
<translation>Nombre de couleurs</translation>
</message>
<message>
<source>Number of pegs in a single row.
Higher values are harder to guess.</source>
<translation>Nombre de fiches sur une rangée.
Plus le nombre est élevé, plus la combinaison
est difficile à deviner.</translation>
</message>
<message>
<source>Number of all possible colors.
Higher values are harder to guess.</source>
<translation>Nombre de couleurs autorisées.
Plus le nombre est élevé, plus la combinaison
est difficile à deviner.</translation>
</message>
<message>
<source>If this option is checked, the hidden combination
may contain one or more (even all would be possible)
pegs of the same color.
If checked, the combination is generally harder to guess.</source>
<translation>Si cette option est cochée, la combinaison cachée
peut contenir une ou plusieurs (ou toutes) fiches
de même couleur. Dans ce cas, la combinaison est
généralement plus difficile à deviner.</translation>
</message>
<message>
<source>Allow Pegs of Same Color</source>
<translation>Autoriser plusieurs fiches de même couleur</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Mode de jeu</translation>
</message>
<message>
<source>Select from the different game modes.
In the 1. mode you have to to guess the hidden,
computer generated combination,
In the 2. mode your computer will try to guess your
own secret combination.</source>
<translation>Sélectionner un mode de jeu parmi deux
modes prédéfinis.</translation>
</message>
<message>
<source>If checked, a row is closed as soon as you place the last peg
and your guess is submitted immediatly.
This option only affects the Human vs. Computer game mode.</source>
<translation>Si cette opions est cochée, votre essai est immédiatement
évalué dès que la dernière fiche est placée dans son trou.</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Finaliser la rangée quand la dernière fiche est placée</translation>
</message>
<message>
<source>If checked, the computer will determine the corresponding hints for the solver&apos;s guess.
This option affects only Computer vs. Human games.
If checked, you only have to place your secret combination.
Then the rest of the game runs automatically until the end.
But you can set a delay between the guesses.</source>
<translation>Si cette option est cochée, l&apos;ordinateur déterminera les indices pour l&apos;essai.
Cette option affecte uniquement les jeus Ordinateur contre Humain.
Ensuite, le restant du jeu se déroule automatiquement jusques à la fin.
Mais vous pouvez régler un délai entre les essais.</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Afficher les indices automatiquement</translation>
</message>
<message>
<source>Adjust the delay (in ms) between two guesses.</source>
<translation>Régler le délai (en millisecondes) entre deux essais.</translation>
</message>
<message>
<source>Delay in ms</source>
<translation>Délai en millisecondes</translation>
</message>
<message>
<source>Solver Strength</source>
<translation>Force du solveur</translation>
</message>
<message>
<source>Select from 3 different strength levels for your computer opponent.
This option only affects the Computer vs. Human game mode.
For the computer&apos;s guess in the Human vs. Computer mode
always the highest level will be used.</source>
<translation>Sélectionner la force de votre adversaire parmi trois niveaux prédéfinis.</translation>
</message>
</context>
<context>
<name>RowHint</name>
<message>
<source>Commit Your solution</source>
<translation>Envoyer votre solution</translation>
</message>
<message>
<source>Click the circles to rate my guess.
Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)</source>
<translation>Cliquer les cercles pour évaluer mon essai.
Pressez Ctrl+H ou le bouton de barre d&apos;outils pour que je le fasse à votre place
de la manière la plus impartiales possible ;-)</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -1,666 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="hu_HU">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>About</name>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>A needful game to train your brain ;-)</source>
<translation>Az agytekervények megmozgatására szolgáló játék ;-)</translation>
</message>
<message>
<source>&lt;br&gt;&lt;br&gt;Free MasterMind clone including a built in,&lt;br&gt;rather intelligent solver.</source>
<translation>&lt;br&gt;&lt;br&gt;Egy ingyenes MasterMind klón,&lt;br&gt; kiegészítve egy meglehetősen intelligens megoldóval.</translation>
</message>
<message>
<source>Version</source>
<translation>Verzió</translation>
</message>
<message>
<source>Author</source>
<translation>Szerző</translation>
</message>
<message>
<source>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</source>
<translation>Ez a program egy szabad szoftver, amit továbbadhatsz és/vagy módosíthatsz a GNU General Public Licensz alapján, amit a Free Software Foundation adott ki; a 2. Licensz verzió szerint, vagy bármely későbbi (tetszés szerint) verzió alapján.</translation>
</message>
<message>
<source>About ColorCode</source>
<translation>Névjegy: ColorCode</translation>
</message>
<message>
<source>&amp;Author</source>
<translation>&amp;Szerző</translation>
</message>
<message>
<source>icon</source>
<translation>ikon</translation>
</message>
<message>
<source>&amp;License</source>
<translation>&amp;Licensz</translation>
</message>
</context>
<context>
<name>ColorCode</name>
<message>
<source>ColorCode</source>
<translation>ColorCode</translation>
</message>
<message>
<source>Done</source>
<translation>Befejez</translation>
</message>
<message>
<source>&amp;New Game</source>
<translation>&amp;Új játék</translation>
</message>
<message>
<source>Ctrl+N</source>
<translation>Ctrl+N</translation>
</message>
<message>
<source>&amp;Restart Game</source>
<translation>&amp;Játék újrakezdése</translation>
</message>
<message>
<source>Ctrl+Shift+N</source>
<translation>Ctrl+Shift+N</translation>
</message>
<message>
<source>&amp;Throw In The Towel</source>
<translation>Játék &amp;feladása</translation>
</message>
<message>
<source>Ctrl+G</source>
<translation>Ctrl+G</translation>
</message>
<message>
<source>E&amp;xit</source>
<translation>&amp;Kilép</translation>
</message>
<message>
<source>Ctrl+Q</source>
<translation>Ctrl+Q</translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Eszköztár mutatása</translation>
</message>
<message>
<source>Ctrl+T</source>
<translation>Ctrl+T</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Menüsor mutatása</translation>
</message>
<message>
<source>Ctrl+M</source>
<translation>Ctrl+M</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Állapotsor mutatása</translation>
</message>
<message>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Szín sorrend nullázása</translation>
</message>
<message>
<source>Ctrl+Shift+R</source>
<translation>Ctrl+Shift+R</translation>
</message>
<message>
<source>Show Indicators</source>
<translation>Jelzők használata</translation>
</message>
<message>
<source>Ctrl+Shift+L</source>
<translation>Ctrl+Shift+L</translation>
</message>
<message>
<source>Allow Pegs of the Same Color</source>
<translation>Azonos színű ékek engedélyezése</translation>
</message>
<message>
<source>Ctrl+Shift+C</source>
<translation>Ctrl+Shift+C</translation>
</message>
<message>
<source>Disallow Pegs of the Same Color</source>
<translation>Azonos színű ékek tiltása</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Sor zárolása az utolsó ék behelyezése után</translation>
</message>
<message>
<source>Ctrl+L</source>
<translation>Ctrl+L</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Automatikus útmutatások</translation>
</message>
<message>
<source>Ctrl+Shift+H</source>
<translation>Ctrl+Shift+H</translation>
</message>
<message>
<source>Online &amp;Help</source>
<translation>Online &amp;segítség</translation>
</message>
<message>
<source>F1</source>
<translation>F1</translation>
</message>
<message>
<source>About &amp;ColorCode</source>
<translation>Névejgy: &amp;ColorCode</translation>
</message>
<message>
<source>Ctrl+A</source>
<translation>Ctrl+A</translation>
</message>
<message>
<source>About &amp;Qt</source>
<translation>Névjegy: &amp;Qt</translation>
</message>
<message>
<source>Ctrl+I</source>
<translation>Ctrl+I</translation>
</message>
<message>
<source>Fill Row by Random</source>
<translation>Sorok kitöltése véletlenszerűen</translation>
</message>
<message>
<source>Ctrl+R</source>
<translation>Ctrl+R</translation>
</message>
<message>
<source>Duplicate Previous Row</source>
<translation>Előző sor duplázása</translation>
</message>
<message>
<source>Ctrl+D</source>
<translation>Ctrl+D</translation>
</message>
<message>
<source>Clear Row</source>
<translation>Sor törlése</translation>
</message>
<message>
<source>Ctrl+C</source>
<translation>Ctrl+C</translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Kezdő (2 szín, 2 lyuk, duplázás)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Könnyű (4 szín, 3 lyuk, nincs duplázás)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Klasszikus (6 szín, 4 lyuk, duplázás)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Kihívás (8 szín, 4 lyuk, duplázás)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Nehéz (10 szín, 5 lyuk, duplázás)</translation>
</message>
<message>
<source>Computer&apos;s Guess</source>
<translation>Gép tippje</translation>
</message>
<message>
<source>Ctrl+H</source>
<translation>Ctrl+H</translation>
</message>
<message>
<source>Rate it for me</source>
<translation>Értékeld nekem</translation>
</message>
<message>
<source>Human vs Computer</source>
<translation>Ember kontra számítógép</translation>
</message>
<message>
<source>Computer vs Human</source>
<translation>Számítógép kontra ember</translation>
</message>
<message>
<source>Preferences</source>
<translation>Beállítások</translation>
</message>
<message>
<source>Ctrl+P</source>
<translation>Ctrl+P</translation>
</message>
<message>
<source>&amp;Game</source>
<translation>&amp;Játék</translation>
</message>
<message>
<source>&amp;Row</source>
<translation>&amp;Sor</translation>
</message>
<message>
<source>&amp;Settings</source>
<translation>&amp;Beállítások</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Játék mód</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Nehézség beállítása</translation>
</message>
<message>
<source>&amp;Help</source>
<translation>&amp;Segítség</translation>
</message>
<message>
<source>Game</source>
<translation>Játék</translation>
</message>
<message>
<source>Colors</source>
<translation>Színek</translation>
</message>
<message>
<source>Slots</source>
<translation>Lyukak</translation>
</message>
<message>
<source>Level</source>
<translation>Nehézség</translation>
</message>
<message>
<source>Message</source>
<translation>Üzenet</translation>
</message>
<message>
<source>The changed settings will only apply to new games!
Do you want to give in the current and start a new Game?</source>
<translation>A megváltozott beállítások csak az új játékra lesznek érvényesek!
Feladod a jelenlegi játékot, és indítasz egy újat?</translation>
</message>
<message>
<source>New Game</source>
<translation>Új játék</translation>
</message>
<message>
<source>Do you want to give in
and start a new Game?</source>
<translation>Feladod, és kezdesz egy újat?</translation>
</message>
<message>
<source>Give In</source>
<translation>Felad</translation>
</message>
<message>
<source>Do you really want to give in?</source>
<translation>Tényleg feladod?</translation>
</message>
<message>
<source>About Qt</source>
<translation>Névjegy: Qt</translation>
</message>
<message>
<source>Press the Hint Field or Key Enter if You&apos;re done.</source>
<translation>Nyomd meg az útmutatás mezőt, vagy üsd le az entert ha kész vagy.</translation>
</message>
<message>
<source>Place Your pegs ...</source>
<translation>Helyezd el az ékeket...</translation>
</message>
<message>
<source>Press the button below or Key Enter if You&apos;re done.</source>
<translation>Nyomd meg a fenti gombot, vagy üsd le az entert ha végeztél.</translation>
</message>
<message>
<source>The chosen settings do not allow pegs of the same color!</source>
<translation>A megadott beállítások nem engedélyezik az azonos színeket!</translation>
</message>
<message>
<source>Place Your secret ColorCode ...</source>
<translation>Helyezd el a titkos színkombinációt...</translation>
</message>
<message>
<source>Yes</source>
<translation>Igen</translation>
</message>
<message>
<source>No</source>
<translation>Nem</translation>
</message>
<message>
<source>Pegs of Same Color</source>
<translation>Azonos színű ékek</translation>
</message>
<message>
<source>Please rate the guess. Press OK or Key Enter if You&apos;re done.</source>
<translation>Értékeld a tippet. Kattints az OK-ra, vagy üss entert ha kész vagy.</translation>
</message>
<message>
<source>Congratulation! You have won!</source>
<translation>Gratulálok! Nyertél!</translation>
</message>
<message>
<source>Sorry! You lost!</source>
<translation>Sajnálom! Vesztettél!</translation>
</message>
<message>
<source>Sure, You&apos;re too weak for me!</source>
<translation>Biztos, Túl kevés vagy hozzám!</translation>
</message>
<message>
<source>The impossible happened, sorry.</source>
<translation>A lehetetlen megtörtént, bocsi.</translation>
</message>
<message>
<source>Yeah! I guessed it, man!</source>
<translation>Fain! Kitalátam öcsém!</translation>
</message>
<message>
<source>Embarrassing! I lost a game!</source>
<translation>Lenyűgöző! Elvesztettem a játékot!</translation>
</message>
<message>
<source>Don&apos;t you like to see me winning? ;-)</source>
<translation>Nem akarsz győzni látni engem? ;-)</translation>
</message>
<message>
<source>Nope! Thats impossible! Did you gave me false hints?</source>
<translation>Neee! Ez hihetetlen! Hamis útmutatást adtál nekem?</translation>
</message>
</context>
<context>
<name>PrefDialog</name>
<message>
<source>... Select from predefined level settings</source>
<translation>... Válassz az előre meghatározott szint beállítások közül</translation>
</message>
<message>
<source>Beginner (2 Colors, 2 Slots, Doubles)</source>
<translation>Kezdő (2szín, 2 lyuk, duplázás)</translation>
</message>
<message>
<source>Easy (4 Colors, 3 Slots, No Doubles)</source>
<translation>Könnyű (4 szín, 3 lyuk, nincs duplázás)</translation>
</message>
<message>
<source>Classic (6 Colors, 4 Slots, Doubles)</source>
<translation>Klasszikus (6 szín, 4 lyuk, duplázás)</translation>
</message>
<message>
<source>Challenging (8 Colors, 4 Slots, Doubles)</source>
<translation>Kihívás (8 szín, 4 lyuk, duplázás)</translation>
</message>
<message>
<source>Hard (10 Colors, 5 Slots, Doubles)</source>
<translation>Nehéz (10 szín, 5 lyuk, duplázás)</translation>
</message>
<message>
<source>Slots</source>
<translation>Lyukak</translation>
</message>
<message>
<source>Colors</source>
<translation>Színek</translation>
</message>
<message>
<source>Human vs. Computer</source>
<translation>Ember kontra számítógép</translation>
</message>
<message>
<source>Computer vs. Human</source>
<translation>Számítógép kontra ember</translation>
</message>
<message>
<source>Low</source>
<translation>Könnyű</translation>
</message>
<message>
<source>Medium</source>
<translation>Közepes</translation>
</message>
<message>
<source>High</source>
<translation>Nehéz</translation>
</message>
<message>
<source>Preferences</source>
<translation>Beállítások</translation>
</message>
<message>
<source>Appearance</source>
<translation>Megjelenés</translation>
</message>
<message>
<source>Controls</source>
<translation>Gombok</translation>
</message>
<message>
<source>Show or hide the Menubar.</source>
<translation>Menüsor mutatása vagy elrejtése.</translation>
</message>
<message>
<source>Show Menubar</source>
<translation>Meüsor mutatása</translation>
</message>
<message>
<source>Show or hide the Toolbar.</source>
<translation>Eszköztár mutatása vagy elrejtése.</translation>
</message>
<message>
<source>Show Toolbar</source>
<translation>Eszköztár mutatása</translation>
</message>
<message>
<source>Show or hide the Statusbar.</source>
<translation>Állapotsor mutatása vagy elrejtése.</translation>
</message>
<message>
<source>Show Statusbar</source>
<translation>Állapotsor mutatása</translation>
</message>
<message>
<source>Indicators</source>
<translation>Jelzők</translation>
</message>
<message>
<source>If this option is checked, an indicator
inside each peg is displayed.</source>
<translation>Ha ez az opció be van jelölve,
akkor minden ékben megjelenik egy jelző.</translation>
</message>
<message>
<source>Show Indicators inside pegs</source>
<translation>Jelzők mutatása az ékeken belül</translation>
</message>
<message>
<source>Use unique letters as indicators.</source>
<translation>Egyedi betűk használata jelzőként.</translation>
</message>
<message>
<source>Letter Indicators</source>
<translation>Betű jelzők</translation>
</message>
<message>
<source>Use unique numbers as indicators.</source>
<translation>Egydi számok használata jelzőként.</translation>
</message>
<message>
<source>Number Indicators</source>
<translation>Szám jelzők</translation>
</message>
<message>
<source>Use the same neutral background color for each peg,
when indicators are shown.</source>
<translation>Egyforma sima háttér használata az ékeknél,
amikor a jelzők látszanak.</translation>
</message>
<message>
<source>Hide Colors</source>
<translation>Színek elrejtése</translation>
</message>
<message>
<source>Click here if you have changed the color order
and now you want to revert it to it&apos;s initial state. </source>
<translation>Kattints ide ha megváltoztattad a szín sorrendet,
és visszakarod állatani az eredetire.</translation>
</message>
<message>
<source>Reset Color Order</source>
<translation>Szín sorrend nullázása</translation>
</message>
<message>
<source>Game Settings</source>
<translation>Játék beállítások</translation>
</message>
<message>
<source>Level Presets</source>
<translation>Nehézségi beállítások</translation>
</message>
<message>
<source>Select from predefined combinations
of the three different level related settings,
the number of colors, the number of slots (columns)
and the possibility of pegs of the same color in one row. </source>
<translation>Válassz az előre meghatározott nehézségi szint
3 különböző lehetősége közül,
színek száma, lyukak (oszlop) száma,
és az egy sorban lehetséges azonos színek száma.</translation>
</message>
<message>
<source>Number of Slots</source>
<translation>Lyukak száma</translation>
</message>
<message>
<source>Number of Colors</source>
<translation>Színek száma</translation>
</message>
<message>
<source>Number of pegs in a single row.
Higher values are harder to guess.</source>
<translation>Ékek száma egy sorban.
A nyagyobb értéket nehezebb eltalálni.</translation>
</message>
<message>
<source>Number of all possible colors.
Higher values are harder to guess.</source>
<translation>A lehetséges színek száma.
A nagyobb értéket nehezebb eltalálni.</translation>
</message>
<message>
<source>If this option is checked, the hidden combination
may contain one or more (even all would be possible)
pegs of the same color.
If checked, the combination is generally harder to guess.</source>
<translation>Amennyiben ez a lehetőség be van kapcsolva,
akkor a rejtett kombináció tartalmazhat egy vagy több
(akár az összes) azonos színű éket.
Ha be van kapcsolva, nehezebb megfejteni a kombinációt.</translation>
</message>
<message>
<source>Allow Pegs of Same Color</source>
<translation>Azonons színű ékek engedélyezése</translation>
</message>
<message>
<source>Game Mode</source>
<translation>Játék mód</translation>
</message>
<message>
<source>Select from the different game modes.
In the 1. mode you have to to guess the hidden,
computer generated combination,
In the 2. mode your computer will try to guess your
own secret combination.</source>
<translation>Válassz a különböző játék módok közül.
Az 1. módban neked kell kitalálnod a titkos kombinációt,
amit a gép kigondolt.
A 2. módban a gépnek kell kitalálnia
az általad megadott kombinációt.</translation>
</message>
<message>
<source>If checked, a row is closed as soon as you place the last peg
and your guess is submitted immediatly.
This option only affects the Human vs. Computer game mode.</source>
<translation>Ha ez be van kapcsolva, akkor a sor zárolásra kerül, amint beraktad az utolsó éket,
és a tipped azonnal ki lesz értékelve.
Ez az opció csak az Ember kontra számítógép módban működik.</translation>
</message>
<message>
<source>Close Rows when the last Peg is placed</source>
<translation>Sor zárolása, amint az utolsó ék is a helyére került</translation>
</message>
<message>
<source>If checked, the computer will determine the corresponding hints for the solver&apos;s guess.
This option affects only Computer vs. Human games.
If checked, you only have to place your secret combination.
Then the rest of the game runs automatically until the end.
But you can set a delay between the guesses.</source>
<translation>Ha ezt bekapcsolod, akkor a gép automatikusan kiértékeli a tippet a jelzők segítségével.
Ez a lehetőség csak a Számítógép kontra ember módnál működik.
Bekapcsolt állapotban, csak titkos kombinációt kell megadnod,
majd a játék hátralevő részét a gép automatikusan lejátsza.
De meg tudsz adni késleltetést a tippek közé.</translation>
</message>
<message>
<source>Set Hints automatically</source>
<translation>Jelzők automatikus használata</translation>
</message>
<message>
<source>Adjust the delay (in ms) between two guesses.</source>
<translation>Tippek közti késleltetés megadása.</translation>
</message>
<message>
<source>Delay in ms</source>
<translation>Késleltelés ms-ban</translation>
</message>
<message>
<source>Solver Strength</source>
<translation>Megoldási nehézség</translation>
</message>
<message>
<source>Select from 3 different strength levels for your computer opponent.
This option only affects the Computer vs. Human game mode.
For the computer&apos;s guess in the Human vs. Computer mode
always the highest level will be used.</source>
<translation>Válassz a 3 különböző nehézség közül a gépi ellenfél számára.
Ez az opció csak a Számítógép kontra ember módot befolyásolja.
A gép tippjeinél az Ember kontra számítógép módban
a legnehezebb nehézségi szint lesz használva.</translation>
</message>
</context>
<context>
<name>RowHint</name>
<message>
<source>Commit Your solution</source>
<translation>Kövesd a megoldásodat</translation>
</message>
<message>
<source>Click the circles to rate my guess.
Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)</source>
<translation>Kattints a körökbe, hogy kiértékeld a tippemet.
Vagy nyomd le a Ctrl+H billentyűkombinációt, vagy használd az eszköztár adott gombját, hogy megtegyem ezt helyetted;-)</translation>
</message>
</context>
</TS>

View File

@ -1,264 +0,0 @@
//! [0]
function Plugin(ui)
{
this.ui = ui;
this.pendingAdditiveOperator = "";
this.pendingMultiplicativeOperator = "";
this.sumInMemory = 0;
this.sumSoFar = 0;
this.factorSoFar = 0;
this.waitingForOperand = true;
with (ui) {
display.text = "0";
zeroButton.clicked.connect(this, this.digitClicked);
oneButton.clicked.connect(this, "digitClicked");
twoButton.clicked.connect(this, "digitClicked");
threeButton.clicked.connect(this, "digitClicked");
fourButton.clicked.connect(this, "digitClicked");
fiveButton.clicked.connect(this, "digitClicked");
sixButton.clicked.connect(this, "digitClicked");
sevenButton.clicked.connect(this, "digitClicked");
eightButton.clicked.connect(this, "digitClicked");
nineButton.clicked.connect(this, "digitClicked");
pointButton.clicked.connect(this, "pointClicked");
changeSignButton.clicked.connect(this, "changeSignClicked");
backspaceButton.clicked.connect(this, "backspaceClicked");
clearButton.clicked.connect(this, "clear");
clearAllButton.clicked.connect(this, "clearAll");
clearMemoryButton.clicked.connect(this, "clearMemory");
readMemoryButton.clicked.connect(this, "readMemory");
setMemoryButton.clicked.connect(this, "setMemory");
addToMemoryButton.clicked.connect(this, "addToMemory");
divisionButton.clicked.connect(this, "multiplicativeOperatorClicked");
timesButton.clicked.connect(this, "multiplicativeOperatorClicked");
minusButton.clicked.connect(this, "additiveOperatorClicked");
plusButton.clicked.connect(this, "additiveOperatorClicked");
squareRootButton.clicked.connect(this, "unaryOperatorClicked");
powerButton.clicked.connect(this, "unaryOperatorClicked");
reciprocalButton.clicked.connect(this, "unaryOperatorClicked");
equalButton.clicked.connect(this, "equalClicked");
}
}
//! [0]
Plugin.prototype.abortOperation = function()
{
this.clearAll();
this.ui.display.text = "####";
}
Plugin.prototype.calculate = function(rightOperand, pendingOperator)
{
if (pendingOperator == "+") {
this.sumSoFar += rightOperand;
} else if (pendingOperator == "-") {
this.sumSoFar -= rightOperand;
} else if (pendingOperator == "*") {
this.factorSoFar *= rightOperand;
} else if (pendingOperator == "/") {
if (rightOperand == 0)
return false;
this.factorSoFar /= rightOperand;
}
return true;
}
//! [1]
Plugin.prototype.digitClicked = function()
{
var digitValue = __qt_sender__.text - 0;
if ((digitValue == 0) && (this.ui.display.text == "0"))
return;
if (this.waitingForOperand) {
this.ui.display.clear();
this.waitingForOperand = false;
}
this.ui.display.text += digitValue;
}
//! [1]
Plugin.prototype.unaryOperatorClicked = function()
{
var operand = this.ui.display.text - 0;
var result = 0;
if (__qt_sender__.text == "Sqrt") {
if (operand < 0) {
this.abortOperation();
return;
}
result = Math.sqrt(operand);
} else if (__qt_sender__.text == "x^2") {
result = Math.pow(operand, 2);
} else if (__qt_sender__.text == "1/x") {
if (operand == 0.0) {
this.abortOperation();
return;
}
result = 1 / operand;
}
this.ui.display.text = result + "";
this.waitingForOperand = true;
}
Plugin.prototype.additiveOperatorClicked = function()
{
var operand = this.ui.display.text - 0;
if (this.pendingMultiplicativeOperator.length != 0) {
if (!this.calculate(operand, this.pendingMultiplicativeOperator)) {
this.abortOperation();
return;
}
this.ui.display.text = this.factorSoFar + "";
operand = this.factorSoFar;
this.factorSoFar = 0;
this.pendingMultiplicativeOperator = "";
}
if (this.pendingAdditiveOperator.length != 0) {
if (!this.calculate(operand, this.pendingAdditiveOperator)) {
this.abortOperation();
return;
}
this.ui.display.text = this.sumSoFar + "";
} else {
this.sumSoFar = operand;
}
this.pendingAdditiveOperator = __qt_sender__.text;
this.waitingForOperand = true;
}
Plugin.prototype.multiplicativeOperatorClicked = function()
{
var operand = this.ui.display.text - 0;
if (this.pendingMultiplicativeOperator.length != 0) {
if (!this.calculate(operand, this.pendingMultiplicativeOperator)) {
this.abortOperation();
return;
}
this.ui.display.text = this.factorSoFar + "";
} else {
this.factorSoFar = operand;
}
this.pendingMultiplicativeOperator = __qt_sender__.text;
this.waitingForOperand = true;
}
Plugin.prototype.equalClicked = function()
{
var operand = this.ui.display.text - 0;
if (this.pendingMultiplicativeOperator.length != 0) {
if (!this.calculate(operand, this.pendingMultiplicativeOperator)) {
this.abortOperation();
return;
}
operand = this.factorSoFar;
this.factorSoFar = 0.0;
this.pendingMultiplicativeOperator = "";
}
if (this.pendingAdditiveOperator.length != 0) {
if (!this.calculate(operand, this.pendingAdditiveOperator)) {
this.abortOperation();
return;
}
this.pendingAdditiveOperator = "";
} else {
this.sumSoFar = operand;
}
this.ui.display.text = this.sumSoFar + "";
this.sumSoFar = 0.0;
this.waitingForOperand = true;
}
Plugin.prototype.pointClicked = function()
{
if (this.waitingForOperand)
this.ui.display.text = "0";
if (this.ui.display.text.indexOf(".") == -1)
this.ui.display.text += ".";
this.waitingForOperand = false;
}
//! [2]
Plugin.prototype.changeSignClicked = function()
{
var text = this.ui.display.text;
var value = text - 0;
if (value > 0) {
text = "-" + text;
} else if (value < 0) {
text = text.slice(1);
}
this.ui.display.text = text;
}
//! [2]
Plugin.prototype.backspaceClicked = function()
{
if (this.waitingForOperand)
return;
var text = this.ui.display.text;
text = text.slice(0, -1);
if (text.length == 0) {
text = "0";
this.waitingForOperand = true;
}
this.ui.display.text = text;
}
Plugin.prototype.clear = function()
{
if (this.waitingForOperand)
return;
this.ui.display.text = "0";
this.waitingForOperand = true;
}
Plugin.prototype.clearAll = function()
{
this.sumSoFar = 0.0;
this.factorSoFar = 0.0;
this.pendingAdditiveOperator = "";
this.pendingMultiplicativeOperator = "";
this.ui.display.text = "0";
this.waitingForOperand = true;
}
Plugin.prototype.clearMemory = function()
{
this.sumInMemory = 0.0;
}
Plugin.prototype.readMemory = function()
{
this.ui.display.text = this.sumInMemory + "";
this.waitingForOperand = true;
}
Plugin.prototype.setMemory = function()
{
this.equalClicked();
this.sumInMemory = this.ui.display.text - 0;
}
Plugin.prototype.addToMemory = function()
{
this.equalClicked();
this.sumInMemory += this.ui.display.text - 0;
}

View File

@ -1,406 +0,0 @@
<ui version="4.0" >
<class>Calculator</class>
<widget class="QWidget" name="Calculator" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>301</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>314</width>
<height>301</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>314</width>
<height>301</height>
</size>
</property>
<property name="windowTitle" >
<string>Calculator</string>
</property>
<widget class="QToolButton" name="backspaceButton" >
<property name="geometry" >
<rect>
<x>10</x>
<y>50</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>Backspace</string>
</property>
</widget>
<widget class="QToolButton" name="clearButton" >
<property name="geometry" >
<rect>
<x>110</x>
<y>50</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>Clear :)</string>
</property>
</widget>
<widget class="QToolButton" name="clearAllButton" >
<property name="geometry" >
<rect>
<x>210</x>
<y>50</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>Clear All</string>
</property>
</widget>
<widget class="QToolButton" name="clearMemoryButton" >
<property name="geometry" >
<rect>
<x>10</x>
<y>100</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>MC</string>
</property>
</widget>
<widget class="QToolButton" name="readMemoryButton" >
<property name="geometry" >
<rect>
<x>10</x>
<y>150</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>MR</string>
</property>
</widget>
<widget class="QToolButton" name="setMemoryButton" >
<property name="geometry" >
<rect>
<x>10</x>
<y>200</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>MS</string>
</property>
</widget>
<widget class="QToolButton" name="addToMemoryButton" >
<property name="geometry" >
<rect>
<x>10</x>
<y>250</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>M+</string>
</property>
</widget>
<widget class="QToolButton" name="sevenButton" >
<property name="geometry" >
<rect>
<x>60</x>
<y>100</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>7</string>
</property>
</widget>
<widget class="QToolButton" name="eightButton" >
<property name="geometry" >
<rect>
<x>110</x>
<y>100</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>8</string>
</property>
</widget>
<widget class="QToolButton" name="nineButton" >
<property name="geometry" >
<rect>
<x>160</x>
<y>100</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>9</string>
</property>
</widget>
<widget class="QToolButton" name="fourButton" >
<property name="geometry" >
<rect>
<x>60</x>
<y>150</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>4</string>
</property>
</widget>
<widget class="QToolButton" name="fiveButton" >
<property name="geometry" >
<rect>
<x>110</x>
<y>150</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>5</string>
</property>
</widget>
<widget class="QToolButton" name="sixButton" >
<property name="geometry" >
<rect>
<x>160</x>
<y>150</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>6</string>
</property>
</widget>
<widget class="QToolButton" name="oneButton" >
<property name="geometry" >
<rect>
<x>60</x>
<y>200</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>1</string>
</property>
</widget>
<widget class="QToolButton" name="twoButton" >
<property name="geometry" >
<rect>
<x>110</x>
<y>200</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>2</string>
</property>
</widget>
<widget class="QToolButton" name="threeButton" >
<property name="geometry" >
<rect>
<x>160</x>
<y>200</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>3</string>
</property>
</widget>
<widget class="QToolButton" name="zeroButton" >
<property name="geometry" >
<rect>
<x>60</x>
<y>250</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>0</string>
</property>
</widget>
<widget class="QToolButton" name="pointButton" >
<property name="geometry" >
<rect>
<x>110</x>
<y>250</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>.</string>
</property>
</widget>
<widget class="QToolButton" name="changeSignButton" >
<property name="geometry" >
<rect>
<x>160</x>
<y>250</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>+-</string>
</property>
</widget>
<widget class="QToolButton" name="plusButton" >
<property name="geometry" >
<rect>
<x>210</x>
<y>250</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>+</string>
</property>
</widget>
<widget class="QToolButton" name="divisionButton" >
<property name="geometry" >
<rect>
<x>210</x>
<y>100</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>/</string>
</property>
</widget>
<widget class="QToolButton" name="timesButton" >
<property name="geometry" >
<rect>
<x>210</x>
<y>150</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>*</string>
</property>
</widget>
<widget class="QToolButton" name="minusButton" >
<property name="geometry" >
<rect>
<x>210</x>
<y>200</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>-</string>
</property>
</widget>
<widget class="QToolButton" name="squareRootButton" >
<property name="geometry" >
<rect>
<x>260</x>
<y>100</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>Sqrt</string>
</property>
</widget>
<widget class="QToolButton" name="powerButton" >
<property name="geometry" >
<rect>
<x>260</x>
<y>150</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>x^2</string>
</property>
</widget>
<widget class="QToolButton" name="reciprocalButton" >
<property name="geometry" >
<rect>
<x>260</x>
<y>200</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>1/x</string>
</property>
</widget>
<widget class="QToolButton" name="equalButton" >
<property name="geometry" >
<rect>
<x>260</x>
<y>250</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text" >
<string>=</string>
</property>
</widget>
<widget class="QLineEdit" name="display" >
<property name="geometry" >
<rect>
<x>10</x>
<y>10</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="maxLength" >
<number>15</number>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,28 +0,0 @@
#=== this part is common (similar) for all plugin projects =====================
TEMPLATE = lib
CONFIG += plugin debug
# this is directory, where PluginInterface.h is located
INCLUDEPATH += ../
# and, the result (*.so or *.dll) should appear in this directory
DESTDIR = ../bin
OBJECTS_DIR = temp/obj
RCC_DIR = temp/qrc
UI_DIR = temp/ui
MOC_DIR = temp/moc
# the name of the result file;
TARGET = $$qtLibraryTarget(calendar_plugin)
HEADERS += ../PluginInterface.h \
src/CalendarPlugin.h
SOURCES += src/CalendarPlugin.cpp
#===============================================================================
#=== and this are definitions, specific for this program =======================
HEADERS += src/mainwindow.h
SOURCES += src/mainwindow.cpp
#===============================================================================

View File

@ -1,33 +0,0 @@
//#include <QApplication>
//#include <QString>
//#include <QPushButton>
#include "CalendarPlugin.h"
#include "mainwindow.h"
QString
CalendarPlugin::pluginDescription() const
{
QString res;
res = "A simple plugin, based on QT calendar(richtext) example" ;
return res;
}
QString
CalendarPlugin::pluginName() const
{
return "Calendar" ;
}
QWidget*
CalendarPlugin::pluginWidget(QWidget * parent )
{
MainWindow* window = new MainWindow(parent);
//window->openImage(":/images/example.jpg");
return window;
}
Q_EXPORT_PLUGIN2(calendar_plugin, CalendarPlugin)

View File

@ -1,27 +0,0 @@
#ifndef _HWA_PLUGIN_H_
#define _HWA_PLUGIN_H_
#include <QObject>
#include <QString>
#include <QWidget>
#include <PluginInterface.h>
#include <QDebug>
class CalendarPlugin: public QObject, public PluginInterface
{
Q_OBJECT
Q_INTERFACES(PluginInterface)
public slots:
virtual QString pluginDescription() const ;
virtual QString pluginName() const ;
virtual QWidget* pluginWidget(QWidget * parent = 0) ;
};
#endif

View File

@ -1,213 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the example classes of the Qt Toolkit.
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information
** to ensure GNU General Public Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html. In addition, as a special
** exception, Nokia gives you certain additional rights. These rights
** are described in the Nokia Qt GPL Exception version 1.3, included in
** the file GPL_EXCEPTION.txt in this package.
**
** Qt for Windows(R) Licensees
** As a special exception, Nokia, as the sole copyright holder for Qt
** Designer, grants users of the Qt/Eclipse Integration plug-in the
** right for the Qt/Eclipse Integration to link to functionality
** provided by Qt Designer and its related libraries.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/
#include <QtGui>
#include "mainwindow.h"
//! [0]
MainWindow::MainWindow(QWidget* parent)
:QFrame(parent)
{
selectedDate = QDate::currentDate();
fontSize = 10;
// QWidget *centralWidget = new QWidget;
//! [0]
//! [1]
QLabel *dateLabel = new QLabel(tr("Date:"));
QComboBox *monthCombo = new QComboBox;
for (int month = 1; month <= 12; ++month)
monthCombo->addItem(QDate::longMonthName(month));
QDateTimeEdit *yearEdit = new QDateTimeEdit;
yearEdit->setDisplayFormat("yyyy");
yearEdit->setDateRange(QDate(1753, 1, 1), QDate(8000, 1, 1));
//! [1]
monthCombo->setCurrentIndex(selectedDate.month() - 1);
yearEdit->setDate(selectedDate);
//! [2]
QLabel *fontSizeLabel = new QLabel(tr("Font size:"));
QSpinBox *fontSizeSpinBox = new QSpinBox;
fontSizeSpinBox->setRange(1, 64);
fontSizeSpinBox->setValue(10);
editor = new QTextBrowser;
insertCalendar();
//! [2]
//! [3]
connect(monthCombo, SIGNAL(activated(int)), this, SLOT(setMonth(int)));
connect(yearEdit, SIGNAL(dateChanged(QDate)), this, SLOT(setYear(QDate)));
connect(fontSizeSpinBox, SIGNAL(valueChanged(int)),
this, SLOT(setFontSize(int)));
//! [3]
//! [4]
QHBoxLayout *controlsLayout = new QHBoxLayout;
controlsLayout->addWidget(dateLabel);
controlsLayout->addWidget(monthCombo);
controlsLayout->addWidget(yearEdit);
controlsLayout->addSpacing(24);
controlsLayout->addWidget(fontSizeLabel);
controlsLayout->addWidget(fontSizeSpinBox);
controlsLayout->addStretch(1);
QVBoxLayout *centralLayout = new QVBoxLayout;
centralLayout->addLayout(controlsLayout);
centralLayout->addWidget(editor, 1);
//centralWidget->setLayout(centralLayout);
this->setLayout(centralLayout);
//setCentralWidget(centralWidget);
//! [4]
}
//! [5]
void MainWindow::insertCalendar()
{
editor->clear();
QTextCursor cursor = editor->textCursor();
cursor.beginEditBlock();
QDate date(selectedDate.year(), selectedDate.month(), 1);
//! [5]
//! [6]
QTextTableFormat tableFormat;
tableFormat.setAlignment(Qt::AlignHCenter);
tableFormat.setBackground(QColor("#e0e0e0"));
tableFormat.setCellPadding(2);
tableFormat.setCellSpacing(4);
//! [6] //! [7]
QVector<QTextLength> constraints;
constraints << QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14);
tableFormat.setColumnWidthConstraints(constraints);
//! [7]
//! [8]
QTextTable *table = cursor.insertTable(1, 7, tableFormat);
//! [8]
//! [9]
QTextFrame *frame = cursor.currentFrame();
QTextFrameFormat frameFormat = frame->frameFormat();
frameFormat.setBorder(1);
frame->setFrameFormat(frameFormat);
//! [9]
//! [10]
QTextCharFormat format = cursor.charFormat();
format.setFontPointSize(fontSize);
QTextCharFormat boldFormat = format;
boldFormat.setFontWeight(QFont::Bold);
QTextCharFormat highlightedFormat = boldFormat;
highlightedFormat.setBackground(Qt::yellow);
//! [10]
//! [11]
for (int weekDay = 1; weekDay <= 7; ++weekDay) {
QTextTableCell cell = table->cellAt(0, weekDay-1);
//! [11] //! [12]
QTextCursor cellCursor = cell.firstCursorPosition();
cellCursor.insertText(QString("%1").arg(QDate::longDayName(weekDay)),
boldFormat);
}
//! [12]
//! [13]
table->insertRows(table->rows(), 1);
//! [13]
while (date.month() == selectedDate.month()) {
int weekDay = date.dayOfWeek();
QTextTableCell cell = table->cellAt(table->rows()-1, weekDay-1);
QTextCursor cellCursor = cell.firstCursorPosition();
if (date == QDate::currentDate())
cellCursor.insertText(QString("%1").arg(date.day()), highlightedFormat);
else
cellCursor.insertText(QString("%1").arg(date.day()), format);
date = date.addDays(1);
if (weekDay == 7 && date.month() == selectedDate.month())
table->insertRows(table->rows(), 1);
}
cursor.endEditBlock();
//! [14]
setWindowTitle(tr("Calendar for %1 %2"
).arg(QDate::longMonthName(selectedDate.month())
).arg(selectedDate.year()));
}
//! [14]
//! [15]
void MainWindow::setFontSize(int size)
{
fontSize = size;
insertCalendar();
}
//! [15]
//! [16]
void MainWindow::setMonth(int month)
{
selectedDate = QDate(selectedDate.year(), month + 1, selectedDate.day());
insertCalendar();
}
//! [16]
//! [17]
void MainWindow::setYear(QDate date)
{
selectedDate = QDate(date.year(), selectedDate.month(), selectedDate.day());
insertCalendar();
}
//! [17]

View File

@ -1,71 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the example classes of the Qt Toolkit.
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information
** to ensure GNU General Public Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html. In addition, as a special
** exception, Nokia gives you certain additional rights. These rights
** are described in the Nokia Qt GPL Exception version 1.3, included in
** the file GPL_EXCEPTION.txt in this package.
**
** Qt for Windows(R) Licensees
** As a special exception, Nokia, as the sole copyright holder for Qt
** Designer, grants users of the Qt/Eclipse Integration plug-in the
** right for the Qt/Eclipse Integration to link to functionality
** provided by Qt Designer and its related libraries.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDate>
//#include <QMainWindow>
#include <QFrame>
QT_BEGIN_NAMESPACE
class QTextBrowser;
QT_END_NAMESPACE
//! [0]
class MainWindow : public QFrame
{
Q_OBJECT
public:
MainWindow(QWidget* parent);
public slots:
void setFontSize(int size);
void setMonth(int month);
void setYear(QDate date);
private:
void insertCalendar();
int fontSize;
QDate selectedDate;
QTextBrowser *editor;
};
//! [0]
#endif

View File

@ -1,59 +0,0 @@
#include "Ablagestapel.h"
#include "Karte.h"
#include "Proportionen.h"
#include "Scene.h"
using namespace std;
Ablagestapel::Ablagestapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent) : Basisstapel(pixmap, oparent, gparent)
{
}
Ablagestapel::~Ablagestapel()
{
}
QPointF Ablagestapel::ablageposition() const
{
QPointF erg;
// im ablagestapel sollen die karten aufgefaechert abgelegt werden, deshalb YDRIFT hinzufuegen. die position ist relative zum parent grafik objekt
if (kartenliste.size() > 0) erg.setY(boundingRect().height() / ABLAGESTAPEL_YDRIFT_VERHAELTNIS);
return erg;
}
bool Ablagestapel::ablage_moeglich(Karte* karte) const
{
bool erg = false;
if (Basisstapel::ablage_moeglich(karte) == true && ((oberste_karte() == 0 && karte->wert() == 13) || (oberste_karte() != 0 && oberste_karte()->farbe() != karte->farbe() && karte->wert() == (oberste_karte()->wert() - 1)))) erg = true;
if (erg == true && oberste_karte() != 0)
{
if (karte->farbe() == KARTEN_KREUTZ && oberste_karte()->farbe() == KARTEN_PIK) erg = false;
else if (karte->farbe() == KARTEN_PIK && oberste_karte()->farbe() == KARTEN_KREUTZ) erg = false;
else if (karte->farbe() == KARTEN_HERZ && oberste_karte()->farbe() == KARTEN_KARO) erg = false;
else if (karte->farbe() == KARTEN_KARO && oberste_karte()->farbe() == KARTEN_HERZ) erg = false;
}
return erg;
}
void Ablagestapel::passe_groesse_an(double wert)
{
if (oberste_karte() != 0) oberste_karte()->nach_hause();
Basisstapel::passe_groesse_an(wert);
for (register int idx = 1; idx < kartenliste.size(); idx++)
{
kartenliste.at(idx)->setPos(kartenliste.at(idx)->pos().x(), (double) boundingRect().height() / ABLAGESTAPEL_YDRIFT_VERHAELTNIS);
kartenliste.at(idx)->speichere_zuhause();
}
}

View File

@ -1,23 +0,0 @@
#ifndef ABLAGESTAPEL_H
#define ABLAGESTAPEL_H
#include "Basisstapel.h"
class Ablagestapel : public Basisstapel
{
Q_OBJECT
public:
Ablagestapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent = 0);
virtual ~Ablagestapel();
virtual bool ablage_moeglich(Karte*) const;
public slots:
virtual void passe_groesse_an(double);
protected:
virtual QPointF ablageposition() const;
};
#endif

View File

@ -1,141 +0,0 @@
#include "Austeilcostapel.h"
#include "Karte.h"
#include "Proportionen.h"
#include "Scene.h"
using namespace std;
Austeilcostapel::Austeilcostapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent) : Basisstapel(pixmap, oparent, gparent), austeilstapel(0), ablagenummer(0)
{
}
Austeilcostapel::~Austeilcostapel()
{
}
void Austeilcostapel::registriere_austeilstapel(Basisstapel* stapel)
{
austeilstapel = stapel;
}
bool Austeilcostapel::ablage_moeglich(Karte * karte) const
{
bool erg = false;
if (karte->eigentuemer_stapel()->objectName() == BASISSTAPEL_AUSTEILSTAPEL) erg = true;
return erg;
}
QPointF Austeilcostapel::ablageposition() const
{
QPointF erg(Basisstapel::ablageposition());
// wenn drei karten gezogen werden und die ablagenummer groesser als 0 ist eine drift nach rechts zur position hinzufuegen
if (nur_eine_wird_gezogen() == false && ablagenummer > 0) erg.setX(erg.x() + (boundingRect().width() / AUSTEILCOSTAPEL_XDRIFT_VERHAELTNIS));
return erg;
}
bool Austeilcostapel::lege_karte_ab(Karte* karte)
{
bool erg = false;
// nur, wenn eine ablage ueberhaupt moeglich ist
if (ablage_moeglich(karte) == true)
{
if (nur_eine_wird_gezogen() == false && oberste_karte() != 0) oberste_karte()->setFlag(QGraphicsItem::ItemIsMovable, false);
// wenn bereits 3 karten aufgefaechert daliegen
if (nur_eine_wird_gezogen() == false && ablagenummer == 3)
{
// ablagenummer wieder zuruecksetzen (die nachste karte wird ohne drift eingefuegt)
ablagenummer = 0;
// die bisher im stapel befindlichen karten sollen ohne drift am stapel liegen
alle_karten_einreihen();
}
erg = Basisstapel::lege_karte_ab(karte);
// wenn drei karten gezogen werden die ablagenummer um 1 erhoehen
if (nur_eine_wird_gezogen() == false) ablagenummer++;
}
return erg;
}
void Austeilcostapel::alle_karten_einreihen()
{
// von allen karten im stapel die drift entfernen
for (register int idx = 0; idx < kartenliste.size(); idx++) kartenliste.at(idx)->setPos(0, 0);
}
void Austeilcostapel::resette_ablagenummer()
{
// die ablagenummer zuruecksetzen
ablagenummer = 0;
// von allen karten im stapel die drift entfernen
alle_karten_einreihen();
}
void Austeilcostapel::entferne_karte(Karte* karte)
{
Basisstapel::entferne_karte(karte);
if (oberste_karte() != 0) oberste_karte()->setFlag(QGraphicsItem::ItemIsMovable);
}
void Austeilcostapel::hilfsanfrage_start(Karte*)
{
}
const QStringList Austeilcostapel::speichere() const
{
QStringList erg(Basisstapel::speichere());
// die ablegenummer speichern
erg.append(QString::number(ablagenummer));
return erg;
}
bool Austeilcostapel::lade(const QStringList& daten)
{
bool erg = Basisstapel::lade(daten);
if (erg == true && daten.size() >= AUSTEILSTAPEL_ANZAHL_SPEICHERELEMENTE)
{
// die ablagenummer laden
ablagenummer = daten.at(AUSTEILSTAPEL_ABLAGENUMMER_IDX).toInt();
}
return erg;
}
void Austeilcostapel::passe_groesse_an(double wert)
{
if (oberste_karte() != 0) oberste_karte()->nach_hause();
Basisstapel::passe_groesse_an(wert);
for (register int idx1 = kartenliste.size() - 1, idx2 = 0; eine_wird_gezogen() == false && idx1 > 0 && idx2 < ablagenummer; idx1--, idx2++)
{
kartenliste.at(idx1)->setPos(QPointF(boundingRect().width() / AUSTEILCOSTAPEL_XDRIFT_VERHAELTNIS, kartenliste.at(idx1)->pos().y()));
kartenliste.at(idx1)->speichere_zuhause();
}
}

View File

@ -1,37 +0,0 @@
#ifndef AUSTEILCOSTAPEL_H
#define AUSTEILCOSTAPEL_H
#include "Basisstapel.h"
class Austeilcostapel : public Basisstapel
{
Q_OBJECT
public:
Austeilcostapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent = 0);
virtual ~Austeilcostapel();
virtual void registriere_austeilstapel(Basisstapel*);
virtual bool ablage_moeglich(Karte *) const;
virtual bool lege_karte_ab(Karte*);
virtual void entferne_karte(Karte*);
virtual const QStringList speichere() const;
virtual bool lade(const QStringList&);
public slots:
virtual void resette_ablagenummer();
virtual void hilfsanfrage_start(Karte*);
virtual void passe_groesse_an(double);
private:
Basisstapel *austeilstapel;
bool nur_eine_ziehen;
virtual void alle_karten_einreihen();
protected:
int ablagenummer;
virtual QPointF ablageposition() const;
};
#endif

View File

@ -1,100 +0,0 @@
#include "Austeilstapel.h"
#include "Karte.h"
#include "Proportionen.h"
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
using namespace std;
Austeilstapel::Austeilstapel(const QPixmap& pixmap, Scene* oparent , QGraphicsItem* gparent) : Basisstapel(pixmap, oparent , gparent), costapel(0)
{
}
Austeilstapel::~Austeilstapel()
{
}
void Austeilstapel::registriere_costapel(Basisstapel* costapel_)
{
costapel = costapel_;
}
void Austeilstapel::karte_wurde_aufgedeckt(Karte* karte)
{
Basisstapel::karte_wurde_aufgedeckt(karte);
costapel->lege_karte_ab(karte);
// nur, wenn drei karten gezogen werden
if (nur_eine_wird_gezogen() == false)
{
// zwei weitere karten ...
for (register int idx = 0; idx < 2 && oberste_karte() != 0; idx++)
{
Karte *tmp_karte = oberste_karte();
// ... auf costapel legen, ...
costapel->lege_karte_ab(tmp_karte);
// ... und dort aufdecken
tmp_karte->zeige_vorderseite();
}
// die neue oberste karte auf costapel beweglich machen
if (costapel->oberste_karte() != 0) costapel->oberste_karte()->setFlag(QGraphicsItem::ItemIsMovable);
}
normalisiere_zwert();
}
bool Austeilstapel::ablage_moeglich(Karte *karte) const
{
bool erg = false;
if (karte->eigentuemer_stapel()->objectName() == BASISSTAPEL_AUSTEILCOSTAPEL && karte->ist_rueckseite() == true) erg = true;
return erg;
}
void Austeilstapel::mousePressEvent(QGraphicsSceneMouseEvent* event)
{
QGraphicsPixmapItem::mousePressEvent(event);
if (event->button() == Qt::LeftButton)
{
if (kartenliste.isEmpty() == true)
{
if (nur_eine_wird_gezogen() == false) costapel->resette_ablagenummer();
while (costapel->karten() > 0)
{
costapel->oberste_karte()->zeige_rueckseite();
lege_karte_ab(costapel->oberste_karte());
}
if (kartenliste.isEmpty() == false) emit stapel_durch();
}
// sicherstellen, das die scene aktualisiert wird. ist dies ein fehler in QT ???
scene()->update();
}
}
void Austeilstapel::hilfsanfrage_start(Karte*)
{
}
void Austeilstapel::undo_karten_ablage(Karte* karte)
{
karte->zeige_rueckseite();
Basisstapel::undo_karten_ablage(karte);
}

View File

@ -1,28 +0,0 @@
#ifndef AUSTEILSTAPEL_H
#define AUSTEILSTAPEL_H
#include "Basisstapel.h"
class Austeilstapel : public Basisstapel
{
Q_OBJECT
public:
Austeilstapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent = 0);
virtual ~Austeilstapel();
virtual void registriere_costapel(Basisstapel*);
virtual void karte_wurde_aufgedeckt(Karte*);
virtual bool ablage_moeglich(Karte*) const;
virtual void undo_karten_ablage(Karte*);
public slots:
virtual void hilfsanfrage_start(Karte*);
private:
Basisstapel *costapel;
virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
};
#endif

View File

@ -1,410 +0,0 @@
#include "Basisstapel.h"
#include "Karte.h"
#include "Rahmen.h"
#include "Hilfszeiger.h"
#include "Scene.h"
#include "Proportionen.h"
using namespace std;
Basisstapel::Basisstapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent) : QObject(oparent), QGraphicsPixmapItem(pixmap, gparent), meine_scene(oparent), nur_eine_ziehen(true), meinrahmen(0), meinhilfszeiger(0), bild(pixmap), bild_skaliert(pixmap), stapelgroesse(pixmap.height())
{
// den hilfszeiger erstellen
meinhilfszeiger = new Hilfszeiger(this);
meinhilfszeiger->hide();
}
Basisstapel::~Basisstapel()
{
}
bool Basisstapel::lege_karte_ab(Karte* karte)
{
bool erg = false;
if (ablage_moeglich(karte) == true)
{
erg = true;
Basisstapel *quelle(karte->eigentuemer_stapel());
// die oberste karte,oder den stapel, wenn keine karte vorhanden ist zum parent der karte machen
if (oberste_karte() == 0) karte->setParentItem(this);
else karte->setParentItem(oberste_karte());
// die position der karte einstellen
karte->setPos(ablageposition());
// die karte aus dem alten stapel entfernen
karte->eigentuemer_stapel()->entferne_karte(karte);
// der karten den stapel, zu der sie jetzt gehoert mitteilen
karte->setze_meinstapel(this);
// die rueckkehrposition der karte anpassen
karte->setze_rueckehrkoordinaten(karte->pos());
// den zwert der karte setzen
karte->setZValue(zwert());
// die karte in die kartenliste einfuegen
kartenliste.append(karte);
// die kinder karten der karten ebenfalls ablegen
lege_child_karten_ab(karte);
emit zug(Zug(karte, quelle, this));
ablage_erfolgt();
}
return erg;
}
bool Basisstapel::beruehrungstest(Karte* karte)
{
return gesamt_rect().intersects(karte->gesamt_rect());
}
bool Basisstapel::ablage_moeglich(Karte* karte) const
{
bool erg = false;
if ((oberste_karte() == 0 || (oberste_karte() != 0 && oberste_karte()->ist_vorderseite() == true)) && karte->eigentuemer_stapel() != this) erg = true;
return erg;
}
QPointF Basisstapel::ablageposition() const
{
return QPointF(0, 0);
}
void Basisstapel::initialisiere_karte(Karte* karte)
{
// die oberste karte,oder den stapel wenn keine karte vorhanden ist zum parent der karte machen
if (oberste_karte() == 0) karte->setParentItem(this);
else karte->setParentItem(oberste_karte());
// die position der karte einstellen
karte->setPos(ablageposition());
// der karten den stapel, zu der sie jetzt gehoert mitteilen
karte->setze_meinstapel(this);
// die rueckkehrposition der karte anpassen
karte->setze_rueckehrkoordinaten(karte->pos());
// den zwert der karte setzen
karte->setZValue(zwert());
// die karte in die kartenliste einfuegen
kartenliste.append(karte);
}
int Basisstapel::zwert() const
{
int erg = zValue();
if (kartenliste.isEmpty() == false) erg = kartenliste.last()->zValue();
erg++;
return erg;
}
Karte* Basisstapel::oberste_karte() const
{
Karte* erg = 0;
if (kartenliste.isEmpty() == false) erg = kartenliste.last();
return erg;
}
bool Basisstapel::ist_oberste_karte(Karte* karte)
{
bool erg = false;
if (oberste_karte() != 0 && oberste_karte() == karte) erg = true;
return erg;
}
void Basisstapel::entferne_karte(Karte* karte)
{
if (kartenliste.contains(karte) == true) kartenliste.removeAll(karte);
}
void Basisstapel::karte_wurde_aufgedeckt(Karte* karte)
{
emit zug(Zug(karte, this));
}
void Basisstapel::lege_child_karten_ab(Karte* karte)
{
QList<Karte*> kinder(karte->kinderkarten());
for (register int idx = 0; idx < kinder.size(); idx++)
{
// die position der karte einstellen
kinder.at(idx)->setPos(ablageposition());
// die karte aus dem alten stapel entfernen
kinder.at(idx)->eigentuemer_stapel()->entferne_karte(kinder.at(idx));
// der karten den stapel, zu der sie jetzt gehoert mitteilen
kinder.at(idx)->setze_meinstapel(this);
// die rueckkehrposition der karte anpassen
kinder.at(idx)->setze_rueckehrkoordinaten(kinder.at(idx)->pos());
// den zwert der karte setzen
kinder.at(idx)->setZValue(zwert());
// die karte in die kartenliste einfuegen
kartenliste.append(kinder.at(idx));
}
}
void Basisstapel::erhoehe_zwert()
{
setZValue(1000);
}
void Basisstapel::normalisiere_zwert()
{
setZValue(0);
}
int Basisstapel::karten() const
{
return kartenliste.size();
}
void Basisstapel::setze_kartenliste_zurueck()
{
kartenliste.clear();
}
void Basisstapel::ablage_erfolgt()
{
}
QRectF Basisstapel::gesamt_rect() const
{
QRectF erg(sceneBoundingRect());
if (oberste_karte() != 0) erg.setBottomRight(oberste_karte()->sceneBoundingRect().bottomRight());
return erg;
}
int Basisstapel::ueberlappungs_flaeche(Karte* karte)
{
QRectF ueberlappung_rect(gesamt_rect().intersect(karte->gesamt_rect()));
return ueberlappung_rect.width() * ueberlappung_rect.height();
}
bool Basisstapel::nur_eine_wird_gezogen() const
{
return nur_eine_ziehen;
}
void Basisstapel::eine_ziehen()
{
nur_eine_ziehen = true;
}
void Basisstapel::drei_ziehen()
{
nur_eine_ziehen = false;
}
void Basisstapel::registriere_costapel(Basisstapel*)
{
}
void Basisstapel::registriere_austeilstapel(Basisstapel*)
{
}
void Basisstapel::resette_ablagenummer()
{
}
void Basisstapel::alle_karten_einreihen()
{
}
void Basisstapel::registriere_siegkontrolle(Siegkontrolle*)
{
}
void Basisstapel::registriere_nachbar_zielstapel(Basisstapel*, Basisstapel*, Basisstapel*)
{
}
void Basisstapel::registriere_rahmen(Rahmen *rahmen)
{
meinrahmen = rahmen;
}
void Basisstapel::zeige_rahmen()
{
if (meinrahmen != 0)
{
QPointF position(scenePos());
if (oberste_karte() != 0) position = oberste_karte()->scenePos();
meinrahmen->zeige(this, position);
}
}
void Basisstapel::hilfsanfrage_start(Karte* karte)
{
// wenn die ablage der karte moeglich ist
if (ablage_moeglich(karte) == true)
{
// die position des hilfszeiger setzen
meinhilfszeiger->setPos(QPointF(boundingRect().width() / 2 - meinhilfszeiger->boundingRect().width() / 2, gesamt_rect().height() + stapelgroesse / BASISSTAPEL_ABSTAND_HILFSZEIGER_VERHAELTNIS));
meinhilfszeiger->show();
}
}
void Basisstapel::hilfsanfrage_ende()
{
// den hilfszeiger verstecken
meinhilfszeiger->hide();
}
void Basisstapel::undo_karten_ablage(Karte* karte)
{
// die oberste karte,oder den stapel, wenn keine karte vorhanden ist zum parent der karte machen
if (oberste_karte() == 0) karte->setParentItem(this);
else karte->setParentItem(oberste_karte());
// die position der karte einstellen
karte->setPos(ablageposition());
// die karte aus dem alten stapel entfernen
karte->eigentuemer_stapel()->entferne_karte(karte);
// der karten den stapel, zu der sie jetzt gehoert mitteilen
karte->setze_meinstapel(this);
// die rueckkehrposition der karte anpassen
karte->setze_rueckehrkoordinaten(karte->pos());
// den zwert der karte setzen
karte->setZValue(zwert());
// die karte in die kartenliste einfuegen
kartenliste.append(karte);
// die kinder karten der karten ebenfalls ablegen
lege_child_karten_ab(karte);
}
const QStringList Basisstapel::speichere() const
{
QStringList erg;
// den namen des stapels als id speichern
erg.append(objectName());
// die enthaltenen karten speichern
QString karten;
for (register int idx = 0; idx < kartenliste.size(); idx++)
{
if (idx > 0) karten.append(BASISSTAPEL_KARTEN_SPLITTER);
karten.append(kartenliste.at(idx)->objectName());
}
erg.append(karten);
return erg;
}
bool Basisstapel::lade(const QStringList& daten)
{
bool erg = false;
if (daten.size() >= BASISSTAPEL_ANZAHL_SPEICHERELEMENTE && daten.first() == objectName())
{
erg = true;
// die enthaltenen karten laden und an den stapel anhaengen
QStringList karten(daten.at(BASISSTAPEL_KARTEN_IDX).split(BASISSTAPEL_KARTEN_SPLITTER, QString::SkipEmptyParts));
for (register int idx = 0; idx < karten.size(); idx++)
{
Karte *karte = meine_scene->suche_karte(karten.at(idx));
if (karte == 0) erg = false;
else initialisiere_karte(karte);
}
}
return erg;
}
void Basisstapel::passe_groesse_an(double wert)
{
stapelgroesse = wert;
bild_skaliert = bild.scaledToHeight(stapelgroesse, Qt::SmoothTransformation);
setPixmap(bild_skaliert);
// auch den hiflszeiger und den rahmen anpassen
if (meinhilfszeiger != 0) meinhilfszeiger->passe_groesse_an(boundingRect());
if (meinrahmen != 0) meinrahmen->passe_groesse_an(boundingRect());
}
bool Basisstapel::eine_wird_gezogen()
{
return nur_eine_ziehen;
}

View File

@ -1,85 +0,0 @@
#ifndef BASISSTAPEL_H
#define BASISSTAPEL_H
#include "Zug.h"
#include <QGraphicsPixmapItem>
#include <QObject>
#include <QPixmap>
#include <QList>
#include <QPointF>
#include <QRectF>
class Karte;
class Siegkontrolle;
class Rahmen;
class Hilfszeiger;
class Scene;
class Basisstapel : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public:
Basisstapel(const QPixmap& pixmap, Scene* oparent, QGraphicsItem* gparent = 0);
virtual ~Basisstapel();
void registriere_rahmen(Rahmen*);
void zeige_rahmen();
virtual bool beruehrungstest(Karte*);
virtual Karte* oberste_karte() const;
virtual bool ist_oberste_karte(Karte*);
virtual void lege_child_karten_ab(Karte*);
virtual void erhoehe_zwert();
virtual void normalisiere_zwert();
virtual int karten() const;
virtual void setze_kartenliste_zurueck();
virtual QRectF gesamt_rect() const;
virtual int ueberlappungs_flaeche(Karte*);
virtual bool nur_eine_wird_gezogen() const;
virtual bool ablage_moeglich(Karte *) const;
virtual bool lege_karte_ab(Karte*);
virtual void undo_karten_ablage(Karte*);
virtual void initialisiere_karte(Karte*);
virtual void karte_wurde_aufgedeckt(Karte*);
virtual void ablage_erfolgt();
virtual void entferne_karte(Karte*);
virtual void registriere_costapel(Basisstapel*);
virtual void registriere_austeilstapel(Basisstapel*);
virtual void resette_ablagenummer();
virtual void registriere_siegkontrolle(Siegkontrolle*);
virtual void registriere_nachbar_zielstapel(Basisstapel*, Basisstapel*, Basisstapel*);
virtual const QStringList speichere() const;
virtual bool lade(const QStringList&);
bool eine_wird_gezogen();
public slots:
virtual void eine_ziehen();
virtual void drei_ziehen();
virtual void hilfsanfrage_start(Karte*);
virtual void hilfsanfrage_ende();
virtual void passe_groesse_an(double);
signals:
void zug(const Zug&);
void stapel_durch();
protected:
QList<Karte*> kartenliste;
virtual QPointF ablageposition() const;
virtual int zwert() const;
private:
Scene *meine_scene;
bool nur_eine_ziehen;
Rahmen *meinrahmen;
Hilfszeiger *meinhilfszeiger;
QPixmap bild, bild_skaliert;
double stapelgroesse;
virtual void alle_karten_einreihen();
};
#endif

View File

@ -1,180 +0,0 @@
#include "Highscore.h"
#include "Proportionen.h"
#include <QTableWidgetItem>
#include <QStringList>
#include <QDir>
#include <QInputDialog>
#include <QSettings>
using namespace std;
Highscore::Highscore(QWidget *parent) : QDialog(parent), einstellungen(0)
{
setupUi(this);
tabelle->setRowCount(HIGHSCORE_ZEILEN);
// die tabelle mit elementen befuellen
for (register int idx1 = 0; idx1 < tabelle->rowCount(); idx1++)
{
for (register int idx2 = 0; idx2 <= HIGHSCORE_ZEIT_POSITION; idx2++)
{
QTableWidgetItem *tmp_item = new QTableWidgetItem();
tmp_item->setText(HIGHSCORE_LEER);
tabelle->setItem(idx1, idx2, tmp_item);
}
}
}
Highscore::~Highscore()
{
}
bool Highscore::neues_ergebnis(int punkte, long sekunden)
{
bool erg = false;
int ziel = -1;
for (register int idx = HIGHSCORE_ZEILEN - 1; idx >= 0; idx--)
{
int element_sekundenverbrauch = 0, element_ergebnis = 0;
QStringList tmp_zeit(tabelle->item(idx, HIGHSCORE_ZEIT_POSITION)->text().split(HIGHSCORE_SPLITTER, QString::SkipEmptyParts));
// wenn das element an idx leer ist ist es auf jeden fall unterlegen
if (tabelle->item(idx, HIGHSCORE_NAME_POSITION)->text() == HIGHSCORE_LEER || tabelle->item(idx, HIGHSCORE_PUNKTE_POSITION)->text() == HIGHSCORE_LEER || tabelle->item(idx, HIGHSCORE_ZEIT_POSITION)->text() == HIGHSCORE_LEER)
{
ziel = idx;
}
// ansonsten
else if (tmp_zeit.size() == 3)
{
// die bewertung des tabellenelements an idx berechnen. je mehr mienen und felder, je mehr punkte
element_ergebnis = tabelle->item(idx, HIGHSCORE_PUNKTE_POSITION)->text().toInt();
// den sekundenverbrauch fuer des tabellenelements an idx berechnen
element_sekundenverbrauch = (tmp_zeit.at(0).toInt() * 3600) + (tmp_zeit.at(1).toInt() * 60) + tmp_zeit.at(2).toInt();
}
// wenn das neue ergebnis mehr punkte hat als das tabellenelement oder gleich viel punkte wie das tabellenelement enthaelt, aber weniger zeit verbraucht hat ist es ueberlegen
if (punkte > element_ergebnis || (punkte == element_ergebnis && sekunden < element_sekundenverbrauch)) ziel = idx;
}
// wenn das neue element in die tabelle darf
if (ziel >= 0 && ziel < tabelle->rowCount())
{
// eine neue reihe an ziel in die tabelle einfuegen ...
tabelle->insertRow(ziel);
// ... und mit elementen befuellen
tabelle->setItem(ziel, HIGHSCORE_NAME_POSITION, new QTableWidgetItem());
tabelle->setItem(ziel, HIGHSCORE_PUNKTE_POSITION, new QTableWidgetItem());
tabelle->setItem(ziel, HIGHSCORE_ZEIT_POSITION, new QTableWidgetItem());
// der letzte muss die tabelle verlassen
tabelle->removeRow(tabelle->rowCount() - 1);
erg = true;
bool ok;
// den namen des nutzers abfragen
QString name_vorbereitung(QDir::home().dirName());
// wenn name_vorbereitung nicht leer ist
if (name_vorbereitung.isEmpty() == false)
{
QChar erstes_zeichen = name_vorbereitung.at(0);
if (erstes_zeichen.isLower() == true) name_vorbereitung[0] = erstes_zeichen.toUpper();
}
QString name = QInputDialog::getText(parentWidget(), tr("Patience"), tr("You got a Highscore !"), QLineEdit::Normal, name_vorbereitung, &ok);
// wenn kein nutzername eingegeben wurde den namen auf unbekannt setzen
if (ok == false || name.isEmpty() == true) name = tr("Unknown");
// wenn der name LEER entspricht den namen ebenfalls auf unbekannt setzen
if (name == HIGHSCORE_LEER) name = tr("Unknown");
int stunden = sekunden / 3600;
int minuten = (sekunden - (stunden * 3600)) / 60;
int sekunden_ = sekunden - (minuten * 60) - (stunden * 3600);
QString stunden_string = QString::number(stunden);
QString minuten_string = QString::number(minuten);
QString sekunden_string = QString::number(sekunden_);
if (stunden < 10) stunden_string.prepend('0');
if (minuten < 10) minuten_string.prepend('0');
if (sekunden_ < 10) sekunden_string.prepend('0');
tabelle->item(ziel, HIGHSCORE_NAME_POSITION)->setText(name);
tabelle->item(ziel, HIGHSCORE_PUNKTE_POSITION)->setText(QString::number(punkte));
tabelle->item(ziel, HIGHSCORE_ZEIT_POSITION)->setText(stunden_string + HIGHSCORE_SPLITTER + minuten_string + HIGHSCORE_SPLITTER + sekunden_string);
// die highscoretabelle anzeigen
show();
}
return erg;
}
void Highscore::registriere_einstellungen(QSettings* einstellungen_)
{
einstellungen = einstellungen_;
}
void Highscore::einstellungen_laden()
{
if (einstellungen != 0)
{
// die breite der spalten laden
tabelle->setColumnWidth(HIGHSCORE_NAME_POSITION, einstellungen->value(QString("tabelle/spalte_") + QString::number(HIGHSCORE_NAME_POSITION), HIGHSCORE_NAME_SPALTE_STANDARTGROESSE).toInt());
tabelle->setColumnWidth(HIGHSCORE_PUNKTE_POSITION, einstellungen->value(QString("tabelle/spalte_") + QString::number(HIGHSCORE_PUNKTE_POSITION), tabelle->columnWidth(HIGHSCORE_PUNKTE_POSITION)).toInt());
tabelle->setColumnWidth(HIGHSCORE_ZEIT_POSITION, einstellungen->value(QString("tabelle/spalte_") + QString::number(HIGHSCORE_ZEIT_POSITION), tabelle->columnWidth(HIGHSCORE_ZEIT_POSITION)).toInt());
}
// den inhalt der tabelle laden
for (register int idx = 0; idx < tabelle->rowCount() && einstellungen != 0; idx++)
{
// den namen laden
tabelle->item(idx, HIGHSCORE_NAME_POSITION)->setText(einstellungen->value(QString("highscore/") + QString::number(idx) + QString("name"), HIGHSCORE_LEER).toString());
// die punkte laden
tabelle->item(idx, HIGHSCORE_PUNKTE_POSITION)->setText(einstellungen->value(QString("highscore/") + QString::number(idx) + QString("breite"), HIGHSCORE_LEER).toString());
// die zeit laden
tabelle->item(idx, HIGHSCORE_ZEIT_POSITION)->setText(einstellungen->value(QString("highscore/") + QString::number(idx) + QString("hoehe"), HIGHSCORE_LEER).toString());
}
}
void Highscore::einstellungen_speichern()
{
// die breite der spalten speichern
einstellungen->setValue(QString("tabelle/spalte_") + QString::number(HIGHSCORE_NAME_POSITION), tabelle->columnWidth(HIGHSCORE_NAME_POSITION));
einstellungen->setValue(QString("tabelle/spalte_") + QString::number(HIGHSCORE_PUNKTE_POSITION), tabelle->columnWidth(HIGHSCORE_PUNKTE_POSITION));
einstellungen->setValue(QString("tabelle/spalte_") + QString::number(HIGHSCORE_ZEIT_POSITION), tabelle->columnWidth(HIGHSCORE_ZEIT_POSITION));
// den inhalt der tabelle speichern
for (register int idx = 0; idx < tabelle->rowCount() && einstellungen != 0; idx++)
{
// den namen speichern
einstellungen->setValue(QString("highscore/") + QString::number(idx) + QString("name"), tabelle->item(idx, HIGHSCORE_NAME_POSITION)->text());
// die punkte speichern
einstellungen->setValue(QString("highscore/") + QString::number(idx) + QString("breite"), tabelle->item(idx, HIGHSCORE_PUNKTE_POSITION)->text());
// die zeit speichern
einstellungen->setValue(QString("highscore/") + QString::number(idx) + QString("hoehe"), tabelle->item(idx, HIGHSCORE_ZEIT_POSITION)->text());
}
}

View File

@ -1,27 +0,0 @@
#ifndef HIGHSCORE_H
#define HIGHSCORE_H
#include <QDialog>
#include <QString>
#include "ui_Highscore.h"
class QSettings;
class Highscore : public QDialog, private Ui::Highscore
{
Q_OBJECT
public:
Highscore(QWidget *parent);
virtual ~Highscore();
bool neues_ergebnis(int, long);
void registriere_einstellungen(QSettings*);
void einstellungen_laden();
void einstellungen_speichern();
private:
QSettings *einstellungen;
};
#endif

View File

@ -1,111 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Highscore</class>
<widget class="QDialog" name="Highscore">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>528</width>
<height>300</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>528</width>
<height>300</height>
</size>
</property>
<property name="windowTitle">
<string>Patience - Highscore</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableWidget" name="tabelle">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Points</string>
</property>
</column>
<column>
<property name="text">
<string>Time</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok_button">
<property name="text">
<string>Ok</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>ok_button</sender>
<signal>clicked()</signal>
<receiver>Highscore</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>485</x>
<y>275</y>
</hint>
<hint type="destinationlabel">
<x>356</x>
<y>263</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,49 +0,0 @@
#include "Hilfszeiger.h"
#include "Basisstapel.h"
#include "Proportionen.h"
#include <QPainter>
using namespace std;
Hilfszeiger::Hilfszeiger(Basisstapel *parent) : QObject(parent), QGraphicsItem(parent), meinstapel(parent), breite(parent->boundingRect().width() / HILFSZEIGER_BREITE_VERHAELTNIS), hoehe(parent->boundingRect().height() / HILFSZEIGER_HOEHE_VERHAELTNIS), dicke(parent->boundingRect().height() / HILFSZEIGER_DICKE_VERHAELTNIS)
{
setZValue(1000);
}
Hilfszeiger::~Hilfszeiger()
{
}
void Hilfszeiger::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
{
painter->setPen(Qt::darkBlue);
painter->setBrush(Qt::darkBlue);
QPen stift(painter->pen());
stift.setWidth(dicke);
painter->setPen(stift);
painter->drawLine(breite / 2, 0 + (dicke / 2), breite / 2, hoehe - (dicke / 2));
painter->drawLine(breite / 2, 0 + (dicke / 2), dicke / 2, (hoehe / 2));
painter->drawLine(breite / 2, 0 + (dicke / 2), breite - (dicke / 2), (hoehe / 2));
}
QRectF Hilfszeiger::boundingRect() const
{
return QRectF(0, 0, breite, hoehe);
}
void Hilfszeiger::passe_groesse_an(const QRectF& wert)
{
prepareGeometryChange();
breite = wert.width() / HILFSZEIGER_BREITE_VERHAELTNIS;
hoehe = wert.height() / HILFSZEIGER_HOEHE_VERHAELTNIS;
dicke = wert.height() / HILFSZEIGER_DICKE_VERHAELTNIS;
update();
}

View File

@ -1,27 +0,0 @@
#ifndef HILFSZEIGER_H
#define HILFSZEIGER_H
#include <QObject>
#include <QGraphicsItem>
class Basisstapel;
class Hilfszeiger : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
Hilfszeiger(Basisstapel *parent);
virtual ~Hilfszeiger();
virtual QRectF boundingRect() const;
void passe_groesse_an(const QRectF&);
private:
Basisstapel *meinstapel;
double breite, hoehe, dicke;
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
};
#endif

View File

@ -1,424 +0,0 @@
#include "Karte.h"
#include "Basisstapel.h"
#include "Proportionen.h"
#include "Scene.h"
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
using namespace std;
Karte::Karte(const QPixmap& vorderseite, const QPixmap& hinterseite, Scene *oparent, QGraphicsItem *gparent) : QObject(oparent), QGraphicsPixmapItem(hinterseite, gparent), vorne(vorderseite), hinten(hinterseite), vorne_skaliert(vorderseite), hinten_skaliert(hinterseite), Wert(0), vorderseite_oben(false), rahmen_anzeigen(true), double_click_sperre(false), gegrabbt(false), scene(oparent), kreutzstapel(0), pikstapel(0), herzstapel(0), karostapel(0), kartengroesse(vorderseite.height())
{
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
}
Karte::~Karte()
{
}
void Karte::setze_farbe(const QString& farbe_)
{
Farbe = farbe_;
}
const QString& Karte::farbe() const
{
return Farbe;
}
void Karte::setze_wert(int wert_)
{
Wert = wert_;
}
int Karte::wert() const
{
return Wert;
}
void Karte::zeige_vorderseite()
{
vorderseite_oben = true;
setPixmap(vorne_skaliert);
Meinstapel->karte_wurde_aufgedeckt(this);
// wenn es sich beim stapel nicht um austeilcostapel handelt die karte beweglich machen
if (Meinstapel->objectName() != BASISSTAPEL_AUSTEILCOSTAPEL) setFlag(QGraphicsItem::ItemIsMovable, true);
// ansonsten die karte unbeweglich machen. dies muss spaeter, im mouse release event wieder rueckgaengig gemacht werden
else setFlag(QGraphicsItem::ItemIsMovable, false);
}
void Karte::zeige_rueckseite()
{
vorderseite_oben = false;
setPixmap(hinten_skaliert);
setFlag(QGraphicsItem::ItemIsMovable, false);
}
bool Karte::ist_vorderseite() const
{
return vorderseite_oben;
}
bool Karte::ist_rueckseite() const
{
return !vorderseite_oben;
}
void Karte::registriere_stapel(const QList<Basisstapel*>& stapelliste_)
{
stapelliste = stapelliste_;
}
void Karte::setze_meinstapel(Basisstapel *meinstapel_)
{
Meinstapel = meinstapel_;
}
void Karte::setze_rueckehrkoordinaten(const QPointF& punkt)
{
Rueckkehrkoordinaten = punkt;
}
// diese methode ist fuer das ablegen der karte auf dem passenden zielstapel zustaendig, sofern moeglich
void Karte::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
{
if (event->buttons() == Qt::LeftButton && gegrabbt == false && flags() == QGraphicsItem::ItemIsMovable && event->button() == Qt::LeftButton && ist_vorderseite() == true && Meinstapel->ist_oberste_karte(this) == true && hat_kinderkarten() == false && Meinstapel->objectName().contains(BASISSTAPEL_ZIELSTAPEL) == false)
{
// nach einem double click soll die karte bis zum naechsten release gegen bewegungen geschuetzt werden
double_click_sperre = true;
// die karte soll nicht mehr über die anderen erhoeht werden
Meinstapel->normalisiere_zwert();
if (farbe() == KARTEN_KREUTZ) kreutzstapel->lege_karte_ab(this);
else if (farbe() == KARTEN_PIK) pikstapel->lege_karte_ab(this);
else if (farbe() == KARTEN_HERZ) herzstapel->lege_karte_ab(this);
else if (farbe() == KARTEN_KARO) karostapel->lege_karte_ab(this);
// sicherstellen, das die scene aktualisiert wird
scene->update();
}
}
void Karte::mousePressEvent(QGraphicsSceneMouseEvent* event)
{
// linke maustaste
if (event->button() == Qt::LeftButton && gegrabbt == false)
{
gegrabbt = true;
// die karte soll ueber den anderen erhoeht angezeigt werden
Meinstapel->erhoehe_zwert();
if (ist_vorderseite() == true) QGraphicsPixmapItem::mousePressEvent(event);
// wenn diese karte die oberste karte ist und noch nicht die vorderseite gezeigt wird die vorderseite zeigen
else if (Meinstapel->ist_oberste_karte(this) == true && ist_vorderseite() == false) zeige_vorderseite();
}
// wenn die rechte maustaste gedrueckt wurde und die karte beweglich, jedoch nicht gegrabbt ist eine hilfsanfrage starten
else if (event->button() == Qt::RightButton && flags() == QGraphicsItem::ItemIsMovable && gegrabbt == false)
{
gegrabbt = true;
emit hilfsanfrage_start(this);
}
}
void Karte::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
{
// die karte soll nicht mehr über die anderen erhoeht werden
Meinstapel->normalisiere_zwert();
QGraphicsPixmapItem::mouseReleaseEvent(event);
// nur wenn keine weitere maustaste mehr gehalten wird
if (event->buttons() == Qt::NoButton)
{
// wenn double klick sperre nicht aktive ist
if (double_click_sperre == false)
{
Basisstapel *ziel = suche_ziel();
if (ziel == 0) setPos(Rueckkehrkoordinaten);
else if (ziel != 0 && ziel->lege_karte_ab(this) == false) setPos(Rueckkehrkoordinaten);
else setPos(Rueckkehrkoordinaten);
// die ist noetig, weil beim aufdecken auf dem austeilcostapel die karte unbeweglich gemacht wurde. dies ist jedoch nur zulaessig, wenn nur eine karte gezogen wird. wenn 3 gezogen werden, erfolgt die freigabe aus dem austeilstapel heraus
if (Meinstapel->objectName() == BASISSTAPEL_AUSTEILCOSTAPEL && Meinstapel->nur_eine_wird_gezogen() == true) setFlag(QGraphicsItem::ItemIsMovable, true);
}
// wenn double klick sperre doch aktive ist
else setPos(Rueckkehrkoordinaten);
}
// wenn doch noch eine weitere maustaste gehalten wird
else setPos(Rueckkehrkoordinaten);
// den rahmen wieder verstecken
emit rahmen_verstecken();
// den hilfs pfeil wieder ausblenden
emit hilfsanfrage_ende();
// die double click sperre wieder aufheben, damit die karte zukuenftig wieder beweglich ist
double_click_sperre = false;
gegrabbt = false;
// sicherstellen, das das element nicht laenger gegrabbt ist !!!
ungrabMouse();
}
Basisstapel* Karte::eigentuemer_stapel()
{
return Meinstapel;
}
void Karte::registriere_zielstapel(Basisstapel* kreutzstapel_, Basisstapel* pikstapel_, Basisstapel* herzstapel_, Basisstapel* karostapel_)
{
kreutzstapel = kreutzstapel_;
pikstapel = pikstapel_;
herzstapel = herzstapel_;
karostapel = karostapel_;
}
void Karte::setze_kartenbilder(const QPixmap& vorne_, const QPixmap& hinten_)
{
vorne = vorne_;
hinten = hinten_;
passe_groesse_an(kartengroesse);
}
Basisstapel* Karte::suche_ziel()
{
QList<Basisstapel*> moegliche_ziele(stapelliste);
Basisstapel *erg = 0;
// den eigenen stapel aus moegliche_ziele entfernen
moegliche_ziele.removeAll(Meinstapel);
// alle unmoeglichen stapel entfernen
for (register int idx = 0; idx < moegliche_ziele.size(); idx++) if (moegliche_ziele.at(idx)->ablage_moeglich(this) == false && (moegliche_ziele.at(idx)->objectName().contains("ziel") == false || (moegliche_ziele.at(idx)->objectName().contains("ziel") == true && kreutzstapel->ablage_moeglich(this) == false && pikstapel->ablage_moeglich(this) == false && herzstapel->ablage_moeglich(this) == false && karostapel->ablage_moeglich(this) == false)))
{
moegliche_ziele.removeAt(idx);
idx--;
}
// wenn das ziel noch nicht eindeutig ist die groesste ueberlappung finden
if (moegliche_ziele.size() > 1)
{
// das ziel mit der groessten ueberlappenden flaeche finden
Basisstapel *ziel = 0;
int groesste_ueberlappung = 0;
for (register int idx = 0; idx < moegliche_ziele.size(); idx++)
{
int ueberlappung = moegliche_ziele.at(idx)->ueberlappungs_flaeche(this);
if (ueberlappung > groesste_ueberlappung)
{
groesste_ueberlappung = ueberlappung;
ziel = moegliche_ziele.at(idx);
}
}
erg = ziel;
}
else if (moegliche_ziele.size() == 1) erg = moegliche_ziele.first();
// besteht mit dem sieger eine beruehrung ?
if (erg != 0 && erg->beruehrungstest(this) == false) erg = 0;
// wird ein zielstapel angepeilt?
if (erg != 0 && erg->objectName().contains("ziel") == true)
{
if (farbe() == KARTEN_KREUTZ && kreutzstapel->ablage_moeglich(this) == true) erg = kreutzstapel;
else if (farbe() == KARTEN_PIK && pikstapel->ablage_moeglich(this) == true) erg = pikstapel;
else if (farbe() == KARTEN_HERZ && herzstapel->ablage_moeglich(this) == true) erg = herzstapel;
else if (farbe() == KARTEN_KARO && karostapel->ablage_moeglich(this) == true) erg = karostapel;
else erg = 0;
}
return erg;
}
void Karte::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
{
if (gegrabbt == true)
{
if (double_click_sperre == false && event->buttons() == Qt::LeftButton) QGraphicsPixmapItem::mouseMoveEvent(event);
else setPos(Rueckkehrkoordinaten);
if (rahmen_anzeigen == true)
{
Basisstapel *ziel = suche_ziel();
if (ziel != 0) ziel->zeige_rahmen();
else
{
emit rahmen_verstecken();
}
}
}
}
void Karte::sichtbarkeit_rahmen(bool wert)
{
rahmen_anzeigen = wert;
}
QRectF Karte::gesamt_rect()
{
QRectF erg(sceneBoundingRect());
Karte *testkarte = unterste_karte();
erg.setBottomRight(testkarte->sceneBoundingRect().bottomRight());
return erg;
}
Karte* Karte::unterste_karte()
{
Karte *erg = this;
if (hat_kinderkarten() == true) erg = kinderkarten().last();
return erg;
}
// wenn die karte child items besitzt, die nicht vom typ karte sind muessen diese hier herausgefiltert werden !!!
bool Karte::hat_kinderkarten() const
{
bool erg = false;
if (childItems().size() > 1)
{
qDebug() << tr("The Card ") << objectName() << tr(" have more than one Child Card");
exit(1);
}
if (childItems().size() > 0) erg = true;
return erg;
}
// wenn die karte child items besitzt, die nicht vom typ karte sind muessen diese hier herausgefiltert werden !!!
QList<Karte*> Karte::kinderkarten()
{
QList<Karte*> erg;
if (childItems().size() > 1)
{
qDebug() << tr("The Card ") << objectName() << tr(" have more than one Child Card");
exit(1);
}
if (childItems().isEmpty() == false) erg.append((Karte*) childItems().first());
if (erg.isEmpty() == false) erg.append(erg.first()->kinderkarten());
return erg;
}
const QStringList Karte::speichere() const
{
QStringList erg;
// die karten id speichern
erg.append(objectName());
// die kartenseite speichern
erg.append(QString::number(ist_vorderseite()));
return erg;
}
bool Karte::lade(const QStringList& daten)
{
bool erg = false;
if (daten.size() == KARTE_ANZAHL_SPEICHERELEMENTE && daten.first() == objectName())
{
erg = true;
if (daten.at(KARTE_IST_VORNE_IDX).toInt() == 1) zeige_vorderseite();
else zeige_rueckseite();
}
return erg;
}
void Karte::passe_groesse_an(double wert)
{
kartengroesse = wert;
vorne_skaliert = vorne.scaledToHeight(kartengroesse, Qt::SmoothTransformation);
hinten_skaliert = hinten.scaledToHeight(kartengroesse, Qt::SmoothTransformation);
if (ist_vorderseite() == true) setPixmap(vorne_skaliert);
else setPixmap(hinten_skaliert);
}
void Karte::nach_hause()
{
setPos(Rueckkehrkoordinaten);
emit rahmen_verstecken();
if (scene->mouseGrabberItem() == this) ungrabMouse();
}
void Karte::speichere_zuhause()
{
Rueckkehrkoordinaten = pos();
}

View File

@ -1,74 +0,0 @@
#ifndef KARTE_H
#define KARTE_H
#include <QObject>
#include <QGraphicsPixmapItem>
#include <QGraphicsItem>
#include <QPixmap>
#include <QColor>
#include <QList>
#include <QPointF>
class Scene;
class Basisstapel;
class Karte : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public:
Karte(const QPixmap& vorderseite, const QPixmap& hinterseite, Scene *oparent, QGraphicsItem *gparent = 0);
virtual ~Karte();
void setze_farbe(const QString&);
const QString& farbe() const;
void setze_wert(int);
int wert() const;
bool ist_vorderseite() const;
bool ist_rueckseite() const;
void registriere_stapel(const QList<Basisstapel*>& stapelliste_);
void setze_meinstapel(Basisstapel *meinstapel_);
void setze_rueckehrkoordinaten(const QPointF&);
void registriere_zielstapel(Basisstapel* kreutzstapel_, Basisstapel* pikstapel_, Basisstapel* herzstapel_, Basisstapel* karoherzstapel_);
Basisstapel* eigentuemer_stapel();
void setze_kartenbilder(const QPixmap&, const QPixmap&);
Basisstapel* suche_ziel();
QList<Karte*> kinderkarten();
QRectF gesamt_rect();
Karte* unterste_karte();
bool hat_kinderkarten() const;
const QStringList speichere() const;
bool lade(const QStringList&);
void nach_hause();
void speichere_zuhause();
public slots:
void zeige_vorderseite();
void zeige_rueckseite();
void sichtbarkeit_rahmen(bool);
void passe_groesse_an(double);
signals:
void rahmen_verstecken();
void hilfsanfrage_start(Karte*);
void hilfsanfrage_ende();
private:
QPixmap vorne, hinten, vorne_skaliert, hinten_skaliert;
QString Farbe;
int Wert;
bool vorderseite_oben, rahmen_anzeigen, double_click_sperre, gegrabbt;
Scene *scene;
QList<Basisstapel*> stapelliste;
Basisstapel *Meinstapel;
QPointF Rueckkehrkoordinaten;
Basisstapel *kreutzstapel, *pikstapel, *herzstapel, *karostapel;
double kartengroesse;
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
};
#endif

Some files were not shown because too many files have changed in this diff Show More