author | zecke <zecke> | 2004-03-14 20:15:38 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 20:15:38 (UTC) |
commit | 5064995ccd7a57edd2e41a2908b6402ff25995c4 (patch) (unidiff) | |
tree | 156685fc97a3fe2002b6f4250c7217b9c250f390 | |
parent | 0d79c003839718ae70b3b997162044abd5c26bf6 (diff) | |
download | opie-5064995ccd7a57edd2e41a2908b6402ff25995c4.zip opie-5064995ccd7a57edd2e41a2908b6402ff25995c4.tar.gz opie-5064995ccd7a57edd2e41a2908b6402ff25995c4.tar.bz2 |
More stuff cvs did not commit the first time
-rw-r--r-- | core/pim/today/config.in | 2 | ||||
-rw-r--r-- | core/pim/today/main.cpp | 1 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 1 | ||||
-rw-r--r-- | core/pim/today/today.h | 1 | ||||
-rw-r--r-- | core/pim/today/todaybase.cpp | 1 | ||||
-rw-r--r-- | core/pim/today/todaybase.h | 5 | ||||
-rw-r--r-- | core/pim/today/todayconfig.cpp | 1 | ||||
-rw-r--r-- | core/pim/today/todayconfig.h | 2 |
8 files changed, 8 insertions, 6 deletions
diff --git a/core/pim/today/config.in b/core/pim/today/config.in index cdebdcb..5166d15 100644 --- a/core/pim/today/config.in +++ b/core/pim/today/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config TODAY | 1 | config TODAY |
2 | boolean "opie-today (today gives an overview of appointments and todos)" | 2 | boolean "opie-today (today gives an overview of appointments and todos)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIEUI2 && LIBOPIEPIM2 |
diff --git a/core/pim/today/main.cpp b/core/pim/today/main.cpp index 974c050..d63bc30 100644 --- a/core/pim/today/main.cpp +++ b/core/pim/today/main.cpp | |||
@@ -1,24 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * main.cpp | 2 | * main.cpp |
3 | * | 3 | * |
4 | * --------------------- | 4 | * --------------------- |
5 | * | 5 | * |
6 | * begin : Sun 10 17:20:00 CEST 2002 | 6 | * begin : Sun 10 17:20:00 CEST 2002 |
7 | * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß | 7 | * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß |
8 | * email : max.reiss@gmx.de | 8 | * email : max.reiss@gmx.de |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 13 | * This program is free software; you can redistribute it and/or modify * |
14 | * it under the terms of the GNU General Public License as published by * | 14 | * it under the terms of the GNU General Public License as published by * |
15 | * the Free Software Foundation; either version 2 of the License, or * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | 19 | ||
20 | #include "today.h" | 20 | #include "today.h" |
21 | 21 | ||
22 | #include <opie2/oapplicationfactory.h> | 22 | #include <opie2/oapplicationfactory.h> |
23 | 23 | ||
24 | using namespace Opie::Core; | ||
24 | OPIE_EXPORT_APP( OApplicationFactory<Today> ) | 25 | OPIE_EXPORT_APP( OApplicationFactory<Today> ) |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 812f8b5..ebcd2dd 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -1,158 +1,159 @@ | |||
1 | /* | 1 | /* |
2 | * today.cpp | 2 | * today.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002,2003,2004 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003,2004 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 | #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 | using namespace Opie::Ui; | ||
31 | struct TodayPlugin { | 32 | struct TodayPlugin { |
32 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} | 33 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} |
33 | QLibrary *library; | 34 | QLibrary *library; |
34 | QInterfacePtr<TodayPluginInterface> iface; | 35 | QInterfacePtr<TodayPluginInterface> iface; |
35 | TodayPluginObject *guiPart; | 36 | TodayPluginObject *guiPart; |
36 | QWidget *guiBox; | 37 | QWidget *guiBox; |
37 | QString name; | 38 | QString name; |
38 | bool active; | 39 | bool active; |
39 | bool excludeRefresh; | 40 | bool excludeRefresh; |
40 | int pos; | 41 | int pos; |
41 | }; | 42 | }; |
42 | 43 | ||
43 | static QValueList<TodayPlugin> pluginList; | 44 | static QValueList<TodayPlugin> pluginList; |
44 | 45 | ||
45 | static QMap<QString, TodayPlugin> tempList; | 46 | static QMap<QString, TodayPlugin> tempList; |
46 | 47 | ||
47 | Today::Today( QWidget* parent, const char* name, WFlags fl ) | 48 | Today::Today( QWidget* parent, const char* name, WFlags fl ) |
48 | : TodayBase( parent, name, fl ) { | 49 | : TodayBase( parent, name, fl ) { |
49 | 50 | ||
50 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); | 51 | QObject::connect( (QObject*)ConfigButton, SIGNAL( clicked() ), this, SLOT( startConfig() ) ); |
51 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); | 52 | QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); |
52 | 53 | ||
53 | #if defined(Q_WS_QWS) | 54 | #if defined(Q_WS_QWS) |
54 | #if !defined(QT_NO_COP) | 55 | #if !defined(QT_NO_COP) |
55 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); | 56 | QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); |
56 | connect ( todayChannel, SIGNAL( received(const QCString&,const QByteArray&) ), | 57 | connect ( todayChannel, SIGNAL( received(const QCString&,const QByteArray&) ), |
57 | this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); | 58 | this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); |
58 | #endif | 59 | #endif |
59 | #endif | 60 | #endif |
60 | 61 | ||
61 | setOwnerField(); | 62 | setOwnerField(); |
62 | m_refreshTimer = new QTimer( this ); | 63 | m_refreshTimer = new QTimer( this ); |
63 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 64 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
64 | m_refreshTimer->start( 15000 ); | 65 | m_refreshTimer->start( 15000 ); |
65 | m_big_box = 0L; | 66 | m_big_box = 0L; |
66 | 67 | ||
67 | 68 | ||
68 | layout = new QVBoxLayout( this ); | 69 | layout = new QVBoxLayout( this ); |
69 | layout->addWidget( Frame ); | 70 | layout->addWidget( Frame ); |
70 | layout->addWidget( OwnerField ); | 71 | layout->addWidget( OwnerField ); |
71 | 72 | ||
72 | m_sv = new QScrollView( this ); | 73 | m_sv = new QScrollView( this ); |
73 | m_sv->setResizePolicy( QScrollView::AutoOneFit ); | 74 | m_sv->setResizePolicy( QScrollView::AutoOneFit ); |
74 | m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 75 | m_sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
75 | m_sv->setFrameShape( QFrame::NoFrame ); | 76 | m_sv->setFrameShape( QFrame::NoFrame ); |
76 | 77 | ||
77 | layout->addWidget( m_sv ); | 78 | layout->addWidget( m_sv ); |
78 | layout->setStretchFactor( m_sv,4 ); | 79 | layout->setStretchFactor( m_sv,4 ); |
79 | 80 | ||
80 | qApp->processEvents(); | 81 | qApp->processEvents(); |
81 | loadPlugins(); | 82 | loadPlugins(); |
82 | QPEApplication::showWidget( this ); | 83 | QPEApplication::showWidget( this ); |
83 | } | 84 | } |
84 | 85 | ||
85 | /** | 86 | /** |
86 | * Qcop receive method. | 87 | * Qcop receive method. |
87 | */ | 88 | */ |
88 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { | 89 | void Today::channelReceived( const QCString &msg, const QByteArray & data ) { |
89 | QDataStream stream( data, IO_ReadOnly ); | 90 | QDataStream stream( data, IO_ReadOnly ); |
90 | if ( msg == "message(QString)" ) { | 91 | if ( msg == "message(QString)" ) { |
91 | QString message; | 92 | QString message; |
92 | stream >> message; | 93 | stream >> message; |
93 | setOwnerField( message ); | 94 | setOwnerField( message ); |
94 | } | 95 | } |
95 | } | 96 | } |
96 | 97 | ||
97 | void Today::setRefreshTimer( int interval ) { | 98 | void Today::setRefreshTimer( int interval ) { |
98 | 99 | ||
99 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 100 | disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
100 | 101 | ||
101 | // 0 is "never" case | 102 | // 0 is "never" case |
102 | if ( !interval == 0 ) { | 103 | if ( !interval == 0 ) { |
103 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 104 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
104 | m_refreshTimer->changeInterval( interval ); | 105 | m_refreshTimer->changeInterval( interval ); |
105 | } | 106 | } |
106 | } | 107 | } |
107 | 108 | ||
108 | 109 | ||
109 | /** | 110 | /** |
110 | * Initialises the owner field with the default value, the username | 111 | * Initialises the owner field with the default value, the username |
111 | */ | 112 | */ |
112 | void Today::setOwnerField() { | 113 | void Today::setOwnerField() { |
113 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); | 114 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); |
114 | if ( QFile::exists( file ) ) { | 115 | if ( QFile::exists( file ) ) { |
115 | Contact cont = Contact::readVCard( file )[0]; | 116 | Contact cont = Contact::readVCard( file )[0]; |
116 | QString returnString = cont.fullName(); | 117 | QString returnString = cont.fullName(); |
117 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); | 118 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); |
118 | } else { | 119 | } else { |
119 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); | 120 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); |
120 | } | 121 | } |
121 | } | 122 | } |
122 | 123 | ||
123 | /** | 124 | /** |
124 | * Set the owner field with a given QString, for example per qcop. | 125 | * Set the owner field with a given QString, for example per qcop. |
125 | */ | 126 | */ |
126 | void Today::setOwnerField( QString &message ) { | 127 | void Today::setOwnerField( QString &message ) { |
127 | if ( !message.isEmpty() ) { | 128 | if ( !message.isEmpty() ) { |
128 | OwnerField->setText( "<b>" + message + "</b>" ); | 129 | OwnerField->setText( "<b>" + message + "</b>" ); |
129 | } | 130 | } |
130 | } | 131 | } |
131 | 132 | ||
132 | /** | 133 | /** |
133 | * Init stuff needed for today. Reads the config file. | 134 | * Init stuff needed for today. Reads the config file. |
134 | */ | 135 | */ |
135 | void Today::init() { | 136 | void Today::init() { |
136 | // read config | 137 | // read config |
137 | Config cfg( "today" ); | 138 | Config cfg( "today" ); |
138 | 139 | ||
139 | cfg.setGroup( "Plugins" ); | 140 | cfg.setGroup( "Plugins" ); |
140 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 141 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
141 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); | 142 | m_allApplets = cfg.readListEntry( "AllApplets", ',' ); |
142 | 143 | ||
143 | cfg.setGroup( "General" ); | 144 | cfg.setGroup( "General" ); |
144 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 145 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
145 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); | 146 | m_hideBanner = cfg.readNumEntry( "HideBanner", 0 ); |
146 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); | 147 | setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); |
147 | 148 | ||
148 | // set the date in top label | 149 | // set the date in top label |
149 | QDate date = QDate::currentDate(); | 150 | QDate date = QDate::currentDate(); |
150 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); | 151 | DateLabel->setText( QString( "<font color=#FFFFFF>" + TimeString::longDateString( date ) + "</font>" ) ); |
151 | 152 | ||
152 | if ( m_hideBanner ) { | 153 | if ( m_hideBanner ) { |
153 | Opiezilla->hide(); | 154 | Opiezilla->hide(); |
154 | TodayLabel->hide(); | 155 | TodayLabel->hide(); |
155 | } else { | 156 | } else { |
156 | Opiezilla->show(); | 157 | Opiezilla->show(); |
157 | TodayLabel->show(); | 158 | TodayLabel->show(); |
158 | } | 159 | } |
diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 972731c..89170e1 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h | |||
@@ -1,83 +1,82 @@ | |||
1 | /* | 1 | /* |
2 | * today.h | 2 | * today.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002,2003,2004 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003,2004 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 | #ifndef TODAY_H | 16 | #ifndef TODAY_H |
17 | #define TODAY_H | 17 | #define TODAY_H |
18 | 18 | ||
19 | 19 | ||
20 | #include "todayconfig.h" | 20 | #include "todayconfig.h" |
21 | #include "todaybase.h" | 21 | #include "todaybase.h" |
22 | 22 | ||
23 | #include <opie2/todayplugininterface.h> | 23 | #include <opie2/todayplugininterface.h> |
24 | #include <opie2/oclickablelabel.h> | 24 | #include <opie2/oclickablelabel.h> |
25 | 25 | ||
26 | #include <qpe/qlibrary.h> | 26 | #include <qpe/qlibrary.h> |
27 | 27 | ||
28 | #include <qscrollview.h> | 28 | #include <qscrollview.h> |
29 | #include <qvbox.h> | 29 | #include <qvbox.h> |
30 | 30 | ||
31 | using namespace Opie; | ||
32 | 31 | ||
33 | class QVBoxLayout; | 32 | class QVBoxLayout; |
34 | 33 | ||
35 | class Today : public TodayBase { | 34 | class Today : public TodayBase { |
36 | 35 | ||
37 | Q_OBJECT | 36 | Q_OBJECT |
38 | 37 | ||
39 | public: | 38 | public: |
40 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 39 | Today( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
41 | ~Today(); | 40 | ~Today(); |
42 | static QString appName() { return QString::fromLatin1("today"); } | 41 | static QString appName() { return QString::fromLatin1("today"); } |
43 | 42 | ||
44 | private slots: | 43 | private slots: |
45 | void startConfig(); | 44 | void startConfig(); |
46 | void startApplication(); | 45 | void startApplication(); |
47 | void editCard(); | 46 | void editCard(); |
48 | void refresh(); | 47 | void refresh(); |
49 | 48 | ||
50 | private: | 49 | private: |
51 | void init(); | 50 | void init(); |
52 | void setOwnerField(); | 51 | void setOwnerField(); |
53 | void setOwnerField(QString &string); | 52 | void setOwnerField(QString &string); |
54 | void loadPlugins(); | 53 | void loadPlugins(); |
55 | void draw(); | 54 | void draw(); |
56 | void reinitialize(); | 55 | void reinitialize(); |
57 | 56 | ||
58 | void setRefreshTimer( int ); | 57 | void setRefreshTimer( int ); |
59 | 58 | ||
60 | private slots: | 59 | private slots: |
61 | void channelReceived(const QCString &msg, const QByteArray & data); | 60 | void channelReceived(const QCString &msg, const QByteArray & data); |
62 | 61 | ||
63 | private: | 62 | private: |
64 | TodayConfig *conf; | 63 | TodayConfig *conf; |
65 | QStringList m_excludeApplets; | 64 | QStringList m_excludeApplets; |
66 | QStringList m_allApplets; | 65 | QStringList m_allApplets; |
67 | 66 | ||
68 | QScrollView *m_sv; | 67 | QScrollView *m_sv; |
69 | QWidget* m_big_box; | 68 | QWidget* m_big_box; |
70 | QVBoxLayout *m_bblayout; | 69 | QVBoxLayout *m_bblayout; |
71 | 70 | ||
72 | 71 | ||
73 | 72 | ||
74 | QTimer *m_refreshTimer; | 73 | QTimer *m_refreshTimer; |
75 | 74 | ||
76 | bool m_refreshTimerEnabled; | 75 | bool m_refreshTimerEnabled; |
77 | int m_newStart; | 76 | int m_newStart; |
78 | int m_iconSize; | 77 | int m_iconSize; |
79 | int m_maxCharClip; | 78 | int m_maxCharClip; |
80 | int m_hideBanner; | 79 | int m_hideBanner; |
81 | }; | 80 | }; |
82 | 81 | ||
83 | #endif | 82 | #endif |
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index 7f1915c..cb809d3 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -1,107 +1,108 @@ | |||
1 | /* | 1 | /* |
2 | * todaybase.cpp | 2 | * todaybase.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003, 2004 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 "todaybase.h" | 17 | #include "todaybase.h" |
18 | 18 | ||
19 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
20 | 20 | ||
21 | #include <qvbox.h> | 21 | #include <qvbox.h> |
22 | #include <qwhatsthis.h> | 22 | #include <qwhatsthis.h> |
23 | 23 | ||
24 | using namespace Opie::Ui; | ||
24 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) | 25 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags ) |
25 | : QWidget( parent, name, WStyle_ContextHelp ) { | 26 | : QWidget( parent, name, WStyle_ContextHelp ) { |
26 | 27 | ||
27 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo | 28 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo |
28 | QImage opiezillaimage = QImage( Resource::loadImage("logo/opielogo" ) ); | 29 | QImage opiezillaimage = QImage( Resource::loadImage("logo/opielogo" ) ); |
29 | opiezillaimage = opiezillaimage.smoothScale( 45, 45 ); | 30 | opiezillaimage = opiezillaimage.smoothScale( 45, 45 ); |
30 | QPixmap opiezilla; //the opiezilla | 31 | QPixmap opiezilla; //the opiezilla |
31 | opiezilla.convertFromImage( opiezillaimage ); | 32 | opiezilla.convertFromImage( opiezillaimage ); |
32 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon | 33 | QPixmap config = Resource::loadPixmap( "SettingsIcon" ); // config icon |
33 | 34 | ||
34 | layout = 0L; | 35 | layout = 0L; |
35 | 36 | ||
36 | QPalette pal = this->palette(); | 37 | QPalette pal = this->palette(); |
37 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); | 38 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
38 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); | 39 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
39 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); | 40 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
40 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); | 41 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
41 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); | 42 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
42 | this->setPalette( pal ); | 43 | this->setPalette( pal ); |
43 | 44 | ||
44 | // --- logo Section --- | 45 | // --- logo Section --- |
45 | QPalette pal2; | 46 | QPalette pal2; |
46 | QColorGroup cg; | 47 | QColorGroup cg; |
47 | cg.setColor( QColorGroup::Text, white ); | 48 | cg.setColor( QColorGroup::Text, white ); |
48 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); | 49 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230 ), logo ) ); |
49 | pal2.setActive( cg ); | 50 | pal2.setActive( cg ); |
50 | 51 | ||
51 | // today logo | 52 | // today logo |
52 | Frame = new QLabel( this, "Frame" ); | 53 | Frame = new QLabel( this, "Frame" ); |
53 | Frame->setPalette( pal2 ); | 54 | Frame->setPalette( pal2 ); |
54 | Frame->setFrameShape( QFrame::StyledPanel ); | 55 | Frame->setFrameShape( QFrame::StyledPanel ); |
55 | Frame->setFrameShadow( QFrame::Raised ); | 56 | Frame->setFrameShadow( QFrame::Raised ); |
56 | Frame->setLineWidth( 0 ); | 57 | Frame->setLineWidth( 0 ); |
57 | 58 | ||
58 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); | 59 | QHBoxLayout *frameLayout = new QHBoxLayout( Frame ); |
59 | QVBox *box1 = new QVBox( Frame ); | 60 | QVBox *box1 = new QVBox( Frame ); |
60 | 61 | ||
61 | // Today text | 62 | // Today text |
62 | TodayLabel = new QLabel( box1, "TodayText" ); | 63 | TodayLabel = new QLabel( box1, "TodayText" ); |
63 | QFont TodayLabel_font( TodayLabel->font() ); | 64 | QFont TodayLabel_font( TodayLabel->font() ); |
64 | TodayLabel_font.setBold( TRUE ); | 65 | TodayLabel_font.setBold( TRUE ); |
65 | TodayLabel_font.setPointSize( 40 ); | 66 | TodayLabel_font.setPointSize( 40 ); |
66 | TodayLabel->setFont( TodayLabel_font ); | 67 | TodayLabel->setFont( TodayLabel_font ); |
67 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 68 | TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
68 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); | 69 | TodayLabel->setText( "<font color=#FFFFFF>" + tr("Today") +"</font>" ); |
69 | 70 | ||
70 | // date | 71 | // date |
71 | DateLabel = new QLabel( box1, "TextLabel1" ); | 72 | DateLabel = new QLabel( box1, "TextLabel1" ); |
72 | QFont DateLabel_font( DateLabel->font() ); | 73 | QFont DateLabel_font( DateLabel->font() ); |
73 | DateLabel_font.setBold( TRUE ); | 74 | DateLabel_font.setBold( TRUE ); |
74 | DateLabel->setFont( DateLabel_font ); | 75 | DateLabel->setFont( DateLabel_font ); |
75 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); | 76 | DateLabel->setBackgroundOrigin( QLabel::ParentOrigin ); |
76 | DateLabel->setTextFormat( RichText ); | 77 | DateLabel->setTextFormat( RichText ); |
77 | 78 | ||
78 | // Opiezilla | 79 | // Opiezilla |
79 | Opiezilla = new QLabel( Frame, "OpieZilla" ); | 80 | Opiezilla = new QLabel( Frame, "OpieZilla" ); |
80 | Opiezilla->setPixmap( opiezilla ); | 81 | Opiezilla->setPixmap( opiezilla ); |
81 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); | 82 | QWhatsThis::add( Opiezilla , tr( "Today by Maximilian Reiß" ) ); |
82 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); | 83 | Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin ); |
83 | 84 | ||
84 | 85 | ||
85 | // Ownerfield | 86 | // Ownerfield |
86 | OwnerField = new OClickableLabel( this , "Owner" ); | 87 | OwnerField = new OClickableLabel( this , "Owner" ); |
87 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); | 88 | OwnerField->setAlignment( int (QLabel::AlignTop | QLabel::AlignLeft ) ); |
88 | 89 | ||
89 | // config | 90 | // config |
90 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); | 91 | ConfigButton = new OClickableLabel ( Frame, "PushButton1" ); |
91 | ConfigButton->setPixmap( config ); | 92 | ConfigButton->setPixmap( config ); |
92 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); | 93 | QWhatsThis::add( ConfigButton, tr( "Click here to get to the config dialog" ) ); |
93 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); | 94 | ConfigButton->setBackgroundOrigin( QLabel::ParentOrigin ); |
94 | 95 | ||
95 | frameLayout->addWidget( box1, 1 ); | 96 | frameLayout->addWidget( box1, 1 ); |
96 | frameLayout->addStretch( 1 ); | 97 | frameLayout->addStretch( 1 ); |
97 | frameLayout->addWidget( ConfigButton, 0, AlignBottom ); | 98 | frameLayout->addWidget( ConfigButton, 0, AlignBottom ); |
98 | frameLayout->addWidget( Opiezilla ); | 99 | frameLayout->addWidget( Opiezilla ); |
99 | } | 100 | } |
100 | 101 | ||
101 | 102 | ||
102 | /** | 103 | /** |
103 | * D' tor | 104 | * D' tor |
104 | */ | 105 | */ |
105 | TodayBase::~TodayBase() { | 106 | TodayBase::~TodayBase() { |
106 | } | 107 | } |
107 | 108 | ||
diff --git a/core/pim/today/todaybase.h b/core/pim/today/todaybase.h index b737351..6ee9bb2 100644 --- a/core/pim/today/todaybase.h +++ b/core/pim/today/todaybase.h | |||
@@ -1,56 +1,55 @@ | |||
1 | /* | 1 | /* |
2 | * todaybase.h | 2 | * todaybase.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003, 2004 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 TODAYBASE_H | 17 | #ifndef TODAYBASE_H |
18 | #define TODAYBASE_H | 18 | #define TODAYBASE_H |
19 | 19 | ||
20 | #include <opie2/oclickablelabel.h> | 20 | #include <opie2/oclickablelabel.h> |
21 | 21 | ||
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | 23 | ||
24 | class QVBox; | 24 | class QVBox; |
25 | class QGridLayout; | 25 | class QGridLayout; |
26 | class QFrame; | 26 | class QFrame; |
27 | class QLabel; | 27 | class QLabel; |
28 | class QPushButton; | 28 | class QPushButton; |
29 | class QBoxLayout; | 29 | class QBoxLayout; |
30 | 30 | ||
31 | 31 | ||
32 | using namespace Opie; | ||
33 | 32 | ||
34 | 33 | ||
35 | class TodayBase : public QWidget | 34 | class TodayBase : public QWidget |
36 | { | 35 | { |
37 | Q_OBJECT | 36 | Q_OBJECT |
38 | 37 | ||
39 | public: | 38 | public: |
40 | TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 ); | 39 | TodayBase( QWidget* parent = 0, const char* name = 0, WFlags = 0 ); |
41 | ~TodayBase(); | 40 | ~TodayBase(); |
42 | 41 | ||
43 | QFrame* Frame4; | 42 | QFrame* Frame4; |
44 | QPushButton* DatesButton; | 43 | QPushButton* DatesButton; |
45 | QVBoxLayout* layout; | 44 | QVBoxLayout* layout; |
46 | Opie::OClickableLabel* OwnerField; | 45 | Opie::Ui::OClickableLabel* OwnerField; |
47 | QLabel* Frame; | 46 | QLabel* Frame; |
48 | QLabel* DateLabel; | 47 | QLabel* DateLabel; |
49 | QFrame* Frame15; | 48 | QFrame* Frame15; |
50 | QLabel* Opiezilla; | 49 | QLabel* Opiezilla; |
51 | QLabel* TodayLabel; | 50 | QLabel* TodayLabel; |
52 | OClickableLabel* ConfigButton; | 51 | Opie::Ui::OClickableLabel* ConfigButton; |
53 | 52 | ||
54 | }; | 53 | }; |
55 | 54 | ||
56 | #endif | 55 | #endif |
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp index a6f53e1..4f0877c 100644 --- a/core/pim/today/todayconfig.cpp +++ b/core/pim/today/todayconfig.cpp | |||
@@ -1,160 +1,161 @@ | |||
1 | /* | 1 | /* |
2 | * todayconfig.cpp | 2 | * todayconfig.cpp |
3 | * | 3 | * |
4 | * copyright : (c) 2002, 2003, 2004 by Maximilian Reiß | 4 | * copyright : (c) 2002, 2003, 2004 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 "todayconfig.h" | 17 | #include "todayconfig.h" |
18 | 18 | ||
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include <qpe/qcopenvelope_qws.h> | 21 | #include <qpe/qcopenvelope_qws.h> |
22 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
23 | 23 | ||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qspinbox.h> | 26 | #include <qspinbox.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qheader.h> | 28 | #include <qheader.h> |
29 | #include <qvbox.h> | 29 | #include <qvbox.h> |
30 | #include <qtoolbutton.h> | 30 | #include <qtoolbutton.h> |
31 | #include <qwhatsthis.h> | 31 | #include <qwhatsthis.h> |
32 | 32 | ||
33 | using namespace Opie::Ui; | ||
33 | class ToolButton : public QToolButton { | 34 | class ToolButton : public QToolButton { |
34 | 35 | ||
35 | public: | 36 | public: |
36 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 37 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
37 | : QToolButton( parent, name ) { | 38 | : QToolButton( parent, name ) { |
38 | setPixmap( Resource::loadPixmap( icon ) ); | 39 | setPixmap( Resource::loadPixmap( icon ) ); |
39 | setAutoRaise( TRUE ); | 40 | setAutoRaise( TRUE ); |
40 | setFocusPolicy( QWidget::NoFocus ); | 41 | setFocusPolicy( QWidget::NoFocus ); |
41 | setToggleButton( t ); | 42 | setToggleButton( t ); |
42 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 43 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
43 | } | 44 | } |
44 | }; | 45 | }; |
45 | 46 | ||
46 | 47 | ||
47 | /** | 48 | /** |
48 | * The class has currently quite some duplicate code. | 49 | * The class has currently quite some duplicate code. |
49 | * By that way it would be real easy to have it as seperate app in settings tab | 50 | * By that way it would be real easy to have it as seperate app in settings tab |
50 | * | 51 | * |
51 | */ | 52 | */ |
52 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) | 53 | TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal ) |
53 | : QDialog( parent, name, modal, WStyle_ContextHelp ) { | 54 | : QDialog( parent, name, modal, WStyle_ContextHelp ) { |
54 | 55 | ||
55 | setCaption( tr( "Today Config" ) ); | 56 | setCaption( tr( "Today Config" ) ); |
56 | 57 | ||
57 | QVBoxLayout *layout = new QVBoxLayout( this ); | 58 | QVBoxLayout *layout = new QVBoxLayout( this ); |
58 | TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 59 | TabWidget3 = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
59 | layout->addWidget( TabWidget3 ); | 60 | layout->addWidget( TabWidget3 ); |
60 | 61 | ||
61 | tab_2 = new QWidget( TabWidget3, "tab_2" ); | 62 | tab_2 = new QWidget( TabWidget3, "tab_2" ); |
62 | QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); | 63 | QVBoxLayout *tab2Layout = new QVBoxLayout( tab_2, 4 ,4 ); |
63 | QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); | 64 | QLabel *l = new QLabel( tr( "Load which plugins in what order:" ), tab_2 ); |
64 | tab2Layout->addWidget( l ); | 65 | tab2Layout->addWidget( l ); |
65 | QHBox *hbox1 = new QHBox( tab_2 ); | 66 | QHBox *hbox1 = new QHBox( tab_2 ); |
66 | m_appletListView = new QListView( hbox1 ); | 67 | m_appletListView = new QListView( hbox1 ); |
67 | m_appletListView->addColumn( "PluginList" ); | 68 | m_appletListView->addColumn( "PluginList" ); |
68 | m_appletListView->header()->hide(); | 69 | m_appletListView->header()->hide(); |
69 | m_appletListView->setSorting( -1 ); | 70 | m_appletListView->setSorting( -1 ); |
70 | QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) ); | 71 | QWhatsThis::add( m_appletListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the appearance order" ) ); |
71 | QVBox *vbox1 = new QVBox( hbox1 ); | 72 | QVBox *vbox1 = new QVBox( hbox1 ); |
72 | new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); | 73 | new ToolButton( vbox1, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); |
73 | new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); | 74 | new ToolButton( vbox1, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); |
74 | tab2Layout->addWidget( hbox1 ); | 75 | tab2Layout->addWidget( hbox1 ); |
75 | TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); | 76 | TabWidget3->addTab( tab_2, "pass", tr( "active/order" ) ); |
76 | 77 | ||
77 | // Misc tab | 78 | // Misc tab |
78 | tab_3 = new QWidget( TabWidget3, "tab_3" ); | 79 | tab_3 = new QWidget( TabWidget3, "tab_3" ); |
79 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); | 80 | QVBoxLayout *tab3Layout = new QVBoxLayout( tab_3 ); |
80 | 81 | ||
81 | m_guiMisc = new TodayConfigMiscBase( tab_3 ); | 82 | m_guiMisc = new TodayConfigMiscBase( tab_3 ); |
82 | 83 | ||
83 | tab3Layout->addWidget( m_guiMisc ); | 84 | tab3Layout->addWidget( m_guiMisc ); |
84 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); | 85 | TabWidget3->addTab( tab_3, "SettingsIcon", tr( "Misc" ) ); |
85 | 86 | ||
86 | m_applets_changed = false; | 87 | m_applets_changed = false; |
87 | 88 | ||
88 | connect ( m_appletListView , SIGNAL( clicked(QListViewItem*) ), this, SLOT( appletChanged() ) ); | 89 | connect ( m_appletListView , SIGNAL( clicked(QListViewItem*) ), this, SLOT( appletChanged() ) ); |
89 | 90 | ||
90 | readConfig(); | 91 | readConfig(); |
91 | QPEApplication::showDialog( this ); | 92 | QPEApplication::showDialog( this ); |
92 | } | 93 | } |
93 | 94 | ||
94 | 95 | ||
95 | /** | 96 | /** |
96 | * Autostart, uses the new (opie only) autostart method in the launcher code. | 97 | * Autostart, uses the new (opie only) autostart method in the launcher code. |
97 | * If registered against that today ist started on each resume. | 98 | * If registered against that today ist started on each resume. |
98 | */ | 99 | */ |
99 | void TodayConfig::setAutoStart() { | 100 | void TodayConfig::setAutoStart() { |
100 | Config cfg( "today" ); | 101 | Config cfg( "today" ); |
101 | cfg.setGroup( "Autostart" ); | 102 | cfg.setGroup( "Autostart" ); |
102 | if ( m_autoStart ) { | 103 | if ( m_autoStart ) { |
103 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); | 104 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString,QString)" ); |
104 | e << QString( "add" ); | 105 | e << QString( "add" ); |
105 | e << QString( "today" ); | 106 | e << QString( "today" ); |
106 | e << QString( "%1" ).arg( m_autoStartTimer ); | 107 | e << QString( "%1" ).arg( m_autoStartTimer ); |
107 | } else { | 108 | } else { |
108 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); | 109 | QCopEnvelope e( "QPE/System", "autoStart(QString,QString)" ); |
109 | e << QString( "remove" ); | 110 | e << QString( "remove" ); |
110 | e << QString( "today" ); | 111 | e << QString( "today" ); |
111 | } | 112 | } |
112 | } | 113 | } |
113 | 114 | ||
114 | /** | 115 | /** |
115 | * Read the config part | 116 | * Read the config part |
116 | */ | 117 | */ |
117 | void TodayConfig::readConfig() { | 118 | void TodayConfig::readConfig() { |
118 | Config cfg( "today" ); | 119 | Config cfg( "today" ); |
119 | cfg.setGroup( "Autostart" ); | 120 | cfg.setGroup( "Autostart" ); |
120 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); | 121 | m_autoStart = cfg.readNumEntry( "autostart", 1 ); |
121 | m_guiMisc->CheckBoxAuto->setChecked( m_autoStart ); | 122 | m_guiMisc->CheckBoxAuto->setChecked( m_autoStart ); |
122 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); | 123 | m_autoStartTimer = cfg.readNumEntry( "autostartdelay", 0 ); |
123 | m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer ); | 124 | m_guiMisc->SpinBoxTime->setValue( m_autoStartTimer ); |
124 | 125 | ||
125 | cfg.setGroup( "General" ); | 126 | cfg.setGroup( "General" ); |
126 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); | 127 | m_iconSize = cfg.readNumEntry( "IconSize", 18 ); |
127 | m_guiMisc->SpinBoxIconSize->setValue( m_iconSize ); | 128 | m_guiMisc->SpinBoxIconSize->setValue( m_iconSize ); |
128 | m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); | 129 | m_guiMisc->SpinRefresh->setValue( cfg.readNumEntry( "checkinterval", 15000 ) / 1000 ); |
129 | m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); | 130 | m_guiMisc->CheckBoxHide->setChecked( cfg.readNumEntry( "HideBanner", 0 ) ); |
130 | 131 | ||
131 | 132 | ||
132 | cfg.setGroup( "Plugins" ); | 133 | cfg.setGroup( "Plugins" ); |
133 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); | 134 | m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); |
134 | } | 135 | } |
135 | 136 | ||
136 | /** | 137 | /** |
137 | * Write the config part | 138 | * Write the config part |
138 | */ | 139 | */ |
139 | void TodayConfig::writeConfig() { | 140 | void TodayConfig::writeConfig() { |
140 | Config cfg( "today" ); | 141 | Config cfg( "today" ); |
141 | cfg.setGroup( "Plugins" ); | 142 | cfg.setGroup( "Plugins" ); |
142 | if ( m_applets_changed ) { | 143 | if ( m_applets_changed ) { |
143 | QStringList exclude; | 144 | QStringList exclude; |
144 | QStringList include; | 145 | QStringList include; |
145 | QStringList all_applets; | 146 | QStringList all_applets; |
146 | 147 | ||
147 | QListViewItemIterator list_it( m_appletListView ); | 148 | QListViewItemIterator list_it( m_appletListView ); |
148 | 149 | ||
149 | // this makes sure the names get saved in the order selected | 150 | // this makes sure the names get saved in the order selected |
150 | for ( ; list_it.current(); ++list_it ) { | 151 | for ( ; list_it.current(); ++list_it ) { |
151 | QMap <QString, QCheckListItem *>::Iterator it; | 152 | QMap <QString, QCheckListItem *>::Iterator it; |
152 | for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { | 153 | for ( it = m_applets.begin(); it != m_applets. end (); ++it ) { |
153 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { | 154 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { |
154 | exclude << it.key(); | 155 | exclude << it.key(); |
155 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ | 156 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ |
156 | include << it.key(); | 157 | include << it.key(); |
157 | } | 158 | } |
158 | if ( list_it.current() == (*it) ) { | 159 | if ( list_it.current() == (*it) ) { |
159 | all_applets << it.key(); | 160 | all_applets << it.key(); |
160 | } | 161 | } |
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h index 3b585c9..2b6c507 100644 --- a/core/pim/today/todayconfig.h +++ b/core/pim/today/todayconfig.h | |||
@@ -1,73 +1,73 @@ | |||
1 | /* | 1 | /* |
2 | * todayconfig.h | 2 | * todayconfig.h |
3 | * | 3 | * |
4 | * copyright : (c) 2002,2003, 2004 by Maximilian Reiß | 4 | * copyright : (c) 2002,2003, 2004 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 TODAYCONFIG_H | 17 | #ifndef TODAYCONFIG_H |
18 | #define TODAYCONFIG_H | 18 | #define TODAYCONFIG_H |
19 | 19 | ||
20 | #include "todayconfigmiscbase.h" | 20 | #include "todayconfigmiscbase.h" |
21 | 21 | ||
22 | #include <opie2/otabwidget.h> | 22 | #include <opie2/otabwidget.h> |
23 | 23 | ||
24 | #include <qvariant.h> | 24 | #include <qvariant.h> |
25 | #include <qdialog.h> | 25 | #include <qdialog.h> |
26 | #include <qlistview.h> | 26 | #include <qlistview.h> |
27 | 27 | ||
28 | class QCheckBox; | 28 | class QCheckBox; |
29 | class QLabel; | 29 | class QLabel; |
30 | class QSpinBox; | 30 | class QSpinBox; |
31 | class QTabWidget; | 31 | class QTabWidget; |
32 | 32 | ||
33 | class TodayConfig : public QDialog { | 33 | class TodayConfig : public QDialog { |
34 | 34 | ||
35 | Q_OBJECT | 35 | Q_OBJECT |
36 | 36 | ||
37 | public: | 37 | public: |
38 | TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE ); | 38 | TodayConfig( QWidget* parent = 0, const char* name = 0, bool modal = FALSE ); |
39 | ~TodayConfig(); | 39 | ~TodayConfig(); |
40 | 40 | ||
41 | OTabWidget* TabWidget3; | 41 | Opie::Ui::OTabWidget* TabWidget3; |
42 | 42 | ||
43 | void writeConfig(); | 43 | void writeConfig(); |
44 | void pluginManagement( QString libName, QString name, QPixmap icon ); | 44 | void pluginManagement( QString libName, QString name, QPixmap icon ); |
45 | 45 | ||
46 | 46 | ||
47 | protected slots: | 47 | protected slots: |
48 | void appletChanged(); | 48 | void appletChanged(); |
49 | void moveSelectedUp(); | 49 | void moveSelectedUp(); |
50 | void moveSelectedDown(); | 50 | void moveSelectedDown(); |
51 | 51 | ||
52 | private: | 52 | private: |
53 | void setAutoStart(); | 53 | void setAutoStart(); |
54 | void readConfig(); | 54 | void readConfig(); |
55 | 55 | ||
56 | QListView* m_appletListView; | 56 | QListView* m_appletListView; |
57 | QMap<QString,QCheckListItem*> m_applets; | 57 | QMap<QString,QCheckListItem*> m_applets; |
58 | 58 | ||
59 | int m_autoStart; | 59 | int m_autoStart; |
60 | int m_autoStartTimer; | 60 | int m_autoStartTimer; |
61 | int m_iconSize; | 61 | int m_iconSize; |
62 | QStringList m_excludeApplets; | 62 | QStringList m_excludeApplets; |
63 | bool m_applets_changed; | 63 | bool m_applets_changed; |
64 | 64 | ||
65 | QWidget* tab_2; | 65 | QWidget* tab_2; |
66 | QWidget* tab_3; | 66 | QWidget* tab_3; |
67 | QLabel* TextLabel1, *TextLabel4; | 67 | QLabel* TextLabel1, *TextLabel4; |
68 | QSpinBox* SpinBox7; | 68 | QSpinBox* SpinBox7; |
69 | 69 | ||
70 | TodayConfigMiscBase *m_guiMisc; | 70 | TodayConfigMiscBase *m_guiMisc; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | #endif | 73 | #endif |