Advertisement
Guest User

Untitled

a guest
May 4th, 2017
604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.68 KB | None | 0 0
  1. /***************************************************************************
  2.  *   By Karthik Paithankar <biophysics@hotmail.com>     *
  3.  *   A lot of code was used from weatherplasmoid. Thanks to                *
  4.  *                         Vinnie Futia <rowancompsciguy@gmail.com>        *
  5.  *
  6.  *   Credits to Vinnie Futia <rowancompsciguy@gmail.com>        *
  7.  *   This program is free software; you can redistribute it and/or modify  *
  8.  *   it under the terms of the GNU General Public License as published by  *
  9.  *   the Free Software Foundation; either version 3 of the License, or     *
  10.  *   (at your option) any later version.                                   *
  11.  *                                                                         *
  12.  *   This program is distributed in the hope that it will be useful,       *
  13.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  14.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  15.  *   GNU General Public License for more details.                          *
  16.  *                                                                         *
  17.  *   You should have received a copy of the GNU General Public License     *
  18.  *   along with this program; if not, write to the                         *
  19.  *   Free Software Foundation, Inc.,                                       *
  20.  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
  21.  ***************************************************************************/
  22.  
  23. // Here we avoid loading the header multiple times
  24. #ifndef Plasma_Weather_HEADER
  25. #define Plasma_Weather_HEADER
  26.  
  27. // We need the Plasma Applet headers
  28. #include <Plasma/Applet>
  29. #include <Plasma/Svg>
  30. #include <QTimer>
  31. #include <KConfigDialog>
  32. #include <QWidget>
  33. #include <kio/job.h>
  34.  
  35. #include "ui_config.h"
  36. #include "config.h"
  37.  
  38.  
  39. class QSizeF;
  40. class QTimer;
  41.  
  42. class Plasma_Weather : public Plasma::Applet
  43. {
  44.     Q_OBJECT
  45.     public:
  46.         // Basic Create/Destroy
  47.         Plasma_Weather(QObject *parent, const QVariantList &args);
  48.         ~Plasma_Weather();
  49.  
  50.         // The paintInterface procedure paints the applet to screen
  51.         void paintInterface(QPainter *painter,
  52.                 const QStyleOptionGraphicsItem *option,
  53.                 const QRect& contentsRect);
  54.         void init();
  55.         QSizeF contentSizeHint() const;
  56.         Qt::Orientations expandingDirections() const;
  57.  
  58.     public slots:
  59.         void refresh();
  60.         void configAccepted();
  61.         void configRejected();
  62.         void parseData(KIO::Job *, const QByteArray & data);
  63.  
  64.     protected:
  65.         void createConfigurationInterface(KConfigDialog *parent);
  66.  
  67.     private:
  68. //        void paintImage(QPainter *p, const QRect &contentsRect);
  69.         void collectData();
  70.         void readConfigData();
  71.         QString region;
  72.         QString country;
  73.         QString city;
  74.         QString tempType;
  75.         QString chill;
  76.         QString temperature;
  77.         QString tomorrow_day;
  78.         QString tomorrow_code;
  79.         QString d_a_t;
  80.         QString d_a_t_low;
  81.         QString d_a_t_high;
  82.         QString d_a_t_condition;
  83.         QString d_a_t_code;
  84.         QString temperature_tomorrow_low;
  85.         QString temperature_tomorrow_high;
  86.         QString temperature_tomorrow_condition;
  87.         QString condition;
  88.         QString humidity;
  89.         QString iconTheme;
  90.         QString zip;
  91.         QString today_code;
  92.         QString updateFrequency;
  93.         QTimer* timer;
  94.         QFont titleFont;
  95.         QFont tempFont;
  96.         ConfigDialog* conf;
  97. };
  98.  
  99. // This is the command that links your applet to the .desktop file
  100. K_EXPORT_PLASMA_APPLET(weatherforecast, Plasma_Weather)
  101. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement