Skip to content

Commit

Permalink
Initial revision
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.mythtv.org/svn/trunk@743 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
Isaac Richards committed Jan 9, 2003
1 parent 2ee2b4b commit 25be1f4
Show file tree
Hide file tree
Showing 26 changed files with 2,187 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mythplugins/mythweather/AUTHORS
@@ -0,0 +1,17 @@
Main Author:
John Danner <johndanner@untzuntz.com>

Contributing:
Weather Graphics
- Nathan Ziarek <nathan@ziarek.com>
(www.ziarek.com)

MythMusic Authors
- Base Application

Special Thanks:
Dustin Doris & Randy Schad
- Weather Source

Tarek Lubani
- Some conversions to SI units
3 changes: 3 additions & 0 deletions mythplugins/mythweather/COPYING
@@ -0,0 +1,3 @@
MythWeather is distributed under the terms of the GPL, version 2 only.
If you don't have a copy of the GPL, get one at:
http://www.gnu.org/licenses/gpl.txt
38 changes: 38 additions & 0 deletions mythplugins/mythweather/Makefile
@@ -0,0 +1,38 @@
#############################################################################
# Makefile for building: mythweather
# Generated by qmake (1.04a) (Qt 3.1.0) on: Wed Jan 8 18:47:32 2003
# Project: mythweather.pro
# Template: subdirs
# Command: $(QMAKE) -o Makefile mythweather.pro
#############################################################################

MAKEFILE = Makefile
QMAKE = qmake
DEL_FILE = rm -f
SUBTARGETS = \
sub-mythweather

first: all

all: Makefile $(SUBTARGETS)

mythweather/$(MAKEFILE):
cd mythweather && $(QMAKE) -o $(MAKEFILE)
sub-mythweather: mythweather/$(MAKEFILE) FORCE
cd mythweather && $(MAKE) -f $(MAKEFILE)

Makefile: mythweather.pro $(QTDIR)/mkspecs/linux-g++/qmake.conf
$(QMAKE) -o Makefile mythweather.pro
qmake: qmake_all
@$(QMAKE) -o Makefile mythweather.pro

all: $(SUBTARGETS)
qmake_all: mythweather/$(MAKEFILE)
( [ -d mythweather ] && cd mythweather ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
clean uninstall install uiclean mocclean: qmake_all FORCE
( [ -d mythweather ] && cd mythweather ; $(MAKE) -f $(MAKEFILE) $@; ) || true
distclean: qmake_all FORCE
( [ -d mythweather ] && cd mythweather ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true

FORCE:

109 changes: 109 additions & 0 deletions mythplugins/mythweather/README
@@ -0,0 +1,109 @@
MythWeather
Release 0.8c

BUILD/CONFIGURATION INSTRUCTIONS
--------------------------------

Requirements:
MythTV (v0.8) installed and working
Internet Access (to get the weather!)

If you have met the requirements above, simply type 'make' in the main directory
to begin compiling.

Compiling note: If you get an error on building this, that says something
about 'mkspecs', then you don't have the QTDIR environment
variable set. On debian, this should be set to /usr/share/qt.
I hear on mandrake, it's /usr/lib/qt3. You'll need to figure
out what it should be on your system, set the variable,
and attempt to compile again.


Once the make is completed, do a 'make install'.

- mythweather will go into /usr/local/bin
- images and weathertype file will be put into the newly created
/usr/local/share/mythtv/mythweather directory

The software is now installed, one simple configuration must be made:

1. Connect to your SQL server you already have running for MythTV.
2. Issue the following commands (be sure to replace the YOUR_ZIPCODE_OR_AREA_ID,
see below for more information):

use mythconverg;
insert into settings (value, data) VALUES ('locale', 'YOUR_ZIPCODE_OR_AREA_ID');

2A. If you want to default to SI units, do the following, if not, skip to #3:
insert into settings (value, data) VALUES ('SIUnits', 'Yes');

3. Exit out of the SQL server
4. Edit 'mainmenu.xml' in /usr/local/share/mythtv, add the following:

<button>
<type>WEATHER</type>
<text>Weather</text>
<action>EXEC mythweather</action>
<depends>mythweather</depends>
</button>

5. You're done! Enjoy! See below if you have any problems, ideas, concerns...


MYTHWEATHER KEYBOARD COMMANDS
-----------------------------
Left Key Goes back one page, this also extends the time spent
on the page you are at.
Right Key Goes forward one page, see above.
Space Pause, wait on the current page until space is hit
again.
Numeric Keys You can check other weather by keying in other ZIP codes.
Enter Key Switch between celsius and fahrenheit. Can also
be used a way to force a data update.

OTHER INFORMATION
-----------------
Current the program cycles through the three pages. Each page is
shown for 10 seconds. When the user intervens and changes the page
it waits for 20 seconds. The weather data is updated every 30 minutes
or until the user selects a new zip code (or even the current zip code
again). See below for the todo list!


YOUR_ZIPCODE_OR_AREA_ID Information
-----------------------------------
In the United States this is simply your zip code.
It can be an Airport code as well.

If you're not sure what to put here, goto:
http://www.msnbc.com/news/wea_front.asp?0wl=w3&tab=oth&ta=y
And type in your city name, select the city you live in.

For Example
-----------
If you live in Paris, France -- you would type in Paris.
A list of 15 or so 'Paris' cities come up, select 'Paris, France'
Now, in your browser's address bar is:
http://www.msnbc.com/news/wea_front.asp?pos=&tab=oth&ta=y& \\
czstr=Paris%2C+France&action=&inst=n&accid=FRXX0076
Your AREA_ID is FRXX0076


TODO LIST
---------
- Ability to save a new location using MythWeather
- Radar Map Page
- Finish list of weather types and icons
- Get a real graphics person to make the weather icons :)

KNOWN ISSUES
------------
I don't have all the weather descriptions and icons. If you see a '?'
icon or weather description as 'Unknown [XX]', please email and let
me know the XX number, the type of weather at www.msnbc.com for that
day. THANKS!

If you have any questions, you can find me on the #mythtv channel at
irc.freenode.net (IRC Name: moegreen)

or you can email me: John Danner <johndanner@psu.edu>
8 changes: 8 additions & 0 deletions mythplugins/mythweather/mythweather.pro
@@ -0,0 +1,8 @@
######################################################################
# Automatically generated by qmake (1.04a) Mon Dec 9 23:49:41 2002
######################################################################

TEMPLATE = subdirs

# Directories
SUBDIRS = mythweather
3 changes: 3 additions & 0 deletions mythplugins/mythweather/mythweather/.cvsignore
@@ -0,0 +1,3 @@
Makefile
moc_databasebox.cpp
mythvideo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions mythplugins/mythweather/mythweather/main.cpp
@@ -0,0 +1,64 @@
/*
MythWeather
Version 0.8
January 8th, 2003
By John Danner & Dustin Doris
Note: Portions of this code taken from MythMusic
*/

#include <iostream>
using namespace std;

#include <qapplication.h>
#include <qsqldatabase.h>
#include <unistd.h>

#include "weather.h"

#include <mythtv/themedmenu.h>
#include <mythtv/mythcontext.h>


int main(int argc, char *argv[])
{
QApplication a(argc, argv);

MythContext *context = new MythContext();

QSqlDatabase *db = QSqlDatabase::addDatabase("QMYSQL3");
if (!db)
{
printf("Couldn't connect to database\n");
return -1;
}

if (!context->OpenDatabase(db))
{
printf("couldn't open db\n");
return -1;
}

QString themename = context->GetSetting("Theme");
QString themedir = context->FindThemeDir(themename);

QString paths = context->GetSetting("TreeLevels");

if (themedir == "")
{
cerr << "Couldn't find theme " << themename << endl;
exit(0);
}

context->LoadQtConfig();

Weather weatherDat(context);
weatherDat.Show();
weatherDat.exec();

delete context;

return 0;
}
26 changes: 26 additions & 0 deletions mythplugins/mythweather/mythweather/mythweather.pro
@@ -0,0 +1,26 @@
######################################################################
# Automatically generated by qmake (1.02a) Wed Jul 24 19:17:01 2002
######################################################################

include ( ../settings.pro )

TEMPLATE = app
CONFIG += thread
TARGET = mythweather
target.path = $${PREFIX}/bin
INSTALLS += target

installfiles.path = $${PREFIX}/share/mythtv/mythweather
installfiles.files = weathertypes.dat
installimages.path = $${PREFIX}/share/mythtv/mythweather/images
installimages.files = images/*

INSTALLS += installfiles installimages

LIBS +=
LIBS += -L/usr/local/lib -lmyth-$$LIBVERSION

# Input

HEADERS += weather.h
SOURCES += main.cpp weather.cpp

0 comments on commit 25be1f4

Please sign in to comment.