From 48af5398ed76a655d0fb2715a1dd1dd181c8a907 Mon Sep 17 00:00:00 2001 From: Roman Moravcik Date: Thu, 3 Mar 2011 15:43:43 +0100 Subject: [PATCH] Initial import --- deployment.pri | 111 +++++++++ medard.desktop | 11 + medard.png | Bin 0 -> 10502 bytes medard.pro | 46 ++++ medard.svg | 93 ++++++++ qtc_packaging/debian_fremantle/README | 6 + qtc_packaging/debian_fremantle/changelog | 5 + qtc_packaging/debian_fremantle/compat | 1 + qtc_packaging/debian_fremantle/control | 17 ++ qtc_packaging/debian_fremantle/copyright | 38 +++ qtc_packaging/debian_fremantle/rules | 91 +++++++ src/forecastwidget.cpp | 65 +++++ src/forecastwidget.h | 44 ++++ src/main.cpp | 39 +++ src/mainwindow.cpp | 340 ++++++++++++++++++++++++++ src/mainwindow.h | 87 +++++++ src/medarddownloader.cpp | 380 ++++++++++++++++++++++++++++++ src/medarddownloader.h | 108 +++++++++ translations/medard_cs.qm | 1 + translations/medard_cs.ts | 103 ++++++++ translations/medard_en.qm | Bin 0 -> 1181 bytes translations/medard_en.ts | 103 ++++++++ translations/medard_sk.qm | Bin 0 -> 1183 bytes translations/medard_sk.ts | 103 ++++++++ 24 files changed, 1792 insertions(+) create mode 100644 deployment.pri create mode 100644 medard.desktop create mode 100644 medard.png create mode 100644 medard.pro create mode 100644 medard.svg create mode 100644 qtc_packaging/debian_fremantle/README create mode 100644 qtc_packaging/debian_fremantle/changelog create mode 100644 qtc_packaging/debian_fremantle/compat create mode 100644 qtc_packaging/debian_fremantle/control create mode 100644 qtc_packaging/debian_fremantle/copyright create mode 100755 qtc_packaging/debian_fremantle/rules create mode 100644 src/forecastwidget.cpp create mode 100644 src/forecastwidget.h create mode 100644 src/main.cpp create mode 100644 src/mainwindow.cpp create mode 100644 src/mainwindow.h create mode 100644 src/medarddownloader.cpp create mode 100644 src/medarddownloader.h create mode 100644 translations/medard_cs.qm create mode 100644 translations/medard_cs.ts create mode 100644 translations/medard_en.qm create mode 100644 translations/medard_en.ts create mode 100644 translations/medard_sk.qm create mode 100644 translations/medard_sk.ts diff --git a/deployment.pri b/deployment.pri new file mode 100644 index 0000000..04b1b16 --- /dev/null +++ b/deployment.pri @@ -0,0 +1,111 @@ +# checksum 0x2939 version 0x20001 +# This file was generated by an application wizard of Qt Creator. +# The code below handles deployment to Symbian and Maemo, aswell as copying +# of the application data to shadow build directories on desktop. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. + +defineTest(qtcAddDeployment) { +for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemsources = $${item}.sources + $$itemsources = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath= $$eval($${deploymentfolder}.target) + export($$itemsources) + export($$itempath) + DEPLOYMENT += $$item +} + +MAINPROFILEPWD = $$PWD + +symbian { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, /, \\) + sourcePathSegments = $$split(source, \\) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) + target = $$replace(target, /, \\) + !isEqual(source,$$target) { + !isEmpty(copyCommand):copyCommand += && + copyCommand += $(COPY_DIR) \"$$source\" \"$$target\" + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, \\, /) + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + target = $$replace(target, \\, /) + sourcePathSegments = $$split(source, /) + targetFullPath = $$target/$$last(sourcePathSegments) + !isEqual(source,$$targetFullPath) { + !isEmpty(copyCommand):copyCommand += && + copyCommand += $(MKDIR) \"$$target\" + copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\" + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } + } + for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemfiles = $${item}.files + $$itemfiles = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/medard.desktop b/medard.desktop new file mode 100644 index 0000000..3bb23af --- /dev/null +++ b/medard.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Medard +Exec=/opt/usr/bin/medard +Icon=medard +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/medard.png b/medard.png new file mode 100644 index 0000000000000000000000000000000000000000..b5d40cdc19a62dfbf4173ae3e9eb582aedc1da1d GIT binary patch literal 10502 zcmV+hDf!lkP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipP} z4+8|m;N9K;000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}001BWNklmS8DIdA0EmSk1=$iG6k#(YIS^VRY(MzL za)6d?DlE%(*bg=dTa+SX%Rw^`GzADI0T3jy&59n(^j^JGb*))z?)%-&@x!gIo(5>s zx1u7eZr(iioO8eB|NZ}8im(33KSmmoqqSYiE7LqVyzY?BeuK(|8MM{_wDxLKsbc2K zR?2+?t*;6p=30BTQmT~2bS(g+A=$sNiIYuIT&Q3rTiD4VJJ$~=pT9;FoZdjd$)6gG zmtI9h5eR`l>QOP~F_q0x57Qbzld$4ZI2bF|hwv4j_PB3$t=@7HLS7(o`L<%+ z(&T2RadVpP!Q9ydGBQPS_Yzu$Xf&CyNH)xWbol?z!*QyF!Y=_O;2Q9or*C}=_&V^t zzx0Djz$@=Vc8Ekn6h@3+nmv2c0FfUu_p#NBTB&aW-vz#snJl8!v(vL&`)u(5DpC{| z$FVcVocnl^Vb?=zO}diAbb4qFXpL5y#KjIO+dSLQNCfErAFCGv(2(;>r<*QODvB*b zYlM(rk%sx*Fz~+#TzqnkH|!yVM7tv>)Dco3xqAg61S(PpAwF^w@l_qETSADhJheNG z5aOAQdh+*^*ZBR2MBxO(G7&<2@kI z`Srg?*V`n}ZJcxxtu(E@+Ha3q{r|3e*p#WUETI?BIcPGdcZq@sCzHVMkLVsX>7TT5 zG6|$<&^vC^J83g)^~g;R(OR?h);{gM9$wccJDx_PIlLP%Xmkh$K8ZpC?@^v^^ zH7dC!gf#K}BTB^+HaFKurKXWm(r)k5>($8RCNWJ1A)(hgA-8Z2Cy_!($!O3aTbN*O z^%cUvM+hOkVgJ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x{D0iUD7XYs3^Y_PBIy(vWojHI{_tY?^5j45 z9=5)c&W<5f65(55DSD3}J$MeGCFNiW1Cz(SpOLJTP-6!uLm>`aZc=rP7IMtzS$$)G}$P#Y*=A-WwNzFp_9eIcUCI6_4{ zXcg!d7wMCsPKi<5$4;l|ROeBV`K?s>=pT8#lQkz*qFqUYt+qtJ@QiDON~AKBKe>`$*5C!ra9c0dGTXd zDGTdd3w`AlI2jw$HjqMc|GRBe zI7f2K!xRxI(dBsCqq;t#GUZUV`;4kB`qdT-=Ow0ycwBXP{4lKNChZ43QTTq6!S5Ko z&fnj^)BHUnBQ}y_BNB{AMO`*;_X&n=ti%Lb8EB=bt?%>y02zlo$Z@eGNdN!<07*qo IM6N<$f)+C6X8-^I literal 0 HcmV?d00001 diff --git a/medard.pro b/medard.pro new file mode 100644 index 0000000..b69ddad --- /dev/null +++ b/medard.pro @@ -0,0 +1,46 @@ +# Add files and directories to ship with the application +# by adapting the examples below. +# file1.source = myfile +# dir1.source = mydir +translations.source = \ + translations/medard_cs.qm \ + translations/medard_en.qm \ + translations/medard_sk.qm + +DEPLOYMENTFOLDERS = translations + +QT += network + +# Avoid auto screen rotation +DEFINES += ORIENTATIONLOCK + +# Needs to be defined for Symbian +DEFINES += NETWORKACCESS + +symbian:TARGET.UID3 = 0xE49E7B8A + +# If your application uses the Qt Mobility libraries, uncomment +# the following lines and add the respective components to the +# MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +SOURCES += \ + src/forecastwidget.cpp \ + src/medarddownloader.cpp \ + src/mainwindow.cpp \ + src/main.cpp +HEADERS += \ + src/forecastwidget.h \ + src/medarddownloader.h \ + src/mainwindow.h +FORMS += + +TRANSLATIONS += \ + translations/medard_cs.qm \ + translations/medard_en.ts \ + translations/medard_sk.ts + +# Please do not modify the following two lines. Required for deployment. +include(deployment.pri) +qtcAddDeployment() diff --git a/medard.svg b/medard.svg new file mode 100644 index 0000000..566acfa --- /dev/null +++ b/medard.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/qtc_packaging/debian_fremantle/README b/qtc_packaging/debian_fremantle/README new file mode 100644 index 0000000..afe3c6b --- /dev/null +++ b/qtc_packaging/debian_fremantle/README @@ -0,0 +1,6 @@ +The Debian Package medard +---------------------------- + +Comments regarding the Package + + -- Roman Moravcik Ut, 22 feb 2011 15:15:13 +0100 diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog new file mode 100644 index 0000000..5c79056 --- /dev/null +++ b/qtc_packaging/debian_fremantle/changelog @@ -0,0 +1,5 @@ +medard (0.1.1) unstable; urgency=low + + * Initial Release. + + -- Roman Moravcik Ut, 22 feb 2011 15:15:13 +0100 diff --git a/qtc_packaging/debian_fremantle/compat b/qtc_packaging/debian_fremantle/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/qtc_packaging/debian_fremantle/compat @@ -0,0 +1 @@ +7 diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control new file mode 100644 index 0000000..5e0e4db --- /dev/null +++ b/qtc_packaging/debian_fremantle/control @@ -0,0 +1,17 @@ +Source: medard +Section: user/hidden +Priority: optional +Maintainer: Roman Moravcik +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.3 + +Package: medard +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Weather forecasts from MEDARD project + Simple application to show weather forecast for Middle Europe and + the Czech Republic. The weather forecast is based on the numeric + weather prediction model MM5 of PSU/NCAR. + . + http://www.medard-online.cz/index.php +XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAF0NJREFUaIGVmmmMZNd133/3vqVeLV1d1dVdve8z3bMPh5wRKXJoUpQtOSIcyYg/JDYCJJDywRJsJDCQxIIFxJYjwzGCBHASwZSSDwGkxIGTWFDk0Foo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fv4Tx1nfiJe8SSOZQwkKZE2hKBwAwZ2FGbmGiRpEKUOmH69LRNJKS482qF5y91iE7EKFRNvPAwDRIYliSSatGtjXzDGc3+2r869YW//iDWn/u1CsDnfvzHU4mp1IsIfXXnjZsvnnjudEoqQfPgLabSFZYX+0RoUNrrUj/sM/TERQIEe40kQkIoZiMQ5O+PMX0qz7jIwO4G1UOPM5eHyHz7IWN2navPSd7JptnOmuX04+m9vLH85V5Hfesz0f/6cz+3+T/98KG5e2OWsgAAAABJRU5ErkJggg== diff --git a/qtc_packaging/debian_fremantle/copyright b/qtc_packaging/debian_fremantle/copyright new file mode 100644 index 0000000..fa8674e --- /dev/null +++ b/qtc_packaging/debian_fremantle/copyright @@ -0,0 +1,38 @@ +This package was debianized by Roman Moravcik on +Ut, 22 feb 2011 15:15:13 +0100. + +It was downloaded from + +Upstream Author(s): + + Roman Moravcik + +Copyright: + + + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2011, Roman Moravcik and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/qtc_packaging/debian_fremantle/rules b/qtc_packaging/debian_fremantle/rules new file mode 100755 index 0000000..d694ffc --- /dev/null +++ b/qtc_packaging/debian_fremantle/rules @@ -0,0 +1,91 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/medard.sgml > medard.1 + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/medard. + $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/medard install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_python +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + # dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs + dh_installdeb + # dh_shlibdeps # Uncomment this line for publishing! + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/src/forecastwidget.cpp b/src/forecastwidget.cpp new file mode 100644 index 0000000..82ae3cb --- /dev/null +++ b/src/forecastwidget.cpp @@ -0,0 +1,65 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "forecastwidget.h" + +ForecastWidget::ForecastWidget(QWidget *parent) : QWidget(parent) +{ + m_filename.clear(); + m_error = false; +} + +void ForecastWidget::setImage(const QString &filename) +{ + m_filename = filename; + m_error = false; + update(); +} + +void ForecastWidget::clearImage(bool error) +{ + m_filename.clear(); + m_error = error; + update(); +} + +void ForecastWidget::paintEvent(QPaintEvent * /* event */) +{ + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + + QRect widgetArea(rect().x(), rect().y(), rect().width(), 408); + + painter.setPen(QColor(0, 0, 0)); + painter.setBrush(QColor(255, 255, 255)); + painter.drawRect(widgetArea); + + if (m_error) { + painter.drawText(widgetArea, Qt::AlignCenter, tr("Download failed!")); + } else { + if (!m_filename.isEmpty()) { + QImage image(m_filename); + painter.drawImage(widgetArea, image); + } else { + painter.drawText(widgetArea, Qt::AlignCenter, tr("Downloading image...")); + } + } +} diff --git a/src/forecastwidget.h b/src/forecastwidget.h new file mode 100644 index 0000000..e498582 --- /dev/null +++ b/src/forecastwidget.h @@ -0,0 +1,44 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef FORECASTWIDGET_H +#define FORECASTWIDGET_H + +#include +#include + +class ForecastWidget : public QWidget +{ + Q_OBJECT + +public: + ForecastWidget(QWidget *parent = 0); + + void setImage(const QString &filename); + void clearImage(bool error); + +protected: + void paintEvent(QPaintEvent *event); + +private: + QString m_filename; + bool m_error; +}; + +#endif // FORECASTWIDGET_H diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..8ae1d03 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,39 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QString translatorFileName = "medard_" + QLocale::system().name(); + QTranslator translator; + if (translator.load(translatorFileName, "/opt/usr/share/medard/")) + app.installTranslator(&translator); + + MainWindow window; + window.showMaximized(); + + return app.exec(); +} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp new file mode 100644 index 0000000..d76a17c --- /dev/null +++ b/src/mainwindow.cpp @@ -0,0 +1,340 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include + +#include "mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ + m_downloader = new MedardDownloader(); + + connect(m_downloader, SIGNAL(downloadFinished(const QString &, const QDateTime &)), this, + SLOT(downloadedFinished(const QString &, const QDateTime &))); + connect(m_downloader, SIGNAL(downloadFailed()), this, SLOT(downloadFailed())); + + m_forecast = new ForecastWidget(); + m_forecast->setFixedSize(m_downloader->getImageSize()); + + m_forecastTypeLabel = new QLabel(); + m_forecastTypeLabel->setAlignment(Qt::AlignCenter); + m_forecastTypeLabel->setFixedSize(220, 80); + + m_forecastInitialDateLabel = new QLabel(); + m_forecastInitialDateLabel->setAlignment(Qt::AlignCenter); + m_forecastInitialDateLabel->setDisabled(true); + + m_forecastDateLabel = new QLabel(); + m_forecastDateLabel->setAlignment(Qt::AlignCenter); + + m_downloadRetryButton = new QPushButton(tr("Download again")); + + connect(m_downloadRetryButton, SIGNAL(clicked()), this, SLOT(downloadAgainClicked())); + + m_minusDayButton = new QPushButton(tr("-1 d")); + m_plusDayButton = new QPushButton(tr("+1 d")); + m_minusHourButton = new QPushButton(tr("-1 h")); + m_plusHourButton = new QPushButton(tr("+1 h")); + + connect(m_minusDayButton, SIGNAL(clicked()), this, SLOT(minusDayClicked())); + connect(m_plusDayButton, SIGNAL(clicked()), this, SLOT(plusDayClicked())); + connect(m_minusHourButton, SIGNAL(clicked()), this, SLOT(minusHourClicked())); + connect(m_plusHourButton, SIGNAL(clicked()), this, SLOT(plusHourClicked())); + + setupUi(); + setupMenu(); + + loadSettings(); +} + +MainWindow::~MainWindow() +{ + delete m_downloader; +} + +void MainWindow::setupUi() +{ +#ifdef Q_WS_MAEMO_5 + setAttribute(Qt::WA_Maemo5LandscapeOrientation, true); +#endif + setWindowTitle(tr("Medard")); + + QWidget *widget = new QWidget; + setCentralWidget(widget); + + QHBoxLayout *mainLayout = new QHBoxLayout(); + mainLayout->setMargin(8); + mainLayout->setSpacing(4); + widget->setLayout(mainLayout); + + mainLayout->addWidget(m_forecast); + mainLayout->addSpacing(4); + + QVBoxLayout *layout = new QVBoxLayout(); + mainLayout->addLayout(layout); + + layout->addWidget(m_forecastTypeLabel); + layout->addWidget(m_forecastDateLabel); + layout->addSpacing(20); + layout->addWidget(m_forecastInitialDateLabel); + layout->addSpacing(20); + layout->addWidget(m_downloadRetryButton); + + QHBoxLayout *dayNavigationBox = new QHBoxLayout(); + dayNavigationBox->addWidget(m_minusDayButton); + dayNavigationBox->addWidget(m_plusDayButton); + layout->addLayout(dayNavigationBox); + + QHBoxLayout *hourNavigationBox = new QHBoxLayout(); + hourNavigationBox->addWidget(m_minusHourButton); + hourNavigationBox->addWidget(m_plusHourButton); + layout->addLayout(hourNavigationBox); + + hideNavigationButtons(false); +} + +void MainWindow::setupMenu() +{ + QMenuBar *menu = new QMenuBar(); + setMenuBar(menu); + + m_domainActionGroup = new QActionGroup(this); + m_domainActionGroup->setExclusive(true); + + QAction *domainAction; + domainAction = new QAction(tr("Europe"), m_domainActionGroup); + domainAction->setCheckable(true); + domainAction = new QAction(tr("Czech Republic"), m_domainActionGroup); + domainAction ->setCheckable(true); + menu->addActions(m_domainActionGroup->actions()); + connect(m_domainActionGroup, SIGNAL(triggered(QAction *)), this, SLOT(forecastDomainChanged(QAction *))); + + QAction *seaLevelPreasureAction = new QAction(tr("Sea Level Pressure"), this); + menu->addAction(seaLevelPreasureAction); + connect(seaLevelPreasureAction, SIGNAL(triggered()), this, SLOT(seaLevelPreasureMenuClicked())); + + QAction *precipitationAction = new QAction(tr("Precipitation"), this); + menu->addAction(precipitationAction); + connect(precipitationAction, SIGNAL(triggered()), this, SLOT(precipitationMenuClicked())); + + QAction *windVelocityAction = new QAction(tr("Wind Velocity"), this); + menu->addAction(windVelocityAction); + connect(windVelocityAction, SIGNAL(triggered()), this, SLOT(windVelocityMenuClicked())); + + QAction *cloudinessAction = new QAction(tr("Cloudiness"), this); + menu->addAction(cloudinessAction); + connect(cloudinessAction, SIGNAL(triggered()), this, SLOT(cloudinessMenuClicked())); + + QAction *temperatureAction = new QAction(tr("Temperature"), this); + menu->addAction(temperatureAction); + connect(temperatureAction, SIGNAL(triggered()), this, SLOT(temperatureMenuClicked())); +} + +void MainWindow::loadSettings() +{ + QSettings settings; + + int forecastDomain = settings.value("ForecastDomain").toInt(); + int forecastType = settings.value("ForecastType").toInt(); + + m_downloader->setForecastDomain((MedardDownloader::ForecastDomain) forecastDomain); + m_domainActionGroup->actions().at(forecastDomain)->setChecked(true); + + switch ((MedardDownloader::ForecastType) forecastType) { + case MedardDownloader::SeaLevelPressure: + seaLevelPreasureMenuClicked(); + break; + + case MedardDownloader::Precipitation: + precipitationMenuClicked(); + break; + + case MedardDownloader::WindVelocity: + windVelocityMenuClicked(); + break; + + case MedardDownloader::Cloudiness: + cloudinessMenuClicked(); + break; + + case MedardDownloader::Temperature: + temperatureMenuClicked(); + break; + } +} + +void MainWindow::showNavigationButtons() +{ + m_downloadRetryButton->hide(); + + m_minusDayButton->show(); + m_plusDayButton->show(); + m_minusHourButton->show(); + m_plusHourButton->show(); +} + +void MainWindow::hideNavigationButtons(bool showRetryButton) +{ + if (showRetryButton) + m_downloadRetryButton->show(); + else + m_downloadRetryButton->hide(); + + m_minusDayButton->hide(); + m_plusDayButton->hide(); + m_minusHourButton->hide(); + m_plusHourButton->hide(); +} + +void MainWindow::updateNavigationButtons() +{ + if ((m_downloader->getForecastDateOffset() - 24) < m_downloader->getMinForecastDateOffset()) { + m_minusDayButton->setDisabled(true); + m_plusDayButton->setDisabled(false); + } else if ((m_downloader->getForecastDateOffset() + 24) > m_downloader->getMaxForecastDateOffset()) { + m_minusDayButton->setDisabled(false); + m_plusDayButton->setDisabled(true); + } else { + m_minusDayButton->setDisabled(false); + m_plusDayButton->setDisabled(false); + } + + if ((m_downloader->getForecastDateOffset() - 1) < m_downloader->getMinForecastDateOffset()) { + m_minusHourButton->setDisabled(true); + m_plusHourButton->setDisabled(false); + } else if ((m_downloader->getForecastDateOffset() + 1) > m_downloader->getMaxForecastDateOffset()) { + m_minusHourButton->setDisabled(false); + m_plusHourButton->setDisabled(true); + } else { + m_minusHourButton->setDisabled(false); + m_plusHourButton->setDisabled(false); + } +} + +void MainWindow::seaLevelPreasureMenuClicked() +{ + forecastTypeChanged(tr("Sea Level Pressure"), MedardDownloader::SeaLevelPressure); +} + +void MainWindow::precipitationMenuClicked() +{ + forecastTypeChanged(tr("Precipitation"), MedardDownloader::Precipitation); +} + +void MainWindow::windVelocityMenuClicked() +{ + forecastTypeChanged(tr("Wind Velocity"), MedardDownloader::WindVelocity); +} + +void MainWindow::cloudinessMenuClicked() +{ + forecastTypeChanged(tr("Cloudiness"), MedardDownloader::Cloudiness); +} + +void MainWindow::temperatureMenuClicked() +{ + forecastTypeChanged(tr("Temperature"), MedardDownloader::Temperature); +} + +void MainWindow::downloadAgainClicked() +{ + m_forecast->clearImage(false); + m_downloader->downloadImage(); + + hideNavigationButtons(false); +} + +void MainWindow::plusDayClicked() +{ + forecastDateOffsetChanged(+24); +} + +void MainWindow::minusDayClicked() +{ + forecastDateOffsetChanged(-24); +} + +void MainWindow::plusHourClicked() +{ + forecastDateOffsetChanged(+1); +} + +void MainWindow::minusHourClicked() +{ + forecastDateOffsetChanged(-1); +} + +void MainWindow::forecastTypeChanged(const QString label, MedardDownloader::ForecastType type) +{ + m_forecastTypeLabel->setText(label); + m_forecast->clearImage(false); + m_downloader->setForecastType(type); + m_downloader->downloadImage(); + + QSettings settings; + settings.setValue("ForecastType", type); +} + +void MainWindow::forecastDateOffsetChanged(int offset) +{ + m_forecast->clearImage(false); + m_downloader->setForecastDateOffset(m_downloader->getForecastDateOffset() + offset); + m_downloader->downloadImage(); +} + +void MainWindow::forecastDomainChanged(QAction *action) +{ + int forecastDomain = m_domainActionGroup->actions().indexOf(action); + + m_forecast->clearImage(false); + + if (forecastDomain == 0) + m_downloader->setForecastDomain(MedardDownloader::Europe); + else + m_downloader->setForecastDomain(MedardDownloader::CzechRepublic); + + m_downloader->downloadImage(); + + QSettings settings; + settings.setValue("ForecastDomain", forecastDomain); +} + +void MainWindow::downloadedFinished(const QString &filename, const QDateTime &date) +{ + m_forecast->setImage(filename); + m_forecastInitialDateLabel->setText(tr("Forecast from:\n") + + m_downloader->getForecastInitialDate().toString("dd.MM.yyyy hh:mm")); + + /* upcase the first letter of name of day */ + QString temp = date.toString("dddd\ndd.MM.yyyy hh:mm"); + m_forecastDateLabel->setText(temp.replace(0, 1, temp.at(0).toUpper())); + + showNavigationButtons(); + updateNavigationButtons(); +} + +void MainWindow::downloadFailed() +{ + m_forecast->clearImage(true); + m_forecastInitialDateLabel->setText(""); + m_forecastDateLabel->setText(""); + + hideNavigationButtons(true); +} diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000..a281e5b --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,87 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include + +#include "forecastwidget.h" +#include "medarddownloader.h" + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = 0); + virtual ~MainWindow(); + +private slots: + void seaLevelPreasureMenuClicked(); + void precipitationMenuClicked(); + void windVelocityMenuClicked(); + void cloudinessMenuClicked(); + void temperatureMenuClicked(); + + void downloadAgainClicked(); + + void plusDayClicked(); + void minusDayClicked(); + void plusHourClicked(); + void minusHourClicked(); + + void forecastTypeChanged(const QString label, MedardDownloader::ForecastType type); + void forecastDateOffsetChanged(int offset); + void forecastDomainChanged(QAction *action); + + void downloadedFinished(const QString &filename, const QDateTime &date); + void downloadFailed(); + +private: + void setupUi(); + void setupMenu(); + void loadSettings(); + + void showNavigationButtons(); + void hideNavigationButtons(bool showRetryButton); + void updateNavigationButtons(); + +private: + MedardDownloader *m_downloader; + + ForecastWidget *m_forecast; + QLabel *m_forecastTypeLabel; + QLabel *m_forecastInitialDateLabel; + QLabel *m_forecastDateLabel; + + QPushButton *m_downloadRetryButton; + + QPushButton *m_minusDayButton; + QPushButton *m_plusDayButton; + QPushButton *m_minusHourButton; + QPushButton *m_plusHourButton; + + QActionGroup *m_domainActionGroup; +}; + +#endif // MAINWINDOW_H diff --git a/src/medarddownloader.cpp b/src/medarddownloader.cpp new file mode 100644 index 0000000..a4a1b1e --- /dev/null +++ b/src/medarddownloader.cpp @@ -0,0 +1,380 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include + +#include "medarddownloader.h" + +#define DOWNLOAD_CACHE_DIR ".cache/medard-downloader" + +#define MEDARD_URL "http://www.medard-online.cz" +#define MEDARD_IMAGE_URL "http://www.medard-online.cz/scripts/getimage.php?initDate=%1&domain=%2&variable=%3&offset=%4" + +#define FC_SEA_LEVEL_PRESSURE "slp" +#define FC_PRECIPITATION "precip" +#define FC_WIND_VELOCITY "wv" +#define FC_CLOUDINESS "cloud" +#define FC_TEMPERATURE "temp" + +#define FD_EUROPE "1" +#define FD_CZECH_REPUBLIC "2" + +#define MIN_OFFSET 0 +#define MAX_OFFSET 72 + +#define IMAGE_WIDTH 556 +#define IMAGE_HEIGHT 408 + +#define MAX_DOWNLOAD_RETRIES 3 + +MedardDownloader::MedardDownloader() : QObject() +{ + m_forecastType = FC_SEA_LEVEL_PRESSURE; + m_forecastDomain = FD_EUROPE; + m_forecastInitialDateCode.clear(); + m_forecastDateOffset = 0; + + m_network = new QNetworkAccessManager(); + m_reply = 0; + + m_retryCounter = 0; + m_retryTimer = new QTimer(); + m_retryTimer->setInterval(5000); + connect(m_retryTimer, SIGNAL(timeout()), this, SLOT(retryTimerEvent())); + + m_cachePath = QString("%1/%2") + .arg(QDir().homePath()) + .arg(DOWNLOAD_CACHE_DIR); + + createCacheDirectory(); +} + +MedardDownloader::~MedardDownloader() +{ + if (m_retryTimer->isActive()) + m_retryTimer->stop(); + + if (m_reply) { + m_reply->abort(); + delete m_reply; + } +} + +QSize MedardDownloader::getImageSize() +{ + return QSize(IMAGE_WIDTH, IMAGE_HEIGHT); +} + +void MedardDownloader::setForecastType(ForecastType type) +{ + switch (type) { + case SeaLevelPressure: + m_forecastType = FC_SEA_LEVEL_PRESSURE; + break; + + case Precipitation: + m_forecastType = FC_PRECIPITATION; + break; + + case WindVelocity: + m_forecastType = FC_WIND_VELOCITY; + break; + + case Cloudiness: + m_forecastType = FC_CLOUDINESS; + break; + + case Temperature: + m_forecastType = FC_TEMPERATURE; + break; + } +} + +void MedardDownloader::setForecastDomain(ForecastDomain domain) +{ + switch (domain) { + case Europe: + m_forecastDomain = FD_EUROPE; + break; + + case CzechRepublic: + m_forecastDomain = FD_CZECH_REPUBLIC; + break; + } +} + +void MedardDownloader::setForecastInitialDate(QDateTime date) +{ + QString offset; + + m_forecastInitialDate = date.toUTC(); + + if (date.toUTC().time().hour() >= 18) { + m_forecastInitialDate.setTime(QTime(18, 0, 0)); + offset = "12"; + } else if (date.toUTC().time().hour() >= 12) { + m_forecastInitialDate.setTime(QTime(12, 0, 0)); + offset = "06"; + } else if (date.toUTC().time().hour() >= 6) { + m_forecastInitialDate.setTime(QTime(6, 0, 0)); + offset = "00"; + } else { + m_forecastInitialDate.setTime(QTime(0, 0, 0)); + offset = "18"; + } + + if (offset == "18") { + /* use previous day */ + m_forecastInitialDateCode = QString("%1_%2") + .arg(date.addDays(-1).toUTC().toString("yyMMdd")) + .arg(offset); + } else { + /* use current day */ + m_forecastInitialDateCode = QString("%1_%2") + .arg(date.toUTC().toString("yyMMdd")) + .arg(offset); + } + + cleanCacheDirectory(); +} + +QDateTime MedardDownloader::getForecastInitialDate() +{ + return m_forecastInitialDate.toLocalTime(); +} + +QDateTime MedardDownloader::getForecastDate() +{ + return m_forecastInitialDate.addSecs(3600 * m_forecastDateOffset).toLocalTime(); +} + +void MedardDownloader::setForecastDateOffset(int offset) +{ + m_forecastDateOffset = offset; + if (m_forecastDateOffset > MAX_OFFSET) + m_forecastDateOffset = MAX_OFFSET; + + if (m_forecastDateOffset < MIN_OFFSET) + m_forecastDateOffset = MIN_OFFSET; +} + +void MedardDownloader::retryTimerEvent() +{ + if (m_retryTimer->isActive()) + m_retryTimer->stop(); + + downloadImage(); +} + +void MedardDownloader::tryDownloadImageAgain() +{ + m_retryCounter++; + + if (m_retryCounter < MAX_DOWNLOAD_RETRIES) { + m_retryTimer->start(); + } else { + m_retryCounter = 0; + emit downloadFailed(); + } +} + +void MedardDownloader::clearDownloadRequest() +{ + qDebug() << "clearDownloadRequest: m_reply=" << m_reply; + + delete m_reply; + m_reply = 0; +} + +void MedardDownloader::downloadImageFinished() +{ + qDebug() << "downloadImageFinished: m_reply=" << m_reply; + + QByteArray picture = m_reply->readAll(); + + if (picture.isNull() || picture.size() <= 0) + return; + + m_retryCounter = 0; + + QImage image; + if (!image.loadFromData(picture, "png")) + return; + + QString filename = QString("%1/%2_%3_%4_%5.png") + .arg(m_cachePath) + .arg(m_forecastType) + .arg(m_forecastDomain) + .arg(m_forecastInitialDateCode) + .arg(QString().number(m_forecastDateOffset)); + + if ((image.width() == 512) && (image.height() == 512)) { + QImage croped(512, 400, QImage::Format_ARGB32_Premultiplied); + croped = image.copy(0, 52, 512, IMAGE_HEIGHT); + croped.save(filename, "png"); + } else { + QImage croped(560, 400, QImage::Format_ARGB32_Premultiplied); + croped = image.copy(10, 96, IMAGE_WIDTH, IMAGE_HEIGHT); + croped.save(filename, "png"); + } + + qDebug() << "downloadImageFinished: downloadFinished=" << filename; + emit downloadFinished(filename, getForecastDate()); + + QTimer::singleShot(0, this, SLOT(clearDownloadRequest())); +} + +void MedardDownloader::downloadImageError(QNetworkReply::NetworkError /* code */) +{ + tryDownloadImageAgain(); + QTimer::singleShot(0, this, SLOT(clearDownloadRequest())); +} + +void MedardDownloader::downloadImage() +{ + qDebug() << "downloadImage: retry=" << m_retryCounter << "date:" << m_forecastInitialDate.toString("dd.MM.yyyy hh:mm"); + + if (m_forecastInitialDateCode.isNull()) { + retrieveForecastInitialDate(); + tryDownloadImageAgain(); + return; + } + + QString filename = QString("%1/%2_%3_%4_%5.png") + .arg(m_cachePath) + .arg(m_forecastType) + .arg(m_forecastDomain) + .arg(m_forecastInitialDateCode) + .arg(QString().number(m_forecastDateOffset)); + + if (isDownloaded(filename)) { + qDebug() << "downloadImage: downloadFinished=" << filename; + + emit downloadFinished(filename, getForecastDate()); + return; + } + + QString imageUrl = QString(MEDARD_IMAGE_URL) + .arg(m_forecastInitialDateCode) + .arg(m_forecastDomain) + .arg(m_forecastType) + .arg(QString().number(m_forecastDateOffset)); + + QUrl url(imageUrl); + QNetworkRequest request(url); + + if (m_reply) + clearDownloadRequest(); + m_reply = m_network->get(request); + + connect(m_reply, SIGNAL(finished()), this, SLOT(downloadImageFinished())); + connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, + SLOT(downloadImageError(QNetworkReply::NetworkError))); +} + +bool MedardDownloader::isDownloaded(const QString filename) +{ + return QFile(filename).exists(); +} + +int MedardDownloader::getForecastDateOffset() +{ + return m_forecastDateOffset; +} + +int MedardDownloader::getMinForecastDateOffset() +{ + return MIN_OFFSET; +} + +int MedardDownloader::getMaxForecastDateOffset() +{ + return MAX_OFFSET; +} + +void MedardDownloader::retrieveForecastInitialDateFinished() +{ + qDebug() << "retrieveForecastInitialDateFinished: m_reply=" << m_reply; + + QByteArray data = m_reply->readAll(); + + int index1 = data.indexOf("var fcst_initDatestamp=\"", 0); + int index2 = data.indexOf("\";", index1); + if (index1 != -1) { + QString temp; + for (int i = index1 + 24; i < index2; i++) { + temp.append(data.at(i)); + } + QDateTime date = QDateTime::fromTime_t(temp.toULong() + 6 * 3600); + if (!date.isNull()) { + setForecastInitialDate(date.toLocalTime()); + + int forecastDateOffset = date.toLocalTime().secsTo(QDateTime().currentDateTime()) / 3600; + setForecastDateOffset(forecastDateOffset); + } + m_retryCounter = 0; + } + + QTimer::singleShot(0, this, SLOT(clearDownloadRequest())); +} + +void MedardDownloader::retrieveForecastInitialDateError(QNetworkReply::NetworkError /* code */) +{ + qDebug() << "retrieveForecastInitialDateError: m_reply=" << m_reply; +} + +void MedardDownloader::retrieveForecastInitialDate() +{ + qDebug() << "retrieveForecastInitialDate: m_reply=" << m_reply; + + QString serverUrl = QString(MEDARD_URL); + + QUrl url(serverUrl); + QNetworkRequest request(url); + + if (m_reply) + clearDownloadRequest(); + m_reply = m_network->get(request); + + connect(m_reply, SIGNAL(finished()), this, SLOT(retrieveForecastInitialDateFinished())); + connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, + SLOT(retrieveForecastInitialDateError(QNetworkReply::NetworkError))); +} + +void MedardDownloader::createCacheDirectory() +{ + QDir cacheDir(m_cachePath); + if (!cacheDir.exists()) + cacheDir.mkpath(cacheDir.path()); +} + +void MedardDownloader::cleanCacheDirectory() +{ + QDir cacheDir(m_cachePath); + QStringList list = cacheDir.entryList(); + for (int i = 0; i < list.size(); i++) { + if (!list.at(i).contains(m_forecastInitialDateCode)) { + QFile(m_cachePath + "/" + list.at(i)).remove(); + } + } +} diff --git a/src/medarddownloader.h b/src/medarddownloader.h new file mode 100644 index 0000000..4bb671c --- /dev/null +++ b/src/medarddownloader.h @@ -0,0 +1,108 @@ +/* + * Medard for Maemo. + * Copyright (C) 2011 Roman Moravcik + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef MEDARDDOWNLOADER_H +#define MEDARDDOWNLOADER_H + +#include +#include +#include +#include +#include +#include +#include + +class MedardDownloader : public QObject +{ + Q_OBJECT + +public: + enum ForecastType { + SeaLevelPressure = 0, + Precipitation = 1, + WindVelocity = 2, + Cloudiness = 3, + Temperature = 4 + }; + + enum ForecastDomain { + Europe = 0, + CzechRepublic = 1 + }; + + MedardDownloader(); + ~MedardDownloader(); + + void setForecastType(ForecastType type); + + void setForecastDomain(ForecastDomain domain); + + void setForecastInitialDate(QDateTime date); + QDateTime getForecastInitialDate(); + QDateTime getForecastDate(); + + void setForecastDateOffset(int offset); + int getForecastDateOffset(); + int getMinForecastDateOffset(); + int getMaxForecastDateOffset(); + + void downloadImage(); + + QSize getImageSize(); + +signals: + void downloadFinished(const QString &filename, const QDateTime &date); + void downloadFailed(); + +private slots: + void retryTimerEvent(); + void clearDownloadRequest(); + + void downloadImageFinished(); + void downloadImageError(QNetworkReply::NetworkError code); + + void retrieveForecastInitialDateFinished(); + void retrieveForecastInitialDateError(QNetworkReply::NetworkError code); + +private: + void tryDownloadImageAgain(); + bool isDownloaded(const QString filename); + + void retrieveForecastInitialDate(); + + void createCacheDirectory(); + void cleanCacheDirectory(); + +private: + QDateTime m_forecastInitialDate; + QString m_forecastInitialDateCode; + int m_forecastDateOffset; + QString m_forecastType; + QString m_forecastDomain; + + QNetworkAccessManager *m_network; + QNetworkReply *m_reply; + + int m_retryCounter; + QTimer *m_retryTimer; + + QString m_cachePath; +}; + +#endif // MEDARDDOWNLOADER_H diff --git a/translations/medard_cs.qm b/translations/medard_cs.qm new file mode 100644 index 0000000..be651ee --- /dev/null +++ b/translations/medard_cs.qm @@ -0,0 +1 @@ +<¸dÊÍ!¿`¡½Ý \ No newline at end of file diff --git a/translations/medard_cs.ts b/translations/medard_cs.ts new file mode 100644 index 0000000..d634808 --- /dev/null +++ b/translations/medard_cs.ts @@ -0,0 +1,103 @@ + + + + + ForecastWidget + + + Download failed! + Stahování se nezdařilo! + + + + Downloading image... + Stahování obrázku... + + + + MainWindow + + + + Sea Level Pressure + Atmosférický tlak + + + + + Precipitation + Srážky (mm/2h) + + + + + Wind Velocity + Rychlost větru + + + + + Cloudiness + Oblačnost + + + + + Temperature + Teplota + + + + Forecast from: + + Předpověď z: + + + + + Europe + Evropa + + + + Download again + Stáhnout znovu + + + + -1 d + -1 d + + + + +1 d + +1 d + + + + -1 h + -1 h + + + + +1 h + +1 h + + + + Czech Republic + Česká republika + + + + Medard + Medard + + + Initial date: + + Počiatočný dátum: + + + + diff --git a/translations/medard_en.qm b/translations/medard_en.qm new file mode 100644 index 0000000000000000000000000000000000000000..4600867dc725f0d46c57ae305334408ececa67d1 GIT binary patch literal 1181 zcmZ{j&ubGw6vy8tZ5q=wEmA~EDI4^llmu#TRXmusr$$R#nu`=CJCn`8{$hV5ws;Wn z;6I=T_2Nk>o;-*b5%eZ{5j;r`;tvE5{Rcewovqo_cEhr~dBc03dGGsXF1_NX-|s)Z z|FJy%=EjrPdsm3)Hf6qX*cY&E*geW-;cIzV_}V<(`FR=kyY}$bXQFI*=)(g+l&K6~ ze0CRhH+Nz9JoaCXoSB$`|K-HB-(SI@(dYZ`khfKQJFo1c;-{NG5Z5U+pY9@VYyA4J zs|Z_{*!+{lN~c9~sY?!7u#7l%TCftnfLG2dY!3g#qT6*WmvOztq$PNH1e>L0*B1s0 z!iMCg2sMQ~cMK_kHvyJp18o9aRbPUh?4hM&>e6PWs8*|k@Ohf0Ily?5J~TV0a}{2w zGwC#>!`*INNiVehUuZi$v~rYM8Av?{Jw!!lDs_@-v91x6R3ZopC`gJa)GRmR(h)(B zR?;+*caUOG8||)PJdfWv3774MArnWK07U zX$ckhxF{ZpBr&%X`K~9@5@u)_!G7EXL+@dHyA;5t1u7(n@!mDkTfS>A6w+8ls)NH( zwSQ>#xw_!YPo4f0t^PY&qF#x^8Gebw`%RCn;`&NYhAfnBYR_kB9mg^hz5?69Z()5v z#xP?&`dXY^7ffFf9bxGp2SMbg>T-%U0J4>gC{dNAWbI={H-zm8pM?YRr>LQ37r)lc gxFi?XM76k`Xga1Ig1#v%*O1}%QAO|Jxnwl$FV#Kn&j0`b literal 0 HcmV?d00001 diff --git a/translations/medard_en.ts b/translations/medard_en.ts new file mode 100644 index 0000000..078928a --- /dev/null +++ b/translations/medard_en.ts @@ -0,0 +1,103 @@ + + + + + ForecastWidget + + + Download failed! + Download failed! + + + + Downloading image... + Downloading image... + + + + MainWindow + + + + Sea Level Pressure + Sea Level Pressure + + + + + Precipitation + Precipitation + + + + + Wind Velocity + Wind Velocity + + + + + Cloudiness + Cloudiness + + + + + Temperature + Temperature + + + + Forecast from: + + Forecast from: + + + + + Europe + Europe + + + + Download again + Download again + + + + -1 d + -1 d + + + + +1 d + +1 d + + + + -1 h + -1 h + + + + +1 h + +1 h + + + + Czech Republic + Czech Republic + + + + Medard + Medard + + + Initial date: + + Initial date: + + + + diff --git a/translations/medard_sk.qm b/translations/medard_sk.qm new file mode 100644 index 0000000000000000000000000000000000000000..3fac29f11b19edaa56e792e513125ce02f62fb64 GIT binary patch literal 1183 zcmZ{j&r4KM6vw~M8Alt(QKUtSL7oMrgcIs2i=fO_nWB79 z{()LV5Uq-c7OmVwP`jv2&@y6>B5L8HT@dwsQ}dkU$uOLEFXw#DkMFt1H{`xITleq0 z8z{WI{P4xcQvhzDZBx>2&{k+SkxKDw?65U}GH))_5yu4F){0aEL2JRtYs&goire2FoZ$zZkr?3D$1e)>Tnf#bR+ccqa~H zgg_aGrw@ z;9Dv#B|G7mP-<8Ceo{gGR*sYNIjcIG_4r*w*nnx?i5QcgSXZTrJ*#TrqN7Vms6s;y z-B8*^NNFOCqk5?NHmE6rEy^5Y5-5jB*5Kg>YuOIWOopDRsic4cW*VhS21MBuH?F6V zeH__1b5C=H>?O}s$FoVK9Huw|$sW8GGu z;?&(UTwYz%fe5ro?0G*zh-;KC4!gW0ULqp_e$7 zJmwp6Mz1Sq8D!VIs@9Yzf?eVYm}S}$8;BygODusiCBti>bVm=sKCc{8(!tu!S>EO| L$ynC!bX)olw~p~t literal 0 HcmV?d00001 diff --git a/translations/medard_sk.ts b/translations/medard_sk.ts new file mode 100644 index 0000000..ad7463c --- /dev/null +++ b/translations/medard_sk.ts @@ -0,0 +1,103 @@ + + + + + ForecastWidget + + + Download failed! + S‌ťahovanie zlyhalo! + + + + Downloading image... + SÅ¥ahujem obrázok... + + + + MainWindow + + + + Sea Level Pressure + Atmosferický tlak + + + + + Precipitation + Zrážky (mm/2h) + + + + + Wind Velocity + RýchlosÅ¥ vetra + + + + + Cloudiness + OblačnosÅ¥ + + + + + Temperature + Teplota + + + + Forecast from: + + Predpove‌ď z: + + + + + Europe + Európa + + + + Download again + SÅ¥iahnuÅ¥ znova + + + + -1 d + -1 d + + + + +1 d + +1 d + + + + -1 h + -1 h + + + + +1 h + +1 h + + + + Czech Republic + Česká republika + + + + Medard + Medard + + + Initial date: + + Počiatočný dátum: + + + + -- 1.7.9.5