Hello community, here is the log from the commit of package khangman for openSUSE:Factory checked in at 2015-10-03 20:27:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/khangman (Old) and /work/SRC/openSUSE:Factory/.khangman.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "khangman" Changes: -------- --- /work/SRC/openSUSE:Factory/khangman/khangman.changes 2015-07-14 17:41:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.khangman.new/khangman.changes 2015-10-03 20:29:08.000000000 +0200 @@ -1,0 +2,28 @@ +Wed Sep 30 15:45:41 UTC 2015 - wba...@tmo.at + +- Remove conflict with itself + +------------------------------------------------------------------- +Sun Sep 13 19:15:03 UTC 2015 - tittiatc...@gmail.com + +- Update to KDE Applications 15.08.1 + * KDE Applications 15.08.1 + * https://www.kde.org/announcements/announce-applications-15.08.1.php + + +------------------------------------------------------------------- +Wed Aug 19 19:43:17 UTC 2015 - cgiboude...@gmx.com + +- Update to KDE Applications 15.08.0 + * KDE Applications 15.08.0 + * https://www.kde.org/announcements/announce-applications-15.08.0.php + +------------------------------------------------------------------- +Fri Aug 7 07:08:15 UTC 2015 - tittiatc...@gmail.com + +- Update to KDE Applications 15.07.90 + * KDE Applications 15.08.0 RC1 + * https://www.kde.org/announcements/announce-applications-15.07.90.php + + +------------------------------------------------------------------- Old: ---- khangman-15.04.3.tar.xz New: ---- khangman-15.08.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ khangman.spec ++++++ --- /var/tmp/diff_new_pack.8mkuJQ/_old 2015-10-03 20:29:09.000000000 +0200 +++ /var/tmp/diff_new_pack.8mkuJQ/_new 2015-10-03 20:29:09.000000000 +0200 @@ -17,7 +17,7 @@ Name: khangman -Version: 15.04.3 +Version: 15.08.1 Release: 0 Summary: Hangman Game License: GPL-2.0+ @@ -45,7 +45,6 @@ BuildRequires: pkgconfig(Qt5Quick) BuildRequires: pkgconfig(Qt5QuickWidgets) BuildRequires: pkgconfig(Qt5Svg) -Conflicts: khangman Requires: kdeedu-data Obsoletes: %{name}5 < %{version} Provides: %{name}5 = %{version} ++++++ khangman-15.04.3.tar.xz -> khangman-15.08.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/CMakeLists.txt new/khangman-15.08.1/CMakeLists.txt --- old/khangman-15.04.3/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -9,7 +9,7 @@ include(FeatureSummary) find_package(Qt5 REQUIRED COMPONENTS Core Qml Quick QuickWidgets Svg) -find_package(ECM 1.3.0 NO_MODULE REQUIRED) +find_package(ECM 1.7.0 NO_MODULE REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) @@ -17,6 +17,7 @@ include(KDECompilerSettings) include(ECMInstallIcons) include(GenerateExportHeader) +include(ECMAddAppIcon) find_package(KF5 REQUIRED COMPONENTS I18n @@ -46,6 +47,6 @@ add_subdirectory( icons ) -install(FILES khangman.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/) +install(FILES khangman.appdata.xml DESTINATION ${KDE_INSTALL_DATAROOTDIR}/appdata/) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/doc/CMakeLists.txt new/khangman-15.08.1/doc/CMakeLists.txt --- old/khangman-15.04.3/doc/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/doc/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,5 +1,5 @@ ########### install files ############### # -kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR khangman) -kdoctools_create_manpage(man-khangman.6.docbook 6 INSTALL_DESTINATION ${MAN_INSTALL_DIR}) +kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR khangman) +kdoctools_create_manpage(man-khangman.6.docbook 6 INSTALL_DESTINATION ${KDE_INSTALL_MANDIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/fonts/CMakeLists.txt new/khangman-15.08.1/fonts/CMakeLists.txt --- old/khangman-15.04.3/fonts/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/fonts/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,2 +1,2 @@ -install( FILES Dustismo_Roman.ttf Domestic_Manners.ttf DESTINATION ${DATA_INSTALL_DIR}/khangman/fonts ) +install( FILES Dustismo_Roman.ttf Domestic_Manners.ttf DESTINATION ${KDE_INSTALL_DATADIR}/khangman/fonts ) Files old/khangman-15.04.3/icons/128-apps-khangman.png and new/khangman-15.08.1/icons/128-apps-khangman.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/icons/CMakeLists.txt new/khangman-15.08.1/icons/CMakeLists.txt --- old/khangman-15.04.3/icons/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/icons/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -7,6 +7,7 @@ 80-apps-khangman-harmattan.png sc-apps-khangman-harmattan.svgz sc-apps-khangman.svgz - DESTINATION ${ICON_INSTALL_DIR} + 128-apps-khangman.png + DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor ) Files old/khangman-15.04.3/icons/hi128-app-khangman.png and new/khangman-15.08.1/icons/hi128-app-khangman.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/khangman.appdata.xml new/khangman-15.08.1/khangman.appdata.xml --- old/khangman-15.04.3/khangman.appdata.xml 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/khangman.appdata.xml 2015-08-27 04:29:15.000000000 +0200 @@ -15,6 +15,7 @@ <name xml:lang="et">KHangMan</name> <name xml:lang="fi">KHangMan</name> <name xml:lang="fr">KHangMan</name> + <name xml:lang="gl">KHangMan</name> <name xml:lang="hu">KHangMan</name> <name xml:lang="it">KHangMan</name> <name xml:lang="ko">KHangMan</name> @@ -42,6 +43,7 @@ <summary xml:lang="et">Poomismäng</summary> <summary xml:lang="fi">Hirsipuupeli</summary> <summary xml:lang="fr">Jeu de pendu</summary> + <summary xml:lang="gl">O xogo do aforcado.</summary> <summary xml:lang="hu">Akasztófajáték</summary> <summary xml:lang="it">Gioco dell'impiccato</summary> <summary xml:lang="ko">행맨 게임</summary> @@ -60,6 +62,7 @@ <summary xml:lang="zh-TW">劊子手(hangman)遊戲</summary> <description> <p>KHangMan is a game based on the well-known hangman game. It is aimed at children aged six and over. The game has several categories of words to play with, for example: Animals (animals words) and three difficulty categories: Easy, Medium and Hard. A word is picked at random, the letters are hidden, and you must guess the word by trying one letter after another. Each time you guess a wrong letter, part of a picture of a hangman is drawn. You must guess the word before being hanged! You have 10 tries.</p> + <p xml:lang="ast">KHangMan ye un xuegu basáu nel bien conocíu aforcáu. Tien como oxetivu a guaḥes mayores de 6 años. El xuegu tien delles estayes de pallabres coles que xugase, por exemplu: Animales (pallabres d'animales) y 3 estayes de dificultá; fácil, media y difícil. Les pallabres cuéyense al debalu, anúbrense les lletres, y tienes d'aldovinar la pallabra escribiendo una lletra dempués d'otra. Cada vez que suxeras una lletra incorreuta, dibuxaráse una parte de la semeya del home aforcáu. ¡Tienes d'aldovinar la pallabra enantes d'aforcate! Tienes 10 intentos.</p> <p xml:lang="bs">KHangMan je igra bazirana na poznatoj igri vješala. Namijenjena je djeci uzrasta od šest i više godina. Igra ima nekoliko kategorija riječi da se igraju, na primjer: Životinje (riječi životinje ) i tri težine kategorije: lakii, srednje i teško. Riječ je izabrananasumice, slova su skrivenae, i morate pogodite reč pokušavajući jedno slovoo za drugom. Svaki put kada probate pogrešno slovo,nacrta se dio obješenog.. Morate pogoditi riječ pre nego što je obješen! Imate 10 pokušaja.</p> <p xml:lang="ca">El KHangMan és un joc basat en el conegut joc del penjat. Està dirigit a nens de 6 anys o més. El joc disposa de diverses categories de paraules amb les quals jugar, per exemple: Animals (noms d'animals) i tres nivells de dificultat: fàcil, mitjà i difícil. Es tria una paraula aleatòriament, les lletres resten ocultes i s'ha d'endevinar la paraula provant una lletra rere l'altra. Cada vegada que s'escriu una lletra errònia es va dibuixant la imatge del penjat. Haureu d'endevinar-la abans de quedar penjat! Disposareu de 10 intents.</p> <p xml:lang="de">KHangMan ist ein Spiel, das auf dem wohlbekannten Galgenmännchen basiert. Es ist ein Spiel für Kinder ab 6 Jahren mit verschiedenen Wort-Kategorien, zum Beispiel Tiere (Tiernamen) und weitere drei Kategorien mit unterschiedlichen Schwierigkeitsstufen: Leicht, Mittel und Schwer. Ein Wort wird zufällig ausgewählt, die Buchstaben verdeckt und Sie müssen das Wort raten, indem Sie einen Buchstaben nach dem anderen eingeben. Jedesmal, wenn Sie einen falschen Buchstaben eingeben, wird ein weiterer Teil des Galgenmännchens gezeichnet. Sie müssen das gesuchte Wort erraten, ehe das Galgenmännchen fertig gezeichnet ist! Dafür haben Sie 10 Versuche.</p> @@ -68,6 +71,7 @@ <p xml:lang="et">KHangMan tugineb tuntud poomismängule. See on mõeldud enam kui kuueaastastele lastele. Mängul on neli raskusastet (loomad ehk loomanimed, lihtne, keskmine ja raske). Sõna valitakse juhuslikult, tähed on peidetud ning sul tuleb sõna tähti ükshaaval pakkudes ära arvata. Iga kord, kui pakud vale tähe, joonistatakse poomispildile kriipsuke juurde. Nii et parem arva sõna ära, enne kui pooja oma tegevusega lõpule jõuab! Pakkuda saab 10 korda.</p> <p xml:lang="fi">KHangMan perustuu tunnettuun hirsipuupeliin ja on suunnattu kuusivuotiaille sekä sitä vanhemmille lapsille. Pelissä on useita pelattavia sanaryhmiä kuten esimerkiksi eläimet (eläinsanat) sekä kolme vaikeusryhmää: helppo, keskitaso and vaikea. Sana valitaan satunnaisesti, kirjaimet piilotetaan, ja pelaajan täytyy arvata sana yrittämällä yhtä kirjainta toisen jälkeen. Jokaisesta väärin arvatusta kirjaimesta piirretään seuraava osa hirsipuuhun. Sana täytyy arvata ennen kuin tulee hirtetyksi! Pelissä on 10 yritystä.</p> <p xml:lang="fr">KHangMan est un jeu de pendu. Il est conçu pour les enfants de six ans et plus. Le jeu offre plusieurs catégories de mots, par exemple les animaux, et trois niveaux de difficulté : facile, moyen et difficile. Un mot est choisi au hasard, les lettres sont cachées et vous devez deviner le mot en proposant une lettre après l'autre. À chaque fois que vous proposez une mauvaise lettre, une partie du dessin du pendu est affichée. Vous devez deviner le mot avant d'être pendu ! Vous avez 10 essais.</p> + <p xml:lang="gl">KHangMan é un xogo baseado no coñecido xogo do enforcado. Está dirixido a rapaces de seis anos para riba. O xogo ten varias categorías de palabras coas que xogar (por exemplo «Animais», palabras relacionadas con animais) e tres categorías de dificultade: doado, medio e difícil.Escóllese unha palabra ao chou, acóchanse as letras e hai que adiviñar a palabra tentando letra a letra. Cada vez que se propón unha letra errada, debúxase unha parte dunha imaxe dun enforcado. Hai que adiviñar a palabra antes de que che colguen! Tes dez intentos.</p> <p xml:lang="it">KHangMan è basato sul ben noto gioco dell'impiccato. È pensato per i bambini da sei anni in su. Il gioco ha diverse categorie di parole con cui giocare tra cui Animali (parole di animali) e tre livelli di difficoltà: facile, medio e difficile. Una parola è scelta a caso, le lettere sono nascoste, e bisogna indovinare la parola provando una lettera alla volta. Ogni volta che provi una lettera sbagliata, compare parte dell'immagine di un impiccato. Devi indovinare la parola prima di farti impiccare! Hai a disposizione dieci tentativi.</p> <p xml:lang="nds">KHangMan is en Speel, dat op dat begäng Speel „Galgenraden“ opbuut. Dat is för Kinners vun söss Johr af. Dat Speel hett en Reeg Woortkategorien, so as „Deerten“, un de dree Swoorheitstopen „Eenfach“, „Middel“ un „Swoor“. Dat Woort warrt tofällig utsöcht, de Bookstaven sünd toeerst versteken, un Du muttst de an na den annern raden. Raadst Du verkehrt, warrt en mehr Deel vun den Mann an'n Galgen maalt. Du muttst dat Woort raadt hebben, ehr he fardig is! Du hest 10 Versöök.</p> <p xml:lang="nl">KHangMan is een spel dat is gebaseerd op het welbekende galgje. Het richt zich op kinderen van zes jaar en ouder. Het spel kent verschillende categorieën te spelen woorden waaronder: Dieren (dierenwoorden) en drie moeilijkheidsgraden, Eenvoudig, Middel en Moeilijk. Woorden worden willekeurig gekozen en de letters ervan worden verborgen. U raadt het woord door een voor een letters op te geven. Telkens als u een verkeerde letter raadt wordt er een gedeelte van de galg-afbeelding getekend. U moet het woord raden voordat u wordt opgehangen! U hebt 10 pogingen.</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/CMakeLists.txt new/khangman-15.08.1/src/CMakeLists.txt --- old/khangman-15.04.3/src/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -24,25 +24,25 @@ FILES khangman.kcfg DESTINATION - ${KCFG_INSTALL_DIR} + ${KDE_INSTALL_KCFGDIR} ) install( FILES khangman.knsrc DESTINATION - ${CONFIG_INSTALL_DIR} + ${KDE_INSTALL_CONFDIR} ) install( DIRECTORY qml/ - DESTINATION ${DATA_INSTALL_DIR}/khangman/qml) + DESTINATION ${KDE_INSTALL_DATADIR}/khangman/qml) install( FILES org.kde.khangman.desktop - DESTINATION ${XDG_APPS_INSTALL_DIR} + DESTINATION ${KDE_INSTALL_APPDIR} ) install( - TARGETS khangman ${INSTALL_TARGETS_DEFAULT_ARGS} + TARGETS khangman ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/khangman.cpp new/khangman-15.08.1/src/khangman.cpp --- old/khangman-15.04.3/src/khangman.cpp 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/khangman.cpp 2015-08-27 04:29:15.000000000 +0200 @@ -49,7 +49,11 @@ : QMainWindow(), m_currentCategory(0), m_currentLanguage(0), + m_winCount(0), + m_lossCount(0), m_randomInt(0), + m_scoreMultiplyingFactor(1), + m_netScore(0), m_doc(0), m_helpMenu(new KHelpMenu(NULL)) { @@ -265,6 +269,19 @@ return m_currentWord == m_originalWord; } +void KHangMan::revealCurrentWord() +{ + m_currentWord = m_originalWord; + emit currentWordChanged(); +} + +void KHangMan::calculateNetScore() +{ + m_netScore = ( m_winCount - m_lossCount ) * m_scoreMultiplyingFactor; + qDebug() << "Net Score = " << m_netScore; + emit netScoreChanged(); +} + bool KHangMan::containsChar(const QString &sChar) { return m_originalWord.contains(sChar) || stripAccents(m_originalWord).contains(sChar); @@ -297,6 +314,47 @@ return m_languageNames; } +int KHangMan::winCount() const +{ + return m_winCount; +} + +void KHangMan::setWinCount(int count) +{ + m_winCount = count; + calculateNetScore(); + emit winCountChanged(); +} + +int KHangMan::lossCount() const +{ + return m_lossCount; +} + +void KHangMan::setLossCount(int count) +{ + m_lossCount = count; + calculateNetScore(); + emit lossCountChanged(); +} + +int KHangMan::scoreMultiplyingFactor() const +{ + return m_scoreMultiplyingFactor; +} + +void KHangMan::setScoreMultiplyingFactor( int factor ) +{ + m_scoreMultiplyingFactor = factor; + calculateNetScore(); + emit scoreMultiplyingFactorChanged(); +} + +int KHangMan::netScore() const +{ + return m_netScore; +} + int KHangMan::currentLanguage() { return m_currentLanguage; @@ -559,7 +617,6 @@ } } -#include "khangman.moc" // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on; // vim: set et sw=4 ts=4 cino=l1,cs,U1: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/khangman.h new/khangman-15.08.1/src/khangman.h --- old/khangman-15.04.3/src/khangman.h 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/khangman.h 2015-08-27 04:29:15.000000000 +0200 @@ -59,6 +59,13 @@ Q_PROPERTY( QString currentHint READ getCurrentHint NOTIFY currentHintChanged) Q_PROPERTY( QStringList alphabet READ alphabet NOTIFY currentLanguageChanged) + Q_PROPERTY( int winCount READ winCount WRITE setWinCount NOTIFY winCountChanged ) + Q_PROPERTY( int lossCount READ lossCount WRITE setLossCount NOTIFY lossCountChanged ) + + Q_PROPERTY( int scoreMultiplyingFactor READ scoreMultiplyingFactor WRITE setScoreMultiplyingFactor NOTIFY scoreMultiplyingFactorChanged ) + + Q_PROPERTY( int netScore READ netScore NOTIFY netScoreChanged ) + public: /** * Default Constructor @@ -86,6 +93,12 @@ int currentLanguage(); QStringList languages(); + int winCount() const; + int lossCount() const; + + int scoreMultiplyingFactor() const; + int netScore() const; + int currentTheme(); QStringList themes(); QString backgroundUrl(); @@ -96,6 +109,9 @@ // get m_view->engine() QQmlEngine* getEngine(); + /** Calculate the net score */ + void calculateNetScore(); + Q_INVOKABLE QStringList currentWord() const; /** Get the current hint */ @@ -111,6 +127,9 @@ /** Return true if the answer and the current word match */ Q_INVOKABLE bool isResolved() const; + /** Reveals the solution to the current puzzle */ + Q_INVOKABLE void revealCurrentWord(); + public slots: ///When the language is changed in the Language menu void setCurrentLanguage(int index); @@ -130,6 +149,15 @@ /** Generate a new word */ void nextWord(); + /** Sets the count for number of words correctly guessed */ + void setWinCount(int count); + + /** Sets the count for number of words wrongly guessed */ + void setLossCount(int count); + + /** Sets the score multiplying factor */ + void setScoreMultiplyingFactor( int factor ); + /** Handle the guessed letter */ void replaceLetters(const QString& charString); @@ -151,6 +179,10 @@ void categoriesChanged(); void themesChanged(); void currentThemeChanged(); + void winCountChanged(); + void lossCountChanged(); + void scoreMultiplyingFactorChanged(); + void netScoreChanged(); private: KConfigGroup config(const QString &group); @@ -202,6 +234,11 @@ int m_winCount; int m_lossCount; + int m_netScore; + + // Multiplying factor for scores + int m_scoreMultiplyingFactor; + //The index to the random sequence int m_randomInt; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/khangman.knsrc new/khangman-15.08.1/src/khangman.knsrc --- old/khangman-15.04.3/src/khangman.knsrc 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/khangman.knsrc 2015-08-27 04:29:15.000000000 +0200 @@ -1,12 +1,12 @@ [KNewStuff2] ProvidersUrl=http://edu.kde.org/khangman/downloads/providers.xml -TargetDir=kvtml/ +TargetDir=apps/kvtml/ Uncompress=true [KNewStuff3] ProvidersUrl=http://download.kde.org/ocs/providers.xml Categories=KHangMan UploadCategories=KHangMan -TargetDir=kvtml +TargetDir=apps/kvtml Uncompress=never AcceptHtmlDownloads=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/qml/GamePage.qml new/khangman-15.08.1/src/qml/GamePage.qml --- old/khangman-15.04.3/src/qml/GamePage.qml 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/qml/GamePage.qml 2015-08-27 04:29:15.000000000 +0200 @@ -25,6 +25,7 @@ import QtQuick.Window 2.2 import QtMultimedia 5.0 import QtQml 2.2 +import QtGraphicalEffects 1.0 Item { @@ -49,6 +50,7 @@ // Re enable all alphabet buttons for (var i = 0; i < alphabetLetterRepeater.count; ++i) { alphabetLetterRepeater.itemAt(i).enabled = true; + alphabetLetterRepeater.itemAt(i).buttonColor = "black"; } // Reset variables for the new word. @@ -85,10 +87,13 @@ } disableLetterButton(letter); + changeButtonColor(letter); if (khangman.containsChar(letter)) { khangman.replaceLetters(letter); if (khangman.isResolved()) { + // the current puzzle is solved + khangman.winCount++; successImage.visible = true; khangmanResultTimer.start(); @@ -100,6 +105,8 @@ // Only add to missedLetters if it's not already there if (missedLetters.indexOf(letter) == -1) { if (gallowsSeriesCounter++ == 9) { + // wrong solution given for current puzzle + khangman.lossCount++; if (khangman.soundEnabled) { wrongSoundEffect.play(); } @@ -112,6 +119,14 @@ } } + function changeButtonColor(letter) { + for (var i = 0; i < alphabetLetterRepeater.count; ++i) { + if (alphabetLetterRepeater.itemAt(i).letter == letter) { + alphabetLetterRepeater.itemAt(i).buttonColor = khangman.containsChar(letter) ? "green" : "red"; + } + } + } + MainSettingsDialog { id: mainSettingsDialog property bool wasPlaying: false @@ -317,7 +332,7 @@ } } - // display the wrong guesses in a row + // display the remaining number of wrong guesses Row { id: misses spacing: 5 @@ -325,35 +340,106 @@ anchors { top: homePageTools.bottom - horizontalCenter: parent.horizontalCenter topMargin: 5 + right: parent.right + rightMargin: 5 } Label { id: missesLabel - text: i18n("Misses- ") + text: i18n("Remaining guesses: ") font.pixelSize: 40 font.bold: true } - // display the missed alphabets stored in missedLetters variable + Text { + id: remainingGuessesCount + text: i18n(10 - gallowsSeriesCounter) + color: gallowsSeriesCounter >= 7 ? "red" : "black" + font.pixelSize: 40 + font.bold: true + } + } + + Label { + id: scoreLabel + visible: isPlaying + + anchors { + top: misses.top + left: parent.left + leftMargin: 5 + } + + text: i18n("Score: ") + font.pixelSize: 40 + font.bold: true + } + + Label { + id: netScoreLabel + visible: isPlaying + + anchors { + left: scoreLabel.right + top: scoreLabel.top + } + + text: khangman.netScore + color: khangman.netScore < 0 ? "red" : "black" + font.pixelSize: 40 + font.bold: true + } + + Row { + id: winCountRow + spacing: 15 + visible: isPlaying + + anchors { + top: scoreLabel.bottom + left: parent.left + leftMargin: 5 + } + Label { - id: missedLetterText - text: missedLetters + id: winLabel + text: i18n("Wins: ") font.pixelSize: 40 font.bold: true } - // display the remaining blanks - Repeater { - id: blank - model: 10 - missedLetters.length - Label { - id: blankRepeater - text: "_" - font.pixelSize: 40 - font.bold: true - } + Label { + id: winCountLabel + text: khangman.winCount + font.pixelSize: 40 + font.bold: true + } + } + + Row { + id: lossCountRow + spacing: 15 + visible: isPlaying + + anchors { + top: winCountRow.bottom + left: parent.left + leftMargin: 5 + } + + Label { + id: lossLabel + text: i18n("Losses: ") + font.pixelSize: 40 + font.bold: true + } + + Label { + id: lossCountLabel + text: khangman.lossCount + font.pixelSize: 40 + font.bold: true } } @@ -416,29 +502,28 @@ model: alphabet; Button { id: alphabetButton; - property string letter: modelData + property string buttonColor: "black" style: ButtonStyle { id: alphabetLetterIdStyle background: Rectangle { id: alphabetLetterIdStyleRectangle - /*background: "image://theme/meegotouch-button-inverted-background"; - fontFamily: "Arial"; - fontPixelSize: 40; - fontCapitalization: Font.AllUppercase; - fontWeight: Font.Bold; - horizontalAlignment: Text.AlignHCenter; - textColor: "white"; - pressedTextColor: "pink"; - disabledTextColor: "gray"; - checkedTextColor: "blue"; - buttonWidth: 45; - buttonHeight: 60;*/ implicitWidth: gamePage.width / 22 implicitHeight: gamePage.width / 22 - color: alphabetButton.enabled ? "black" : "grey" + color: buttonColor radius: 8 + layer.enabled: true + layer.effect: DropShadow { + radius: 4 + horizontalOffset: 3 + verticalOffset: 3 + spread: 0 + samples: radius * 2 + source: alphabetLetterIdStyleRectangle + color: Qt.rgba(0, 0, 0, 0.5) + transparentBorder: true + } } label: Text { id: buttonLabel @@ -450,10 +535,10 @@ font.weight : Font.Bold horizontalAlignment : Text.AlignHCenter verticalAlignment : Text.AlignVCenter - color: "white" + color: parent.enabled ? "white" : "grey" } } - + onClicked: { guessLetter(modelData); } @@ -530,6 +615,23 @@ } } + ToolButton { + id: revealWordButton + Layout.fillWidth: true + text: i18n("Reveal Word") + tooltip: i18n("Reveal the current word.") + + onClicked: { + khangman.revealCurrentWord(); + khangman.lossCount++; + if (khangman.soundEnabled) { + wrongSoundEffect.play(); + } + + khangmanResultTimer.start(); + } + } + Text { id: timerText visible: khangman.resolveTime == 0 ? false : true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/qml/LetterElement.qml new/khangman-15.08.1/src/qml/LetterElement.qml --- old/khangman-15.04.3/src/qml/LetterElement.qml 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/qml/LetterElement.qml 2015-08-27 04:29:15.000000000 +0200 @@ -32,7 +32,6 @@ id: letterId; text: letterText; color: "black"; - font { pixelSize: letterPixelSize; bold: true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/src/qml/MainSettingsDialog.qml new/khangman-15.08.1/src/qml/MainSettingsDialog.qml --- old/khangman-15.04.3/src/qml/MainSettingsDialog.qml 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/src/qml/MainSettingsDialog.qml 2015-08-27 04:29:15.000000000 +0200 @@ -56,6 +56,13 @@ icon: StandardIcon.Information standardButtons: StandardButton.Ok } + MessageDialog { + id: scoreMultiplyingFactorUserGuideDialog; + title: i18n("KHangMan Score Multiplying Factor") + text: i18n("Determine the factor by which the scores will be multiplied."); + icon: StandardIcon.Information + standardButtons: StandardButton.Ok + } MessageDialog { id: soundsUserGuideDialog; @@ -68,11 +75,13 @@ function saveSettings() { khangman.resolveTime = resolveTimeSlider.value khangman.soundEnabled = soundsSwitch.checked + khangman.scoreMultiplyingFactor = parseInt(scoreMultiplyingFactorTextEdit.text) } function resetSettings () { resolveTimeSlider.value = khangman.resolveTime soundsSwitch.checked = khangman.soundEnabled + scoreMultiplyingFactorTextEdit.text = khangman.scoreMultiplyingFactor } Component.onCompleted: { @@ -146,6 +155,53 @@ } } } + + RowLayout { + id: scoreMultiplyingFactorLayout + width: parent.width + + Label { + id: scoreMultiplyingFactorLabel + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + } + + text: i18n("Score Multiplying Factor") + font.bold: true + color: "white" + } + + Rectangle { + id: scoreMultiplyingFactorInputBox + color: "black" + border.color: "white" + height: scoreMultiplyingFactorLabel.height + width: height * 5 + + TextEdit { + id: scoreMultiplyingFactorTextEdit + horizontalAlignment: TextEdit.AlignJustify + wrapMode: TextEdit.Wrap + text: khangman.scoreMultiplyingFactor.toString() + font.bold: true + color: "white" + focus: true + } + } + ToolButton { + iconSource: "dialog-information.png" + + anchors { + right: parent.right; + verticalCenter: parent.verticalCenter; + } + + onClicked: { + scoreMultiplyingFactorUserGuideDialog.open(); + } + } + } RowLayout { width: parent.width; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/themes/CMakeLists.txt new/khangman-15.08.1/themes/CMakeLists.txt --- old/khangman-15.04.3/themes/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/themes/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -4,5 +4,5 @@ add_subdirectory(winter) add_subdirectory(notes) -install( FILES standardthemes.xml DESTINATION ${DATA_INSTALL_DIR}/khangman/themes) +install( FILES standardthemes.xml DESTINATION ${KDE_INSTALL_DATADIR}/khangman/themes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/themes/bees/CMakeLists.txt new/khangman-15.08.1/themes/bees/CMakeLists.txt --- old/khangman-15.04.3/themes/bees/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/themes/bees/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,4 +1,4 @@ -install( FILES khangman_bees.svg DESTINATION ${DATA_INSTALL_DIR}/khangman/themes ) +install( FILES khangman_bees.svg DESTINATION ${KDE_INSTALL_DATADIR}/khangman/themes ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/themes/desert/CMakeLists.txt new/khangman-15.08.1/themes/desert/CMakeLists.txt --- old/khangman-15.04.3/themes/desert/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/themes/desert/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,4 +1,4 @@ -install( FILES khangman_desert.svg DESTINATION ${DATA_INSTALL_DIR}/khangman/themes ) +install( FILES khangman_desert.svg DESTINATION ${KDE_INSTALL_DATADIR}/khangman/themes ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/themes/notes/CMakeLists.txt new/khangman-15.08.1/themes/notes/CMakeLists.txt --- old/khangman-15.04.3/themes/notes/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/themes/notes/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,4 +1,4 @@ -install( FILES khangman_notes.png DESTINATION ${DATA_INSTALL_DIR}/khangman/themes ) +install( FILES khangman_notes.png DESTINATION ${KDE_INSTALL_DATADIR}/khangman/themes ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/themes/sea/CMakeLists.txt new/khangman-15.08.1/themes/sea/CMakeLists.txt --- old/khangman-15.04.3/themes/sea/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/themes/sea/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,3 +1,3 @@ -install( FILES khangman_sea.svg DESTINATION ${DATA_INSTALL_DIR}/khangman/themes ) +install( FILES khangman_sea.svg DESTINATION ${KDE_INSTALL_DATADIR}/khangman/themes ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khangman-15.04.3/themes/winter/CMakeLists.txt new/khangman-15.08.1/themes/winter/CMakeLists.txt --- old/khangman-15.04.3/themes/winter/CMakeLists.txt 2015-05-31 13:05:31.000000000 +0200 +++ new/khangman-15.08.1/themes/winter/CMakeLists.txt 2015-08-27 04:29:15.000000000 +0200 @@ -1,4 +1,4 @@ -install( FILES khangman_winter.svg DESTINATION ${DATA_INSTALL_DIR}/khangman/themes ) +install( FILES khangman_winter.svg DESTINATION ${KDE_INSTALL_DATADIR}/khangman/themes )