Update upstream source from tag 'upstream/1.3.0'
Update to upstream version '1.3.0'
with Debian dir 80bf20db8b6ae970d46c1b41953850d4d6b29923
Markus Koschany
2 years ago
0 | cmake_minimum_required(VERSION 3.16.0) | |
1 | ||
2 | # Configure project | |
3 | project(peg-e VERSION 1.3.0 LANGUAGES CXX) | |
4 | ||
5 | set(CMAKE_CXX_STANDARD 17) | |
6 | set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
7 | ||
8 | set(CMAKE_AUTOMOC ON) | |
9 | set(CMAKE_AUTORCC ON) | |
10 | ||
11 | find_package(Qt6 REQUIRED COMPONENTS Core Gui LinguistTools Widgets) | |
12 | if(UNIX AND NOT APPLE) | |
13 | include(GNUInstallDirs) | |
14 | endif() | |
15 | ||
16 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") | |
17 | add_compile_definitions( | |
18 | QT_STRICT_ITERATORS | |
19 | QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
20 | QT_DISABLE_DEPRECATED_BEFORE=0x060000 | |
21 | ) | |
22 | endif() | |
23 | ||
24 | # Create translations | |
25 | file(GLOB translations_SRCS translations/*.ts) | |
26 | qt6_add_translation(translations_QM ${translations_SRCS}) | |
27 | ||
28 | add_custom_target(update_translations | |
29 | COMMAND Qt6::lupdate -no-obsolete -locations none src -ts ${translations_SRCS} | |
30 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | |
31 | VERBATIM | |
32 | ) | |
33 | ||
34 | # Create program | |
35 | qt6_add_executable(peg-e | |
36 | src/board.cpp | |
37 | src/hole.cpp | |
38 | src/locale_dialog.cpp | |
39 | src/main.cpp | |
40 | src/movement.cpp | |
41 | src/peg.cpp | |
42 | src/puzzle.cpp | |
43 | src/window.cpp | |
44 | ${translations_QM} | |
45 | ) | |
46 | ||
47 | target_link_libraries(peg-e PRIVATE | |
48 | Qt6::Core | |
49 | Qt6::Gui | |
50 | Qt6::Widgets | |
51 | ) | |
52 | ||
53 | target_compile_definitions(peg-e PRIVATE VERSIONSTR="${PROJECT_VERSION}") | |
54 | ||
55 | # Install | |
56 | if(UNIX AND NOT APPLE) | |
57 | target_sources(peg-e PRIVATE icons/icon.qrc) | |
58 | ||
59 | install(TARGETS peg-e RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
60 | install(FILES ${translations_QM} DESTINATION ${CMAKE_INSTALL_DATADIR}/peg-e/translations) | |
61 | install(FILES doc/peg-e.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6 COMPONENT doc) | |
62 | install(DIRECTORY icons/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons) | |
63 | install(DIRECTORY icons/oxygen/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/peg-e/icons) | |
64 | install(FILES icons/peg-e.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) | |
65 | install(FILES icons/peg-e.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) | |
66 | elseif(WIN32) | |
67 | # Use Qt6 macro until CMake provides something | |
68 | # https://bugreports.qt.io/browse/QTBUG-87618 | |
69 | set_target_properties(peg-e PROPERTIES | |
70 | WIN32_EXECUTABLE TRUE | |
71 | QT_TARGET_VERSION "${PROJECT_VERSION}" | |
72 | QT_TARGET_COMPANY_NAME "Graeme Gott" | |
73 | QT_TARGET_DESCRIPTION "Peg elimination game" | |
74 | QT_TARGET_COPYRIGHT "Copyright (C) 2021 Graeme Gott" | |
75 | QT_TARGET_PRODUCT_NAME "Peg-E" | |
76 | QT_TARGET_RC_ICONS ${CMAKE_SOURCE_DIR}/icons/peg-e.ico | |
77 | ) | |
78 | _qt_internal_generate_win32_rc_file(peg-e) | |
79 | endif() |
0 | 1.3.0 | |
1 | ----- | |
2 | * Added support for Qt 6. | |
3 | * Refactored code. | |
4 | * Removed XPM icon. | |
5 | * Translation updates: Esperanto, Telugu. | |
6 | ||
0 | 7 | 1.2.8 |
1 | 8 | ----- |
2 | 9 | * FIXED: Did not load locales with underscores. |
13 | 13 | |
14 | 14 | 3.) Type 'sudo make install' to install the program. |
15 | 15 | |
16 | Mac OS X: | |
17 | 1.) Type 'qmake -spec macx-g++' to configure the program. | |
16 | macOS: | |
17 | 1.) Type 'qmake -spec macx-clang' to configure the program. | |
18 | 18 | |
19 | 19 | 2.) Type 'make' to compile the program. |
20 | 20 | |
25 | 25 | |
26 | 26 | 2.) Type 'make' to compile the program. |
27 | 27 | |
28 | 3.) Type 'windows_deploy' to create a compressed image of the program. Note | |
29 | that you must have the 7z executable from 7-zip.org in your %PATH% for | |
30 | this to work. | |
28 | 3.) Type 'windows_deploy' to create an installer of the program. Note | |
29 | that you must have the NSIS executable from nsis.sourceforge.io in | |
30 | your %PATH% for this to work. |
0 | .TH "PEG-E" "6" "February 2014" | |
0 | .TH PEG-E 6 "April 2021" "Peg-E 1.2.8" "Games Manual" | |
1 | 1 | |
2 | 2 | .SH "NAME" |
3 | 3 | peg\-e \- peg elimination solitaire game |
4 | 4 | |
5 | 5 | .SH "SYNOPSIS" |
6 | .PP | |
7 | 6 | .B peg\-e |
7 | [options] | |
8 | 8 | |
9 | 9 | .SH "DESCRIPTION" |
10 | .PP | |
11 | 10 | Peg-E is a peg solitaire game in which you jump over pieces in order to |
12 | 11 | remove them from the board, ultimately trying to eliminate all but one. The |
13 | 12 | boards are randomly generated, with 100 levels of difficulty. The game |
14 | 13 | auto-saves, and has undo-redo capability. Pieces can move horizontally, |
15 | 14 | vertically, and diagonally. |
16 | 15 | |
16 | .SH "OPTIONS" | |
17 | .TP | |
18 | .BR \-h ", " \-\-help | |
19 | Displays help on commandline options. | |
20 | .TP | |
21 | .B \-\-help-all | |
22 | Displays help including Qt specific options. | |
23 | .TP | |
24 | .BR \-v ", " \-\-version | |
25 | Displays version information. | |
26 | ||
27 | .SH "SEE ALSO" | |
28 | .BR qt5options (7) | |
29 | ||
30 | .SH "REPORTING BUGS" | |
31 | Report bugs to <peg\-e@bugs.gottcode.org>. | |
32 | ||
17 | 33 | .SH "COPYRIGHT" |
34 | Copyright \(co 2009-2021 Graeme Gott | |
18 | 35 | .PP |
19 | Copyright \(co 2014 Graeme Gott | |
20 | .PP | |
21 | This program is free software; you can redistribute it and/or modify | |
22 | it under the terms of the GNU General Public License as published by | |
23 | the Free Software Foundation; either version 3 of the License, or | |
24 | (at your option) any later version. | |
25 | .PP | |
26 | This program is distributed in the hope that it will be useful, | |
27 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
29 | GNU General Public License for more details. | |
30 | .PP | |
31 | You should have received a copy of the GNU General Public License | |
32 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
36 | Free use of this software is granted under the terms of the GNU General | |
37 | Public License version 3 (GPLv3). There is NO WARRANTY, to the extent | |
38 | permitted by law. | |
33 | 39 | |
34 | 40 | .SH "AUTHOR" |
35 | .PP | |
36 | 41 | Graeme Gott <graeme@gottcode.org>. |
6 | 6 | <name xml:lang="cs">Peg-E</name> |
7 | 7 | <name xml:lang="de">Peg-E</name> |
8 | 8 | <name xml:lang="el">Peg-E</name> |
9 | <name xml:lang="eo">Peg-Eo</name> | |
9 | 10 | <name xml:lang="es">Peg-E</name> |
10 | 11 | <name xml:lang="lt">Peg-E</name> |
11 | 12 | <name xml:lang="ms">Peg-E</name> |
14 | 15 | <name xml:lang="pt">Peg-E</name> |
15 | 16 | <name xml:lang="ro">Peg-E</name> |
16 | 17 | <name xml:lang="ru">Peg-E</name> |
18 | <name xml:lang="sv">Peg-E</name> | |
19 | <name xml:lang="te">పెగ్-ఇ</name> | |
17 | 20 | <name xml:lang="tr">Peg-E</name> |
18 | 21 | <name xml:lang="zh">Peg-E</name> |
19 | 22 | <summary>Jump pegs to eliminate them</summary> |
20 | 23 | <summary xml:lang="de">Sprung zu Heringen, um sie zu beseitigen</summary> |
21 | 24 | <summary xml:lang="el">Μετάβαση σε γόμφους για να εξαλειφθούν</summary> |
25 | <summary xml:lang="eo">Saltu sur pegojn por ilin elimini </summary> | |
22 | 26 | <summary xml:lang="es">Salta sobre los pegs para eliminarlos</summary> |
23 | 27 | <summary xml:lang="he">קפוץ מעל גולות כדי לסלק אותן</summary> |
24 | 28 | <summary xml:lang="lt">Peršokite per kamštelius, kad juos pašalintumėte</summary> |
27 | 31 | <summary xml:lang="pl">Przeskocz kołki, aby je usunąć</summary> |
28 | 32 | <summary xml:lang="pt">Salte com os pinos para os eliminar</summary> |
29 | 33 | <summary xml:lang="ro">Sari peste pioni pentru a-i eliminna</summary> |
34 | <summary xml:lang="sv">Hoppa över pinnar för att eliminera dem</summary> | |
35 | <summary xml:lang="te">వాటిని తొలగించడానికి పెగ్స్ ని ఎగరవేయి</summary> | |
30 | 36 | <summary xml:lang="zh">跳过棋子,消除它!</summary> |
31 | 37 | |
32 | 38 | <description> |
41 | 47 | <p xml:lang="pl">Peg-E to gra typu solitaire, w której przeskakujesz przez części, aby usunąć je z planszy, w końcu próbujesz usunąć wszystkie, oprócz jednego. Plansze generowane są losowo, przy 100 poziomach trudności. Gra automatycznie zapisuje stan i ma opcję cofania ruchu. Części mogą poruszać się poziomo, pionowo i na ukos.</p> |
42 | 48 | <p xml:lang="pt">O Peg-E é um jogo do tipo solitário em que se salta sobre as peças por forma a removê-las do tabuleiro, por forma a tentar remover todas até restar apenas uma. Os tabuleiros são gerados aleatoriamente, com 100 níveis de dificuldade. O jogo grava automaticamente e tem a funcionalidade de desfazer as jogadas. As peças podem-se mover na horizontal, vertical e diagonal.</p> |
43 | 49 | <p xml:lang="ro">Peg-E este un joc cu pioni în care sa sari peste piese pentru a le elimina de pe tablă, încercînd, în cele din urmă, a le elimina pe toate cu excepţia uneia. Tablele sunt generate aleator, cu 100 de niveluri de dificultate. Jocul salvează automat şi are capacitatea de a face/reface. Piese se pot deplasa orizontal, vertical şi pe diagonală.</p> |
50 | <p xml:lang="sv">Peg-E är ett solitairespel där du hoppar över bitar för att ta bort dem från brädet, i slutändan för att eliminera alla utom en. Banorna genereras slumpmässigt i 100 svårighetsgrader. Spelet sparas automatiskt och har ångra-gör-om-funktioner. Bitarna kan röra sig horisontellt, vertikalt och diagonalt.</p> | |
51 | <p xml:lang="te">పెగ్-ఇ అనేది ఒక పెగ్ సాలిటైర్ ఆట, దీనిలో మీరు వాటిని బోర్డు నుండి తొలగించడానికి ముక్కల మీద దూకుతారు, చివరికి ఒకటి తప్తేపి అన్నింటినీ తొలగించడానికి ప్రయత్నిస్తారు. బోర్డులు యాదృచ్ఛికంగా ఉత్పత్తి చేయబడతాయి, కష్టమైన 100 స్థాయిలు ఉంటాయి. ఆట స్వయంచాలకంగా సేవ్ చేస్తుంది మరియు అన్డు-పునరావృత సామర్థ్యాన్ని కలిగి ఉంటుంది. ముక్కలు అడ్డంగా, నిలువుగా మరియు వికర్ణంగా కదలగలవు.</p> | |
44 | 52 | <p xml:lang="zh">Peg-E 是一款孔明棋游戏。一颗棋子跳过另一颗后,该棋子就会被消除,游戏的目的是最终只剩下一颗棋子。本游戏的棋盘自动生成,有100种不同难度可供选择。游戏会自动保存,并具有撤销(悔棋)、重做功能。棋子可以横向、纵向和斜向移动。</p> |
45 | 53 | </description> |
46 | 54 | |
69 | 77 | <kudo>ModernToolkit</kudo> |
70 | 78 | </kudos> |
71 | 79 | |
72 | <content_rating type="oars-1.1" /> | |
80 | <content_rating type="oars-1.1"/> | |
73 | 81 | |
74 | 82 | <releases> |
83 | <release version="1.3.0" date="2021-09-20"> | |
84 | <description> | |
85 | <ul> | |
86 | <li>Added support for Qt 6</li> | |
87 | <li>Refactored code</li> | |
88 | <li>Removed XPM icon</li> | |
89 | <li>Translation updates: Esperanto, Telugu</li> | |
90 | </ul> | |
91 | </description> | |
92 | </release> | |
75 | 93 | <release version="1.2.8" date="2020-04-20"> |
76 | 94 | <description> |
77 | 95 | <ul> |
2 | 2 | Name[cs]=Peg-E |
3 | 3 | Name[de]=Peg-E |
4 | 4 | Name[el]=Peg-E |
5 | Name[eo]=Peg-Eo | |
5 | 6 | Name[es]=Peg-E |
6 | 7 | Name[lt]=Peg-E |
7 | 8 | Name[ms]=Peg-E |
10 | 11 | Name[pt]=Peg-E |
11 | 12 | Name[ro]=Peg-E |
12 | 13 | Name[ru]=Peg-E |
14 | Name[sv]=Peg-E | |
15 | Name[te]=పెగ్-ఇ | |
13 | 16 | Name[tr]=Peg-E |
14 | 17 | Name[zh]=Peg-E |
15 | 18 | GenericName=Peg Elimination Game |
16 | 19 | GenericName[cs]=Peg eliminační hra |
17 | 20 | GenericName[de]=Peg Elimination Spiel |
18 | 21 | GenericName[el]=Peg παιχνίδι εξάλειψης |
22 | GenericName[eo]=Pega eliminoludo | |
19 | 23 | GenericName[es]=Juego de eliminación tipo Peg |
20 | 24 | GenericName[he]=משחק לוח מחשבת |
21 | 25 | GenericName[lt]=Kamštelių šalinimo žaidimas |
25 | 29 | GenericName[pt]=Jogo de Eliminação Peg |
26 | 30 | GenericName[ro]=Peg - joc de eliminare |
27 | 31 | GenericName[ru]=Peg — игра, в которой нужно очистить игровое поле |
32 | GenericName[sv]=Peggelimineringsspel | |
33 | GenericName[te]=పెగ్ తొలగించే ఆట | |
28 | 34 | GenericName[tr]=Peg eleme oyunu |
29 | 35 | GenericName[zh]=孔明棋游戏 |
30 | 36 | Comment=Jump pegs to eliminate them |
31 | 37 | Comment[de]=Sprung zu Heringen, um sie zu beseitigen |
32 | 38 | Comment[el]=Μετάβαση σε γόμφους για να εξαλειφθούν |
39 | Comment[eo]=Saltu sur pegojn por ilin elimini | |
33 | 40 | Comment[es]=Salta sobre los pegs para eliminarlos |
34 | 41 | Comment[he]=קפוץ מעל גולות כדי לסלק אותן |
35 | 42 | Comment[lt]=Peršokite per kamštelius, kad juos pašalintumėte |
38 | 45 | Comment[pl]=Przeskocz kołki, aby je usunąć |
39 | 46 | Comment[pt]=Salte com os pinos para os eliminar |
40 | 47 | Comment[ro]=Sari peste pioni pentru a-i eliminna |
48 | Comment[sv]=Hoppa över pinnar för att eliminera dem | |
49 | Comment[te]=వాటిని తొలగించడానికి పెగ్స్ ని ఎగరవేయి | |
41 | 50 | Comment[zh]=跳过棋子,消除它! |
42 | 51 | Exec=peg-e |
43 | 52 | Icon=peg-e |
0 | /* XPM */ | |
1 | static char * peg_e_xpm[] = { | |
2 | "32 32 200 2", | |
3 | " c None", | |
4 | ". c #002A7F", | |
5 | "+ c #002B82", | |
6 | "@ c #002B83", | |
7 | "# c #002C84", | |
8 | "$ c #002C86", | |
9 | "% c #002D88", | |
10 | "& c #002D89", | |
11 | "* c #002E8A", | |
12 | "= c #002B81", | |
13 | "- c #002C85", | |
14 | "; c #385CA5", | |
15 | "> c #7D95C5", | |
16 | ", c #9BADD3", | |
17 | "' c #B7C5E0", | |
18 | ") c #D5DDED", | |
19 | "! c #053189", | |
20 | "~ c #5271B0", | |
21 | "{ c #AAB9DA", | |
22 | "] c #CFD8EA", | |
23 | "^ c #CFD8EB", | |
24 | "/ c #CFD8EC", | |
25 | "( c #07338B", | |
26 | "_ c #879DC9", | |
27 | ": c #BBC8E2", | |
28 | "< c #BBC8E3", | |
29 | "[ c #BBC8E4", | |
30 | "} c #BBC9E4", | |
31 | "| c #BBC9E5", | |
32 | "1 c #09348D", | |
33 | "2 c #8097C7", | |
34 | "3 c #A7B8DA", | |
35 | "4 c #A7B8DB", | |
36 | "5 c #A7B9DC", | |
37 | "6 c #A7B9DE", | |
38 | "7 c #A7BADF", | |
39 | "8 c #A7BAE0", | |
40 | "9 c #3D61A9", | |
41 | "0 c #93A8D1", | |
42 | "a c #93A9D4", | |
43 | "b c #93A9D5", | |
44 | "c c #93AAD7", | |
45 | "d c #93AAD9", | |
46 | "e c #93ABDA", | |
47 | "f c #93ABDB", | |
48 | "g c #93ABDC", | |
49 | "h c #002E8C", | |
50 | "i c #5C7CB9", | |
51 | "j c #7E98CB", | |
52 | "k c #7E98CE", | |
53 | "l c #7E99D0", | |
54 | "m c #7E9AD3", | |
55 | "n c #7E9BD5", | |
56 | "o c #7E9BD7", | |
57 | "p c #7E9CD8", | |
58 | "q c #7E9CD9", | |
59 | "r c #003090", | |
60 | "s c #6180BF", | |
61 | "t c #6A88C6", | |
62 | "u c #6A8AC9", | |
63 | "v c #6A8BCD", | |
64 | "w c #6A8CCF", | |
65 | "x c #6A8CD2", | |
66 | "y c #6A8DD4", | |
67 | "z c #6A8ED6", | |
68 | "A c #6A8ED7", | |
69 | "B c #002F8D", | |
70 | "C c #003194", | |
71 | "D c #375FB0", | |
72 | "E c #567AC1", | |
73 | "F c #567BC5", | |
74 | "G c #567CC9", | |
75 | "H c #567ECD", | |
76 | "I c #567ED0", | |
77 | "J c #567FD3", | |
78 | "K c #5680D5", | |
79 | "L c #5680D6", | |
80 | "M c #5680D7", | |
81 | "N c #002A80", | |
82 | "O c #003297", | |
83 | "P c #1445A7", | |
84 | "Q c #426BBD", | |
85 | "R c #426CC2", | |
86 | "S c #426EC7", | |
87 | "T c #426FCB", | |
88 | "U c #4271CF", | |
89 | "V c #4271D2", | |
90 | "W c #4273D4", | |
91 | "X c #4273D6", | |
92 | "Y c #4274D7", | |
93 | "Z c #003092", | |
94 | "` c #00339A", | |
95 | " . c #0036A2", | |
96 | ".. c #1649B1", | |
97 | "+. c #2E5EBF", | |
98 | "@. c #2E60C4", | |
99 | "#. c #2E62CA", | |
100 | "$. c #2E63CE", | |
101 | "%. c #2E65D2", | |
102 | "&. c #2E66D5", | |
103 | "*. c #2E67D7", | |
104 | "=. c #2E67D8", | |
105 | "-. c #002E8B", | |
106 | ";. c #00349C", | |
107 | ">. c #0037A5", | |
108 | ",. c #0039AD", | |
109 | "'. c #0B44B7", | |
110 | "). c #1951C3", | |
111 | "!. c #1A54C8", | |
112 | "~. c #1A56CE", | |
113 | "{. c #1A57D3", | |
114 | "]. c #1A59D7", | |
115 | "^. c #1A5AD9", | |
116 | "/. c #1A5ADB", | |
117 | "(. c #003195", | |
118 | "_. c #00349E", | |
119 | ":. c #0037A7", | |
120 | "<. c #003AAF", | |
121 | "[. c #003DB7", | |
122 | "}. c #003FBF", | |
123 | "|. c #0344C7", | |
124 | "1. c #0548CE", | |
125 | "2. c #064AD4", | |
126 | "3. c #064CD9", | |
127 | "4. c #064DDD", | |
128 | "5. c #064EDF", | |
129 | "6. c #003296", | |
130 | "7. c #00359F", | |
131 | "8. c #0038A8", | |
132 | "9. c #003BB1", | |
133 | "0. c #003EB9", | |
134 | "a. c #0040C2", | |
135 | "b. c #0043CA", | |
136 | "c. c #0046D1", | |
137 | "d. c #0048D8", | |
138 | "e. c #004ADE", | |
139 | "f. c #004BE2", | |
140 | "g. c #004CE5", | |
141 | "h. c #003EBA", | |
142 | "i. c #0041C3", | |
143 | "j. c #0044CC", | |
144 | "k. c #0047D4", | |
145 | "l. c #0049DC", | |
146 | "m. c #004CE3", | |
147 | "n. c #004DE8", | |
148 | "o. c #004EEC", | |
149 | "p. c #0041C4", | |
150 | "q. c #0044CD", | |
151 | "r. c #0047D6", | |
152 | "s. c #004DE7", | |
153 | "t. c #004FEE", | |
154 | "u. c #0051F2", | |
155 | "v. c #003193", | |
156 | "w. c #0037A6", | |
157 | "x. c #003DB9", | |
158 | "y. c #0041C2", | |
159 | "z. c #0047D5", | |
160 | "A. c #004ADF", | |
161 | "B. c #0050F1", | |
162 | "C. c #0053F9", | |
163 | "D. c #003399", | |
164 | "E. c #0036A3", | |
165 | "F. c #003DB6", | |
166 | "G. c #0040C0", | |
167 | "H. c #0043C9", | |
168 | "I. c #0046D3", | |
169 | "J. c #004DE6", | |
170 | "K. c #0050EF", | |
171 | "L. c #0053F8", | |
172 | "M. c #0038A9", | |
173 | "N. c #003BB2", | |
174 | "O. c #003EBB", | |
175 | "P. c #0041C5", | |
176 | "Q. c #0045CE", | |
177 | "R. c #0048D7", | |
178 | "S. c #004BE0", | |
179 | "T. c #004FED", | |
180 | "U. c #003091", | |
181 | "V. c #003CB6", | |
182 | "W. c #0042C7", | |
183 | "X. c #0045CF", | |
184 | "Y. c #004ADD", | |
185 | "Z. c #00349D", | |
186 | "`. c #003AAE", | |
187 | " + c #0042C6", | |
188 | ".+ c #0046D4", | |
189 | "++ c #003CB5", | |
190 | "@+ c #0040C1", | |
191 | "#+ c #002F8E", | |
192 | "$+ c #0036A4", | |
193 | "%+ c #0039AB", | |
194 | "&+ c #003AB0", | |
195 | "*+ c #003DB8", | |
196 | "=+ c #0037A4", | |
197 | "-+ c #002F8F", | |
198 | ";+ c #003398", | |
199 | ">+ c #00359E", | |
200 | ",+ c #0035A0", | |
201 | "'+ c #003192", | |
202 | ")+ c #002B84", | |
203 | " ", | |
204 | " ", | |
205 | " . + + @ @ + + . ", | |
206 | " + # $ % & * * & % $ # + ", | |
207 | " = - % ; > , ' ) ) ' , > ; % - = ", | |
208 | " @ ! ~ { ] ^ ^ ^ / / ^ ^ ^ ] { ~ ! @ ", | |
209 | " @ ( _ : < [ } | | | | | | } [ < : _ ( @ ", | |
210 | " @ 1 2 3 4 5 6 7 7 8 8 8 8 7 7 6 5 4 3 2 1 @ ", | |
211 | " = % 9 0 a b c d e f g g g g f e d c b a 0 9 % = ", | |
212 | " - h i j k l m n o p q q q q p o n m l k j i h - ", | |
213 | " + & r s t u v w x y z A A A A z y x w v u t s r & + ", | |
214 | " - B C D E F G H I J K L M M L K J I H G F E D C B - ", | |
215 | " N % r O P Q R S T U V W X Y Y X W V U T S R Q P O r % N ", | |
216 | " + * Z ` ...+.@.#.$.%.&.*.=.=.*.&.%.$.#.@.+... .` Z * + ", | |
217 | " + -.C ;.>.,.'.).!.~.{.].^././.^.].{.~.!.).'.,.>.;.C -.+ ", | |
218 | " @ h (._.:.<.[.}.|.1.2.3.4.5.5.4.3.2.1.|.}.[.<.:._.(.h @ ", | |
219 | " # B 6.7.8.9.0.a.b.c.d.e.f.g.g.f.e.d.c.b.a.0.9.8.7.6.B # ", | |
220 | " + h 6.7.8.9.h.i.j.k.l.m.n.o.o.n.m.l.k.j.i.h.9.8.7.6.h + ", | |
221 | " + -.(._.8.9.h.p.q.r.e.s.t.u.u.t.s.e.r.q.p.h.9.8._.(.-.+ ", | |
222 | " N & v.;.w.<.x.y.j.z.A.n.B.C.C.B.n.A.z.j.y.x.<.w.;.v.& N ", | |
223 | " $ r D.E.,.F.G.H.I.l.J.K.L.L.K.J.l.I.H.G.F.,.E.D.r $ ", | |
224 | " @ h 6.7.M.N.O.P.Q.R.S.n.T.T.n.S.R.Q.P.O.N.M.7.6.h @ ", | |
225 | " % U.` E.,.V.}.W.X.R.Y.S.S.Y.R.X.W.}.V.,.E.` U.% ", | |
226 | " + -.C Z.w.`.[.}. +j.c..+.+c.j. +}.[.`.w.Z.C -.+ ", | |
227 | " - B 6._.w.`.++O.@+P.W.W.P.@+O.++`.w._.6.B - ", | |
228 | " $ #+6.Z.$+%+&+++*+h.h.*+++&+%+$+Z.6.#+$ ", | |
229 | " - h v.` 7.=+8.%+,.,.%+8.=+7.` v.h - ", | |
230 | " + & -+C ;+;.>+,+,+>+;.;+C -+& + ", | |
231 | " @ % h -+U.'+'+U.-+h % @ ", | |
232 | " N @ )+- - )+@ N ", | |
233 | " ", | |
234 | " "}; |
0 | # SOME DESCRIPTIVE TITLE. | |
1 | # Copyright (C) YEAR Graeme Gott | |
2 | # This file is distributed under the same license as the PACKAGE package. | |
3 | # | |
4 | # Translators: | |
5 | # tlhIngan'a' <dave.colletti2@gmail.com>, 2021 | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: Peg-E\n" | |
9 | "Report-Msgid-Bugs-To: \n" | |
10 | "POT-Creation-Date: 2014-11-14 20:54+0000\n" | |
11 | "PO-Revision-Date: 2021-06-14 11:09+0000\n" | |
12 | "Last-Translator: tlhIngan'a' <dave.colletti2@gmail.com>\n" | |
13 | "Language-Team: Esperanto (http://www.transifex.com/gottcode/peg-e/language/" | |
14 | "eo/)\n" | |
15 | "Language: eo\n" | |
16 | "MIME-Version: 1.0\n" | |
17 | "Content-Type: text/plain; charset=UTF-8\n" | |
18 | "Content-Transfer-Encoding: 8bit\n" | |
19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
20 | ||
21 | #: ../peg-e.appdata.xml.in:6 ../peg-e.desktop.in:3 | |
22 | msgid "Peg-E" | |
23 | msgstr "Peg-Eo" | |
24 | ||
25 | #: ../peg-e.appdata.xml.in:7 ../peg-e.desktop.in:5 | |
26 | msgid "Jump pegs to eliminate them" | |
27 | msgstr "Saltu sur pegojn por ilin elimini " | |
28 | ||
29 | #: ../peg-e.appdata.xml.in:10 | |
30 | msgid "" | |
31 | "Peg-E is a peg solitaire game in which you jump over pieces in order to " | |
32 | "remove them from the board, ultimately trying to eliminate all but one. The " | |
33 | "boards are randomly generated, with 100 levels of difficulty. The game auto-" | |
34 | "saves, and has undo-redo capability. Pieces can move horizontally, " | |
35 | "vertically, and diagonally." | |
36 | msgstr "" | |
37 | ||
38 | #: ../peg-e.desktop.in:4 | |
39 | msgid "Peg Elimination Game" | |
40 | msgstr "Pega eliminoludo" |
0 | # SOME DESCRIPTIVE TITLE. | |
1 | # Copyright (C) YEAR Graeme Gott | |
2 | # This file is distributed under the same license as the PACKAGE package. | |
3 | # | |
4 | # Translators: | |
5 | # Åke Engelbrektson, 2021 | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: Peg-E\n" | |
9 | "Report-Msgid-Bugs-To: \n" | |
10 | "POT-Creation-Date: 2014-11-14 20:54+0000\n" | |
11 | "PO-Revision-Date: 2021-02-18 04:56+0000\n" | |
12 | "Last-Translator: Åke Engelbrektson\n" | |
13 | "Language-Team: Swedish (http://www.transifex.com/gottcode/peg-e/language/" | |
14 | "sv/)\n" | |
15 | "Language: sv\n" | |
16 | "MIME-Version: 1.0\n" | |
17 | "Content-Type: text/plain; charset=UTF-8\n" | |
18 | "Content-Transfer-Encoding: 8bit\n" | |
19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
20 | ||
21 | #: ../peg-e.appdata.xml.in:6 ../peg-e.desktop.in:3 | |
22 | msgid "Peg-E" | |
23 | msgstr "Peg-E" | |
24 | ||
25 | #: ../peg-e.appdata.xml.in:7 ../peg-e.desktop.in:5 | |
26 | msgid "Jump pegs to eliminate them" | |
27 | msgstr "Hoppa över pinnar för att eliminera dem" | |
28 | ||
29 | #: ../peg-e.appdata.xml.in:10 | |
30 | msgid "" | |
31 | "Peg-E is a peg solitaire game in which you jump over pieces in order to " | |
32 | "remove them from the board, ultimately trying to eliminate all but one. The " | |
33 | "boards are randomly generated, with 100 levels of difficulty. The game auto-" | |
34 | "saves, and has undo-redo capability. Pieces can move horizontally, " | |
35 | "vertically, and diagonally." | |
36 | msgstr "" | |
37 | "Peg-E är ett solitairespel där du hoppar över bitar för att ta bort dem från " | |
38 | "brädet, i slutändan för att eliminera alla utom en. Banorna genereras " | |
39 | "slumpmässigt i 100 svårighetsgrader. Spelet sparas automatiskt och har ångra-" | |
40 | "gör-om-funktioner. Bitarna kan röra sig horisontellt, vertikalt och " | |
41 | "diagonalt." | |
42 | ||
43 | #: ../peg-e.desktop.in:4 | |
44 | msgid "Peg Elimination Game" | |
45 | msgstr "Peggelimineringsspel" |
0 | # SOME DESCRIPTIVE TITLE. | |
1 | # Copyright (C) YEAR Graeme Gott | |
2 | # This file is distributed under the same license as the PACKAGE package. | |
3 | # | |
4 | # Translators: | |
5 | # Jagadeeshvarma, 2021 | |
6 | msgid "" | |
7 | msgstr "" | |
8 | "Project-Id-Version: Peg-E\n" | |
9 | "Report-Msgid-Bugs-To: \n" | |
10 | "POT-Creation-Date: 2014-11-14 20:54+0000\n" | |
11 | "PO-Revision-Date: 2021-05-16 04:47+0000\n" | |
12 | "Last-Translator: Jagadeeshvarma\n" | |
13 | "Language-Team: Telugu (http://www.transifex.com/gottcode/peg-e/language/" | |
14 | "te/)\n" | |
15 | "Language: te\n" | |
16 | "MIME-Version: 1.0\n" | |
17 | "Content-Type: text/plain; charset=UTF-8\n" | |
18 | "Content-Transfer-Encoding: 8bit\n" | |
19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" | |
20 | ||
21 | #: ../peg-e.appdata.xml.in:6 ../peg-e.desktop.in:3 | |
22 | msgid "Peg-E" | |
23 | msgstr "పెగ్-ఇ" | |
24 | ||
25 | #: ../peg-e.appdata.xml.in:7 ../peg-e.desktop.in:5 | |
26 | msgid "Jump pegs to eliminate them" | |
27 | msgstr "వాటిని తొలగించడానికి పెగ్స్ ని ఎగరవేయి" | |
28 | ||
29 | #: ../peg-e.appdata.xml.in:10 | |
30 | msgid "" | |
31 | "Peg-E is a peg solitaire game in which you jump over pieces in order to " | |
32 | "remove them from the board, ultimately trying to eliminate all but one. The " | |
33 | "boards are randomly generated, with 100 levels of difficulty. The game auto-" | |
34 | "saves, and has undo-redo capability. Pieces can move horizontally, " | |
35 | "vertically, and diagonally." | |
36 | msgstr "" | |
37 | "పెగ్-ఇ అనేది ఒక పెగ్ సాలిటైర్ ఆట, దీనిలో మీరు వాటిని బోర్డు నుండి తొలగించడానికి ముక్కల మీద దూకుతారు, " | |
38 | "చివరికి ఒకటి తప్తేపి అన్నింటినీ తొలగించడానికి ప్రయత్నిస్తారు. బోర్డులు యాదృచ్ఛికంగా ఉత్పత్తి చేయబడతాయి, కష్టమైన " | |
39 | "100 స్థాయిలు ఉంటాయి. ఆట స్వయంచాలకంగా సేవ్ చేస్తుంది మరియు అన్డు-పునరావృత సామర్థ్యాన్ని కలిగి ఉంటుంది. " | |
40 | "ముక్కలు అడ్డంగా, నిలువుగా మరియు వికర్ణంగా కదలగలవు." | |
41 | ||
42 | #: ../peg-e.desktop.in:4 | |
43 | msgid "Peg Elimination Game" | |
44 | msgstr "పెగ్ తొలగించే ఆట" |
1 | 1 | |
2 | 2 | APP='Peg-E' |
3 | 3 | BUNDLE="$APP.app" |
4 | VERSION='1.2.8' | |
4 | VERSION='1.3.0' | |
5 | 5 | |
6 | 6 | # Remove any previous disk folder or DMG |
7 | 7 | echo -n 'Preparing... ' |
42 | 42 | TRANSLATIONS="$APP/$BUNDLE/Contents/Resources/translations" |
43 | 43 | mkdir "$TRANSLATIONS" |
44 | 44 | cp translations/*.qm "$TRANSLATIONS" |
45 | echo 'Done' | |
46 | ||
47 | # Make macOS aware that the app bundle is translated. | |
48 | # This is required to translate parts of native open/save dialogs. | |
49 | echo -n 'Creating mac lproj directories for translations... ' | |
50 | for translation in $(ls translations | grep qm | cut -d'.' -f1 | cut -d'_' -f2- | uniq); do | |
51 | mkdir -p "$APP/$BUNDLE/Contents/Resources/${translation}.lproj" | |
52 | done | |
45 | 53 | echo 'Done' |
46 | 54 | |
47 | 55 | # Copy Qt translations |
0 | lessThan(QT_MAJOR_VERSION, 5) { | |
1 | error("Peg-E requires Qt 5.9 or greater") | |
2 | } | |
3 | equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 9) { | |
4 | error("Peg-E requires Qt 5.9 or greater") | |
0 | !versionAtLeast(QT_VERSION, 5.12) { | |
1 | error("Peg-E requires Qt 5.12 or greater") | |
5 | 2 | } |
6 | 3 | |
7 | 4 | TEMPLATE = app |
8 | 5 | QT += widgets |
9 | CONFIG += c++11 | |
6 | CONFIG += c++17 | |
10 | 7 | |
11 | 8 | CONFIG(debug, debug|release) { |
12 | 9 | CONFIG += warn_on |
13 | 10 | DEFINES += QT_DEPRECATED_WARNINGS |
14 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x051400 | |
11 | DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 | |
15 | 12 | DEFINES += QT_NO_NARROWING_CONVERSIONS_IN_CONNECT |
16 | 13 | } |
17 | 14 | |
21 | 18 | RCC_DIR = build |
22 | 19 | |
23 | 20 | # Set program version |
24 | VERSION = 1.2.8 | |
21 | VERSION = 1.3.0 | |
25 | 22 | DEFINES += VERSIONSTR=\\\"$${VERSION}\\\" |
26 | 23 | |
27 | 24 | # Set program name |
69 | 66 | } else:win32 { |
70 | 67 | RC_ICONS = icons/peg-e.ico |
71 | 68 | QMAKE_TARGET_DESCRIPTION = "Peg elimination game" |
72 | QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2019 Graeme Gott" | |
69 | QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2021 Graeme Gott" | |
73 | 70 | } else:unix { |
74 | 71 | RESOURCES = icons/icon.qrc |
75 | 72 | |
84 | 81 | |
85 | 82 | icon.files = icons/hicolor/* |
86 | 83 | icon.path = $$PREFIX/share/icons/hicolor |
87 | ||
88 | pixmap.files = icons/peg-e.xpm | |
89 | pixmap.path = $$PREFIX/share/pixmaps | |
90 | 84 | |
91 | 85 | icons.files = icons/oxygen/hicolor/* |
92 | 86 | icons.path = $$PREFIX/share/peg-e/icons/hicolor |
104 | 98 | man.files = doc/peg-e.6 |
105 | 99 | man.path = $$PREFIX/share/man/man6 |
106 | 100 | |
107 | INSTALLS += target icon pixmap desktop appdata icons qm man | |
101 | INSTALLS += target icon desktop appdata icons qm man | |
108 | 102 | } |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013, 2018 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2020 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "board.h" |
20 | 7 | |
24 | 11 | #include "puzzle.h" |
25 | 12 | |
26 | 13 | #include <QLinearGradient> |
27 | #include <QRegExp> | |
28 | 14 | #include <QResizeEvent> |
29 | 15 | #include <QSettings> |
30 | 16 | #include <QUndoStack> |
33 | 19 | |
34 | 20 | //----------------------------------------------------------------------------- |
35 | 21 | |
22 | #if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) | |
36 | 23 | inline uint qHash(const QPoint& key) |
37 | 24 | { |
38 | 25 | return (key.x() << 16) + key.y(); |
39 | 26 | } |
40 | ||
41 | //----------------------------------------------------------------------------- | |
42 | ||
43 | Board::Board(QUndoStack* moves, QWidget* parent) : | |
44 | QGraphicsView(parent), | |
45 | m_color(QSettings().value("Appearance", "#0055ff").toString()), | |
46 | m_status(0), | |
47 | m_moves(moves) | |
27 | #endif | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | ||
31 | Board::Board(QUndoStack* moves, QWidget* parent) | |
32 | : QGraphicsView(parent) | |
33 | , m_color(QSettings().value("Appearance", "#0055ff").toString()) | |
34 | , m_status(0) | |
35 | , m_moves(moves) | |
48 | 36 | { |
49 | 37 | QGraphicsScene* scene = new QGraphicsScene(this); |
50 | 38 | setScene(scene); |
62 | 50 | |
63 | 51 | bool Board::isHole(const QPoint& hole) const |
64 | 52 | { |
65 | return m_holes.contains(hole) ? !m_holes.value(hole)->hasPeg() : 0; | |
53 | return m_holes.contains(hole) ? !m_holes[hole]->hasPeg() : false; | |
66 | 54 | } |
67 | 55 | |
68 | 56 | //----------------------------------------------------------------------------- |
69 | 57 | |
70 | 58 | bool Board::isPeg(const QPoint& hole) const |
71 | 59 | { |
72 | return m_holes.contains(hole) ? m_holes.value(hole)->hasPeg() : 0; | |
60 | return m_holes.contains(hole) ? m_holes[hole]->hasPeg() : false; | |
73 | 61 | } |
74 | 62 | |
75 | 63 | //----------------------------------------------------------------------------- |
76 | 64 | |
77 | 65 | Hole* Board::hole(const QPoint& hole) const |
78 | 66 | { |
79 | return m_holes.contains(hole) ? m_holes[hole] : 0; | |
67 | return m_holes.contains(hole) ? m_holes[hole] : nullptr; | |
80 | 68 | } |
81 | 69 | |
82 | 70 | //----------------------------------------------------------------------------- |
91 | 79 | setInteractive(true); |
92 | 80 | |
93 | 81 | // Create puzzle |
94 | Puzzle* puzzle = 0; | |
82 | Puzzle* puzzle = nullptr; | |
95 | 83 | switch (algorithm) { |
96 | 84 | case 2: |
97 | 85 | puzzle = new PuzzleBranch; |
231 | 219 | bool Board::checkFinished() |
232 | 220 | { |
233 | 221 | int pegs = 0; |
234 | for (Hole* hole : m_holes) { | |
222 | for (Hole* hole : qAsConst(m_holes)) { | |
235 | 223 | if (hole->hasPeg()) { |
236 | 224 | pegs++; |
237 | 225 | if (hole->peg()->canMove()) { |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2012, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_BOARD_H |
20 | 7 | #define PEGE_BOARD_H |
44 | 31 | * @param moves where to store the history of peg movements |
45 | 32 | * @param parent the game board's parent widget |
46 | 33 | */ |
47 | Board(QUndoStack* moves, QWidget* parent = 0); | |
34 | explicit Board(QUndoStack* moves, QWidget* parent = nullptr); | |
48 | 35 | |
49 | 36 | /** Returns @c true if there is only one peg left. */ |
50 | 37 | bool isFinished() const |
107 | 94 | |
108 | 95 | protected: |
109 | 96 | /** Override parent function to draw background gradient. */ |
110 | void drawBackground(QPainter* painter, const QRectF& rect); | |
97 | void drawBackground(QPainter* painter, const QRectF& rect) override; | |
111 | 98 | |
112 | 99 | /** Override parent function to draw status message. */ |
113 | void drawForeground(QPainter* painter, const QRectF& rect); | |
100 | void drawForeground(QPainter* painter, const QRectF& rect) override; | |
114 | 101 | |
115 | 102 | /** Override parent function to scale board when resized. */ |
116 | void resizeEvent(QResizeEvent* event); | |
103 | void resizeEvent(QResizeEvent* event) override; | |
117 | 104 | |
118 | 105 | private: |
119 | 106 | /** |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "hole.h" |
20 | 7 | |
24 | 11 | |
25 | 12 | //----------------------------------------------------------------------------- |
26 | 13 | |
27 | Hole::Hole(const QPoint& position, QGraphicsItem* parent) : | |
28 | QGraphicsEllipseItem(0, 0, 16, 16, parent), | |
29 | m_peg(0) | |
14 | Hole::Hole(const QPoint& position, QGraphicsItem* parent) | |
15 | : QGraphicsEllipseItem(0, 0, 16, 16, parent) | |
16 | , m_peg(nullptr) | |
30 | 17 | { |
31 | 18 | QRadialGradient gradient(QPointF(8,8), 8); |
32 | 19 | gradient.setColorAt(0, QColor(0, 0, 0, 0)); |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_HOLE_H |
20 | 7 | #define PEGE_HOLE_H |
39 | 26 | * @param position the location of the hole |
40 | 27 | * @param parent the parent item of the hole |
41 | 28 | */ |
42 | Hole(const QPoint& position, QGraphicsItem* parent = 0); | |
29 | explicit Hole(const QPoint& position, QGraphicsItem* parent = nullptr); | |
43 | 30 | |
44 | 31 | /** Returns @c true if the hole has a peg. */ |
45 | 32 | bool hasPeg() const |
46 | 33 | { |
47 | return m_peg != 0; | |
34 | return m_peg; | |
48 | 35 | } |
49 | 36 | |
50 | 37 | /** Returns the peg contained by the hole. */ |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018, 2019, 2020 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2010-2020 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "locale_dialog.h" |
20 | 7 | |
42 | 29 | |
43 | 30 | //----------------------------------------------------------------------------- |
44 | 31 | |
45 | LocaleDialog::LocaleDialog(QWidget* parent) : | |
46 | QDialog(parent, Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint) | |
32 | LocaleDialog::LocaleDialog(QWidget* parent) | |
33 | : QDialog(parent, Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint) | |
47 | 34 | { |
48 | 35 | QString title = parent ? parent->window()->windowTitle() : QString(); |
49 | 36 | setWindowTitle(!title.isEmpty() ? title : QCoreApplication::applicationName()); |
52 | 39 | |
53 | 40 | m_translations = new QComboBox(this); |
54 | 41 | m_translations->addItem(tr("<System Language>")); |
55 | QStringList translations = findTranslations(); | |
42 | const QStringList translations = findTranslations(); | |
56 | 43 | for (QString translation : translations) { |
57 | 44 | if (translation.startsWith("qt")) { |
58 | 45 | continue; |
98 | 85 | // Find current locale |
99 | 86 | m_current = QSettings().value("Locale/Language").toString(); |
100 | 87 | if (!m_current.isEmpty()) { |
101 | QLocale::setDefault(m_current); | |
88 | QLocale::setDefault(QLocale(m_current)); | |
102 | 89 | } |
103 | 90 | const QString locale = QLocale().name(); |
104 | 91 | |
107 | 94 | if (translator.load(m_appname + locale, m_path)) { |
108 | 95 | QCoreApplication::installTranslator(&translator); |
109 | 96 | |
97 | #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) | |
98 | const QString path = QLibraryInfo::path(QLibraryInfo::TranslationsPath); | |
99 | #else | |
110 | 100 | const QString path = QLibraryInfo::location(QLibraryInfo::TranslationsPath); |
101 | #endif | |
111 | 102 | |
112 | 103 | static QTranslator qtbase_translator; |
113 | 104 | if (qtbase_translator.load("qtbase_" + locale, m_path) || qtbase_translator.load("qtbase_" + locale, path)) { |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2010, 2011, 2012, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2010-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_LOCALE_DIALOG_H |
20 | 7 | #define PEGE_LOCALE_DIALOG_H |
39 | 26 | * |
40 | 27 | * @param parent the parent widget of the dialog |
41 | 28 | */ |
42 | LocaleDialog(QWidget* parent = 0); | |
29 | explicit LocaleDialog(QWidget* parent = nullptr); | |
43 | 30 | |
44 | 31 | /** |
45 | 32 | * Load the stored language into the application; defaults to system language. |
59 | 46 | |
60 | 47 | public slots: |
61 | 48 | /** Override parent function to store application language. */ |
62 | void accept(); | |
49 | void accept() override; | |
63 | 50 | |
64 | 51 | private: |
65 | 52 | /** |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2018, 2019 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2021 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "locale_dialog.h" |
20 | 7 | #include "window.h" |
21 | 8 | |
22 | 9 | #include <QApplication> |
10 | #include <QCommandLineParser> | |
23 | 11 | |
24 | 12 | /** |
25 | 13 | * Program entry point. |
30 | 18 | */ |
31 | 19 | int main(int argc, char** argv) |
32 | 20 | { |
21 | #if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) | |
33 | 22 | #if !defined(Q_OS_MAC) |
34 | 23 | if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO") |
35 | 24 | && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") |
37 | 26 | && !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) { |
38 | 27 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
39 | 28 | } |
29 | #endif | |
30 | QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | |
40 | 31 | #endif |
41 | 32 | QApplication app(argc, argv); |
42 | 33 | app.setApplicationName("Peg-E"); |
49 | 40 | app.setDesktopFileName("peg-e"); |
50 | 41 | #endif |
51 | 42 | app.setAttribute(Qt::AA_DontShowIconsInMenus, true); |
52 | app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); | |
53 | 43 | |
54 | 44 | LocaleDialog::loadTranslator("pege_"); |
55 | 45 | |
73 | 63 | // Set up icons |
74 | 64 | #if defined(Q_OS_MAC) || defined(Q_OS_WIN) |
75 | 65 | QIcon::setThemeName("hicolor"); |
76 | #elif (QT_VERSION >= QT_VERSION_CHECK(5,12,0)) | |
66 | #else | |
67 | if (QIcon::themeName() == "hicolor") { | |
68 | QIcon::setThemeName("Hicolor"); | |
69 | } | |
77 | 70 | QIcon::setFallbackThemeName("hicolor"); |
78 | #else | |
79 | if (QIcon::themeName().isEmpty()) { | |
80 | QIcon::setThemeName("hicolor"); | |
81 | } | |
82 | 71 | #endif |
72 | ||
73 | QCommandLineParser parser; | |
74 | parser.setApplicationDescription(Window::tr("Peg elimination game")); | |
75 | parser.addHelpOption(); | |
76 | parser.addVersionOption(); | |
77 | parser.process(app); | |
83 | 78 | |
84 | 79 | Window window; |
85 | 80 | window.show(); |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "movement.h" |
20 | 7 | |
26 | 13 | |
27 | 14 | //----------------------------------------------------------------------------- |
28 | 15 | |
29 | Movement::Movement(const QPoint& start_hole, const QPoint& end_hole, Board* board) : | |
30 | m_start_hole(start_hole), | |
31 | m_jumped_hole(start_hole + ((end_hole - start_hole) / 2)), | |
32 | m_end_hole(end_hole), | |
33 | m_board(board) | |
16 | Movement::Movement(const QPoint& start_hole, const QPoint& end_hole, Board* board) | |
17 | : m_start_hole(start_hole) | |
18 | , m_jumped_hole(start_hole + ((end_hole - start_hole) / 2)) | |
19 | , m_end_hole(end_hole) | |
20 | , m_board(board) | |
34 | 21 | { |
35 | 22 | Q_ASSERT(m_board->isPeg(m_start_hole)); |
36 | 23 | Q_ASSERT(m_board->isPeg(m_jumped_hole)); |
44 | 31 | |
45 | 32 | void Movement::redo() |
46 | 33 | { |
47 | m_board->hole(m_start_hole)->setPeg(0); | |
48 | m_board->hole(m_jumped_hole)->setPeg(0); | |
34 | m_board->hole(m_start_hole)->setPeg(nullptr); | |
35 | m_board->hole(m_jumped_hole)->setPeg(nullptr); | |
49 | 36 | m_board->hole(m_end_hole)->setPeg(m_peg); |
50 | 37 | |
51 | 38 | m_jumped_peg->hide(); |
62 | 49 | { |
63 | 50 | m_board->hole(m_start_hole)->setPeg(m_peg); |
64 | 51 | m_board->hole(m_jumped_hole)->setPeg(m_jumped_peg); |
65 | m_board->hole(m_end_hole)->setPeg(0); | |
52 | m_board->hole(m_end_hole)->setPeg(nullptr); | |
66 | 53 | |
67 | 54 | m_peg->move(m_start_hole); |
68 | 55 | m_jumped_peg->show(); |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_MOVEMENT_H |
20 | 7 | #define PEGE_MOVEMENT_H |
47 | 34 | Movement(const QPoint& start_hole, const QPoint& end_hole, Board* board); |
48 | 35 | |
49 | 36 | /** Move the peg from the start hole to the end hole, removing the peg in the hole between them. */ |
50 | void redo(); | |
37 | void redo() override; | |
51 | 38 | |
52 | 39 | /** Move the peg from the end hole to the start hole, restoring the peg in the hole between them. */ |
53 | void undo(); | |
40 | void undo() override; | |
54 | 41 | |
55 | 42 | private: |
56 | 43 | Peg* m_peg; /**< peg that was moved */ |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "peg.h" |
20 | 7 | |
25 | 12 | |
26 | 13 | //----------------------------------------------------------------------------- |
27 | 14 | |
28 | Peg::Peg(const QPoint& hole, Board* board, QGraphicsItem* parent) : | |
29 | QGraphicsEllipseItem(0, 0, 20, 20, parent), | |
30 | m_hole(hole), | |
31 | m_board(board) | |
15 | Peg::Peg(const QPoint& hole, Board* board, QGraphicsItem* parent) | |
16 | : QGraphicsEllipseItem(0, 0, 20, 20, parent) | |
17 | , m_hole(hole) | |
18 | , m_board(board) | |
32 | 19 | { |
33 | 20 | setPen(Qt::NoPen); |
34 | 21 |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_PEG_H |
20 | 7 | #define PEGE_PEG_H |
42 | 29 | * @param board the board containing the peg |
43 | 30 | * @param parent the parent item of the peg |
44 | 31 | */ |
45 | Peg(const QPoint& hole, Board* board, QGraphicsItem* parent = 0); | |
32 | Peg(const QPoint& hole, Board* board, QGraphicsItem* parent = nullptr); | |
46 | 33 | |
47 | 34 | /** Returns @c true if the peg can move; @c false otherwise */ |
48 | 35 | bool canMove() |
67 | 54 | |
68 | 55 | protected: |
69 | 56 | /** Override parent function to check if there are valid moves. */ |
70 | void mousePressEvent(QGraphicsSceneMouseEvent* event); | |
57 | void mousePressEvent(QGraphicsSceneMouseEvent* event) override; | |
71 | 58 | |
72 | 59 | /** Override parent function to handle completing a jump. */ |
73 | void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); | |
60 | void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override; | |
74 | 61 | |
75 | 62 | private: |
76 | 63 | /** Search game board for valid jumps to make. */ |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013, 2014 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2014 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "puzzle.h" |
20 | 7 | |
22 | 9 | |
23 | 10 | //----------------------------------------------------------------------------- |
24 | 11 | |
12 | #if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) | |
25 | 13 | inline uint qHash(const QPoint& key) |
26 | 14 | { |
27 | 15 | return (key.x() << 16) + key.y(); |
28 | 16 | } |
17 | #endif | |
29 | 18 | |
30 | 19 | //----------------------------------------------------------------------------- |
31 | 20 | |
109 | 98 | bool Puzzle::findNextMove(const QPoint& start_hole, QPoint& jumped_hole, QPoint& end_hole) |
110 | 99 | { |
111 | 100 | std::shuffle(m_directions.begin(), m_directions.end(), m_random); |
112 | for (const QPoint& direction : m_directions) { | |
101 | for (const QPoint& direction : qAsConst(m_directions)) { | |
113 | 102 | jumped_hole = direction + start_hole; |
114 | 103 | end_hole = (direction * 2) + start_hole; |
115 | 104 | if (isAvailable(jumped_hole) && isAvailable(end_hole)) { |
132 | 121 | QPoint jumped_hole, end_hole; |
133 | 122 | for (int i = 0; i < loops; ++i) { |
134 | 123 | shuffle(pegs); |
135 | for (const QPoint& start_hole : pegs) { | |
124 | for (const QPoint& start_hole : qAsConst(pegs)) { | |
136 | 125 | if (findNextMove(start_hole, jumped_hole, end_hole)) { |
137 | 126 | pegs.removeOne(start_hole); |
138 | 127 | pegs.append(jumped_hole); |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2013, 2014 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2014 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_PUZZLE_H |
20 | 7 | #define PEGE_PUZZLE_H |
36 | 23 | { |
37 | 24 | public: |
38 | 25 | /** Constructs an empty layout. */ |
39 | Puzzle(); | |
26 | explicit Puzzle(); | |
40 | 27 | |
41 | 28 | /** Destroys the layout. */ |
42 | 29 | virtual ~Puzzle(); |
132 | 119 | * |
133 | 120 | * @param pegs how many pegs to create |
134 | 121 | */ |
135 | void generate(int pegs); | |
122 | void generate(int pegs) override; | |
136 | 123 | }; |
137 | 124 | |
138 | 125 | /** Puzzle that doesn't reuse or shuffle any holes. */ |
144 | 131 | * |
145 | 132 | * @param hole the hole to check |
146 | 133 | */ |
147 | bool isAvailable(const QPoint& hole) const; | |
134 | bool isAvailable(const QPoint& hole) const override; | |
148 | 135 | |
149 | 136 | /** |
150 | 137 | * Override parent function to prevent shuffling the pegs. |
151 | 138 | * |
152 | 139 | * @param pegs the pegs to shuffle |
153 | 140 | */ |
154 | void shuffle(QList<QPoint>& pegs); | |
141 | void shuffle(QList<QPoint>& pegs) override; | |
155 | 142 | }; |
156 | 143 | |
157 | 144 | #endif // PEGE_PUZZLE_H |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2021 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #include "window.h" |
20 | 7 | |
30 | 17 | #include <QFormLayout> |
31 | 18 | #include <QMenuBar> |
32 | 19 | #include <QMessageBox> |
20 | #include <QRandomGenerator> | |
21 | #include <QRegularExpression> | |
33 | 22 | #include <QSettings> |
34 | 23 | #include <QSpinBox> |
35 | 24 | #include <QToolBar> |
36 | 25 | #include <QUndoStack> |
37 | 26 | #include <QVBoxLayout> |
38 | 27 | |
39 | #include <ctime> | |
40 | #include <random> | |
41 | ||
42 | //----------------------------------------------------------------------------- | |
43 | ||
44 | Window::Window() : | |
45 | m_seed(0), | |
46 | m_difficulty(QSettings().value("Difficulty", 5).toInt()), | |
47 | m_algorithm(QSettings().value("Algorithm", 1).toInt()) | |
28 | //----------------------------------------------------------------------------- | |
29 | ||
30 | Window::Window() | |
31 | : m_seed(0) | |
32 | , m_difficulty(QSettings().value("Difficulty", 5).toInt()) | |
33 | , m_algorithm(QSettings().value("Algorithm", 1).toInt()) | |
48 | 34 | { |
49 | 35 | // Create board |
50 | 36 | QUndoStack* moves = new QUndoStack(this); |
55 | 41 | // Create menubar |
56 | 42 | QMenu* game_menu = menuBar()->addMenu(tr("&Game")); |
57 | 43 | |
58 | QAction* new_action = game_menu->addAction(QIcon::fromTheme("document-new"), tr("&New"), this, SLOT(newGame()), QKeySequence::New); | |
59 | QAction* restart_action = game_menu->addAction(QIcon::fromTheme("view-refresh"), tr("&Restart Game"), this, SLOT(restartGame()), QKeySequence::Refresh); | |
60 | game_menu->addAction(tr("&Details"), this, SLOT(showDetails())); | |
44 | QAction* new_action = game_menu->addAction(QIcon::fromTheme("document-new"), tr("&New"), this, &Window::newGame, QKeySequence::New); | |
45 | QAction* restart_action = game_menu->addAction(QIcon::fromTheme("view-refresh"), tr("&Restart Game"), this, &Window::restartGame, QKeySequence::Refresh); | |
46 | game_menu->addAction(tr("&Details"), this, &Window::showDetails); | |
61 | 47 | game_menu->addSeparator(); |
62 | QAction* quit_action = game_menu->addAction(QIcon::fromTheme("application-exit"), tr("Quit"), this, SLOT(close()), QKeySequence::Quit); | |
48 | QAction* quit_action = game_menu->addAction(QIcon::fromTheme("application-exit"), tr("Quit"), this, &Window::close, QKeySequence::Quit); | |
63 | 49 | quit_action->setMenuRole(QAction::QuitRole); |
64 | 50 | |
65 | 51 | QMenu* move_menu = menuBar()->addMenu(tr("&Move")); |
66 | 52 | |
67 | QAction* undo_action = move_menu->addAction(QIcon::fromTheme("edit-undo"), tr("&Undo"), moves, SLOT(undo()), QKeySequence::Undo); | |
53 | QAction* undo_action = move_menu->addAction(QIcon::fromTheme("edit-undo"), tr("&Undo"), moves, &QUndoStack::undo, QKeySequence::Undo); | |
68 | 54 | undo_action->setEnabled(false); |
69 | 55 | connect(moves, &QUndoStack::canUndoChanged, undo_action, &QAction::setEnabled); |
70 | 56 | |
71 | QAction* redo_action = move_menu->addAction(QIcon::fromTheme("edit-redo"), tr("&Redo"), moves, SLOT(redo()), QKeySequence::Redo); | |
57 | QAction* redo_action = move_menu->addAction(QIcon::fromTheme("edit-redo"), tr("&Redo"), moves, &QUndoStack::redo, QKeySequence::Redo); | |
72 | 58 | redo_action->setEnabled(false); |
73 | 59 | connect(moves, &QUndoStack::canRedoChanged, redo_action, &QAction::setEnabled); |
74 | 60 | |
99 | 85 | |
100 | 86 | connect(m_colors, &QActionGroup::triggered, this, &Window::changeAppearance); |
101 | 87 | |
102 | appearance_menu->addAction(tr("Custom..."), this, SLOT(changeAppearanceCustom())); | |
88 | appearance_menu->addAction(tr("Custom..."), this, &Window::changeAppearanceCustom); | |
103 | 89 | |
104 | 90 | QMenu* settings_menu = menuBar()->addMenu(tr("&Settings")); |
105 | settings_menu->addAction(tr("Application &Language..."), this, SLOT(setLocale())); | |
91 | settings_menu->addAction(tr("Application &Language..."), this, &Window::setLocale); | |
106 | 92 | |
107 | 93 | QMenu* help_menu = menuBar()->addMenu(tr("&Help")); |
108 | QAction* about_action = help_menu->addAction(tr("&About"), this, SLOT(about())); | |
94 | QAction* about_action = help_menu->addAction(tr("&About"), this, &Window::about); | |
109 | 95 | about_action->setMenuRole(QAction::AboutRole); |
110 | QAction* about_qt_action = help_menu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt())); | |
96 | QAction* about_qt_action = help_menu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt); | |
111 | 97 | about_qt_action->setMenuRole(QAction::AboutQtRole); |
112 | 98 | |
113 | 99 | // Create toolbar |
232 | 218 | "<p align='center'>%6<br/><small>%7</small></p>") |
233 | 219 | .arg(tr("Peg-E"), QCoreApplication::applicationVersion(), |
234 | 220 | tr("Peg elimination game"), |
235 | tr("Copyright © 2009-%1 Graeme Gott").arg("2020"), | |
221 | tr("Copyright © 2009-%1 Graeme Gott").arg("2021"), | |
236 | 222 | tr("Released under the <a href=%1>GPL 3</a> license").arg("\"http://www.gnu.org/licenses/gpl.html\""), |
237 | 223 | tr("Uses icons from the <a href=%1>Oxygen</a> icon theme").arg("\"http://www.oxygen-icons.org/\""), |
238 | 224 | tr("Used under the <a href=%1>LGPL 3</a> license").arg("\"http://www.gnu.org/licenses/lgpl.html\"")) |
256 | 242 | } |
257 | 243 | |
258 | 244 | QString selected_color = color.name(); |
259 | QList<QAction*> actions = m_colors->actions(); | |
245 | const QList<QAction*> actions = m_colors->actions(); | |
260 | 246 | for (QAction* action : actions) { |
261 | action->setChecked(action->data() == selected_color); | |
247 | action->setChecked(action->data().toString() == selected_color); | |
262 | 248 | } |
263 | 249 | |
264 | 250 | m_board->setAppearance(color); |
280 | 266 | startGame(seed, difficulty, algorithm); |
281 | 267 | |
282 | 268 | // Load moves |
283 | QRegExp parse("(-?\\d+)x(-?\\d+) to (-?\\d+)x(-?\\d+)"); | |
284 | for (const QString& move : moves) { | |
285 | if (!parse.exactMatch(move)) { | |
269 | const QRegularExpression parse("^(-?\\d+)x(-?\\d+) to (-?\\d+)x(-?\\d+)$"); | |
270 | for (const QString& move : qAsConst(moves)) { | |
271 | const QRegularExpressionMatch match = parse.match(move); | |
272 | if (!match.hasMatch()) { | |
286 | 273 | continue; |
287 | 274 | } |
288 | 275 | |
289 | QPoint old_hole(parse.cap(1).toInt(), parse.cap(2).toInt()); | |
290 | QPoint new_hole(parse.cap(3).toInt(), parse.cap(4).toInt()); | |
276 | QPoint old_hole(match.captured(1).toInt(), match.captured(2).toInt()); | |
277 | QPoint new_hole(match.captured(3).toInt(), match.captured(4).toInt()); | |
291 | 278 | if (m_board->isPeg(old_hole) && m_board->isHole(new_hole)) { |
292 | 279 | m_board->move(old_hole, new_hole); |
293 | 280 | } else { |
301 | 288 | void Window::startGame(int seed, int difficulty, int algorithm) |
302 | 289 | { |
303 | 290 | if (seed == 0) { |
304 | #ifndef Q_OS_WIN | |
305 | std::random_device rd; | |
306 | std::mt19937 gen(rd()); | |
307 | #else | |
308 | std::mt19937 gen(time(0)); | |
309 | #endif | |
310 | std::uniform_int_distribution<int> dis; | |
311 | seed = dis(gen); | |
291 | seed = QRandomGenerator::system()->bounded(INT_MAX); | |
312 | 292 | } |
313 | 293 | m_seed = seed; |
314 | 294 | m_difficulty = difficulty; |
0 | /*********************************************************************** | |
1 | * | |
2 | * Copyright (C) 2009, 2012, 2013 Graeme Gott <graeme@gottcode.org> | |
3 | * | |
4 | * This program is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | * | |
17 | ***********************************************************************/ | |
0 | /* | |
1 | SPDX-FileCopyrightText: 2009-2013 Graeme Gott <graeme@gottcode.org> | |
2 | ||
3 | SPDX-License-Identifier: GPL-3.0-or-later | |
4 | */ | |
18 | 5 | |
19 | 6 | #ifndef PEGE_WINDOW_H |
20 | 7 | #define PEGE_WINDOW_H |
37 | 24 | |
38 | 25 | public: |
39 | 26 | /** Constructs the main window. */ |
40 | Window(); | |
27 | explicit Window(); | |
41 | 28 | |
42 | 29 | protected: |
43 | 30 | /** Override parent function to save window geometry. */ |
44 | void closeEvent(QCloseEvent* event); | |
31 | void closeEvent(QCloseEvent* event) override; | |
45 | 32 | |
46 | 33 | private slots: |
47 | 34 | /** |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | <!DOCTYPE TS> | |
2 | <TS version="2.1" language="eo"> | |
3 | <context> | |
4 | <name>Board</name> | |
5 | <message> | |
6 | <source>Success</source> | |
7 | <translation>Sukceson!</translation> | |
8 | </message> | |
9 | <message> | |
10 | <source>Game Over</source> | |
11 | <translation>Malsukceson</translation> | |
12 | </message> | |
13 | </context> | |
14 | <context> | |
15 | <name>LocaleDialog</name> | |
16 | <message> | |
17 | <source>Select application language:</source> | |
18 | <translation>Elektu lingvon de programo:</translation> | |
19 | </message> | |
20 | <message> | |
21 | <source><System Language></source> | |
22 | <translation><System Language></translation> | |
23 | </message> | |
24 | <message> | |
25 | <source>Note</source> | |
26 | <translation>Noto</translation> | |
27 | </message> | |
28 | <message> | |
29 | <source>Please restart this application for the change in language to take effect.</source> | |
30 | <translation>Bonvolu rekomencu ĉi tiun programon, tial la lingvo sanĝiĝas.</translation> | |
31 | </message> | |
32 | </context> | |
33 | <context> | |
34 | <name>Window</name> | |
35 | <message> | |
36 | <source>Peg-E</source> | |
37 | <translation>Peg-E</translation> | |
38 | </message> | |
39 | <message> | |
40 | <source>&Game</source> | |
41 | <translation>Ludo</translation> | |
42 | </message> | |
43 | <message> | |
44 | <source>&New</source> | |
45 | <translation>Nova</translation> | |
46 | </message> | |
47 | <message> | |
48 | <source>&Restart Game</source> | |
49 | <translation>Rekomenci la ludon</translation> | |
50 | </message> | |
51 | <message> | |
52 | <source>&Details</source> | |
53 | <translation>Detaloj</translation> | |
54 | </message> | |
55 | <message> | |
56 | <source>Quit</source> | |
57 | <translation>Fini</translation> | |
58 | </message> | |
59 | <message> | |
60 | <source>&Move</source> | |
61 | <translation>Movi</translation> | |
62 | </message> | |
63 | <message> | |
64 | <source>&Undo</source> | |
65 | <translation type="unfinished"></translation> | |
66 | </message> | |
67 | <message> | |
68 | <source>&Redo</source> | |
69 | <translation>Refari</translation> | |
70 | </message> | |
71 | <message> | |
72 | <source>&Appearance</source> | |
73 | <translation>Aspekto</translation> | |
74 | </message> | |
75 | <message> | |
76 | <source>Blue</source> | |
77 | <translation>Blua</translation> | |
78 | </message> | |
79 | <message> | |
80 | <source>Charcoal</source> | |
81 | <translation>Lignokarbo</translation> | |
82 | </message> | |
83 | <message> | |
84 | <source>Green</source> | |
85 | <translation>Verda</translation> | |
86 | </message> | |
87 | <message> | |
88 | <source>Midnight</source> | |
89 | <translation>Mezonokta</translation> | |
90 | </message> | |
91 | <message> | |
92 | <source>Plum</source> | |
93 | <translation>Pruna</translation> | |
94 | </message> | |
95 | <message> | |
96 | <source>Red</source> | |
97 | <translation>Roĝa</translation> | |
98 | </message> | |
99 | <message> | |
100 | <source>Yellow</source> | |
101 | <translation>Flava</translation> | |
102 | </message> | |
103 | <message> | |
104 | <source>Custom...</source> | |
105 | <translation>Kotimo</translation> | |
106 | </message> | |
107 | <message> | |
108 | <source>&Settings</source> | |
109 | <translation>Agordoj</translation> | |
110 | </message> | |
111 | <message> | |
112 | <source>Application &Language...</source> | |
113 | <translation>Lingvo de programo</translation> | |
114 | </message> | |
115 | <message> | |
116 | <source>&Help</source> | |
117 | <translation>Helpo</translation> | |
118 | </message> | |
119 | <message> | |
120 | <source>&About</source> | |
121 | <translation>Pri</translation> | |
122 | </message> | |
123 | <message> | |
124 | <source>About &Qt</source> | |
125 | <translation type="unfinished"></translation> | |
126 | </message> | |
127 | <message> | |
128 | <source>New Game</source> | |
129 | <translation>Nova ludo</translation> | |
130 | </message> | |
131 | <message> | |
132 | <source>Original</source> | |
133 | <translation type="unfinished"></translation> | |
134 | </message> | |
135 | <message> | |
136 | <source>Branch</source> | |
137 | <translation type="unfinished"></translation> | |
138 | </message> | |
139 | <message> | |
140 | <source>Line</source> | |
141 | <translation type="unfinished"></translation> | |
142 | </message> | |
143 | <message> | |
144 | <source>Random</source> | |
145 | <translation>Hazarda</translation> | |
146 | </message> | |
147 | <message> | |
148 | <source>Algorithm:</source> | |
149 | <translation type="unfinished"></translation> | |
150 | </message> | |
151 | <message> | |
152 | <source>Difficulty:</source> | |
153 | <translation type="unfinished"></translation> | |
154 | </message> | |
155 | <message> | |
156 | <source>Seed:</source> | |
157 | <translation type="unfinished"></translation> | |
158 | </message> | |
159 | <message> | |
160 | <source>Question</source> | |
161 | <translation type="unfinished"></translation> | |
162 | </message> | |
163 | <message> | |
164 | <source>Do you want to restart?</source> | |
165 | <translation>Ĉu vi volas rekomenci</translation> | |
166 | </message> | |
167 | <message> | |
168 | <source>Details</source> | |
169 | <translation type="unfinished"></translation> | |
170 | </message> | |
171 | <message> | |
172 | <source><p><b>Algorithm:</b> %1<br><b>Difficulty:</b> %2<br><b>Seed:</b> %L3</p></source> | |
173 | <translation type="unfinished"></translation> | |
174 | </message> | |
175 | <message> | |
176 | <source>About Peg-E</source> | |
177 | <translation type="unfinished"></translation> | |
178 | </message> | |
179 | <message> | |
180 | <source>Peg elimination game</source> | |
181 | <translation type="unfinished"></translation> | |
182 | </message> | |
183 | <message> | |
184 | <source>Copyright &copy; 2009-%1 Graeme Gott</source> | |
185 | <translation type="unfinished"></translation> | |
186 | </message> | |
187 | <message> | |
188 | <source>Released under the <a href=%1>GPL 3</a> license</source> | |
189 | <translation type="unfinished"></translation> | |
190 | </message> | |
191 | <message> | |
192 | <source>Uses icons from the <a href=%1>Oxygen</a> icon theme</source> | |
193 | <translation type="unfinished"></translation> | |
194 | </message> | |
195 | <message> | |
196 | <source>Used under the <a href=%1>LGPL 3</a> license</source> | |
197 | <translation type="unfinished"></translation> | |
198 | </message> | |
199 | </context> | |
200 | </TS> |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | <!DOCTYPE TS> | |
2 | <TS version="2.1" language="sv"> | |
3 | <context> | |
4 | <name>Board</name> | |
5 | <message> | |
6 | <source>Success</source> | |
7 | <translation>Succé</translation> | |
8 | </message> | |
9 | <message> | |
10 | <source>Game Over</source> | |
11 | <translation>Slutspelat</translation> | |
12 | </message> | |
13 | </context> | |
14 | <context> | |
15 | <name>LocaleDialog</name> | |
16 | <message> | |
17 | <source>Select application language:</source> | |
18 | <translation>Välj programspråk:</translation> | |
19 | </message> | |
20 | <message> | |
21 | <source><System Language></source> | |
22 | <translation><Systemspråk></translation> | |
23 | </message> | |
24 | <message> | |
25 | <source>Note</source> | |
26 | <translation>Notis</translation> | |
27 | </message> | |
28 | <message> | |
29 | <source>Please restart this application for the change in language to take effect.</source> | |
30 | <translation>Starta om programmet för att byta språk.</translation> | |
31 | </message> | |
32 | </context> | |
33 | <context> | |
34 | <name>Window</name> | |
35 | <message> | |
36 | <source>Peg-E</source> | |
37 | <translation>Peg-E</translation> | |
38 | </message> | |
39 | <message> | |
40 | <source>&Game</source> | |
41 | <translation>&Spel</translation> | |
42 | </message> | |
43 | <message> | |
44 | <source>&New</source> | |
45 | <translation>&Nytt</translation> | |
46 | </message> | |
47 | <message> | |
48 | <source>&Restart Game</source> | |
49 | <translation>&Starta om spelet</translation> | |
50 | </message> | |
51 | <message> | |
52 | <source>&Details</source> | |
53 | <translation>&Detaljer</translation> | |
54 | </message> | |
55 | <message> | |
56 | <source>Quit</source> | |
57 | <translation>Avsluta</translation> | |
58 | </message> | |
59 | <message> | |
60 | <source>&Move</source> | |
61 | <translation>&Flytta</translation> | |
62 | </message> | |
63 | <message> | |
64 | <source>&Undo</source> | |
65 | <translation>&Ångra</translation> | |
66 | </message> | |
67 | <message> | |
68 | <source>&Redo</source> | |
69 | <translation>&Upprepa</translation> | |
70 | </message> | |
71 | <message> | |
72 | <source>&Appearance</source> | |
73 | <translation>&Utseende</translation> | |
74 | </message> | |
75 | <message> | |
76 | <source>Blue</source> | |
77 | <translation>Blå</translation> | |
78 | </message> | |
79 | <message> | |
80 | <source>Charcoal</source> | |
81 | <translation>Kol</translation> | |
82 | </message> | |
83 | <message> | |
84 | <source>Green</source> | |
85 | <translation>Grön</translation> | |
86 | </message> | |
87 | <message> | |
88 | <source>Midnight</source> | |
89 | <translation>Midnatt</translation> | |
90 | </message> | |
91 | <message> | |
92 | <source>Plum</source> | |
93 | <translation>Plommon</translation> | |
94 | </message> | |
95 | <message> | |
96 | <source>Red</source> | |
97 | <translation>Röd</translation> | |
98 | </message> | |
99 | <message> | |
100 | <source>Yellow</source> | |
101 | <translation>Gul</translation> | |
102 | </message> | |
103 | <message> | |
104 | <source>Custom...</source> | |
105 | <translation>Anpassa...</translation> | |
106 | </message> | |
107 | <message> | |
108 | <source>&Settings</source> | |
109 | <translation>&Inställningar</translation> | |
110 | </message> | |
111 | <message> | |
112 | <source>Application &Language...</source> | |
113 | <translation>Program&språk...</translation> | |
114 | </message> | |
115 | <message> | |
116 | <source>&Help</source> | |
117 | <translation>&Hjälp</translation> | |
118 | </message> | |
119 | <message> | |
120 | <source>&About</source> | |
121 | <translation>&Om</translation> | |
122 | </message> | |
123 | <message> | |
124 | <source>About &Qt</source> | |
125 | <translation>Om &Qt</translation> | |
126 | </message> | |
127 | <message> | |
128 | <source>New Game</source> | |
129 | <translation>Nytt spel</translation> | |
130 | </message> | |
131 | <message> | |
132 | <source>Original</source> | |
133 | <translation>Original</translation> | |
134 | </message> | |
135 | <message> | |
136 | <source>Branch</source> | |
137 | <translation>Gren</translation> | |
138 | </message> | |
139 | <message> | |
140 | <source>Line</source> | |
141 | <translation>Linje</translation> | |
142 | </message> | |
143 | <message> | |
144 | <source>Random</source> | |
145 | <translation>Slumpmässigt</translation> | |
146 | </message> | |
147 | <message> | |
148 | <source>Algorithm:</source> | |
149 | <translation>Algoritm:</translation> | |
150 | </message> | |
151 | <message> | |
152 | <source>Difficulty:</source> | |
153 | <translation>Svårighet:</translation> | |
154 | </message> | |
155 | <message> | |
156 | <source>Seed:</source> | |
157 | <translation>Slumptal:</translation> | |
158 | </message> | |
159 | <message> | |
160 | <source>Question</source> | |
161 | <translation>Fråga</translation> | |
162 | </message> | |
163 | <message> | |
164 | <source>Do you want to restart?</source> | |
165 | <translation>Vill du starta om?</translation> | |
166 | </message> | |
167 | <message> | |
168 | <source>Details</source> | |
169 | <translation>Detaljer</translation> | |
170 | </message> | |
171 | <message> | |
172 | <source><p><b>Algorithm:</b> %1<br><b>Difficulty:</b> %2<br><b>Seed:</b> %L3</p></source> | |
173 | <translation><p><b>Algoritm:</b> %1<br><b>Svårighet:</b> %2<br><b>Slumptal:</b> %L3</p></translation> | |
174 | </message> | |
175 | <message> | |
176 | <source>About Peg-E</source> | |
177 | <translation>Om Peg-E</translation> | |
178 | </message> | |
179 | <message> | |
180 | <source>Peg elimination game</source> | |
181 | <translation>Peggelimineringsspel</translation> | |
182 | </message> | |
183 | <message> | |
184 | <source>Copyright &copy; 2009-%1 Graeme Gott</source> | |
185 | <translation>Copyright &copy; 2009-%1 Graeme Gott</translation> | |
186 | </message> | |
187 | <message> | |
188 | <source>Released under the <a href=%1>GPL 3</a> license</source> | |
189 | <translation>Publicerat under <a href=%1>GPL 3</a>- licensen</translation> | |
190 | </message> | |
191 | <message> | |
192 | <source>Uses icons from the <a href=%1>Oxygen</a> icon theme</source> | |
193 | <translation>Använder ikoner från <a href=%1>Oxygen</a> ikontema</translation> | |
194 | </message> | |
195 | <message> | |
196 | <source>Used under the <a href=%1>LGPL 3</a> license</source> | |
197 | <translation>Använt under <a href=%1>LGPL 3</a> -licensen</translation> | |
198 | </message> | |
199 | </context> | |
200 | </TS> |
0 | <?xml version="1.0" encoding="utf-8"?> | |
1 | <!DOCTYPE TS> | |
2 | <TS version="2.1" language="te"> | |
3 | <context> | |
4 | <name>Board</name> | |
5 | <message> | |
6 | <source>Success</source> | |
7 | <translation>విజయం</translation> | |
8 | </message> | |
9 | <message> | |
10 | <source>Game Over</source> | |
11 | <translation>ఆట సమాప్తం</translation> | |
12 | </message> | |
13 | </context> | |
14 | <context> | |
15 | <name>LocaleDialog</name> | |
16 | <message> | |
17 | <source>Select application language:</source> | |
18 | <translation>అనువర్తన భాషను ఎంచుకోండి:</translation> | |
19 | </message> | |
20 | <message> | |
21 | <source><System Language></source> | |
22 | <translation><System Language></translation> | |
23 | </message> | |
24 | <message> | |
25 | <source>Note</source> | |
26 | <translation>గమనిక</translation> | |
27 | </message> | |
28 | <message> | |
29 | <source>Please restart this application for the change in language to take effect.</source> | |
30 | <translation>భాషలో మార్పు అమలులోకి రావడానికి దయచేసి ఈ అనువర్తనాన్ని పునఃప్రారంభించండి.</translation> | |
31 | </message> | |
32 | </context> | |
33 | <context> | |
34 | <name>Window</name> | |
35 | <message> | |
36 | <source>Peg-E</source> | |
37 | <translation>పెగ్-ఇ</translation> | |
38 | </message> | |
39 | <message> | |
40 | <source>&Game</source> | |
41 | <translation>&ఆట</translation> | |
42 | </message> | |
43 | <message> | |
44 | <source>&New</source> | |
45 | <translation>&కొత్త</translation> | |
46 | </message> | |
47 | <message> | |
48 | <source>&Restart Game</source> | |
49 | <translation>&ఆటను పునఃప్రారంభించు</translation> | |
50 | </message> | |
51 | <message> | |
52 | <source>&Details</source> | |
53 | <translation>&వివరాలు</translation> | |
54 | </message> | |
55 | <message> | |
56 | <source>Quit</source> | |
57 | <translation>నిష్క్రమించు</translation> | |
58 | </message> | |
59 | <message> | |
60 | <source>&Move</source> | |
61 | <translation>&కదులు</translation> | |
62 | </message> | |
63 | <message> | |
64 | <source>&Undo</source> | |
65 | <translation>&అన్ డూ</translation> | |
66 | </message> | |
67 | <message> | |
68 | <source>&Redo</source> | |
69 | <translation>&రీడు</translation> | |
70 | </message> | |
71 | <message> | |
72 | <source>&Appearance</source> | |
73 | <translation>&స్వరూపం</translation> | |
74 | </message> | |
75 | <message> | |
76 | <source>Blue</source> | |
77 | <translation>నీలం</translation> | |
78 | </message> | |
79 | <message> | |
80 | <source>Charcoal</source> | |
81 | <translation>బొగ్గు</translation> | |
82 | </message> | |
83 | <message> | |
84 | <source>Green</source> | |
85 | <translation>ఆకుపచ్చ</translation> | |
86 | </message> | |
87 | <message> | |
88 | <source>Midnight</source> | |
89 | <translation>అర్ధరాత్రి</translation> | |
90 | </message> | |
91 | <message> | |
92 | <source>Plum</source> | |
93 | <translation>ప్లం</translation> | |
94 | </message> | |
95 | <message> | |
96 | <source>Red</source> | |
97 | <translation>ఎరుపు</translation> | |
98 | </message> | |
99 | <message> | |
100 | <source>Yellow</source> | |
101 | <translation>పసుపు</translation> | |
102 | </message> | |
103 | <message> | |
104 | <source>Custom...</source> | |
105 | <translation>కస్టమ్...</translation> | |
106 | </message> | |
107 | <message> | |
108 | <source>&Settings</source> | |
109 | <translation>&సెట్టింగులు</translation> | |
110 | </message> | |
111 | <message> | |
112 | <source>Application &Language...</source> | |
113 | <translation>అనువర్తనం &భాష...</translation> | |
114 | </message> | |
115 | <message> | |
116 | <source>&Help</source> | |
117 | <translation>&సహాయం</translation> | |
118 | </message> | |
119 | <message> | |
120 | <source>&About</source> | |
121 | <translation>&గురించి</translation> | |
122 | </message> | |
123 | <message> | |
124 | <source>About &Qt</source> | |
125 | <translation>&Qt గురించి</translation> | |
126 | </message> | |
127 | <message> | |
128 | <source>New Game</source> | |
129 | <translation>కొత్త ఆట</translation> | |
130 | </message> | |
131 | <message> | |
132 | <source>Original</source> | |
133 | <translation>అసలైనది</translation> | |
134 | </message> | |
135 | <message> | |
136 | <source>Branch</source> | |
137 | <translation>శాఖ</translation> | |
138 | </message> | |
139 | <message> | |
140 | <source>Line</source> | |
141 | <translation>గీత</translation> | |
142 | </message> | |
143 | <message> | |
144 | <source>Random</source> | |
145 | <translation>పద్ధతి లేకుండా</translation> | |
146 | </message> | |
147 | <message> | |
148 | <source>Algorithm:</source> | |
149 | <translation>అల్గోరిథం</translation> | |
150 | </message> | |
151 | <message> | |
152 | <source>Difficulty:</source> | |
153 | <translation>కష్టం</translation> | |
154 | </message> | |
155 | <message> | |
156 | <source>Seed:</source> | |
157 | <translation>విత్తనం:</translation> | |
158 | </message> | |
159 | <message> | |
160 | <source>Question</source> | |
161 | <translation>ప్రశ్న</translation> | |
162 | </message> | |
163 | <message> | |
164 | <source>Do you want to restart?</source> | |
165 | <translation>మీరు పునఃప్రారంభించాలనుకుంటున్నారా?</translation> | |
166 | </message> | |
167 | <message> | |
168 | <source>Details</source> | |
169 | <translation>వివరాలు</translation> | |
170 | </message> | |
171 | <message> | |
172 | <source><p><b>Algorithm:</b> %1<br><b>Difficulty:</b> %2<br><b>Seed:</b> %L3</p></source> | |
173 | <translation><p><b>అల్గోరిథం:</b> %1<br><b>కష్ట్టం:</b> %2<br><b>విత్తనం:</b> %L3</p></translation> | |
174 | </message> | |
175 | <message> | |
176 | <source>About Peg-E</source> | |
177 | <translation>పెగ్-ఇ గురించి</translation> | |
178 | </message> | |
179 | <message> | |
180 | <source>Peg elimination game</source> | |
181 | <translation>పెగ్ తొలగించే ఆట</translation> | |
182 | </message> | |
183 | <message> | |
184 | <source>Copyright &copy; 2009-%1 Graeme Gott</source> | |
185 | <translation>కాపీరైట్ &కాపీ; 2009-%1 గ్రేమ్ గాట్</translation> | |
186 | </message> | |
187 | <message> | |
188 | <source>Released under the <a href=%1>GPL 3</a> license</source> | |
189 | <translation><a href=%1>GPL3</a> లైసెన్స్ కింద విడుదల చేయబడింది</translation> | |
190 | </message> | |
191 | <message> | |
192 | <source>Uses icons from the <a href=%1>Oxygen</a> icon theme</source> | |
193 | <translation><a href=%1>ఆక్స్సిజన్</a> చిహ్నం థీమ్ నుండి చిహ్నాలను ఉపయోగిస్తుంది</translation> | |
194 | </message> | |
195 | <message> | |
196 | <source>Used under the <a href=%1>LGPL 3</a> license</source> | |
197 | <translation><a href=%1>LGPL3</a> లైసెన్స్ కింద ఉపయోగించబడినది</translation> | |
198 | </message> | |
199 | </context> | |
200 | </TS> |
2 | 2 | |
3 | 3 | !define APPNAME "Peg-E" |
4 | 4 | !define VERSIONMAJOR 1 |
5 | !define VERSIONMINOR 2 | |
6 | !define VERSIONPATCH 8 | |
5 | !define VERSIONMINOR 3 | |
6 | !define VERSIONPATCH 0 | |
7 | 7 | !define APPVERSION "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}" |
8 | 8 | !define ABOUTURL "https://gottcode.org/peg-e/" |
9 | 9 |
0 | @ECHO ON>windows\dirs.nsh | |
1 | @ECHO ON>windows\files.nsh | |
0 | @ECHO ON>..\peg-e\windows\dirs.nsh | |
1 | @ECHO ON>..\peg-e\windows\files.nsh | |
2 | 2 | @ECHO OFF |
3 | 3 | |
4 | SET SRCDIR=..\peg-e | |
4 | 5 | SET APP=Peg-E |
5 | SET VERSION=1.2.8 | |
6 | SET VERSION=1.3.0 | |
6 | 7 | |
7 | 8 | ECHO Copying executable |
8 | MKDIR %APP% | |
9 | COPY release\%APP%.exe %APP% >nul | |
9 | MKDIR %SRCDIR%\%APP% | |
10 | COPY %APP%.exe %SRCDIR%\%APP%\%APP%.exe >nul | |
10 | 11 | |
11 | 12 | ECHO Copying translations |
12 | SET TRANSLATIONS=%APP%\translations | |
13 | SET TRANSLATIONS=%SRCDIR%\%APP%\translations | |
13 | 14 | MKDIR %TRANSLATIONS% |
14 | COPY translations\*.qm %TRANSLATIONS% >nul | |
15 | COPY *.qm %TRANSLATIONS% >nul | |
16 | ||
17 | CD %SRCDIR% | |
15 | 18 | |
16 | 19 | ECHO Copying icons |
17 | 20 | SET ICONS=%APP%\icons\hicolor |
19 | 22 | XCOPY /Q /S /Y icons\oxygen\hicolor %ICONS% >nul |
20 | 23 | |
21 | 24 | ECHO Copying Qt |
22 | %QTDIR%\bin\windeployqt.exe --verbose 0 --no-angle --no-opengl-sw --no-svg %APP%\%APP%.exe | |
25 | %QTDIR%\bin\windeployqt.exe --verbose 0 --no-opengl-sw --no-system-d3d-compiler --no-svg %APP%\%APP%.exe | |
23 | 26 | RMDIR /S /Q %APP%\imageformats |
24 | 27 | |
25 | 28 | ECHO Creating ReadMe |