Summary: | Add a <division> tag in the description file | ||
---|---|---|---|
Product: | [Applications] kgeography | Reporter: | Anne-Marie Mahfouf <annma> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | mvillarino |
Priority: | NOR | ||
Version: | 0.4.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Anne-Marie Mahfouf
2006-12-26 15:13:03 UTC
<division> is already taken so it has to be another tag! SVN commit 617340 by aacid: Please the mistress! Now a map can define how its divisions are called using <divisionsName> tag FEATURE: 139237 M +1 -0 data/spain.kgm M +7 -0 src/kgeography.cpp M +13 -2 src/map.cpp M +5 -2 src/map.h M +8 -0 src/mapparser.cpp --- trunk/KDE/kdeedu/kgeography/data/spain.kgm #617339:617340 @@ -1,6 +1,7 @@ <map> <mapFile>spain.png</mapFile> <name>Spain</name> + <divisionsName>Autonomous communities</divisionsName> <division> <name>Not Spain</name> <ignore>yes</ignore> --- trunk/KDE/kdeedu/kgeography/src/kgeography.cpp #617339:617340 @@ -345,6 +345,13 @@ delete p_map; p_map = m; + p_askMap->setText(i18n("&Location of %1", p_map->getDivisionsString())); + p_askPlaceMap->setText(i18n("&Place %1 in the Map", p_map->getDivisionsString())); + p_askCapitalDivisions->setText(i18n("%1 by Capital", p_map->getDivisionsString())); + p_askDivisionCapitals->setText(i18n("&Capitals of %1", p_map->getDivisionsString())); + p_askFlagDivisions->setText(i18n("%1 by Flag", p_map->getDivisionsString())); + p_askDivisionFlags->setText(i18n("&Flags of %1", p_map->getDivisionsString())); + QString sw = i18nc("There are two ways of dealing with the translation of \"Current map: %1\". The first option simply replaces %1 with the translated name of the relevant region. If the grammar of your language allows this, choose this option by setting the translation of this message to 1, and leave untranslated the translations of \"Current map: %1\" that have the placename embedded (or translate them as - if you wish to show the file as fully translated. The second option is to translate all messages in full - this is likely to be required in the case of highly-inflected languages like Russian. To choose this option, set the translation of this message to 0, and translate all the messages.", "0"); if (sw == "1") { --- trunk/KDE/kdeedu/kgeography/src/map.cpp #617339:617340 @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by Albert Astals Cid * - * tsdgeos@terra.es * + * Copyright (C) 2004-2006 by Albert Astals Cid * + * aacid@kde.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -59,6 +59,11 @@ p_name = s; } +void KGmap::setDivisionsString(const QString &s) +{ + p_divisionsString = s; +} + uint KGmap::count(bool clickDivisionMode) const { uint count = 0; @@ -105,6 +110,12 @@ return p_name; } +QString KGmap::getDivisionsString() const +{ + if (p_divisionsString.isNull()) return i18n("Regions"); + else return p_divisionsString; +} + QString KGmap::getRandomDivision(bool clickDivisionMode) const { QList<division*> aux; --- trunk/KDE/kdeedu/kgeography/src/map.h #617339:617340 @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by Albert Astals Cid * - * tsdgeos@terra.es * + * Copyright (C) 2004-2006 by Albert Astals Cid * + * aacid@kde.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -27,6 +27,7 @@ void setFile(const QString &s); bool setMapFile(const QString &s); void setName(const QString &s); + void setDivisionsString(const QString &s); // return the number of askable divisions uint count(bool clickDivisionMode) const; @@ -37,6 +38,7 @@ QString getFileName() const; QString getMapFile() const; QString getName() const; + QString getDivisionsString() const; QString getRandomDivision(bool clickDivisionMode) const; QString getWhatIs(QRgb c, bool all) const; QColor getColor(const QString &s) const; @@ -49,6 +51,7 @@ QList<division*> p_divisions; QString p_name, p_file, p_mapFile; + QString p_divisionsString; bool p_hasAllFlags; }; --- trunk/KDE/kdeedu/kgeography/src/mapparser.cpp #617339:617340 @@ -47,6 +47,14 @@ p_error = i18n("The map image file for %1 does not exist", kgmap -> getName()); } + // Divisions string + QString divisionsString = getElementString("divisionsName", root, Optional); + if (!divisionsString.isNull()) + { + qDebug("WUUUUUU"); + kgmap -> setDivisionsString( divisionsString ); + } + QDomElement divisionTag = root.firstChildElement("division"); while (!divisionTag.isNull()) { *** Bug 132495 has been marked as a duplicate of this bug. *** |