-rw-r--r-- | core/pim/today/today.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 72cdfd6..812f8b5 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -8,98 +8,98 @@ | |||
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 | #define QTOPIA_INTERNAL_LANGLIST | 17 | #define QTOPIA_INTERNAL_LANGLIST |
18 | 18 | ||
19 | #include "today.h" | 19 | #include "today.h" |
20 | 20 | ||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/contact.h> | 25 | #include <qpe/contact.h> |
26 | 26 | ||
27 | #include <qdir.h> | 27 | #include <qdir.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qwhatsthis.h> | 29 | #include <qwhatsthis.h> |
30 | 30 | ||
31 | struct TodayPlugin { | 31 | struct TodayPlugin { |
32 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} | 32 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} |
33 | QLibrary *library; | 33 | QLibrary *library; |
34 | QInterfacePtr<TodayPluginInterface> iface; | 34 | QInterfacePtr<TodayPluginInterface> iface; |
35 | TodayPluginObject *guiPart; | 35 | TodayPluginObject *guiPart; |
36 | QWidget *guiBox; | 36 | QWidget *guiBox; |
37 | QString name; | 37 | QString name; |
38 | bool active; | 38 | bool active; |
39 | bool excludeRefresh; | 39 | bool excludeRefresh; |
40 | int pos; | 40 | int pos; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | static QValueList<TodayPlugin> pluginList; | 43 | static QValueList<TodayPlugin> pluginList; |
44 | 44 | ||
45 | static QMap<QString, TodayPlugin> tempList; | 45 | static QMap<QString, TodayPlugin> tempList; |
46 | 46 | ||
47 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 47 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
48 | : TodayBase( parent, name, fl ) { | 48 | : TodayBase( parent, name, fl ) { |
49 | 49 | ||
50 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); | 50 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); |
51 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); | 51 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); |
52 | 52 | ||
53 | #if defined(Q_WS_QWS) | 53 | #if defined(Q_WS_QWS) |
54 | #if !defined(QT_NO_COP) | 54 | #if !defined(QT_NO_COP) |
55 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); | 55 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); |
56 | connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), | 56 | connect ( todayChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
57 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); | 57 | this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); |
58 | #endif | 58 | #endif |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | setOwnerField(); | 61 | setOwnerField(); |
62 | m_refreshTimer = new QTimer( this ); | 62 | m_refreshTimer = new QTimer( this ); |
63 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 63 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
64 | m_refreshTimer->start( 15000 ); | 64 | m_refreshTimer->start( 15000 ); |
65 | m_big_box = 0L; | 65 | m_big_box = 0L; |
66 | 66 | ||
67 | 67 | ||
68 | layout = new QVBoxLayout( this ); | 68 | layout = new QVBoxLayout( this ); |
69 | layout->addWidget( Frame ); | 69 | layout->addWidget( Frame ); |
70 | layout->addWidget( OwnerField ); | 70 | layout->addWidget( OwnerField ); |
71 | 71 | ||
72 | m_sv = new QScrollView( this ); | 72 | m_sv = new QScrollView( this ); |
73 | m_sv->setResizePolicy( QScrollView::AutoOneFit ); | 73 | m_sv->setResizePolicy( QScrollView::AutoOneFit ); |
74 | m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 74 | m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
75 | m_sv->setFrameShape( QFrame::NoFrame ); | 75 | m_sv->setFrameShape( QFrame::NoFrame ); |
76 | 76 | ||
77 | layout->addWidget( m_sv ); | 77 | layout->addWidget( m_sv ); |
78 | layout->setStretchFactor( m_sv,4 ); | 78 | layout->setStretchFactor( m_sv,4 ); |
79 | 79 | ||
80 | qApp->processEvents(); | 80 | qApp->processEvents(); |
81 | loadPlugins(); | 81 | loadPlugins(); |
82 | QPEApplication::showWidget( this ); | 82 | QPEApplication::showWidget( this ); |
83 | } | 83 | } |
84 | 84 | ||
85 | /** | 85 | /** |
86 | * Qcop receive method. | 86 | * Qcop receive method. |
87 | */ | 87 | */ |
88 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { | 88 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { |
89 | QDataStream stream( data, IO_ReadOnly ); | 89 | QDataStream stream( data, IO_ReadOnly ); |
90 | if ( msg == "message(QString)" ) { | 90 | if ( msg == "message(QString)" ) { |
91 | QString message; | 91 | QString message; |
92 | stream >> message; | 92 | stream >> message; |
93 | setOwnerField( message ); | 93 | setOwnerField( message ); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | void Today::setRefreshTimer( int interval ) { | 97 | void Today::setRefreshTimer( int interval ) { |
98 | 98 | ||
99 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 99 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
100 | 100 | ||
101 | // 0 is "never" case | 101 | // 0 is "never" case |
102 | if ( !interval == 0 ) { | 102 | if ( !interval == 0 ) { |
103 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 103 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
104 | m_refreshTimer->changeInterval( interval ); | 104 | m_refreshTimer->changeInterval( interval ); |
105 | } | 105 | } |