Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/maps/KReportItemMaps.cpp
Show All 10 Lines | |||||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * Lesser General Public License for more details. | 13 | * Lesser General Public License for more details. | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU Lesser General Public | 15 | * You should have received a copy of the GNU Lesser General Public | ||
16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | 17 | */ | ||
18 | #include "KReportItemMaps.h" | 18 | #include "KReportItemMaps.h" | ||
19 | #include "KReportUtils.h" | ||||
20 | #include "KReportRenderObjects.h" | ||||
19 | 21 | | |||
20 | #include <KPropertySet> | 22 | #include <KPropertySet> | ||
21 | 23 | | |||
22 | #include <QStringList> | 24 | #include <QStringList> | ||
23 | 25 | | |||
24 | #include <KReportRenderObjects.h> | | |||
25 | | ||||
26 | #include <sys/socket.h> | 26 | #include <sys/socket.h> | ||
27 | 27 | | |||
28 | #define myDebug() if (0) kDebug(44021) | 28 | #define myDebug() if (0) kDebug(44021) | ||
29 | 29 | | |||
30 | //! @todo replace with ReportItemMaps(const QDomNode &element = QDomNode()) | 30 | //! @todo replace with ReportItemMaps(const QDomNode &element = QDomNode()) | ||
31 | KReportItemMaps::KReportItemMaps() | 31 | KReportItemMaps::KReportItemMaps() | ||
32 | : m_longtitude(0) | 32 | : m_longtitude(0) | ||
33 | , m_latitude(0) | 33 | , m_latitude(0) | ||
34 | , m_zoom(1200) | 34 | , m_zoom(1200) | ||
35 | , m_pageId(0) | 35 | , m_pageId(0) | ||
36 | , m_sectionId(0) | 36 | , m_sectionId(0) | ||
37 | , m_oroPicture(0) | 37 | , m_oroPicture(0) | ||
38 | , m_longDataSetFromScript(false) | 38 | , m_longDataSetFromScript(false) | ||
39 | , m_latDataSetFromScript(false) | 39 | , m_latDataSetFromScript(false) | ||
40 | , m_zoomDataSetFromScript(false) | 40 | , m_zoomDataSetFromScript(false) | ||
41 | { | 41 | { | ||
42 | createProperties(); | 42 | createProperties(); | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | KReportItemMaps::KReportItemMaps(const QDomNode &element) | 45 | KReportItemMaps::KReportItemMaps(const QDomNode &element) | ||
46 | : KReportItemMaps() | 46 | : KReportItemMaps() | ||
47 | { | 47 | { | ||
48 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 48 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
49 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 49 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
50 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 50 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
51 | m_latitudeProperty->setValue(element.toElement().attribute(QLatin1String("report:latitude")).toDouble()); | 51 | m_latitudeProperty->setValue(element.toElement().attribute(QLatin1String("report:latitude")).toDouble()); | ||
52 | m_longitudeProperty->setValue(element.toElement().attribute(QLatin1String("report:longitude")).toDouble()); | 52 | m_longitudeProperty->setValue(element.toElement().attribute(QLatin1String("report:longitude")).toDouble()); | ||
53 | m_zoomProperty->setValue(element.toElement().attribute(QLatin1String("report:zoom")).toInt()); | 53 | m_zoomProperty->setValue(element.toElement().attribute(QLatin1String("report:zoom")).toInt()); | ||
54 | QString themeId(element.toElement().attribute(QLatin1String("report:theme"))); | 54 | QString themeId(element.toElement().attribute(QLatin1String("report:theme"))); | ||
55 | themeId = themeId.isEmpty() ? m_themeManager.mapThemeIds()[0] : themeId; | 55 | themeId = themeId.isEmpty() ? m_themeManager.mapThemeIds()[0] : themeId; | ||
56 | m_themeProperty->setValue(themeId); | 56 | m_themeProperty->setValue(themeId); | ||
57 | 57 | | |||
58 | parseReportRect(element.toElement()); | 58 | parseReportRect(element.toElement()); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | KReportItemMaps::~KReportItemMaps() | 61 | KReportItemMaps::~KReportItemMaps() | ||
62 | { | 62 | { | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | void KReportItemMaps::createProperties() | 65 | void KReportItemMaps::createProperties() | ||
66 | { | 66 | { | ||
67 | m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source")); | 67 | m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source")); | ||
68 | 68 | | |||
69 | m_latitudeProperty = new KProperty("latitude", 0.0, tr("Latitude"), QString(), KProperty::Double); | 69 | m_latitudeProperty = new KProperty("latitude", 0.0, tr("Latitude"), QString(), KProperty::Double); | ||
70 | m_latitudeProperty->setOption("min", -90); | 70 | m_latitudeProperty->setOption("min", -90); | ||
71 | m_latitudeProperty->setOption("max", 90); | 71 | m_latitudeProperty->setOption("max", 90); | ||
72 | m_latitudeProperty->setOption("unit", QString::fromUtf8("°")); | 72 | m_latitudeProperty->setOption("suffix", QString::fromUtf8("°")); | ||
73 | m_latitudeProperty->setOption("precision", 7); | 73 | m_latitudeProperty->setOption("precision", 7); | ||
74 | 74 | | |||
75 | m_longitudeProperty = new KProperty("longitude", 0.0, tr("Longitude"), QString(), KProperty::Double); | 75 | m_longitudeProperty = new KProperty("longitude", 0.0, tr("Longitude"), QString(), KProperty::Double); | ||
76 | m_longitudeProperty->setOption("min", -180); | 76 | m_longitudeProperty->setOption("min", -180); | ||
77 | m_longitudeProperty->setOption("max", 180); | 77 | m_longitudeProperty->setOption("max", 180); | ||
78 | m_longitudeProperty->setOption("unit", QString::fromUtf8("°")); | 78 | m_longitudeProperty->setOption("suffix", QString::fromUtf8("°")); | ||
79 | m_longitudeProperty->setOption("precision", 7); | 79 | m_longitudeProperty->setOption("precision", 7); | ||
80 | 80 | | |||
81 | m_zoomProperty = new KProperty("zoom", 1000, tr("Zoom") ); | 81 | m_zoomProperty = new KProperty("zoom", 1000, tr("Zoom") ); | ||
82 | m_zoomProperty->setOption("min", 0); | 82 | m_zoomProperty->setOption("min", 0); | ||
83 | m_zoomProperty->setOption("max", 4000); | 83 | m_zoomProperty->setOption("max", 4000); | ||
84 | m_zoomProperty->setOption("step", 100); | 84 | m_zoomProperty->setOption("step", 100); | ||
85 | m_zoomProperty->setOption("slider", true); | 85 | m_zoomProperty->setOption("slider", true); | ||
86 | 86 | | |||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |