summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/fortune/config.in1
-rw-r--r--noncore/todayplugins/fortune/fortune.pro2
-rw-r--r--noncore/todayplugins/fortune/fortuneplugin.cpp2
-rw-r--r--noncore/todayplugins/fortune/fortuneplugin.h6
-rw-r--r--noncore/todayplugins/fortune/fortunepluginimpl.h2
-rw-r--r--noncore/todayplugins/fortune/fortunepluginwidget.cpp17
-rw-r--r--noncore/todayplugins/fortune/fortunepluginwidget.h7
-rw-r--r--noncore/todayplugins/fortune/opie-today-fortuneplugin.control2
8 files changed, 18 insertions, 21 deletions
diff --git a/noncore/todayplugins/fortune/config.in b/noncore/todayplugins/fortune/config.in
index 1f9a08b..ca476f1 100644
--- a/noncore/todayplugins/fortune/config.in
+++ b/noncore/todayplugins/fortune/config.in
@@ -1,4 +1,5 @@
1 config TODAY_FORTUNE 1 config TODAY_FORTUNE
2 boolean "opie-today-fortuneplugin (a joke a day keeps the doctor away)" 2 boolean "opie-today-fortuneplugin (a joke a day keeps the doctor away)"
3 default "y" 3 default "y"
4 depends (LIBQPE || LIBQPE-X11) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM && TODAY
4 depends TODAY 5 depends TODAY
diff --git a/noncore/todayplugins/fortune/fortune.pro b/noncore/todayplugins/fortune/fortune.pro
index 3446732..84a5730 100644
--- a/noncore/todayplugins/fortune/fortune.pro
+++ b/noncore/todayplugins/fortune/fortune.pro
@@ -1,21 +1,21 @@
1TEMPLATE = lib 1TEMPLATE = lib
2#CONFIG -= moc 2#CONFIG -= moc
3CONFIG += qt plugin release 3CONFIG += qt plugin release
4 4
5# Input 5# Input
6HEADERS = fortuneplugin.h fortunepluginimpl.h \ 6HEADERS = fortuneplugin.h fortunepluginimpl.h \
7 fortunepluginwidget.h 7 fortunepluginwidget.h
8SOURCES = fortuneplugin.cpp fortunepluginimpl.cpp \ 8SOURCES = fortuneplugin.cpp fortunepluginimpl.cpp \
9 fortunepluginwidget.cpp 9 fortunepluginwidget.cpp
10 10
11INCLUDEPATH += $(OPIEDIR)/include \ 11INCLUDEPATH += $(OPIEDIR)/include \
12 ../ ../library 12 ../ ../library
13DEPENDPATH += $(OPIEDIR)/include \ 13DEPENDPATH += $(OPIEDIR)/include \
14 ../ ../library 14 ../ ../library
15 15
16LIBS+= -lqpe -lopie 16LIBS+= -lqpe -lopiecore2 -lopiepim2 -lopieui2
17 17
18DESTDIR = $(OPIEDIR)/plugins/today 18DESTDIR = $(OPIEDIR)/plugins/today
19TARGET = todayfortuneplugin 19TARGET = todayfortuneplugin
20 20
21include ( $(OPIEDIR)/include.pro ) 21include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/todayplugins/fortune/fortuneplugin.cpp b/noncore/todayplugins/fortune/fortuneplugin.cpp
index 9751e6f..69d2c45 100644
--- a/noncore/todayplugins/fortune/fortuneplugin.cpp
+++ b/noncore/todayplugins/fortune/fortuneplugin.cpp
@@ -8,64 +8,64 @@
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17 17
18 18
19#include "fortuneplugin.h" 19#include "fortuneplugin.h"
20#include "fortunepluginwidget.h" 20#include "fortunepluginwidget.h"
21 21
22 22
23FortunePlugin::FortunePlugin() 23FortunePlugin::FortunePlugin()
24{ 24{
25} 25}
26 26
27FortunePlugin::~FortunePlugin() 27FortunePlugin::~FortunePlugin()
28{ 28{
29} 29}
30 30
31QString FortunePlugin::pluginName() const 31QString FortunePlugin::pluginName() const
32{ 32{
33 return QObject::tr( "Fortune plugin" ); 33 return QObject::tr( "Fortune plugin" );
34} 34}
35 35
36double FortunePlugin::versionNumber() const 36double FortunePlugin::versionNumber() const
37{ 37{
38 return 0.1; 38 return 0.1;
39} 39}
40 40
41QString FortunePlugin::pixmapNameWidget() const 41QString FortunePlugin::pixmapNameWidget() const
42{ 42{
43 return "Fortune"; 43 return "Fortune";
44} 44}
45 45
46QWidget* FortunePlugin::widget( QWidget *wid ) 46QWidget* FortunePlugin::widget( QWidget *wid )
47{ 47{
48 return new FortunePluginWidget( wid, "Fortune" ); 48 return new FortunePluginWidget( wid, "Fortune" );
49} 49}
50 50
51QString FortunePlugin::pixmapNameConfig() const 51QString FortunePlugin::pixmapNameConfig() const
52{ 52{
53 return "Fortune"; 53 return "Fortune";
54} 54}
55 55
56TodayConfigWidget* FortunePlugin::configWidget( QWidget* wid ) 56TodayConfigWidget* FortunePlugin::configWidget( QWidget* /*wid*/ )
57{ 57{
58// return new FortunePluginConfig( wid , "Fortune" ); 58// return new FortunePluginConfig( wid , "Fortune" );
59 return NULL; 59 return NULL;
60} 60}
61 61
62QString FortunePlugin::appName() const 62QString FortunePlugin::appName() const
63{ 63{
64 return "fortune"; 64 return "fortune";
65} 65}
66 66
67 67
68bool FortunePlugin::excludeFromRefresh() const 68bool FortunePlugin::excludeFromRefresh() const
69{ 69{
70 return false; 70 return false;
71} 71}
diff --git a/noncore/todayplugins/fortune/fortuneplugin.h b/noncore/todayplugins/fortune/fortuneplugin.h
index 9376771..9b590ad 100644
--- a/noncore/todayplugins/fortune/fortuneplugin.h
+++ b/noncore/todayplugins/fortune/fortuneplugin.h
@@ -1,43 +1,43 @@
1/* 1/*
2 * fortuneplugin.h 2 * fortuneplugin.h
3 * 3 *
4 * copyright : (c) 2002 by Chris Larson 4 * copyright : (c) 2002 by Chris Larson
5 * email : kergoth@handhelds.org 5 * email : kergoth@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef FORTUNE_PLUGIN_H 17#ifndef FORTUNE_PLUGIN_H
18#define FORTUNE_PLUGIN_H 18#define FORTUNE_PLUGIN_H
19 19
20#include <opie2/oclickablelabel.h>
21#include <opie2/todayplugininterface.h>
22
20#include <qstring.h> 23#include <qstring.h>
21#include <qwidget.h> 24#include <qwidget.h>
22 25
23#include <opie/oclickablelabel.h>
24#include <opie/todayplugininterface.h>
25
26class FortunePlugin : public TodayPluginObject 26class FortunePlugin : public TodayPluginObject
27{ 27{
28 28
29public: 29public:
30 FortunePlugin(); 30 FortunePlugin();
31 ~FortunePlugin(); 31 ~FortunePlugin();
32 32
33 QString pluginName() const; 33 QString pluginName() const;
34 double versionNumber() const; 34 double versionNumber() const;
35 QString pixmapNameWidget() const; 35 QString pixmapNameWidget() const;
36 QWidget* widget( QWidget * ); 36 QWidget* widget( QWidget * );
37 QString pixmapNameConfig() const; 37 QString pixmapNameConfig() const;
38 TodayConfigWidget* configWidget( QWidget * ); 38 TodayConfigWidget* configWidget( QWidget * );
39 QString appName() const; 39 QString appName() const;
40 bool excludeFromRefresh() const; 40 bool excludeFromRefresh() const;
41}; 41};
42 42
43#endif 43#endif
diff --git a/noncore/todayplugins/fortune/fortunepluginimpl.h b/noncore/todayplugins/fortune/fortunepluginimpl.h
index 8e380f5..35ecf92 100644
--- a/noncore/todayplugins/fortune/fortunepluginimpl.h
+++ b/noncore/todayplugins/fortune/fortunepluginimpl.h
@@ -1,40 +1,40 @@
1/* 1/*
2 * todopluginimpl.h 2 * todopluginimpl.h
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef FORTUNE_PLUGIN_IMPL_H 17#ifndef FORTUNE_PLUGIN_IMPL_H
18#define FORTUNE_PLUGIN_IMPL_H 18#define FORTUNE_PLUGIN_IMPL_H
19 19
20#include <opie/todayplugininterface.h> 20#include <opie2/todayplugininterface.h>
21 21
22class FortunePlugin; 22class FortunePlugin;
23 23
24class FortunePluginImpl : public TodayPluginInterface 24class FortunePluginImpl : public TodayPluginInterface
25{ 25{
26 26
27public: 27public:
28 FortunePluginImpl(); 28 FortunePluginImpl();
29 virtual ~FortunePluginImpl(); 29 virtual ~FortunePluginImpl();
30 30
31 QRESULT queryInterface( const QUuid &, QUnknownInterface** ); 31 QRESULT queryInterface( const QUuid &, QUnknownInterface** );
32 Q_REFCOUNT 32 Q_REFCOUNT
33 33
34 virtual TodayPluginObject *guiPart(); 34 virtual TodayPluginObject *guiPart();
35 35
36private: 36private:
37 FortunePlugin *fortunePlugin; 37 FortunePlugin *fortunePlugin;
38}; 38};
39 39
40#endif 40#endif
diff --git a/noncore/todayplugins/fortune/fortunepluginwidget.cpp b/noncore/todayplugins/fortune/fortunepluginwidget.cpp
index e6a0d09..3aa978c 100644
--- a/noncore/todayplugins/fortune/fortunepluginwidget.cpp
+++ b/noncore/todayplugins/fortune/fortunepluginwidget.cpp
@@ -1,84 +1,81 @@
1/* 1/*
2 * fortunepluginwidget.cpp 2 * fortunepluginwidget.cpp
3 * 3 *
4 * copyright : (c) 2002 by Maximilian Reiß 4 * copyright : (c) 2002 by Maximilian Reiß
5 * email : harlekin@handhelds.org 5 * email : harlekin@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "fortunepluginwidget.h" 17#include "fortunepluginwidget.h"
18 18
19#include <qpe/config.h>
20#include <qpe/qcopenvelope_qws.h>
21
19#include <qvaluelist.h> 22#include <qvaluelist.h>
20#include <qtl.h> 23#include <qtl.h>
21#include <qstring.h> 24#include <qstring.h>
22#include <qscrollview.h> 25#include <qscrollview.h>
23#include <qobject.h> 26#include <qobject.h>
24#include <qlayout.h> 27#include <qlayout.h>
25 28
26#include <qpe/config.h>
27#include <qpe/qcopenvelope_qws.h>
28
29#include <opie/oprocess.h>
30#include <opie/oticker.h>
31
32FortunePluginWidget::FortunePluginWidget( QWidget *parent, const char* name ) 29FortunePluginWidget::FortunePluginWidget( QWidget *parent, const char* name )
33 : QWidget( parent, name ) 30 : QWidget( parent, name )
34{ 31{
35 32
36 fortune = NULL; 33 fortune = NULL;
37 getFortune(); 34 getFortune();
38} 35}
39 36
40FortunePluginWidget::~FortunePluginWidget() { 37FortunePluginWidget::~FortunePluginWidget() {
41 if( fortuneProcess ){ 38 if( fortuneProcess ){
42 delete fortuneProcess; 39 delete fortuneProcess;
43 } 40 }
44} 41}
45 42
46/** 43/**
47 * Get the fortunes 44 * Get the fortunes
48 */ 45 */
49void FortunePluginWidget::getFortune() { 46void FortunePluginWidget::getFortune() {
50 47
51 QVBoxLayout* layoutFortune = new QVBoxLayout( this ); 48 QVBoxLayout* layoutFortune = new QVBoxLayout( this );
52 49
53 if ( fortune ) { 50 if ( fortune ) {
54 delete fortune; 51 delete fortune;
55 } 52 }
56 53
57 fortune = new OTicker( this ); 54 fortune = new OTicker( this );
58 //fortune->setReadOnly( TRUE ); 55 //fortune->setReadOnly( TRUE );
59 //fortune->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); 56 //fortune->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
60 57
61 fortune->setText( QString("Obtaining fortune...") ); 58 fortune->setText( QString("Obtaining fortune...") );
62 layoutFortune->addWidget( fortune ); 59 layoutFortune->addWidget( fortune );
63 60
64 fortuneProcess = new OProcess(); 61 fortuneProcess = new OProcess();
65 *fortuneProcess << "fortune"; 62 *fortuneProcess << "fortune";
66 63
67 connect(fortuneProcess, SIGNAL(receivedStdout(OProcess*,char*,int) ), 64 connect(fortuneProcess, SIGNAL(receivedStdout(OProcess*,char*,int) ),
68 this, SLOT(slotStdOut(OProcess*,char*,int) ) ); 65 this, SLOT(slotStdOut(OProcess*,char*,int) ) );
69 66
70 if(!fortuneProcess->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 67 if(!fortuneProcess->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
71 qWarning("could not start :("); 68 qWarning("could not start :(");
72 fortune->setText( QString("Failed to obtain fortune.") ); 69 fortune->setText( QString("Failed to obtain fortune.") );
73 delete fortuneProcess; 70 delete fortuneProcess;
74 fortuneProcess = 0; 71 fortuneProcess = 0;
75 } 72 }
76 73
77} 74}
78 75
79void FortunePluginWidget::slotStdOut( OProcess* proc, char* buf, int len ) 76void FortunePluginWidget::slotStdOut( OProcess* /*proc*/, char* buf, int len )
80{ 77{
81 QCString s( buf, len ); 78 QCString s( buf, len );
82 s.replace( QRegExp("\n"), "" ); 79 s.replace( QRegExp("\n"), "" );
83 fortune->setText( s ); 80 fortune->setText( s );
84} 81}
diff --git a/noncore/todayplugins/fortune/fortunepluginwidget.h b/noncore/todayplugins/fortune/fortunepluginwidget.h
index 302d046..abb7bed 100644
--- a/noncore/todayplugins/fortune/fortunepluginwidget.h
+++ b/noncore/todayplugins/fortune/fortunepluginwidget.h
@@ -1,46 +1,45 @@
1/* 1/*
2 * fortunepluginwidget.h 2 * fortunepluginwidget.h
3 * 3 *
4 * copyright : (c) 2002 by Chris Larson 4 * copyright : (c) 2002 by Chris Larson
5 * email : kergoth@handhelds.org 5 * email : kergoth@handhelds.org
6 * 6 *
7 */ 7 */
8/*************************************************************************** 8/***************************************************************************
9 * * 9 * *
10 * This program is free software; you can redistribute it and/or modify * 10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by * 11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or * 12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#ifndef FORTUNE_PLUGIN_WIDGET_H 17#ifndef FORTUNE_PLUGIN_WIDGET_H
18#define FORTUNE_PLUGIN_WIDGET_H 18#define FORTUNE_PLUGIN_WIDGET_H
19 19
20#include <opie2/oprocess.h>
21#include <opie2/oticker.h>
22
20#include <qstring.h> 23#include <qstring.h>
21#include <qwidget.h> 24#include <qwidget.h>
22 25
23#include <opie/oticker.h>
24#include <opie/oprocess.h>
25
26
27class FortunePluginWidget : public QWidget 26class FortunePluginWidget : public QWidget
28{ 27{
29 28
30 Q_OBJECT 29 Q_OBJECT
31 30
32public: 31public:
33 FortunePluginWidget( QWidget *parent, const char *name ); 32 FortunePluginWidget( QWidget *parent, const char *name );
34 ~FortunePluginWidget(); 33 ~FortunePluginWidget();
35 34
36private: 35private:
37 OTicker *fortune; 36 OTicker *fortune;
38 OProcess *fortuneProcess; 37 OProcess *fortuneProcess;
39 38
40 void getFortune(); 39 void getFortune();
41 40
42private slots: 41private slots:
43 void slotStdOut( OProcess*, char*, int ); 42 void slotStdOut( OProcess*, char*, int );
44}; 43};
45 44
46#endif 45#endif
diff --git a/noncore/todayplugins/fortune/opie-today-fortuneplugin.control b/noncore/todayplugins/fortune/opie-today-fortuneplugin.control
index 48ddab1..9b7adbe 100644
--- a/noncore/todayplugins/fortune/opie-today-fortuneplugin.control
+++ b/noncore/todayplugins/fortune/opie-today-fortuneplugin.control
@@ -1,9 +1,9 @@
1Package: opie-today-fortuneplugin 1Package: opie-today-fortuneplugin
2Files: plugins/today/libtodayfortuneplugin.so* 2Files: plugins/today/libtodayfortuneplugin.so*
3Priority: optional 3Priority: optional
4Section: opie/plugins 4Section: opie/plugins
5Maintainer: Chris Larson <kergoth@handhelds.org> 5Maintainer: Chris Larson <kergoth@handhelds.org>
6Architecture: arm 6Architecture: arm
7Depends: opie-today, fortune (<=9708-0.1) | fortune-mod 7Depends: opie-today, fortune (<=9708-0.1) | fortune-mod, libopiecore2, libopiepim2, libopieui2
8Description: 'fortune' plugin for Today 8Description: 'fortune' plugin for Today
9Version: $QPE_VERSION$EXTRAVERSION 9Version: $QPE_VERSION$EXTRAVERSION