diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index 4d91cc4..0000000 --- a/CHANGELOG +++ /dev/null @@ -1,11 +0,0 @@ -2.0 -=== - -* Separate language data into a different project -* Ability to download language data -* Make some use of local colours - -1.0 -=== - -* First version diff --git a/Makefile b/Makefile deleted file mode 100644 index d555faf..0000000 --- a/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -# parolottero -# Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# author Salvo "LtWorf" Tomaselli - -.PHONY: clean -clean: - $(RM) deb-pkg - -.PHONY: dist -dist: - rm -rf /tmp/parolottero/ - rm -rf /tmp/parolottero-* - mkdir /tmp/parolottero/ - cp -R * /tmp/parolottero/ - ( \ - cd /tmp; \ - tar --exclude '*.user' -zcf parolottero.tar.gz \ - parolottero/src \ - parolottero/Makefile \ - parolottero/LICENSE \ - parolottero/README.md \ - parolottero/CHANGELOG \ - parolottero/CODE_OF_CONDUCT.md \ - ) - mv /tmp/parolottero.tar.gz ./parolottero_`head -1 CHANGELOG`.orig.tar.gz - gpg --sign --armor --detach-sign ./parolottero_`head -1 CHANGELOG`.orig.tar.gz - -.PHONY: deb-pkg -deb-pkg: dist - $(RM) -r /tmp/parolottero* - mv parolottero*orig* /tmp - cd /tmp; tar -xf parolottero*orig*.gz - cp -r debian /tmp/parolottero/ - cd /tmp/parolottero; dpkg-buildpackage --changes-option=-S - mkdir -p deb-pkg - mv /tmp/parolottero*.* deb-pkg - lintian --pedantic -E --color auto -i -I deb-pkg/*changes deb-pkg/*deb - -translations: - cd src; lupdate -verbose parolottero.pro diff --git a/README.md b/README.md index 2b1571d..d4279ac 100644 --- a/README.md +++ b/README.md @@ -3,49 +3,4 @@ Parolottero Interactive game inspired by Passaparola (which I later learnt was inspired by Boggle). - -Game modes ----------- - -You can either challenge yourself or other people. - -To play against other people you will all need a device and will need to set the seed and timer to the same value, in order to obtain the same board. - - -Playing -------- - -[Gameplay video](https://www.youtube.com/watch?v=NEwD4Rn_nPQ) - - -Installing ----------- - -The preferred mode is to install the .deb file. - -Building --------- - -Refer to debian/control for the list of build-time and run-time dependencies. - -You must do - -``` -mkdir build -cd build -qmake ../src -make -j -``` - -Game files ----------- - -See here: https://github.com/ltworf/parolottero-languages - - -Contributing ------------- - -Contributions are welcome both via git send mail to tiposchi@tiscali.it or github pull requests. - -To report bugs on words you can enable bug reporting. Edit `~/.config/Parolottero/Parolottero.conf` and enable. You should use your own github token rather than the provided one. It needs the `public_repo` permission +[THE PROJECT HAS BEEN MOVED](https://codeberg.org/parolottero/) diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 566f6cd..0000000 --- a/debian/changelog +++ /dev/null @@ -1,18 +0,0 @@ -parolottero (2.0-1) UNRELEASED; urgency=low - - * New upstream release - - -- Salvo 'LtWorf' Tomaselli Sun, 16 Oct 2022 19:40:03 +0200 - -parolottero (1.0-1.1) unstable; urgency=medium - - * Non-maintainer upload. - * No change source-only upload for testing migration. - - -- Boyuan Yang Sat, 15 Oct 2022 15:58:42 -0400 - -parolottero (1.0-1) unstable; urgency=low - - * Initial release. (Closes: #1006156) - - -- Salvo 'LtWorf' Tomaselli Sat, 12 Mar 2022 20:30:17 +0100 diff --git a/debian/control b/debian/control deleted file mode 100644 index 40b1925..0000000 --- a/debian/control +++ /dev/null @@ -1,31 +0,0 @@ -Source: parolottero -Section: games -Priority: optional -Maintainer: Salvo 'LtWorf' Tomaselli -Build-Depends: - debhelper-compat (= 13), - qt5-qmake, - qtbase5-dev, - qttools5-dev-tools, - qtdeclarative5-dev -Standards-Version: 4.6.1.0 -Homepage: https://github.com/ltworf/parolottero -Vcs-Browser: https://github.com/ltworf/parolottero -Rules-Requires-Root: no - -Package: parolottero -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends}, - qml-module-qt-labs-settings, - qml-module-qtquick-window2, - qml-module-qtquick-controls2, - qml-module-qtquick-layouts, - qml-module-qtquick2 -Recommends: - qtwayland5 -Description: Compose words using a 4x4 grid of letters - A word game intended for touch screens. - . - Players must drag their finger (or mouse) over random letters in a 4x4 grid - to compose as many words as they can, until the time runs out. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 50a6392..0000000 --- a/debian/copyright +++ /dev/null @@ -1,671 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Contact: Salvo "LtWorf" Tomaselli -Source: https://github.com/ltworf/parolottero -Upstream-Name: parolottero - -Files: * -Copyright: © 2021-2022 Salvo "LtWorf" Tomaselli -License: AGPL-3 - -License: AGPL-3 - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - . - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - . - Preamble - . - The GNU Affero General Public License is a free, copyleft license for - software and other kinds of works, specifically designed to ensure - cooperation with the community in the case of network server software. - . - The licenses for most software and other practical works are designed - to take away your freedom to share and change the works. By contrast, - our General Public Licenses are 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. - . - 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. - . - Developers that use our General Public Licenses protect your rights - with two steps: (1) assert copyright on the software, and (2) offer - you this License which gives you legal permission to copy, distribute - and/or modify the software. - . - A secondary benefit of defending all users' freedom is that - improvements made in alternate versions of the program, if they - receive widespread use, become available for other developers to - incorporate. Many developers of free software are heartened and - encouraged by the resulting cooperation. However, in the case of - software used on network servers, this result may fail to come about. - The GNU General Public License permits making a modified version and - letting the public access it on a server without ever releasing its - source code to the public. - . - The GNU Affero General Public License is designed specifically to - ensure that, in such cases, the modified source code becomes available - to the community. It requires the operator of a network server to - provide the source code of the modified version running there to the - users of that server. Therefore, public use of a modified version, on - a publicly accessible server, gives the public access to the source - code of the modified version. - . - An older license, called the Affero General Public License and - published by Affero, was designed to accomplish similar goals. This is - a different license, not a version of the Affero GPL, but Affero has - released a new version of the Affero GPL which permits relicensing under - this license. - . - 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. - . - Notwithstanding any other provision of this License, if you modify the - Program, your modified version must prominently offer all users - interacting with it remotely through a computer network (if your version - supports such interaction) an opportunity to receive the Corresponding - Source of your version by providing access to the Corresponding Source - from a network server at no charge, through some standard or customary - means of facilitating copying of software. This Corresponding Source - shall include the Corresponding Source for any work covered by version 3 - of the GNU General Public License that is incorporated pursuant to the - following paragraph. - . - 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 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 work with which it is combined will remain governed by version - 3 of the GNU General Public License. - . - 14. Revised Versions of this License. - . - The Free Software Foundation may publish revised and/or new versions of - the GNU Affero 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 Affero 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 Affero 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 Affero 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. - . - - Copyright (C) - . - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero 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 Affero General Public License for more details. - . - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - . - Also add information on how to contact you by electronic and paper mail. - . - If your software can interact with users remotely through a computer - network, you should also make sure that it provides a way for users to - get its source. For example, if your program is a web application, its - interface could display a "Source" link that leads users to an archive - of the code. There are many ways you could offer source, and different - solutions will be better for different programs; see section 13 for the - specific requirements. - . - 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 AGPL, see - . diff --git a/debian/parolottero-data-scn.install b/debian/parolottero-data-scn.install deleted file mode 100644 index 441d0fd..0000000 --- a/debian/parolottero-data-scn.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/share/games/parolottero/language_data/sicilian -usr/share/games/parolottero/language_data/sicilian.wordlist diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 38abd7a..0000000 --- a/debian/rules +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/make -f - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -%: - dh $@ --sourcedirectory=src diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian/upstream/metadata b/debian/upstream/metadata deleted file mode 100644 index dfc2066..0000000 --- a/debian/upstream/metadata +++ /dev/null @@ -1,6 +0,0 @@ -Donation: https://liberapay.com/ltworf -Repository-Browse: https://github.com/ltworf/parolottero -Repository: https://github.com/ltworf/parolottero.git -Changelog: https://raw.githubusercontent.com/ltworf/parolottero/master/CHANGELOG -Bug-Database: https://github.com/ltworf/parolottero/issues -Bug-Submit: https://github.com/ltworf/parolottero/issues/new diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc deleted file mode 100644 index 299126c..0000000 --- a/debian/upstream/signing-key.asc +++ /dev/null @@ -1,233 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQINBEoFq2sBEAC1nrBLTaM2KWj+L944ImJ8Jy0+pmpUuRu2H963/Fbd0oh3APPZ -FvaWJ1YphsRJz0FgJyLqeTGRSTCqdI5WO223mdJY3+sP5hycYuUemTyCaAEn9SLn -AFVK507SCCSVduzbhw1H7ZqFk8730tyJDjkhxdh9Ag9TjS2/VcwNL0wEzOkB4xtX -JJofqJGySpZxLf+3t8kLcgchwrpB4oEQqswplvcwi71Uzfr1eHfsqz+sHeS1DFQV -8QrqH4mBG3DB3cezyk/gPIpH2E7zdV9CgP/3SzBBfbst83q7/uWFhsLyFlmS4RxE -FQcrl6EfYUO6usZyaBlt2LB1IMY8+yOgykhniYcX42EDDu/c9zyD4wMe3u+Kzl+B -AvDk9dCPw5RqRFL4xsM9tYZWPJgwhTvM6MMbtANGWkpqG2ZrZf7xbOSTzOpbJ59o -uVH31rv+nF133Es2oRZZ4OGBgD5e1iRstVeK9bq6XnWSMGDc9zNJheATJSKb80ed -IDOFGmicy/B7E78r/64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BS5+ -UJKb6m16iDf/KfqumN++G5XA9FGv3xUBcPYqmZ9skMZujjS5WVEwSvhKkMFBSyX8 -mBAifhUNgORZYHw7BA5qIDXwrXu4QzTYiIXhk1Z9b/o4bOa8wXU6ffXt5p5VpaU1 -FFNPeArCOWHIdKpzNGw/JXkr+Yl3Oirk9tSUpiwbtlO7/TP3MD01ApHdUa4E9w/k -tgON3SIEFxAzok6l298pcQNpfxx9LxdE5xI9j00CjkQyQv4HHwrjC6885yJ5RPx1 -z97DNjnHqRK50ez3IP9+2g== -=nBaG ------END PGP PUBLIC KEY BLOCK----- diff --git a/debian/watch b/debian/watch deleted file mode 100644 index 741fa59..0000000 --- a/debian/watch +++ /dev/null @@ -1,4 +0,0 @@ -version=4 - -opts=pgpmode=auto \ -https://github.com/ltworf/parolottero/tags (?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index fab7372..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,73 +0,0 @@ -# This file is used to ignore files which are generated -# ---------------------------------------------------------------------------- - -*~ -*.autosave -*.a -*.core -*.moc -*.o -*.obj -*.orig -*.rej -*.so -*.so.* -*_pch.h.cpp -*_resource.rc -*.qm -.#* -*.*# -core -!core/ -tags -.DS_Store -.directory -*.debug -Makefile* -*.prl -*.app -moc_*.cpp -ui_*.h -qrc_*.cpp -Thumbs.db -*.res -*.rc -/.qmake.cache -/.qmake.stash - -# qtcreator generated files -*.pro.user* - -# xemacs temporary files -*.flc - -# Vim temporary files -.*.swp - -# Visual Studio generated files -*.ib_pdb_index -*.idb -*.ilk -*.pdb -*.sln -*.suo -*.vcproj -*vcproj.*.*.user -*.ncb -*.sdf -*.opensdf -*.vcxproj -*vcxproj.* - -# MinGW generated files -*.Debug -*.Release - -# Python byte code -*.pyc - -# Binaries -# -------- -*.dll -*.exe - diff --git a/src/backend/boardmanager.cpp b/src/backend/boardmanager.cpp deleted file mode 100644 index f9fdeb8..0000000 --- a/src/backend/boardmanager.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include - -#include "boardmanager.h" - -BoardManager::BoardManager(QObject *parent) : QObject(parent) -{ } - -void BoardManager::init() { - if (this->language != nullptr) { - this->language = nullptr; - } - this->scoreboard.clear(); - this->multipliers.clear(); - this->letters.clear(); - this->words.clear(); - - if (this->total > 0) { - this->total = 0; - emit total_changed(0); - } - - if (this->_language_index < 0) { - emit playable_changed(false); - return; - } - this->language = this->lang_magr.get_language(this->_language_index); - - //init board - QRandomGenerator* rand; - if (this->use_seed) { - QRandomGenerator rng(this->_seed); - rand = &rng; - } else { - rand = QRandomGenerator::system(); - } - - int seedcount = 0; - QList accumulator; - QStringList words = this->language->get_long_words(); - while (seedcount < 10) { - int index = rand->bounded(words.length()); - QString w = words[index]; - seedcount ++; - for (int i = 0; i < w.length(); i++) - accumulator.append(w[i]); - } - - for (unsigned int i = 0; i < this->get_size(); i++) { - int r = rand->bounded(accumulator.length()); - this->letters.append(accumulator[r]); - accumulator.removeAt(r); - - unsigned int multiplier; - switch (rand->bounded(10)) { - case 3: - multiplier = 3; - break; - case 2: - multiplier = 2; - break; - default: - multiplier = 1; - break; - } - - this->multipliers.append(multiplier); - } - - emit playable_changed(true); - -} - -/** - * @brief BoardManager::input_word - * @param cells - * @return - * - * Pass moves to the board, which returns the score for the given - * sequence. - * - * It also updates the total score. - */ -unsigned int BoardManager::input_word(QList cells) { - if (this->language == nullptr) - return 0; - QString word; - - unsigned int score = 0; - for (int i = 0; i < cells.size(); i++) { - word += this->letters[cells[i]]; - score += this->language->get_score(this->letters[cells[i]]) * this->multipliers[cells[i]]; - } - if (words.contains(word)) { - return 0; - } - - this->words.insert(word); - - if (this->language->is_word(word)) { - this->total += score; - emit total_changed(this->total); - } else - score = 0; - - this->scoreboard.addWord(word, score); - - return score; -} - -/** - * The current scored points for this board - * - * @brief BoardManager::get_total - * @return - */ -unsigned int BoardManager::get_total() { - return this->total; -} - -/** - * Gets the score multiplier at the specified position - * - * The position must be < get_size() - * - * @brief BoardManager::get_multiplier - * @param cell - * @return - */ -unsigned int BoardManager::get_multiplier(unsigned int cell) { - return this->multipliers[cell]; -} - -/** - * Gets the letter at the specified position. - * - * The position must be < get_size() - * - * @brief BoardManager::get_letter - * @param cell - * @return - */ -QString BoardManager::get_letter(unsigned int cell) { - return this->letters[cell]; -} - -/** - * Set a random seed. - * - * It is used to generate the board. - * - * @brief BoardManager::set_seed - * @param seed - */ -void BoardManager::set_seed(unsigned int seed) { - if (seed == this->_seed) - return; - this->_seed = seed; - this->init(); - emit seed_changed(seed); -} - -/** - * @brief BoardManager::get_seed - * @return the random seed in use - */ -unsigned int BoardManager::get_seed() { - return this->_seed; -} - -/** - * Set the language index. - * - * -1 to not have a language. - * - * This makes the board not playable. - * - * Any other value will load the language data and - * initialize the cells. - * - * @brief BoardManager::set_language - * @param language_index - */ -void BoardManager::set_language(int language_index) { - if (language_index == this->_language_index) - return; - this->_language_index = language_index; - this->init(); - emit language_changed(language_index); -} - -/** - * @brief BoardManager::get_language - * @return the index of the currently set language - * - * -1 if no language is set - */ -int BoardManager::get_language() { - return this->_language_index; -} - -/** - * @brief BoardManager::get_playable - * @return true if a language is set - */ -bool BoardManager::get_playable() { - return this->language != nullptr; -} - -/** - * @brief BoardManager::get_size - * @return number of cells on the board - */ -unsigned int BoardManager::get_size() { - return this->rows * this->columns; -} - -bool BoardManager::are_adjacent(unsigned int a, unsigned int b) { - int col_a = a % this->columns; - int row_a = a / this->rows; - - int col_b = b % this->columns; - int row_b = b / this->rows; - - return std::abs(col_a - col_b) < 2 && \ - std::abs(row_a - row_b) < 2; -} - -Scoreboard* BoardManager::get_scoreboard() { - return &this->scoreboard; -} - -void BoardManager::set_use_seed(bool a) { - if (a == this->use_seed) - return; - this->use_seed = a; - emit use_seed_changed(a); -} - -/** - * this defines if the seed property is used or ignored - * - * @brief BoardManager::get_use_seed - * @return - */ -bool BoardManager::get_use_seed() { - return this->use_seed; -} diff --git a/src/backend/boardmanager.h b/src/backend/boardmanager.h deleted file mode 100644 index 3cf89f0..0000000 --- a/src/backend/boardmanager.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef BOARDMANAGER_H -#define BOARDMANAGER_H - -#include -#include -#include -#include - -#include "language.h" -#include "languagemanager.h" -#include "scoreboard.h" - -class BoardManager : public QObject -{ - Q_OBJECT - Q_PROPERTY( - int language - READ get_language - NOTIFY language_changed - WRITE set_language - ) - - Q_PROPERTY( - unsigned int seed - READ get_seed() - WRITE set_seed() - NOTIFY seed_changed - ) - - Q_PROPERTY( - unsigned int total - READ get_total() - NOTIFY total_changed - ) - - Q_PROPERTY( - bool playable - READ get_playable - NOTIFY playable_changed - ) - - Q_PROPERTY( - unsigned int size - READ get_size() - ) - - Q_PROPERTY( - Scoreboard* scoreboard - READ get_scoreboard - CONSTANT - ) - - Q_PROPERTY( - bool use_seed - READ get_use_seed() - WRITE set_use_seed() - NOTIFY use_seed_changed - ) - -public: - explicit BoardManager(QObject *parent = nullptr); - -public slots: - bool are_adjacent(unsigned int a, unsigned int b); - unsigned int input_word(QList cells); - unsigned int get_total(); - unsigned int get_multiplier(unsigned int cell); - QString get_letter(unsigned int cell); - - void set_seed(unsigned int); - unsigned int get_seed(); - - void set_use_seed(bool); - bool get_use_seed(); - - void set_language(int); - int get_language(); - - bool get_playable(); - - unsigned int get_size(); - - Scoreboard* get_scoreboard(); - -signals: - void seed_changed(unsigned int); - void use_seed_changed(bool); - void language_changed(int); - void total_changed(unsigned int); - void playable_changed(bool); - -private: - void init(); - LanguageManager lang_magr; - Language* language = nullptr; - QList letters; - QList multipliers; - Scoreboard scoreboard; - - QSet words; - unsigned int total = 0; - unsigned int _seed = 0; - bool use_seed = false; - int _language_index = -1; - - unsigned int rows = 4; - unsigned int columns = 4; -}; - -#endif // BOARDMANAGER_H diff --git a/src/backend/language.cpp b/src/backend/language.cpp deleted file mode 100644 index 70051b2..0000000 --- a/src/backend/language.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include "language.h" - -#include -#include - -/** - * @brief read_and_strip - * @param file - * @return - * - * Reads 1 line from the file, removes the \n at the end - * and returns the rest as QString - */ -static QString read_and_strip(QFile &file) { - char buf[128]; - qint64 size = file.readLine(buf, sizeof(buf)); - if (size == -1) - return ""; - if (buf[size - 1] == '\n') - buf[size - 1] = '\0'; - return QString(buf); -} - -/** - * @brief wordlistload - * @param file - * @param dest_set - * - * Loads the wordlist file into a QSet - */ -void wordlistload(QFile &file, QSet &dest_set, QStringList &dest_list) { - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - //TODO error - } - - unsigned long long int c = 0; - - while (true) { - QString word = read_and_strip(file); - if (word.size() == 0) - break; - dest_set.insert(word); - if (word.length() >= 5 ) - dest_list.append(word); - c++; - } - qDebug() << "Loaded words" << c; - file.close(); -} - -void Language::load_langfile(QFile &file) { - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - //TODO error - } - - // Read language name - this->name = read_and_strip(file); - - while (true) { - QString line = read_and_strip(file); - if (line.size() == 0) - break; - - QStringList parts = line.split(" "); - this->letters.append(parts[0]); - this->score[parts[0]] = parts[1].toUInt(); - if (parts[2].size()) - this->vowels.append(parts[0]); - } - - file.close(); -} - -/** - * @brief Language::Language - * @param langfile: File with the language definition - * @param wordlist: File with the list of words in the language - * @param parent - * - * Class representing a language. - */ -Language::Language(QFile &langfile, QFile &wordlist, QObject *parent) : QObject(parent) { - wordlistload(wordlist, this->words, this->longwordslist); - this->load_langfile(langfile); -} - -/** - * @brief Language::is_word - * @param word - * @return - * - * Check if a word is in the language. - * - * It must be passed lowercase - */ -bool Language::is_word(QString word) { - qDebug() << "Testing word" << word << this->words.contains(word); - return this->words.contains(word); -} - -/** - * @brief Language::get_score - * @param letter - * @return - * - * Returns the score for a letter. - * - * -1 if the letter doesn't exist - */ -int Language::get_score(QString letter) { - if (!this->score.contains(letter)) - return -1; - return this->score[letter]; -} - -/** - * - * Returns a list of the long words in the language. - * - * Currently long words have to be at least 6 letters. - * - * @brief Language::get_long_words - * @return - */ -QStringList Language::get_long_words() { - return this->longwordslist; -} diff --git a/src/backend/language.h b/src/backend/language.h deleted file mode 100644 index 39fd2f4..0000000 --- a/src/backend/language.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef LANGUAGE_H -#define LANGUAGE_H - -#include -#include -#include -#include -#include -#include -#include - -class Language : public QObject -{ - Q_OBJECT -public: - explicit Language(QFile &langfile, QFile &wordlist, QObject *parent = nullptr); - QStringList letters; - QStringList vowels; - QString name; - -public slots: - bool is_word(QString word); - int get_score(QString letter); - QStringList get_long_words(); - -private: - QSet words; - QStringList longwordslist; - QMap score; - void load_langfile(QFile &file); - -signals: - -}; - -#endif // LANGUAGE_H diff --git a/src/backend/languagedownloader.cpp b/src/backend/languagedownloader.cpp deleted file mode 100644 index ad9d217..0000000 --- a/src/backend/languagedownloader.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include -#include -#include - -#include "languagedownloader.h" - -void LanguageDownloader::download(QString urlstring) { - this->language = QUrl(urlstring); - QUrl wordlist = QUrl(urlstring + ".wordlist"); - QNetworkRequest request(wordlist); - request.setMaximumRedirectsAllowed(5); - this->change_state(LanguageDownloader::DownloadState::DownloadingWordlist); - this->nam.get(request); -} - -LanguageDownloader::LanguageDownloader(QObject *parent) : QObject(parent) { - connect( - &this->nam, - &QNetworkAccessManager::finished, - this, - &LanguageDownloader::finished - ); - this->change_state(LanguageDownloader::DownloadState::Idle); - this->hops = 10; -} - - -void LanguageDownloader::finished(QNetworkReply* reply) { - if (reply->error() != QNetworkReply::NoError) { - this->change_state(LanguageDownloader::DownloadState::Error); - reply->deleteLater(); - return; - } - - if (reply->hasRawHeader("Location") && this->hops > 0) { - this->hops--; - QNetworkRequest request(QUrl(reply->rawHeader("Location"))); - qDebug() << "follow redirect"; - request.setMaximumRedirectsAllowed(5); - this->nam.get(request); - reply->deleteLater(); - return; - } else if (reply->hasRawHeader("Location") && this->hops == 0) { - this->change_state(LanguageDownloader::DownloadState::Error); - qDebug() << "Exceeded hops"; - reply->deleteLater(); - return; - } - - QString destdir = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/language_data/"; - - QString filename = this->language.fileName(); - - if (this->state == LanguageDownloader::DownloadState::DownloadingWordlist) { - filename += ".wordlist"; - } - - qDebug() << "finished, saving into" << filename; - - QFile dest(destdir + filename); - dest.open(QIODevice::WriteOnly); - auto data = reply->readAll(); - - if (data.length() == 0) { - qDebug() << "File is empty"; - this->change_state(LanguageDownloader::DownloadState::Error); - reply->deleteLater(); - return; - } - - dest.write(data); - dest.close(); - reply->deleteLater(); - - if (this->state == LanguageDownloader::DownloadState::DownloadingWordlist) { - this->change_state(LanguageDownloader::DownloadState::DownloadingLanguage); - QNetworkRequest request(this->language); - request.setMaximumRedirectsAllowed(5); - this->nam.get(request); - } else if (this->state == LanguageDownloader::DownloadState::DownloadingLanguage) { - this->change_state(LanguageDownloader::DownloadState::Done); - } else { - this->change_state(LanguageDownloader::DownloadState::Error); - qDebug() << "Unexpected state reached"; - } - -} - -void LanguageDownloader::change_state(LanguageDownloader::DownloadState newstate) { - this->state = newstate; - emit this->stateChanged(newstate); - qDebug() << "state changed" << newstate; -} - -LanguageDownloader::DownloadState LanguageDownloader::getState() { - return this->state; -} diff --git a/src/backend/languagedownloader.h b/src/backend/languagedownloader.h deleted file mode 100644 index 3aab907..0000000 --- a/src/backend/languagedownloader.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef LANGUAGEDOWNLOADER_H -#define LANGUAGEDOWNLOADER_H - -#include -#include -#include -#include -#include - - -class LanguageDownloader : public QObject -{ - Q_OBJECT -public: - explicit LanguageDownloader(QObject *parent = nullptr); - -public: - enum DownloadState { - Error = -1, - Idle, - DownloadingWordlist, - DownloadingLanguage, - Done, - }; - Q_ENUM(DownloadState) - Q_PROPERTY(DownloadState state READ getState NOTIFY stateChanged) -signals: - void stateChanged(DownloadState); -public slots: - void download(QString); - DownloadState getState(); -private: - QNetworkAccessManager nam; - DownloadState state; - void change_state(DownloadState); - QUrl language; - int hops; -private slots: - void finished(QNetworkReply* reply); -}; - -#endif // LANGUAGEDOWNLOADER_H diff --git a/src/backend/languagemanager.cpp b/src/backend/languagemanager.cpp deleted file mode 100644 index 1c66caf..0000000 --- a/src/backend/languagemanager.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include "languagemanager.h" -#include -#include -#include - -#include - -QStringList LanguageManager::languages() { - return this->languagenames; -} - -/** - * - * Returns a pointer to a Language object that is valid until: - * - * the parent LanguageManager exists AND - * get_language is called again - * - * @brief LanguageManager::get_language - * @param id - * @return - */ -Language* LanguageManager::get_language(unsigned int id) { - - // Check if the language is loaded already and return it - if (this->languages_loaded[id]) - return this->languages_loaded[id]; - - this->unload_languages(); - - auto langname = this->languages()[id]; - QFile ldef(this->languagefilenames.at(id)); - QFile wlist(this->languagefilenames.at(id) + ".wordlist"); - Language* l = new Language(ldef, wlist, this); - - // Save the pointer to the language, for eventual reuse - this->languages_loaded[id] = l; - - return l; -} - -void LanguageManager::unload_languages() { - // Not loaded, unload all the loaded languages, if any - for (int i = 0; i < this->languages_loaded.length(); i++) - if (this->languages_loaded[i]) { - delete this->languages_loaded[i]; - this->languages_loaded[i] = nullptr; - } -} - -LanguageManager::LanguageManager(QObject *parent) : QObject(parent) { - QDir languages(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)); - languages.mkpath("language_data"); - this->rescan(); -} - -/** - * @brief LanguageManager::rescan - * - * Deletes all the internal structures and rescans the language files. - */ -void LanguageManager::rescan() { - // Clear all the lists - this->languagefilenames.clear(); - this->languagenames.clear(); - this->unload_languages(); - this->languages_loaded.clear(); - - // Paths where languages can be - QList dirs; - dirs << QDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/language_data"); - dirs << QDir("/usr/share/games/parolottero/language_data/"); - - foreach (QDir dir, dirs) { - if (!dir.exists()) - continue; - dir.setFilter(QDir::Files); - dir.setSorting(QDir::Name | QDir::IgnoreCase); - QFileInfoList list = dir.entryInfoList(); - for (int i = 0 ; i < list.size(); i++) { - QFileInfo fileinfo = list.at(i); - // Skip wordlist files - if (fileinfo.fileName().endsWith(".wordlist")) - continue; - - // Read the name of the language - QFile ldef(fileinfo.absoluteFilePath()); - ldef.open(QIODevice::ReadOnly); - QString language_name = ldef.readLine(120).trimmed(); - - // Skip already existing language - if (this->languagenames.contains(language_name)) - continue; - - this->languagenames.append(language_name); - this->languagefilenames.append(fileinfo.absoluteFilePath()); - this->languages_loaded.append(nullptr); - ldef.close(); - } - } -} diff --git a/src/backend/languagemanager.h b/src/backend/languagemanager.h deleted file mode 100644 index a98ab29..0000000 --- a/src/backend/languagemanager.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef LANGUAGEMANAGER_H -#define LANGUAGEMANAGER_H - -#include -#include -#include -#include "language.h" - -class LanguageManager : public QObject -{ - Q_OBJECT -public: - explicit LanguageManager(QObject *parent = nullptr); - -signals: - -public slots: - QStringList languages(); - Language* get_language(unsigned int); - void rescan(); -private: - QStringList languagenames; - QStringList languagefilenames; - QList languages_loaded; - void unload_languages(); -}; - -#endif // LANGUAGEMANAGER_H diff --git a/src/backend/scoreboard.cpp b/src/backend/scoreboard.cpp deleted file mode 100644 index a9f5f80..0000000 --- a/src/backend/scoreboard.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include "scoreboard.h" - -Scoreboard::Scoreboard(QObject *parent) - : QObject{parent} -{ - -} - -void Scoreboard::clear() { - for (int i = 0; i < items.size(); i++) { - delete items[i]; - } - this->items.clear(); - emit this->size_changed(0); -} - -/** - * @brief Scoreboard::addWord - * - * Adds the word to the list, sorting by points - * - * @param word - * @param points - */ -void Scoreboard::addWord(QString word, unsigned int points) { - int i; - for (i = 0; i < items.size(); i++) { - if (points > this->items[i]->get_points()) - break; - } - - this->items.insert(i, new ScoreboardItem(word, points, this)); - emit this->size_changed(this->items.size()); -} - -unsigned int Scoreboard::get_size() { - return this->items.size(); -} - -QString Scoreboard::get_word(unsigned int i) { - return this->items[i]->get_word(); -} - -unsigned int Scoreboard::get_points(unsigned int i) { - return this->items[i]->get_points(); -} diff --git a/src/backend/scoreboard.h b/src/backend/scoreboard.h deleted file mode 100644 index 6658a56..0000000 --- a/src/backend/scoreboard.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef SCOREBOARD_H -#define SCOREBOARD_H - -#include -#include -#include - -#include "scoreboarditem.h" - -class Scoreboard : public QObject -{ - Q_OBJECT - - Q_PROPERTY( - unsigned int size - READ get_size - NOTIFY size_changed - ) - -public: - explicit Scoreboard(QObject *parent = nullptr); -public slots: - void clear(); - void addWord(QString word, unsigned int points); - unsigned int get_size(); - QString get_word(unsigned int); - unsigned int get_points(unsigned int); - -signals: - void size_changed(unsigned int); - -private: - QList items; - - -}; - -#endif // SCOREBOARD_H diff --git a/src/backend/scoreboarditem.cpp b/src/backend/scoreboarditem.cpp deleted file mode 100644 index 792f4dd..0000000 --- a/src/backend/scoreboarditem.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include "scoreboarditem.h" - -ScoreboardItem::ScoreboardItem(QString word, unsigned int points, QObject *parent): QObject{parent} { - this->word = word; - this->points = points; -} - - -unsigned int ScoreboardItem::get_points() { - return this->points; -} - -QString ScoreboardItem::get_word() { - return this->word; -} diff --git a/src/backend/scoreboarditem.h b/src/backend/scoreboarditem.h deleted file mode 100644 index 32e1a50..0000000 --- a/src/backend/scoreboarditem.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef SCOREBOARDITEM_H -#define SCOREBOARDITEM_H - -#include -#include - -class ScoreboardItem : public QObject -{ - Q_OBJECT - - Q_PROPERTY( - unsigned int points - READ get_points - CONSTANT - ) - - Q_PROPERTY( - QString word - READ get_word - CONSTANT - ) - -public: - explicit ScoreboardItem(QString word, unsigned int points, QObject *parent = nullptr); -public slots: - unsigned int get_points(); - QString get_word(); - -private: - unsigned int points; - QString word; - -}; - -#endif // SCOREBOARDITEM_H diff --git a/src/extras/parolottero.6 b/src/extras/parolottero.6 deleted file mode 100644 index 490ad6d..0000000 --- a/src/extras/parolottero.6 +++ /dev/null @@ -1,29 +0,0 @@ -.TH "parolottero" 6 "Aug 09, 2022" "Word composition game" -.SH "NAME" -parolottero \(em Compose words from a grid of letters -.SH "SYNOPSIS" -.PP -\fBparolottero\fR - -.SH "DESCRIPTION" -.PP -This is a word composition game. -.br -Players must choose a language, then drag their finger (or mouse) over the letters on the screen to compose as many words as possible before the time is over. -.br -The seed lets users repeat a game. It can be used to do multiplayer, if players all agree on a seed. -.SH "REPORTING BUGS" -.PP -Report all bugs here: -.br -To report bugs on words you can enable bug reporting. Edit `~/.config/Parolottero/Parolottero.conf` and enable. You should use your own github token rather than the provided one. -.br -The token requires the public_repo permission. -.SH "AUTHOR" -.PP -Written by Salvo "LtWorf" Tomaselli - -.SH "COPYRIGHT" -.PP -Copyright © 2022 Salvo "LtWorf" Tomaselli. License AGPLv3: GNU Affero GPL version 3 . -This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. diff --git a/src/extras/parolottero.desktop b/src/extras/parolottero.desktop deleted file mode 100644 index 1522200..0000000 --- a/src/extras/parolottero.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=Parolottero -Comment=Word game -Comment[it]=Gioco di parole -Exec=/usr/games/parolottero -Icon=parolottero -Terminal=false -Type=Application -Categories=Game; -Keywords=Games -X-Purism-FormFactor=Workstation;Mobile; -StartupNotify=true diff --git a/src/extras/parolottero.svg b/src/extras/parolottero.svg deleted file mode 100644 index 650596d..0000000 --- a/src/extras/parolottero.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index ce862b0..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "backend/languagemanager.h" -#include "backend/boardmanager.h" -#include "backend/languagedownloader.h" - -/** - * - * Get the machine id and return a qstring of its hash. - * - * Freedesktop standard states that the machine id should not - * be exposed directly but hashed. - * - * I need this to put in bugreports, to identify the sender in case of - * abuse. - * - * @brief hashed_machine_id - * @return - */ -QString hashed_machine_id() { - auto id = QSysInfo::machineUniqueId(); - - QCryptographicHash hasher(QCryptographicHash::Sha3_256); - hasher.addData(id); - QString r(hasher.result().toHex()); - return r; -} - -int main(int argc, char *argv[]) -{ -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#endif - - QGuiApplication app(argc, argv); - - QTranslator translator; - const QStringList uiLanguages = QLocale::system().uiLanguages(); - for (const QString &locale : uiLanguages) { - const QString baseName = "parolottero_" + QLocale(locale).name(); - if (translator.load(":/i18n/" + baseName)) { - app.installTranslator(&translator); - break; - } - } - - app.setApplicationName("Parolottero"); - app.setOrganizationDomain("Parolottero"); - app.setOrganizationName("Parolottero"); - - QQmlApplicationEngine engine; - const QUrl url(QStringLiteral("qrc:/ui/main.qml")); - QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, - &app, [url](QObject *obj, const QUrl &objUrl) { - if (!obj && url == objUrl) - QCoreApplication::exit(-1); - }, Qt::QueuedConnection); - LanguageManager language_manager(&engine); - QString version = QString(VERSION); - - - engine.rootContext()->setContextProperty("languageManager", &language_manager); - engine.rootContext()->setContextProperty("ApplicationVersion", version); // For the about string - engine.rootContext()->setContextProperty("MachineId", hashed_machine_id()); // For identifying bugreporters - qmlRegisterType("ltworf.parolottero", 1, 0, "BoardManager"); - qmlRegisterType("ltworf.parolottero", 1, 0, "LanguageDownloader"); - - engine.load(url); - - return app.exec(); -} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp deleted file mode 100644 index 9f180d0..0000000 --- a/src/mainwindow.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* -parolottero -Copyright (C) 2021 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#include "mainwindow.h" -#include "ui_mainwindow.h" - -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) - , ui(new Ui::MainWindow) -{ - ui->setupUi(this); -} - -MainWindow::~MainWindow() -{ - delete ui; -} - diff --git a/src/mainwindow.h b/src/mainwindow.h deleted file mode 100644 index 5e00b1a..0000000 --- a/src/mainwindow.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -parolottero -Copyright (C) 2021 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -QT_BEGIN_NAMESPACE -namespace Ui { class MainWindow; } -QT_END_NAMESPACE - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(QWidget *parent = nullptr); - ~MainWindow(); - -private: - Ui::MainWindow *ui; -}; -#endif // MAINWINDOW_H diff --git a/src/mainwindow.ui b/src/mainwindow.ui deleted file mode 100644 index b232854..0000000 --- a/src/mainwindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/src/parolottero.pro b/src/parolottero.pro deleted file mode 100644 index ba1ec0f..0000000 --- a/src/parolottero.pro +++ /dev/null @@ -1,79 +0,0 @@ -# parolottero -# Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero 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 Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -# author Salvo "LtWorf" Tomaselli - -QT += core gui network quick - -CONFIG += c++11 - -# You can make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -CHANGELOG = $$cat(../CHANGELOG, lines) -VERSION = $$first(CHANGELOG) -message($$VERSION) -DEFINES += "VERSION=\\\"$$VERSION\\\"" - -SOURCES += \ - backend/boardmanager.cpp \ - backend/language.cpp \ - backend/languagedownloader.cpp \ - backend/languagemanager.cpp \ - backend/scoreboard.cpp \ - backend/scoreboarditem.cpp \ - main.cpp - -HEADERS += \ - backend/boardmanager.h \ - backend/language.h \ - backend/languagedownloader.h \ - backend/languagemanager.h \ - backend/scoreboard.h \ - backend/scoreboarditem.h - -TRANSLATIONS += \ - parolottero_it_IT.ts -CONFIG += lrelease -CONFIG += embed_translations - - -isEmpty(target.path) { - target.path = $${DESTDIR}/usr/games - export(target.path) -} -INSTALLS += target - -launcher.files = extras/parolottero.desktop -launcher.path = $${DESTDIR}/usr/share/applications/ -INSTALLS += launcher - -icon.files = extras/parolottero.svg -icon.path = $${DESTDIR}/usr/share/icons/hicolor/48x48/apps/ -INSTALLS += icon - -manpage.files = extras/parolottero.6 -manpage.path = $${DESTDIR}/usr/share/man/man6/ -INSTALLS += manpage - -export(INSTALLS) - -DISTFILES += \ - ui/*.qml \ - extras* - -RESOURCES += qml.qrc diff --git a/src/parolottero_it_IT.ts b/src/parolottero_it_IT.ts deleted file mode 100644 index 4341789..0000000 --- a/src/parolottero_it_IT.ts +++ /dev/null @@ -1,143 +0,0 @@ - - - - - About - - - Parolottero - Parolottero - - - - Version: %1 - Versione: %1 - - - - Released under AGPL-3 - Rilasciato sotto AGPL-3 - - - - <a href="https://github.com/ltworf/parolottero">Website</a> - <a href="https://github.com/ltworf/parolottero">Sito web</a> - - - - Done - Fatto - - - - LangSelector - - - Pick a language - Scegliere una lingua - - - - - Download more languages - Scarica più lingue - - - - Downloading… - Scaricamento… - - - - Download error - Errore di scaricamento - - - - Download: %1 - Scarica: %1 - - - - Error downloading: %1 - Errore scaricando: %1 - - - - Downloaded: %1 - Scaricato: %1 - - - - Downloading: %1 - Scaricando: %1 - - - - User defined seed - Seme definito dall'utente - - - - Seed - Seme - - - - Duration - Durata - - - - About - Informazioni su - - - - PlayBoard - - - ← - - - - - Scores - Punteggio - - - - Sending bugreport… - Invio segnalazione di errore… - - - - Report wrong words - Segnala parole incorrette - - - - Unable to create bugreport %1 %2 - Impossibile creare segnalazione %1 %2 - - - - <a href="%1">Open in browser</a> - <a href="%1">Apri nel browser</a> - - - - Total: - Totale: - - - - main - - - Parolottero - Parolottero - Parolottero - - - diff --git a/src/qml.qrc b/src/qml.qrc deleted file mode 100644 index 94a3641..0000000 --- a/src/qml.qrc +++ /dev/null @@ -1,11 +0,0 @@ - - - ui/main.qml - ui/GradientRect.qml - ui/About.qml - ui/LangSelector.qml - ui/PlayBoard.qml - ui/LetterCell.qml - ui/ThemedLabel.qml - - diff --git a/src/ui/About.qml b/src/ui/About.qml deleted file mode 100644 index b5881b5..0000000 --- a/src/ui/About.qml +++ /dev/null @@ -1,79 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.12 - -GradientRect { - - MouseArea { - anchors.fill: parent - } - - ColumnLayout { - anchors.fill: parent - spacing: 20 - - Item {Layout.fillHeight: true} - - ThemedLabel { - font.pointSize: 30 - text: qsTr("Parolottero") - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - } - - ThemedLabel { - font.pointSize: 15 - text: qsTr("Version: %1").arg(ApplicationVersion) - Layout.margins: 10 - } - - ThemedLabel { - font.pointSize: 15 - text: qsTr("Released under AGPL-3") - Layout.margins: 10 - } - - ThemedLabel { - font.pointSize: 10 - text: '© 2021-2022 Salvo "LtWorf" Tomaselli
<tiposchi@tiscali.it>' - Layout.margins: 5 - onLinkActivated:Qt.openUrlExternally(link); - } - - ThemedLabel { - font.pointSize: 15 - text: qsTr('Website') - Layout.margins: 10 - onLinkActivated:Qt.openUrlExternally(link); - } - - Button { - text: qsTr("Done") - Layout.fillWidth: true - Layout.margins: 10 - onClicked: parent.parent.visible = false - } - - Item {Layout.fillHeight: true} - } -} diff --git a/src/ui/GradientRect.qml b/src/ui/GradientRect.qml deleted file mode 100644 index 1786343..0000000 --- a/src/ui/GradientRect.qml +++ /dev/null @@ -1,41 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 -import QtQuick.Window 2.15 -import Qt.labs.settings 1.1 -import QtQuick.Controls 2.15 - -/* - * Faded transparent rectangle that goes on top of stuff - */ -Rectangle { - gradient: Gradient { - GradientStop { position: 0.0; color: palette.base } - GradientStop { position: 0.2; color: "#994682B4" } - GradientStop { position: 0.8; color: "#AAAAAAAA" } - GradientStop { position: 1.0; color: palette.base } - } - - SystemPalette { - id: palette - } - z: 1 -} diff --git a/src/ui/LangSelector.qml b/src/ui/LangSelector.qml deleted file mode 100644 index 251903b..0000000 --- a/src/ui/LangSelector.qml +++ /dev/null @@ -1,247 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.12 - -import ltworf.parolottero 1.0 - -Item { - property int language_index: -1 - property alias seed: spinseed.value - property alias use_seed: switchseed.checked - property alias duration: durationspin.value - - ColumnLayout{ - anchors.fill: parent - spacing: 2 - - ListView { - Layout.alignment: Qt.AlignLeft - Layout.fillHeight: true - Layout.fillWidth: true - Layout.leftMargin: 10 - Layout.rightMargin: 10 - clip: true - - model: items - - header: ThemedLabel { - font.pointSize: 25 - text: qsTr("Pick a language") - width: parent.width - horizontalAlignment: Text.AlignHCenter - } - - // Load list of languages - function refreshList() { - items.clear() - var languages = languageManager.languages(); - for(var i = 0; i < languages.length; i++) { - items.append({name: languages[i], index: i, local: true, url: ""}) - } - } - - Component.onCompleted: refreshList() - - // Implement refresh when scrolling down - property bool negativescroll: scrollbar.position < 0 - onNegativescrollChanged: { - if (spinner.visible) { - languageManager.rescan() - refreshList() - } - spinner.visible = !spinner.visible - } - - ScrollBar.vertical: ScrollBar { - id: scrollbar - } - - BusyIndicator { - anchors.top: parent.top - anchors.horizontalCenter: parent.horizontalCenter - visible: false - running: visible - id: spinner - } - - // Button to download language list - footer: Button { - width: parent.width - text: qsTr("Download more languages") - id: downloadlanguagelist - onClicked: { - downloadlanguagelist.enabled = false - downloadlanguagelist.text = qsTr("Downloading…") - - // Remove previous download buttons - for (var i = items.count - 1; i >= 0; i--) { - if (!items.get(i).local) - items.remove(i, 1) - } - - // Prepare http request - var http = new XMLHttpRequest() - http.responseType = "json" - var url = "https://api.github.com/repos/ltworf/parolottero-languages/releases/latest" - - http.open("GET", url); - http.onreadystatechange = function() { - if (http.readyState !== XMLHttpRequest.DONE) return; - // Error - if (http.status !== 200) { - downloadlanguagelist.text = qsTr("Download error") - return; - } - - downloadlanguagelist.enabled = true - text = qsTr("Download more languages") - - var assets = http.response['assets'] - - for (var i = 0; i < assets.length; i++) { - var name = assets[i]["name"] - if (name.includes("wordlist")) - continue; - var download_url = assets[i]["browser_download_url"] - var item = {name: name, url: download_url, local: false, index: -1} - items.append(item) - } - } - http.send() - } - } - - ListModel { - id: items - } - - // Start a match or download a language - delegate: Button { - width: parent.width - text: local ? name : qsTr("Download: %1").arg(name) - enabled: downloader.state === LanguageDownloader.Idle - Rectangle { - visible: downloader.state === LanguageDownloader.Error || downloader.state === LanguageDownloader.Done - anchors.fill: parent - gradient: Gradient { - GradientStop { position: 0.0; color: "#000000FF" } - GradientStop { position: 0.1; color: downloader.state === LanguageDownloader.Done ? "green": "red" } - GradientStop { position: 1.0; color: "#000000FF" } - } - } - BusyIndicator { - id: downloadspinner - running: visible - visible: false - anchors.fill: parent - } - LanguageDownloader { - id: downloader - - onStateChanged: { - if (downloader.getState() === LanguageDownloader.Error) { - downloadspinner.visible = false - text = qsTr("Error downloading: %1").arg(name) - } else if (downloader.getState() === LanguageDownloader.Done) { - text = qsTr("Downloaded: %1").arg(name) - downloadspinner.visible = false - } else { - text = qsTr("Downloading: %1").arg(name) - downloadspinner.visible = true - } - } - } - onClicked: { - if (local) - language_index = index - else { - downloader.download(url) - } - } - } - } - - GridLayout { - Layout.fillWidth: true - Layout.alignment: Qt.AlignBottom - columns: 2 - - ThemedLabel { - text: qsTr("User defined seed") - Layout.fillWidth: true - Layout.leftMargin: 5 - } - - Switch { - Layout.rightMargin: 5 - id: switchseed - } - - ThemedLabel { - text: qsTr("Seed") - Layout.fillWidth: true - Layout.leftMargin: 5 - } - - SpinBox { - id: spinseed - from: 1 - to: 10000 - editable: true - enabled: switchseed.checked - Layout.rightMargin: 5 - } - - ThemedLabel { - text: qsTr("Duration") - Layout.fillWidth: true - Layout.leftMargin: 5 - } - - SpinBox { - id: durationspin - from: 1 - to: 10 - editable: true - Layout.rightMargin: 5 - } - - Button { - Layout.columnSpan: 2 - Layout.fillWidth: true - text: qsTr("About") - onClicked: aboutoverlay.visible = true - Layout.leftMargin: 10 - Layout.rightMargin: 10 - Layout.bottomMargin: 5 - } - - } - } - - About { - visible: false - id: aboutoverlay - anchors.fill: parent - } -} diff --git a/src/ui/LetterCell.qml b/src/ui/LetterCell.qml deleted file mode 100644 index af01c99..0000000 --- a/src/ui/LetterCell.qml +++ /dev/null @@ -1,41 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 - -Rectangle { - property bool used: false - property int multiplier: 1 - property string text: "" - border.width: 3 - - border.color: (multiplier == 1) ? "light steel blue" : ((multiplier == 2) ? "gold": "pink") - - gradient: Gradient { - GradientStop { position: 0.0; color: used ? "steel blue": border.color } - GradientStop { position: 1.0; color: used ? "light gray": "white" } - } - - Text { - anchors.centerIn: parent - text: name.toUpperCase() - font.pointSize: 40 - } -} diff --git a/src/ui/PlayBoard.qml b/src/ui/PlayBoard.qml deleted file mode 100644 index b6f89e0..0000000 --- a/src/ui/PlayBoard.qml +++ /dev/null @@ -1,390 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 -import QtQuick.Layouts 1.15 -import QtQuick.Controls 2.15 -import Qt.labs.settings 1.1 - -import ltworf.parolottero 1.0 - -Item { - property alias language_id: board.language - property alias playable: board.playable - property alias seed: board.seed - property alias use_seed: board.use_seed - property int duration: 3 - property bool match_in_progress: false - - onPlayableChanged: { - items.clear(); - if (! playable) { - return; - } - - match_in_progress = true - - for (var i=0; i < board.size; i++) { - items.append({index: i, name: board.get_letter(i), cell_multiplier: board.get_multiplier(i)}) - } - } - - BoardManager { - property string last_word: "" - property var current_word_indexes: [] - property int last_score: 0 - property int seconds_left: -1 - - id: board - language: -1 - } - - Timer { - interval: 1000 - repeat: true - running: board.seconds_left > 0 - onTriggered: board.seconds_left-- - } - - ListModel { - id: items - } - - ColumnLayout { - anchors.fill: parent - - RowLayout { - width: parent.width - id: header - - Button { - text: qsTr("←") - onClicked: { - board.last_word = "" - board.current_word_indexes = [] - board.last_score = 0 - board.seconds_left = -1 - match_in_progress = false - grid.visible = true - scoreboard.visible = false - } - } - - Button { - text: qsTr("Scores") - visible: board.seconds_left == 0 - highlighted: scoreboard.visible - onClicked: { - // Update the scoreboard just if we are about to show it - if (!scoreboard.visible) { - scores.clear() - scores.incorrectwords = 0 - for (var i=0; i < board.scoreboard.size; i++) { - scores.append( - { - word: board.scoreboard.get_word(i), - points: board.scoreboard.get_points(i), - incorrect: false, - index: i - } - ) - } - } - grid.visible = ! grid.visible - scoreboard.visible = ! scoreboard.visible - } - } - - Item { - Layout.fillWidth: true - } - - Text { - id: time_label - text: board.seconds_left - color: board.seconds_left > 60 ? "green" : (board.seconds_left > 30? "yellow": "red") - font.pointSize: 40 - } - - Rectangle { - color: time_label.color - radius: 10 - Layout.preferredHeight: 30 - Layout.preferredWidth: 30 - Layout.rightMargin: 15 - } - } - - ThemedLabel { - text: board.last_word - color: board.last_score ? "green" : "red" - font.pointSize: 30 - Layout.fillWidth: true - visible: grid.visible - } - - ListView { - id: scoreboard - visible: false - Layout.alignment: Qt.AlignLeft - Layout.fillHeight: true - Layout.fillWidth: true - Layout.margins: 5 - clip: true - property bool bugreportsent: false - - Settings { - id: bugreportsettings - category: "BugReporting" - property bool enablebugreport: false - property string githubtoken: "ghp" + "_" + "nDrVn2GXTC" + "gr0fxr1W7jRkq" + "92PhtcG0dzE63" - property string issuesurl: "https://api.github.com/repos/ltworf/parolottero-languages/issues" - } - - ScrollBar.vertical: ScrollBar { } - - model: scores - - ListModel { - id: scores - property int incorrectwords: 0 - } - - onVisibleChanged: { - bugreportsent = false - } - - footer: ColumnLayout { - width: parent.width - - ThemedLabel { - visible: scoreboard.bugreportsent - onVisibleChanged: text = qsTr("Sending bugreport…") - id: bugreportlabel - onLinkActivated:Qt.openUrlExternally(link); - } - Button { - id: bugreportbutton - visible: bugreportsettings.enablebugreport && ! scoreboard.bugreportsent - width: parent.width - text: qsTr("Report wrong words") - enabled: scores.incorrectwords - onClicked: { - scoreboard.bugreportsent = true - var body = "" - var itemcount = 0 - var language_name = languageManager.languages()[board.language] - - for (var i = 0; i < scores.count; i++) { - var word = scores.get(i) - if (!word.incorrect) - continue - - // should the word be added or removed? - var sign = word.points ? "-" : "+" - - body += sign + word.word + "\n" - itemcount++ - } - - body += "\nid: " + MachineId - body += "\nLanguage: " + language_name - body += "\nItem count: " + itemcount - var title = "User report for " + language_name - - var postdata = {"body": body, "title": title} - - // Do the HTTP request - var http = new XMLHttpRequest() - http.responseType = "json" - http.open("POST", bugreportsettings.issuesurl); - http.setRequestHeader("Accept", "application/vnd.github+json") - http.setRequestHeader("Authorization", "token " + bugreportsettings.githubtoken) - - http.onreadystatechange = function() { - if (http.readyState !== XMLHttpRequest.DONE) return; - - // Error - if (http.status !== 201) { - console.log("Bugreport failed\n" + http.status + "\n" + http.response) - bugreportlabel.text = qsTr("Unable to create bugreport %1 %2").arg(http.status).arg(http.response["message"]) - return - } - - var issue = http.response['html_url'] - - bugreportlabel.text =qsTr('Open in browser').arg(issue) - } - - http.send(JSON.stringify(postdata)); - } - } - } - - delegate: RowLayout { - width: parent ? parent.width: 0 - ThemedLabel { - text: points - color: points ? "green": "red" - font.pointSize: 24 - } - ThemedLabel { - text: word - color: points ? "green": "red" - width: height * 2 - font.pointSize: 24 - Layout.fillWidth: true - } - RoundButton { - visible: bugreportsettings.enablebugreport - text: checked ? "❌": "✔️" - Layout.alignment: Layout.Right - checkable: true - checked: incorrect - onClicked: { - if (checked) - scores.incorrectwords++ - else - scores.incorrectwords-- - scores.get(index).incorrect = checked - } - } - } - } - - Item { - - Layout.preferredWidth: parent.width - Layout.fillHeight: true - - GradientRect { - // Visual feedback that the game is finished - visible: board.seconds_left == 0 && grid.visible - anchors.fill: parent - } - - GridView { - id: grid - - width: parent.width > parent.height ? parent.height : parent.width - height: width - anchors.leftMargin: 20 - anchors.topMargin: 20 - anchors.top: parent.top - anchors.left: parent.left - - cellWidth: Math.floor(width / 4) - cellHeight: cellWidth - - model: items - interactive: false - currentIndex: -1 - - highlight: Rectangle { - width: grid.cellWidth - height: width - color: "lightsteelblue" - } - - delegate: LetterCell { - width: grid.cellWidth * 0.7 - height: width - text: name.toUpperCase() - multiplier: cell_multiplier - } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - - onPressed: (mouse)=> { - mouse.accepted = false; - - if (board.seconds_left == 0) - return; - else if (board.seconds_left == -1) - board.seconds_left = duration * 60 - - var index = find_item_index(mouse.x, mouse.y); - if (index < 0) - return; - - board.current_word_indexes = [index]; - grid.currentIndex = index; - grid.itemAtIndex(index).used = true; - mouse.accepted = true; - } - - onReleased: (mouse)=> { - mouse.accepted = board.seconds_left > 0; - for (var i = 0; i < board.size; i++) { - grid.itemAtIndex(i).used = false; - } - board.last_score = board.input_word(board.current_word_indexes); - - var word = ""; - for (i=0; i < board.current_word_indexes.length; i++) { - word += items.get(board.current_word_indexes[i]).name; - } - board.last_word = word; - - grid.currentIndex = -1; - } - - onPositionChanged: (mouse)=> { - mouse.accepted = true; - - if (mouse.buttons === 0 || board.seconds_left == 0) - return; - - var index = find_item_index(mouse.x, mouse.y); - if (index < 0 || grid.itemAtIndex(index).used) - return; - if (! board.are_adjacent(index, board.current_word_indexes[board.current_word_indexes.length - 1])) - return; - grid.itemAtIndex(index).used = true; - grid.currentIndex = index; - board.current_word_indexes.push(index); - } - - function find_item_index(x, y) { - for (var i=0; i < board.size; i++) { - var item = grid.itemAtIndex(i); - var point = mapToItem(item, x, y); - if (item.contains(point)) - return i; - } - return -1; - } - } - } - } - - RowLayout { - id: footer - width: parent.width - - ThemedLabel { - text: qsTr("Total: ") + board.total - font.pointSize: 30 - } - } - } -} diff --git a/src/ui/ThemedLabel.qml b/src/ui/ThemedLabel.qml deleted file mode 100644 index e4f7f24..0000000 --- a/src/ui/ThemedLabel.qml +++ /dev/null @@ -1,30 +0,0 @@ -/* -parolottero -Copyright (C) 2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 -import QtQuick.Controls 2.15 - - -Label { - SystemPalette { - id: palette - } - color: palette.text -} diff --git a/src/ui/main.qml b/src/ui/main.qml deleted file mode 100644 index c5ddd19..0000000 --- a/src/ui/main.qml +++ /dev/null @@ -1,71 +0,0 @@ -/* -parolottero -Copyright (C) 2021-2022 Salvo "LtWorf" Tomaselli - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero 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 Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . - -author Salvo "LtWorf" Tomaselli -*/ - -import QtQuick 2.15 -import QtQuick.Window 2.15 -import Qt.labs.settings 1.1 -import QtQuick.Controls 2.15 - - -Window { - visible: true - title: qsTr("Parolottero") - id: main_window - width: 400 - height: 700 - - SystemPalette { - id: palette - } - color: palette.base - - LangSelector { - id: language_selector - anchors.fill: parent - visible: !board.match_in_progress - } - - PlayBoard { - id: board - anchors.fill: parent - language_id: language_selector.language_index - visible: board.match_in_progress - seed: language_selector.seed - use_seed: language_selector.use_seed - duration: language_selector.duration - - onMatch_in_progressChanged: { - // Reset language index after a match - if (board.match_in_progress == false) - language_selector.language_index = -1 - } - } - - Settings { - id: settings - property alias duration: language_selector.duration - property alias seed: language_selector.seed - property alias use_seed: language_selector.use_seed - property alias x: main_window.x - property alias y: main_window.y - property alias width: main_window.width - property alias height: main_window.height - } -}