author | zautrix <zautrix> | 2005-03-24 12:34:27 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-24 12:34:27 (UTC) |
commit | 685d04bc8f696697202f2fc0de18e61905cbb2fa (patch) (unidiff) | |
tree | 927d070c135d0025b236f6bd76143e0341ef2566 /korganizer | |
parent | a9e8535fd6960f454ab7009cfa996973291502a2 (diff) | |
download | kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.zip kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.tar.gz kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.tar.bz2 |
layout fix
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 74 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.h | 8 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 4 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 18 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 |
6 files changed, 65 insertions, 45 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index d1caff3..2290c53 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -1,401 +1,415 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org> |
5 | Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> | 5 | Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 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 | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <kdebug.h> | 26 | #include <kdebug.h> |
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | 28 | ||
29 | //#include "koglobals.h" | 29 | //#include "koglobals.h" |
30 | #include "navigatorbar.h" | 30 | #include "navigatorbar.h" |
31 | #include "kdatenavigator.h" | 31 | #include "kdatenavigator.h" |
32 | 32 | ||
33 | #include <kcalendarsystem.h> | 33 | #include <kcalendarsystem.h> |
34 | 34 | ||
35 | #include "datenavigatorcontainer.h" | 35 | #include "datenavigatorcontainer.h" |
36 | #include "koprefs.h" | 36 | #include "koprefs.h" |
37 | 37 | ||
38 | DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, | 38 | DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, |
39 | const char *name ) | 39 | const char *name ) |
40 | : QWidget( parent, name ), mCalendar( 0 ), | 40 | : QWidget( parent, name ), mCalendar( 0 ), |
41 | mHorizontalCount( 1 ), mVerticalCount( 1 ) | 41 | mHorizontalCount( 1 ), mVerticalCount( 1 ) |
42 | { | 42 | { |
43 | mExtraViews.setAutoDelete( true ); | 43 | mExtraViews.setAutoDelete( true ); |
44 | 44 | ||
45 | mNavigatorView = new KDateNavigator( this, name ); | 45 | mNavigatorView = new KDateNavigator( this, name ); |
46 | 46 | ||
47 | connectNavigatorView( mNavigatorView ); | 47 | connectNavigatorView( mNavigatorView ); |
48 | //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 48 | //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
49 | mLastDisplayedDN = 0; | 49 | mLastDisplayedDN = 0; |
50 | mUpdateTimer; | 50 | mUpdateTimer; |
51 | mUpdateTimer = new QTimer( this ); | 51 | mUpdateTimer = new QTimer( this ); |
52 | connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); | 52 | connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); |
53 | mFirstSelectedDate = QDate::currentDate(); | 53 | mFirstSelectedDate = QDate::currentDate(); |
54 | mSelectedDateCount = 1; | 54 | mSelectedDateCount = 1; |
55 | } | 55 | } |
56 | 56 | ||
57 | DateNavigatorContainer::~DateNavigatorContainer() | 57 | DateNavigatorContainer::~DateNavigatorContainer() |
58 | { | 58 | { |
59 | } | 59 | } |
60 | 60 | ||
61 | void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) | 61 | void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) |
62 | { | 62 | { |
63 | connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), | 63 | connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), |
64 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); | 64 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); |
65 | #if 0 | 65 | #if 0 |
66 | connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), | 66 | connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), |
67 | SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); | 67 | SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); |
68 | connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), | 68 | connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), |
69 | SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); | 69 | SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); |
70 | #endif | 70 | #endif |
71 | connect( v, SIGNAL( weekClicked( const QDate & ) ), | 71 | connect( v, SIGNAL( weekClicked( const QDate & ) ), |
72 | SIGNAL( weekClicked( const QDate & ) ) ); | 72 | SIGNAL( weekClicked( const QDate & ) ) ); |
73 | 73 | ||
74 | connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); | 74 | connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); |
75 | connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); | 75 | connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); |
76 | 76 | ||
77 | connect( v, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); | 77 | connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) ); |
78 | connect( v, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); | 78 | connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) ); |
79 | connect( v, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); | 79 | connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) ); |
80 | connect( v, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); | 80 | connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) ); |
81 | 81 | ||
82 | connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); | 82 | connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); |
83 | } | 83 | } |
84 | void DateNavigatorContainer::slotgoNextYear() | ||
85 | { | ||
86 | jumpMonth( 12 ); | ||
87 | emit goNextYear(); | ||
88 | |||
89 | } | ||
90 | void DateNavigatorContainer::slotgoPrevYear() | ||
91 | { | ||
92 | jumpMonth( -12 ); | ||
93 | emit goPrevYear(); | ||
94 | |||
95 | } | ||
96 | void DateNavigatorContainer::slotgoPrevMonth() | ||
97 | { | ||
98 | jumpMonth( -1 ); | ||
99 | emit goPrevMonth(); | ||
100 | |||
101 | } | ||
102 | void DateNavigatorContainer::slotgoNextMonth() | ||
103 | { | ||
104 | jumpMonth( 1 ); | ||
105 | emit goNextMonth(); | ||
106 | } | ||
107 | void DateNavigatorContainer::jumpMonth( int month ) | ||
108 | { | ||
84 | 109 | ||
110 | QDate baseDate = mNavigatorView->baseDate(); | ||
111 | computeMonthSelected( baseDate.month() + month, false ); | ||
112 | } | ||
85 | void DateNavigatorContainer::slotMonthSelected( int month ) | 113 | void DateNavigatorContainer::slotMonthSelected( int month ) |
86 | { | 114 | { |
87 | //qDebug("slotMonthSelected %d ", month); | 115 | computeMonthSelected( month, true ); |
116 | } | ||
117 | void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) | ||
118 | { | ||
119 | //qDebug("slotMonthSelected %d ", month); | ||
88 | QDate baseDate = mNavigatorView->baseDate(); | 120 | QDate baseDate = mNavigatorView->baseDate(); |
89 | if ( baseDate.month() == month ) | 121 | if ( baseDate.month() == month ) |
90 | return; | 122 | return; |
91 | //qDebug("month %d %d ",baseDate.month(),month); | 123 | //qDebug("month %d %d ",baseDate.month(),month); |
92 | QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); | 124 | QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); |
93 | date = date.addDays( -(baseDate.month()-month ) *30 ); | 125 | date = date.addDays( -(baseDate.month()-month ) *30 ); |
94 | QDate newBase = QDate ( date.year(), date.month() , baseDate.day() ); | 126 | QDate newBase = QDate ( date.year(), date.month() , baseDate.day() ); |
95 | 127 | ||
96 | #if 0 | ||
97 | mFirstSelectedDate = dateList.first() ; | ||
98 | mSelectedDateCount = dateList.count() ; | ||
99 | |||
100 | KDateNavigator *view = mExtraViews.at( 0 ); | ||
101 | QDate date = view->baseDate(); | ||
102 | |||
103 | QDate curEnd = date.addDays( (mLastDisplayedDN)*30 +7); | ||
104 | //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() ); | ||
105 | if ( lDate < curEnd && date.addDays( -30 ) < fDate) { | ||
106 | mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate ); | ||
107 | mNavigatorView->dayMatrix()->repaint( false ); | ||
108 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | ||
109 | KDateNavigator *n = mExtraViews.at( i ); | ||
110 | if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) { | ||
111 | n->dayMatrix()->repaint( false ); | ||
112 | } | ||
113 | } | ||
114 | return; | ||
115 | } | ||
116 | #endif | ||
117 | //qDebug("NEW BASE %s", newBase.toString().latin1()); | 128 | //qDebug("NEW BASE %s", newBase.toString().latin1()); |
118 | mNavigatorView->setBaseDate( newBase ); | 129 | mNavigatorView->setBaseDate( newBase ); |
119 | QDate last = lastAvailableDate(); | 130 | QDate last = lastAvailableDate(); |
120 | QDate first = firstAvailableDate(); | 131 | QDate first = firstAvailableDate(); |
121 | 132 | ||
122 | QDate selFirst = mFirstSelectedDate; | 133 | QDate selFirst = mFirstSelectedDate; |
123 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); | 134 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); |
124 | if ( selFirst >= first && selLast <= last ) { | 135 | if ( selFirst >= first && selLast <= last ) { |
125 | setBaseDates(); | 136 | setBaseDates(); |
126 | updateDayMatrixDates(); | 137 | if ( forceEmit ) |
138 | updateDayMatrixDates(); | ||
127 | } | 139 | } |
128 | else { | 140 | else { |
129 | setBaseDates(); | 141 | setBaseDates(); |
130 | updateDayMatrixDates(); | 142 | if ( forceEmit ) |
131 | emit monthSelected( month ); | 143 | updateDayMatrixDates(); |
144 | if ( forceEmit ) | ||
145 | emit monthSelected( month ); | ||
132 | } | 146 | } |
133 | } | 147 | } |
134 | void DateNavigatorContainer::setCalendar( Calendar *cal ) | 148 | void DateNavigatorContainer::setCalendar( Calendar *cal ) |
135 | { | 149 | { |
136 | mCalendar = cal; | 150 | mCalendar = cal; |
137 | mNavigatorView->setCalendar( cal ); | 151 | mNavigatorView->setCalendar( cal ); |
138 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 152 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
139 | KDateNavigator *n = mExtraViews.at( i ); | 153 | KDateNavigator *n = mExtraViews.at( i ); |
140 | n->setCalendar( cal ); | 154 | n->setCalendar( cal ); |
141 | } | 155 | } |
142 | } | 156 | } |
143 | void DateNavigatorContainer::checkUpdateDayMatrixDates() | 157 | void DateNavigatorContainer::checkUpdateDayMatrixDates() |
144 | { | 158 | { |
145 | //qDebug("KODNC: wid %d hei %d ", width(), height()); | 159 | //qDebug("KODNC: wid %d hei %d ", width(), height()); |
146 | mUpdateTimer->stop(); | 160 | mUpdateTimer->stop(); |
147 | //return; | 161 | //return; |
148 | if ( width() < 3 || height() < 3 ) | 162 | if ( width() < 3 || height() < 3 ) |
149 | return; | 163 | return; |
150 | static int lastWid = 0; | 164 | static int lastWid = 0; |
151 | static int lastHei = 0; | 165 | static int lastHei = 0; |
152 | if ( lastWid == width() && height() == lastHei ) { | 166 | if ( lastWid == width() && height() == lastHei ) { |
153 | qDebug("KODNC: No layout computing needed. "); | 167 | qDebug("KODNC: No layout computing needed. "); |
154 | } else { | 168 | } else { |
155 | lastWid = width(); | 169 | lastWid = width(); |
156 | lastHei = height(); | 170 | lastHei = height(); |
157 | 171 | ||
158 | QSize minSize = mNavigatorView->yourSizeHint(); | 172 | QSize minSize = mNavigatorView->yourSizeHint(); |
159 | 173 | ||
160 | int verticalCount = size().height() / minSize.height(); | 174 | int verticalCount = size().height() / minSize.height(); |
161 | int horizontalCount = size().width() / minSize.width(); | 175 | int horizontalCount = size().width() / minSize.width(); |
162 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); | 176 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); |
163 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); | 177 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); |
164 | bool fontchange = false; | 178 | bool fontchange = false; |
165 | if ( horizontalCount == 1) | 179 | if ( horizontalCount == 1) |
166 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); | 180 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); |
167 | QFont fo; | 181 | QFont fo; |
168 | if ( horizontalCount != mHorizontalCount || | 182 | if ( horizontalCount != mHorizontalCount || |
169 | verticalCount != mVerticalCount ) { | 183 | verticalCount != mVerticalCount ) { |
170 | uint count = horizontalCount * verticalCount; | 184 | uint count = horizontalCount * verticalCount; |
171 | if ( count == 0 ) { | 185 | if ( count == 0 ) { |
172 | bool ok; | 186 | bool ok; |
173 | fo = mNavigatorView->yourFontHint( size() , &ok ); | 187 | fo = mNavigatorView->yourFontHint( size() , &ok ); |
174 | //mNavigatorView->resize( size() ); | 188 | //mNavigatorView->resize( size() ); |
175 | //if ( ! ok ) | 189 | //if ( ! ok ) |
176 | // return; | 190 | // return; |
177 | int butt = 2; | 191 | int butt = 2; |
178 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); | 192 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); |
179 | if ( horizontalCount <= 1 ) | 193 | if ( horizontalCount <= 1 ) |
180 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); | 194 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); |
181 | else | 195 | else |
182 | minSize = mNavigatorView->sizeHintTwoButtons(); | 196 | minSize = mNavigatorView->sizeHintTwoButtons(); |
183 | verticalCount = size().height() / minSize.height(); | 197 | verticalCount = size().height() / minSize.height(); |
184 | horizontalCount = size().width() / minSize.width(); | 198 | horizontalCount = size().width() / minSize.width(); |
185 | if ( horizontalCount == 0 ) | 199 | if ( horizontalCount == 0 ) |
186 | horizontalCount = 1; | 200 | horizontalCount = 1; |
187 | if ( verticalCount == 0 ) | 201 | if ( verticalCount == 0 ) |
188 | verticalCount = 1; | 202 | verticalCount = 1; |
189 | fontchange = true; | 203 | fontchange = true; |
190 | count = horizontalCount * verticalCount; | 204 | count = horizontalCount * verticalCount; |
191 | } else { | 205 | } else { |
192 | if ( mNavigatorView->fontChanged() ) { | 206 | if ( mNavigatorView->fontChanged() ) { |
193 | fontchange = true; | 207 | fontchange = true; |
194 | fo = KOPrefs::instance()->mDateNavigatorFont; | 208 | fo = KOPrefs::instance()->mDateNavigatorFont; |
195 | mNavigatorView->changeFont( fo ); | 209 | mNavigatorView->changeFont( fo ); |
196 | mNavigatorView->unsetFontChanged(); | 210 | mNavigatorView->unsetFontChanged(); |
197 | } | 211 | } |
198 | } | 212 | } |
199 | 213 | ||
200 | mLastDisplayedDN = horizontalCount*verticalCount-1; | 214 | mLastDisplayedDN = horizontalCount*verticalCount-1; |
201 | while ( count > ( mExtraViews.count() + 1 ) ) { | 215 | while ( count > ( mExtraViews.count() + 1 ) ) { |
202 | KDateNavigator *n = new KDateNavigator( this ); | 216 | KDateNavigator *n = new KDateNavigator( this ); |
203 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); | 217 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); |
204 | mExtraViews.append( n ); | 218 | mExtraViews.append( n ); |
205 | n->setCalendar( mCalendar ); | 219 | n->setCalendar( mCalendar ); |
206 | connectNavigatorView( n ); | 220 | connectNavigatorView( n ); |
207 | n->show(); | 221 | n->show(); |
208 | } | 222 | } |
209 | int iii = 0; | 223 | int iii = 0; |
210 | while ( iii < ( mExtraViews.count() ) ) { | 224 | while ( iii < ( mExtraViews.count() ) ) { |
211 | if ( iii < count-1 ) | 225 | if ( iii < count-1 ) |
212 | mExtraViews.at( iii )->show(); | 226 | mExtraViews.at( iii )->show(); |
213 | else | 227 | else |
214 | mExtraViews.at( iii )->hide(); | 228 | mExtraViews.at( iii )->hide(); |
215 | ++iii; | 229 | ++iii; |
216 | } | 230 | } |
217 | 231 | ||
218 | setBaseDates(); | 232 | setBaseDates(); |
219 | if ( fontchange ) { | 233 | if ( fontchange ) { |
220 | //mNavigatorView->changeFont( fo ); | 234 | //mNavigatorView->changeFont( fo ); |
221 | uint i; | 235 | uint i; |
222 | for( i = 0; i < mExtraViews.count(); ++i ) { | 236 | for( i = 0; i < mExtraViews.count(); ++i ) { |
223 | KDateNavigator *view = mExtraViews.at( i ); | 237 | KDateNavigator *view = mExtraViews.at( i ); |
224 | view->changeFont( fo ); | 238 | view->changeFont( fo ); |
225 | } | 239 | } |
226 | } | 240 | } |
227 | mHorizontalCount = horizontalCount; | 241 | mHorizontalCount = horizontalCount; |
228 | mVerticalCount = verticalCount; | 242 | mVerticalCount = verticalCount; |
229 | 243 | ||
230 | } | 244 | } |
231 | 245 | ||
232 | int theight = height() / mVerticalCount; | 246 | int theight = height() / mVerticalCount; |
233 | int twidth = width() / mHorizontalCount; | 247 | int twidth = width() / mHorizontalCount; |
234 | 248 | ||
235 | NavigatorBar *bar = mNavigatorView->navigatorBar(); | 249 | NavigatorBar *bar = mNavigatorView->navigatorBar(); |
236 | if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); | 250 | if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); |
237 | else bar->showButtons( true, true ); | 251 | else bar->showButtons( true, true ); |
238 | 252 | ||
239 | mNavigatorView->setGeometry(0, | 253 | mNavigatorView->setGeometry(0, |
240 | 0, twidth, theight ); | 254 | 0, twidth, theight ); |
241 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 255 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
242 | int x = ( i + 1 ) % mHorizontalCount; | 256 | int x = ( i + 1 ) % mHorizontalCount; |
243 | int y = ( i + 1 ) / mHorizontalCount; | 257 | int y = ( i + 1 ) / mHorizontalCount; |
244 | 258 | ||
245 | KDateNavigator *view = mExtraViews.at( i ); | 259 | KDateNavigator *view = mExtraViews.at( i ); |
246 | bar = view->navigatorBar(); | 260 | bar = view->navigatorBar(); |
247 | if ( y > 0 ) bar->showButtons( false, false ); | 261 | if ( y > 0 ) bar->showButtons( false, false ); |
248 | else { | 262 | else { |
249 | if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); | 263 | if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); |
250 | else bar->showButtons( false, false ); | 264 | else bar->showButtons( false, false ); |
251 | } | 265 | } |
252 | view->setGeometry( x * twidth, | 266 | view->setGeometry( x * twidth, |
253 | y * theight, twidth, theight ); | 267 | y * theight, twidth, theight ); |
254 | } | 268 | } |
255 | } | 269 | } |
256 | 270 | ||
257 | QDate last = lastAvailableDate(); | 271 | QDate last = lastAvailableDate(); |
258 | QDate first = firstAvailableDate(); | 272 | QDate first = firstAvailableDate(); |
259 | 273 | ||
260 | QDate selFirst = mFirstSelectedDate; | 274 | QDate selFirst = mFirstSelectedDate; |
261 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); | 275 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); |
262 | if ( selFirst >= first && selLast <= last ) { | 276 | if ( selFirst >= first && selLast <= last ) { |
263 | updateDayMatrixDates(); | 277 | updateDayMatrixDates(); |
264 | } | 278 | } |
265 | else { | 279 | else { |
266 | updateDayMatrixDates(); | 280 | updateDayMatrixDates(); |
267 | emit monthSelected( mFirstSelectedDate.month() ); | 281 | emit monthSelected( mFirstSelectedDate.month() ); |
268 | } | 282 | } |
269 | } | 283 | } |
270 | void DateNavigatorContainer::updateDayMatrixDates() | 284 | void DateNavigatorContainer::updateDayMatrixDates() |
271 | { | 285 | { |
272 | QDate fDate = mFirstSelectedDate; | 286 | QDate fDate = mFirstSelectedDate; |
273 | QDate lDate = fDate.addDays( mSelectedDateCount - 1 ); | 287 | QDate lDate = fDate.addDays( mSelectedDateCount - 1 ); |
274 | mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate ); | 288 | mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate ); |
275 | mNavigatorView->dayMatrix()->repaint( false ); | 289 | mNavigatorView->dayMatrix()->repaint( false ); |
276 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 290 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
277 | KDateNavigator *n = mExtraViews.at( i ); | 291 | KDateNavigator *n = mExtraViews.at( i ); |
278 | if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) { | 292 | if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) { |
279 | n->dayMatrix()->repaint( false ); | 293 | n->dayMatrix()->repaint( false ); |
280 | } | 294 | } |
281 | } | 295 | } |
282 | } | 296 | } |
283 | 297 | ||
284 | void DateNavigatorContainer::updateDayMatrix() | 298 | void DateNavigatorContainer::updateDayMatrix() |
285 | { | 299 | { |
286 | mNavigatorView->updateDayMatrix(); | 300 | mNavigatorView->updateDayMatrix(); |
287 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 301 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
288 | KDateNavigator *n = mExtraViews.at( i ); | 302 | KDateNavigator *n = mExtraViews.at( i ); |
289 | n->updateDayMatrix(); | 303 | n->updateDayMatrix(); |
290 | } | 304 | } |
291 | } | 305 | } |
292 | 306 | ||
293 | void DateNavigatorContainer::updateToday() | 307 | void DateNavigatorContainer::updateToday() |
294 | { | 308 | { |
295 | qDebug("DateNavigatorContainer::updateToday() NOT IMPL "); | 309 | qDebug("DateNavigatorContainer::updateToday() NOT IMPL "); |
296 | #if 0 | 310 | #if 0 |
297 | mNavigatorView->updateToday(); | 311 | mNavigatorView->updateToday(); |
298 | KDateNavigator *n; | 312 | KDateNavigator *n; |
299 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { | 313 | for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { |
300 | n->updateToday(); | 314 | n->updateToday(); |
301 | } | 315 | } |
302 | #endif | 316 | #endif |
303 | } | 317 | } |
304 | 318 | ||
305 | void DateNavigatorContainer::updateView() | 319 | void DateNavigatorContainer::updateView() |
306 | { | 320 | { |
307 | mNavigatorView->updateView(); | 321 | mNavigatorView->updateView(); |
308 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 322 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
309 | KDateNavigator *n = mExtraViews.at( i ); | 323 | KDateNavigator *n = mExtraViews.at( i ); |
310 | n->updateView(); | 324 | n->updateView(); |
311 | } | 325 | } |
312 | } | 326 | } |
313 | 327 | ||
314 | void DateNavigatorContainer::updateConfig() | 328 | void DateNavigatorContainer::updateConfig() |
315 | { | 329 | { |
316 | mNavigatorView->updateConfig(); | 330 | mNavigatorView->updateConfig(); |
317 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 331 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
318 | KDateNavigator *n = mExtraViews.at( i ); | 332 | KDateNavigator *n = mExtraViews.at( i ); |
319 | n->updateConfig(); | 333 | n->updateConfig(); |
320 | } | 334 | } |
321 | } | 335 | } |
322 | QDate DateNavigatorContainer::lastAvailableDate() const | 336 | QDate DateNavigatorContainer::lastAvailableDate() const |
323 | { | 337 | { |
324 | QDate date = mNavigatorView->baseDate(); | 338 | QDate date = mNavigatorView->baseDate(); |
325 | QDate last = QDate ( date.year(), date.month(), date.daysInMonth() ); | 339 | QDate last = QDate ( date.year(), date.month(), date.daysInMonth() ); |
326 | int iii = mLastDisplayedDN; | 340 | int iii = mLastDisplayedDN; |
327 | if ( mLastDisplayedDN ) | 341 | if ( mLastDisplayedDN ) |
328 | last = last.addDays( 1); | 342 | last = last.addDays( 1); |
329 | while ( iii ) { | 343 | while ( iii ) { |
330 | last = last.addDays( last.daysInMonth ()); | 344 | last = last.addDays( last.daysInMonth ()); |
331 | //qDebug("DATE %s ", last.toString().latin1() ); | 345 | //qDebug("DATE %s ", last.toString().latin1() ); |
332 | --iii; | 346 | --iii; |
333 | } | 347 | } |
334 | if ( mLastDisplayedDN ) | 348 | if ( mLastDisplayedDN ) |
335 | last = last.addDays( -1); | 349 | last = last.addDays( -1); |
336 | return last; | 350 | return last; |
337 | } | 351 | } |
338 | QDate DateNavigatorContainer::firstAvailableDate() const | 352 | QDate DateNavigatorContainer::firstAvailableDate() const |
339 | { | 353 | { |
340 | return QDate ( mNavigatorView->baseDate().year(), mNavigatorView->baseDate().month(), 1 ); | 354 | return QDate ( mNavigatorView->baseDate().year(), mNavigatorView->baseDate().month(), 1 ); |
341 | } | 355 | } |
342 | void DateNavigatorContainer::selectDates( const DateList &dateList ) | 356 | void DateNavigatorContainer::selectDates( const DateList &dateList ) |
343 | { | 357 | { |
344 | mFirstSelectedDate = dateList.first() ; | 358 | mFirstSelectedDate = dateList.first() ; |
345 | mSelectedDateCount = dateList.count() ; | 359 | mSelectedDateCount = dateList.count() ; |
346 | if ( !mLastDisplayedDN ) { | 360 | if ( !mLastDisplayedDN ) { |
347 | mNavigatorView->selectDates( dateList ); | 361 | mNavigatorView->selectDates( dateList ); |
348 | return; | 362 | return; |
349 | } | 363 | } |
350 | QDate fDate = dateList.first(); | 364 | QDate fDate = dateList.first(); |
351 | QDate lDate = dateList.last(); | 365 | QDate lDate = dateList.last(); |
352 | //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() ); | 366 | //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() ); |
353 | //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() ); | 367 | //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() ); |
354 | if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) { | 368 | if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) { |
355 | updateDayMatrixDates(); | 369 | updateDayMatrixDates(); |
356 | return; | 370 | return; |
357 | } | 371 | } |
358 | mNavigatorView->selectDates( dateList ); | 372 | mNavigatorView->selectDates( dateList ); |
359 | setBaseDates(); | 373 | setBaseDates(); |
360 | if ( mLastDisplayedDN ) { | 374 | if ( mLastDisplayedDN ) { |
361 | KDateNavigator *view = mExtraViews.at( 0 ); | 375 | KDateNavigator *view = mExtraViews.at( 0 ); |
362 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | 376 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); |
363 | view->dayMatrix()->repaint( false ); | 377 | view->dayMatrix()->repaint( false ); |
364 | if ( mLastDisplayedDN > 1 ) { | 378 | if ( mLastDisplayedDN > 1 ) { |
365 | KDateNavigator *view = mExtraViews.at( 1 ); | 379 | KDateNavigator *view = mExtraViews.at( 1 ); |
366 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | 380 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); |
367 | view->dayMatrix()->repaint( false ); | 381 | view->dayMatrix()->repaint( false ); |
368 | } | 382 | } |
369 | } | 383 | } |
370 | } | 384 | } |
371 | 385 | ||
372 | void DateNavigatorContainer::setBaseDates() | 386 | void DateNavigatorContainer::setBaseDates() |
373 | { | 387 | { |
374 | QDate baseDate = mNavigatorView->baseDate(); | 388 | QDate baseDate = mNavigatorView->baseDate(); |
375 | bool doRepaint = true; | 389 | bool doRepaint = true; |
376 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 390 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
377 | KDateNavigator *n = mExtraViews.at( i ); | 391 | KDateNavigator *n = mExtraViews.at( i ); |
378 | baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); | 392 | baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); |
379 | n->setBaseDate( baseDate, doRepaint ); | 393 | n->setBaseDate( baseDate, doRepaint ); |
380 | } | 394 | } |
381 | } | 395 | } |
382 | 396 | ||
383 | void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | 397 | void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) |
384 | { | 398 | { |
385 | 399 | ||
386 | 400 | ||
387 | //qDebug("COUNT %d ", mExtraViews.count()); | 401 | //qDebug("COUNT %d ", mExtraViews.count()); |
388 | 402 | ||
389 | mUpdateTimer->start( 250 ); | 403 | mUpdateTimer->start( 250 ); |
390 | //updateDayMatrixDates(); | 404 | //updateDayMatrixDates(); |
391 | } | 405 | } |
392 | 406 | ||
393 | QSize DateNavigatorContainer::minimumSizeHint() const | 407 | QSize DateNavigatorContainer::minimumSizeHint() const |
394 | { | 408 | { |
395 | return mNavigatorView->minimumSizeHint(); | 409 | return mNavigatorView->minimumSizeHint(); |
396 | } | 410 | } |
397 | 411 | ||
398 | QSize DateNavigatorContainer::sizeHint() const | 412 | QSize DateNavigatorContainer::sizeHint() const |
399 | { | 413 | { |
400 | return mNavigatorView->yourSizeHint(); | 414 | return mNavigatorView->yourSizeHint(); |
401 | } | 415 | } |
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h index 9a64720..d2f397d 100644 --- a/korganizer/datenavigatorcontainer.h +++ b/korganizer/datenavigatorcontainer.h | |||
@@ -1,100 +1,106 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> |
5 | Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> | 5 | Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 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 | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | #ifndef DATENAVIGATORCONTAINER_H | 25 | #ifndef DATENAVIGATORCONTAINER_H |
26 | #define DATENAVIGATORCONTAINER_H | 26 | #define DATENAVIGATORCONTAINER_H |
27 | 27 | ||
28 | class KDateNavigator; | 28 | class KDateNavigator; |
29 | 29 | ||
30 | #include <qwidget.h> | 30 | #include <qwidget.h> |
31 | #include <qtimer.h> | 31 | #include <qtimer.h> |
32 | #include <libkcal/calendar.h> | 32 | #include <libkcal/calendar.h> |
33 | using namespace KCal; | 33 | using namespace KCal; |
34 | 34 | ||
35 | class DateNavigatorContainer: public QWidget | 35 | class DateNavigatorContainer: public QWidget |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 ); | 39 | DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 ); |
40 | ~DateNavigatorContainer(); | 40 | ~DateNavigatorContainer(); |
41 | 41 | ||
42 | /** | 42 | /** |
43 | Associate date navigator with a calendar. It is used by KODayMatrix. | 43 | Associate date navigator with a calendar. It is used by KODayMatrix. |
44 | */ | 44 | */ |
45 | void setCalendar( Calendar * ); | 45 | void setCalendar( Calendar * ); |
46 | 46 | ||
47 | QSize minimumSizeHint() const; | 47 | QSize minimumSizeHint() const; |
48 | QSize sizeHint() const; | 48 | QSize sizeHint() const; |
49 | KDateNavigator * navigatorView() { return mNavigatorView;} | 49 | KDateNavigator * navigatorView() { return mNavigatorView;} |
50 | QDate lastAvailableDate() const ; | 50 | QDate lastAvailableDate() const ; |
51 | QDate firstAvailableDate() const ; | 51 | QDate firstAvailableDate() const ; |
52 | 52 | ||
53 | public slots: | 53 | public slots: |
54 | void selectDates( const KCal::DateList & ); | 54 | void selectDates( const KCal::DateList & ); |
55 | void updateView(); | 55 | void updateView(); |
56 | void updateConfig(); | 56 | void updateConfig(); |
57 | void updateDayMatrix(); | 57 | void updateDayMatrix(); |
58 | void updateDayMatrixDates(); | 58 | void updateDayMatrixDates(); |
59 | void checkUpdateDayMatrixDates(); | 59 | void checkUpdateDayMatrixDates(); |
60 | void updateToday(); | 60 | void updateToday(); |
61 | void slotMonthSelected( int month ); | 61 | void slotMonthSelected( int month ); |
62 | void slotgoNextMonth(); | ||
63 | void slotgoPrevMonth(); | ||
64 | void slotgoNextYear(); | ||
65 | void slotgoPrevYear(); | ||
62 | 66 | ||
63 | signals: | 67 | signals: |
64 | void datesSelected( const KCal::DateList & ); | 68 | void datesSelected( const KCal::DateList & ); |
65 | void incidenceDropped( Incidence *, const QDate & ); | 69 | void incidenceDropped( Incidence *, const QDate & ); |
66 | void incidenceDroppedMove( Incidence *, const QDate & ); | 70 | void incidenceDroppedMove( Incidence *, const QDate & ); |
67 | void weekClicked( const QDate &); | 71 | void weekClicked( const QDate &); |
68 | 72 | ||
69 | void goPrevious(); | 73 | void goPrevious(); |
70 | void goNext(); | 74 | void goNext(); |
71 | 75 | ||
72 | void goNextMonth(); | 76 | void goNextMonth(); |
73 | void goPrevMonth(); | 77 | void goPrevMonth(); |
74 | void goNextYear(); | 78 | void goNextYear(); |
75 | void goPrevYear(); | 79 | void goPrevYear(); |
76 | 80 | ||
77 | void monthSelected( int month ); | 81 | void monthSelected( int month ); |
78 | 82 | ||
79 | protected: | 83 | protected: |
84 | void computeMonthSelected( int month , bool forceEmit ); | ||
85 | void jumpMonth( int month ); | ||
80 | void resizeEvent( QResizeEvent * ); | 86 | void resizeEvent( QResizeEvent * ); |
81 | 87 | ||
82 | void setBaseDates(); | 88 | void setBaseDates(); |
83 | void connectNavigatorView( KDateNavigator *v ); | 89 | void connectNavigatorView( KDateNavigator *v ); |
84 | 90 | ||
85 | private: | 91 | private: |
86 | QTimer* mUpdateTimer; | 92 | QTimer* mUpdateTimer; |
87 | int mLastDisplayedDN; | 93 | int mLastDisplayedDN; |
88 | QDate mFirstSelectedDate; | 94 | QDate mFirstSelectedDate; |
89 | int mSelectedDateCount; | 95 | int mSelectedDateCount; |
90 | KDateNavigator *mNavigatorView; | 96 | KDateNavigator *mNavigatorView; |
91 | 97 | ||
92 | KCal::Calendar *mCalendar; | 98 | KCal::Calendar *mCalendar; |
93 | 99 | ||
94 | QPtrList<KDateNavigator> mExtraViews; | 100 | QPtrList<KDateNavigator> mExtraViews; |
95 | 101 | ||
96 | int mHorizontalCount; | 102 | int mHorizontalCount; |
97 | int mVerticalCount; | 103 | int mVerticalCount; |
98 | }; | 104 | }; |
99 | 105 | ||
100 | #endif | 106 | #endif |
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index d62402f..6438c9a 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp | |||
@@ -1,465 +1,465 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qkeycode.h> | 25 | #include <qkeycode.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qtimer.h> | 27 | #include <qtimer.h> |
28 | #include <qframe.h> | 28 | #include <qframe.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | 31 | ||
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | #include <kglobal.h> | 34 | #include <kglobal.h> |
35 | 35 | ||
36 | #include "koglobals.h" | 36 | #include "koglobals.h" |
37 | #include "koprefs.h" | 37 | #include "koprefs.h" |
38 | #ifndef KORG_NOPLUGINS | 38 | #ifndef KORG_NOPLUGINS |
39 | #include "kocore.h" | 39 | #include "kocore.h" |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #include <kcalendarsystem.h> | 42 | #include <kcalendarsystem.h> |
43 | 43 | ||
44 | #include "navigatorbar.h" | 44 | #include "navigatorbar.h" |
45 | 45 | ||
46 | #include "kdatenavigator.h" | 46 | #include "kdatenavigator.h" |
47 | 47 | ||
48 | KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) | 48 | KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) |
49 | : QFrame(parent, name), | 49 | : QFrame(parent, name), |
50 | updateTimer(0L) | 50 | updateTimer(0L) |
51 | { | 51 | { |
52 | setFrameStyle(QFrame::NoFrame); | 52 | setFrameStyle(QFrame::NoFrame); |
53 | QDate startDate = QDate::currentDate(); | 53 | QDate startDate = QDate::currentDate(); |
54 | QGridLayout *topLayout = new QGridLayout(this,8,8); | 54 | QGridLayout *topLayout = new QGridLayout(this,8,8); |
55 | 55 | ||
56 | if (! startDate.isValid()) { | 56 | if (! startDate.isValid()) { |
57 | qDebug("KDateNavigator::invalid startdate "); | 57 | qDebug("KDateNavigator::invalid startdate "); |
58 | startDate = QDate::currentDate(); | 58 | startDate = QDate::currentDate(); |
59 | } | 59 | } |
60 | mMonthSignalOffset = 0; | 60 | mMonthSignalOffset = 0; |
61 | mSelectedDates.append(startDate); | 61 | mSelectedDates.append(startDate); |
62 | m_MthYr = startDate; | 62 | m_MthYr = startDate; |
63 | m_bShowWeekNums = true; | 63 | m_bShowWeekNums = true; |
64 | 64 | ||
65 | setFont( KOPrefs::instance()->mDateNavigatorFont ); | 65 | setFont( KOPrefs::instance()->mDateNavigatorFont ); |
66 | mNavigatorBar = new NavigatorBar( startDate, this ); | 66 | mNavigatorBar = new NavigatorBar( startDate, this ); |
67 | topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); | 67 | topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); |
68 | //mNavigatorBar->resize( 1,1); | 68 | //mNavigatorBar->resize( 1,1); |
69 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); | 69 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); |
70 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); | 70 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); |
71 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); | 71 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); |
72 | connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); | 72 | connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); |
73 | connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); | 73 | connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); |
74 | 74 | ||
75 | // get the day of the week on the first day | 75 | // get the day of the week on the first day |
76 | QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); | 76 | QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); |
77 | m_fstDayOfWk = dayone.dayOfWeek(); | 77 | m_fstDayOfWk = dayone.dayOfWeek(); |
78 | 78 | ||
79 | int i; | 79 | int i; |
80 | 80 | ||
81 | // Set up the heading fields. | 81 | // Set up the heading fields. |
82 | for( i = 0; i < 7; i++ ) { | 82 | for( i = 0; i < 7; i++ ) { |
83 | headings[i] = new QLabel("",this); | 83 | headings[i] = new QLabel("",this); |
84 | //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); | 84 | //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); |
85 | headings[i]->setAlignment(AlignCenter); | 85 | headings[i]->setAlignment(AlignCenter); |
86 | headings[i]->installEventFilter(this); | 86 | headings[i]->installEventFilter(this); |
87 | 87 | ||
88 | topLayout->addWidget(headings[i],1,i+1); | 88 | topLayout->addWidget(headings[i],1,i+1); |
89 | } | 89 | } |
90 | 90 | ||
91 | // Create the weeknumber labels | 91 | // Create the weeknumber labels |
92 | for( i = 0; i < 6; i++ ) { | 92 | for( i = 0; i < 6; i++ ) { |
93 | weeknos[i] = new QLabel(this); | 93 | weeknos[i] = new QLabel(this); |
94 | weeknos[i]->setAlignment(AlignCenter); | 94 | weeknos[i]->setAlignment(AlignCenter); |
95 | //weeknos[i]->setFont(QFont("Arial", 10)); | 95 | //weeknos[i]->setFont(QFont("Arial", 10)); |
96 | if(!m_bShowWeekNums) { | 96 | if(!m_bShowWeekNums) { |
97 | weeknos[i]->hide(); | 97 | weeknos[i]->hide(); |
98 | } | 98 | } |
99 | weeknos[i]->installEventFilter(this); | 99 | weeknos[i]->installEventFilter(this); |
100 | 100 | ||
101 | topLayout->addWidget(weeknos[i],i+2,0); | 101 | topLayout->addWidget(weeknos[i],i+2,0); |
102 | } | 102 | } |
103 | 103 | ||
104 | daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); | 104 | daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); |
105 | daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 105 | daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
106 | daymatrix->setLineWidth(1); | 106 | daymatrix->setLineWidth(1); |
107 | 107 | ||
108 | connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), | 108 | connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), |
109 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); | 109 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); |
110 | 110 | ||
111 | connect( daymatrix, SIGNAL( eventDropped( Event * ) ), | 111 | connect( daymatrix, SIGNAL( eventDropped( Event * ) ), |
112 | SIGNAL( eventDropped( Event * ) ) ); | 112 | SIGNAL( eventDropped( Event * ) ) ); |
113 | 113 | ||
114 | topLayout->addMultiCellWidget(daymatrix,2,7,1,7); | 114 | topLayout->addMultiCellWidget(daymatrix,2,7,1,7); |
115 | 115 | ||
116 | // read settings from configuration file. | 116 | // read settings from configuration file. |
117 | updateConfig(); | 117 | updateConfig(); |
118 | enableRollover(FollowMonth); | 118 | enableRollover(FollowMonth); |
119 | mySizeHint = sizeHintTwoButtons(); | 119 | mySizeHint = sizeHintTwoButtons(); |
120 | myFullSizeHint = sizeHintTwoButtons( 4 ); | 120 | myFullSizeHint = sizeHintTwoButtons( 4 ); |
121 | mFontChanged = false; | 121 | mFontChanged = false; |
122 | resize ( mySizeHint ); | 122 | resize ( 0,0 ); |
123 | } | 123 | } |
124 | void KDateNavigator::changeFont ( QFont fo ) | 124 | void KDateNavigator::changeFont ( QFont fo ) |
125 | { | 125 | { |
126 | setFont( fo ); | 126 | setFont( fo ); |
127 | mNavigatorBar->resetFont( fo ); | 127 | mNavigatorBar->resetFont( fo ); |
128 | } | 128 | } |
129 | QFont KDateNavigator::yourFontHint( QSize si , bool *b) | 129 | QFont KDateNavigator::yourFontHint( QSize si , bool *b) |
130 | { | 130 | { |
131 | QFont fo = KOPrefs::instance()->mDateNavigatorFont; | 131 | QFont fo = KOPrefs::instance()->mDateNavigatorFont; |
132 | *b = false; | 132 | *b = false; |
133 | int fontPoint = fo.pointSize(); | 133 | int fontPoint = fo.pointSize(); |
134 | while ( fontPoint > 5 ) { | 134 | while ( fontPoint > 5 ) { |
135 | --fontPoint; | 135 | --fontPoint; |
136 | fo.setPointSize( fontPoint ); | 136 | fo.setPointSize( fontPoint ); |
137 | setFont( fo ); | 137 | setFont( fo ); |
138 | mFontChanged = true; | 138 | mFontChanged = true; |
139 | mNavigatorBar->resetFont( fo ); | 139 | mNavigatorBar->resetFont( fo ); |
140 | QSize sh = sizeHintTwoButtons( 2 ); | 140 | QSize sh = sizeHintTwoButtons( 2 ); |
141 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); | 141 | //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); |
142 | if ( si.width() > sh.width() && si.height() > sh.height()) { | 142 | if ( si.width() > sh.width() && si.height() > sh.height()) { |
143 | if ( si.width() / sh.width() == 1 ) { | 143 | if ( si.width() / sh.width() == 1 ) { |
144 | if ( si.width() < sizeHintTwoButtons( 4 ).width()) | 144 | if ( si.width() < sizeHintTwoButtons( 4 ).width()) |
145 | continue; | 145 | continue; |
146 | } | 146 | } |
147 | *b = true; | 147 | *b = true; |
148 | //qDebug("fooooooooooooooooooooooouuuuund "); | 148 | //qDebug("fooooooooooooooooooooooouuuuund "); |
149 | break; | 149 | break; |
150 | } | 150 | } |
151 | } | 151 | } |
152 | //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); | 152 | //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); |
153 | return fo; | 153 | return fo; |
154 | } | 154 | } |
155 | QSize KDateNavigator::sizeHint() const | 155 | QSize KDateNavigator::sizeHint() const |
156 | { | 156 | { |
157 | QFontMetrics fm ( font() ); | 157 | QFontMetrics fm ( font() ); |
158 | QSize day = daymatrix->sizeHint(); | 158 | QSize day = daymatrix->sizeHint(); |
159 | QSize nav = mNavigatorBar->sizeHint(); | 159 | QSize nav = mNavigatorBar->sizeHint(); |
160 | int wid = fm.width( "30") + day.width()+3; | 160 | int wid = fm.width( "30") + day.width()+3; |
161 | int hei = fm.height() +day.height()+nav.height()+2; | 161 | int hei = fm.height() +day.height()+nav.height()+2; |
162 | if ( wid < nav.width() ) | 162 | if ( wid < nav.width() ) |
163 | wid = nav.width() ; | 163 | wid = nav.width() ; |
164 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); | 164 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); |
165 | return QSize ( wid, hei ); | 165 | return QSize ( wid, hei ); |
166 | } | 166 | } |
167 | QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const | 167 | QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const |
168 | { | 168 | { |
169 | QFontMetrics fm ( font() ); | 169 | QFontMetrics fm ( font() ); |
170 | QSize day = daymatrix->sizeHint(); | 170 | QSize day = daymatrix->sizeHint(); |
171 | QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum ); | 171 | QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum ); |
172 | int wid = fm.width( "30") + day.width()+3; | 172 | int wid = fm.width( "30") + day.width()+3; |
173 | int hei = fm.height() +day.height()+nav.height()+2; | 173 | int hei = fm.height() +day.height()+nav.height()+2; |
174 | if ( wid < nav.width() ) | 174 | if ( wid < nav.width() ) |
175 | wid = nav.width() ; | 175 | wid = nav.width() ; |
176 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); | 176 | //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); |
177 | return QSize ( wid, hei ); | 177 | return QSize ( wid, hei ); |
178 | } | 178 | } |
179 | void KDateNavigator::slotMonthSelected( int m ) | 179 | void KDateNavigator::slotMonthSelected( int m ) |
180 | { | 180 | { |
181 | if ( m_MthYr.month() <= mMonthSignalOffset) | 181 | if ( m_MthYr.month() <= mMonthSignalOffset) |
182 | m += 12; | 182 | m += 12; |
183 | //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset); | 183 | //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset); |
184 | emit monthSelected( m - mMonthSignalOffset ); | 184 | emit monthSelected( m - mMonthSignalOffset ); |
185 | 185 | ||
186 | } | 186 | } |
187 | void KDateNavigator::setCalendar( Calendar *cal ) | 187 | void KDateNavigator::setCalendar( Calendar *cal ) |
188 | { | 188 | { |
189 | daymatrix->setCalendar( cal ); | 189 | daymatrix->setCalendar( cal ); |
190 | } | 190 | } |
191 | 191 | ||
192 | void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true | 192 | void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true |
193 | { | 193 | { |
194 | m_MthYr = date; | 194 | m_MthYr = date; |
195 | //qDebug("KDateNavigator::setBaseDate %s ", date.toString().latin1()); | 195 | //qDebug("KDateNavigator::setBaseDate %s ", date.toString().latin1()); |
196 | 196 | ||
197 | updateDates(); | 197 | updateDates(); |
198 | updateView(); | 198 | updateView(); |
199 | 199 | ||
200 | KCal::DateList dates; | 200 | KCal::DateList dates; |
201 | dates.append( date ); | 201 | dates.append( date ); |
202 | mNavigatorBar->selectDates( dates ); | 202 | mNavigatorBar->selectDates( dates ); |
203 | 203 | ||
204 | daymatrix->clearSelection(); | 204 | daymatrix->clearSelection(); |
205 | if ( doRepaint ) | 205 | if ( doRepaint ) |
206 | daymatrix->repaint( false ); | 206 | daymatrix->repaint( false ); |
207 | } | 207 | } |
208 | 208 | ||
209 | void KDateNavigator::enableRollover(RolloverType r) | 209 | void KDateNavigator::enableRollover(RolloverType r) |
210 | { | 210 | { |
211 | switch(r) | 211 | switch(r) |
212 | { | 212 | { |
213 | case None : | 213 | case None : |
214 | if (updateTimer) | 214 | if (updateTimer) |
215 | { | 215 | { |
216 | updateTimer->stop(); | 216 | updateTimer->stop(); |
217 | delete updateTimer; | 217 | delete updateTimer; |
218 | updateTimer=0L; | 218 | updateTimer=0L; |
219 | } | 219 | } |
220 | break; | 220 | break; |
221 | case FollowDay : | 221 | case FollowDay : |
222 | case FollowMonth : | 222 | case FollowMonth : |
223 | if (!updateTimer) | 223 | if (!updateTimer) |
224 | { | 224 | { |
225 | updateTimer = new QTimer(this); | 225 | updateTimer = new QTimer(this); |
226 | QObject::connect(updateTimer,SIGNAL(timeout()), | 226 | QObject::connect(updateTimer,SIGNAL(timeout()), |
227 | this,SLOT(possiblyPastMidnight())); | 227 | this,SLOT(possiblyPastMidnight())); |
228 | } | 228 | } |
229 | updateTimer->start(0,true); | 229 | updateTimer->start(0,true); |
230 | lastDayChecked = QDate::currentDate(); | 230 | lastDayChecked = QDate::currentDate(); |
231 | } | 231 | } |
232 | updateRollover=r; | 232 | updateRollover=r; |
233 | } | 233 | } |
234 | 234 | ||
235 | 235 | ||
236 | KDateNavigator::~KDateNavigator() | 236 | KDateNavigator::~KDateNavigator() |
237 | { | 237 | { |
238 | } | 238 | } |
239 | 239 | ||
240 | 240 | ||
241 | void KDateNavigator::passedMidnight() | 241 | void KDateNavigator::passedMidnight() |
242 | { | 242 | { |
243 | QDate today = QDate::currentDate(); | 243 | QDate today = QDate::currentDate(); |
244 | bool emitMonth = false; | 244 | bool emitMonth = false; |
245 | 245 | ||
246 | if (today.month() != lastDayChecked.month()) | 246 | if (today.month() != lastDayChecked.month()) |
247 | { | 247 | { |
248 | if (updateRollover==FollowMonth && | 248 | if (updateRollover==FollowMonth && |
249 | daymatrix->isEndOfMonth()) { | 249 | daymatrix->isEndOfMonth()) { |
250 | goNextMonth(); | 250 | goNextMonth(); |
251 | emitMonth=true; | 251 | emitMonth=true; |
252 | } | 252 | } |
253 | } | 253 | } |
254 | daymatrix->recalculateToday(); | 254 | daymatrix->recalculateToday(); |
255 | daymatrix->repaint( false ); | 255 | daymatrix->repaint( false ); |
256 | emit dayPassed(today); | 256 | emit dayPassed(today); |
257 | if (emitMonth) { emit monthPassed(today); } | 257 | if (emitMonth) { emit monthPassed(today); } |
258 | } | 258 | } |
259 | 259 | ||
260 | /* slot */ void KDateNavigator::possiblyPastMidnight() | 260 | /* slot */ void KDateNavigator::possiblyPastMidnight() |
261 | { | 261 | { |
262 | if (lastDayChecked!=QDate::currentDate()) | 262 | if (lastDayChecked!=QDate::currentDate()) |
263 | { | 263 | { |
264 | passedMidnight(); | 264 | passedMidnight(); |
265 | lastDayChecked=QDate::currentDate(); | 265 | lastDayChecked=QDate::currentDate(); |
266 | } | 266 | } |
267 | // Set the timer to go off 1 second after midnight | 267 | // Set the timer to go off 1 second after midnight |
268 | // or after 8 minutes, whichever comes first. | 268 | // or after 8 minutes, whichever comes first. |
269 | if (updateTimer) | 269 | if (updateTimer) |
270 | { | 270 | { |
271 | QTime now = QTime::currentTime(); | 271 | QTime now = QTime::currentTime(); |
272 | QTime midnight = QTime(23,59,59); | 272 | QTime midnight = QTime(23,59,59); |
273 | int msecsWait = QMIN(480000,now.msecsTo(midnight)+2000); | 273 | int msecsWait = QMIN(480000,now.msecsTo(midnight)+2000); |
274 | 274 | ||
275 | // qDebug(QString("Waiting %1 msec from %2 to %3.").arg(msecsWait)) | 275 | // qDebug(QString("Waiting %1 msec from %2 to %3.").arg(msecsWait)) |
276 | //.arg(now.toString()).arg(midnight.toString())); | 276 | //.arg(now.toString()).arg(midnight.toString())); |
277 | 277 | ||
278 | updateTimer->stop(); | 278 | updateTimer->stop(); |
279 | updateTimer->start(msecsWait,true); | 279 | updateTimer->start(msecsWait,true); |
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | void KDateNavigator::updateDates() | 283 | void KDateNavigator::updateDates() |
284 | { | 284 | { |
285 | // Find the first day of the week of the current month. | 285 | // Find the first day of the week of the current month. |
286 | //int d1 = KOGlobals::self()->calendarSystem()->day( m_MthYr ); | 286 | //int d1 = KOGlobals::self()->calendarSystem()->day( m_MthYr ); |
287 | QDate dayone( m_MthYr.year(), m_MthYr.month(), m_MthYr.day() ); | 287 | QDate dayone( m_MthYr.year(), m_MthYr.month(), m_MthYr.day() ); |
288 | int d2 = KOGlobals::self()->calendarSystem()->day( dayone ); | 288 | int d2 = KOGlobals::self()->calendarSystem()->day( dayone ); |
289 | //int di = d1 - d2 + 1; | 289 | //int di = d1 - d2 + 1; |
290 | dayone = dayone.addDays( -d2 + 1 ); | 290 | dayone = dayone.addDays( -d2 + 1 ); |
291 | 291 | ||
292 | int m_fstDayOfWkCalsys = KOGlobals::self()->calendarSystem()->dayOfWeek( dayone ); | 292 | int m_fstDayOfWkCalsys = KOGlobals::self()->calendarSystem()->dayOfWeek( dayone ); |
293 | 293 | ||
294 | // If month begins on Monday and Monday is first day of week, | 294 | // If month begins on Monday and Monday is first day of week, |
295 | // month should begin on second line. Sunday doesn't have this problem. | 295 | // month should begin on second line. Sunday doesn't have this problem. |
296 | int nextLine = ( ( m_fstDayOfWkCalsys == 1) && | 296 | int nextLine = ( ( m_fstDayOfWkCalsys == 1) && |
297 | ( KGlobal::locale()->weekStartsMonday() == 1 ) ) ? 7 : 0; | 297 | ( KGlobal::locale()->weekStartsMonday() == 1 ) ) ? 7 : 0; |
298 | 298 | ||
299 | // update the matrix dates | 299 | // update the matrix dates |
300 | int index = (KGlobal::locale()->weekStartsMonday() ? 1 : 0) - m_fstDayOfWkCalsys - nextLine; | 300 | int index = (KGlobal::locale()->weekStartsMonday() ? 1 : 0) - m_fstDayOfWkCalsys - nextLine; |
301 | 301 | ||
302 | 302 | ||
303 | daymatrix->updateView(dayone.addDays(index)); | 303 | daymatrix->updateView(dayone.addDays(index)); |
304 | //each updateDates is followed by an updateView -> repaint is issued there ! | 304 | //each updateDates is followed by an updateView -> repaint is issued there ! |
305 | // daymatrix->repaint(); | 305 | // daymatrix->repaint(); |
306 | } | 306 | } |
307 | 307 | ||
308 | void KDateNavigator::updateDayMatrix() | 308 | void KDateNavigator::updateDayMatrix() |
309 | { | 309 | { |
310 | daymatrix->updateView(); | 310 | daymatrix->updateView(); |
311 | //daymatrix->repaint(); | 311 | //daymatrix->repaint(); |
312 | } | 312 | } |
313 | 313 | ||
314 | 314 | ||
315 | void KDateNavigator::updateView() | 315 | void KDateNavigator::updateView() |
316 | { | 316 | { |
317 | 317 | ||
318 | setUpdatesEnabled( false ); | 318 | setUpdatesEnabled( false ); |
319 | 319 | ||
320 | int i; | 320 | int i; |
321 | 321 | ||
322 | // kdDebug() << "updateView() -> daymatrix->updateView()" << endl; | 322 | // kdDebug() << "updateView() -> daymatrix->updateView()" << endl; |
323 | daymatrix->updateView(); | 323 | daymatrix->updateView(); |
324 | 324 | ||
325 | // set the week numbers. | 325 | // set the week numbers. |
326 | for(i = 0; i < 6; i++) { | 326 | for(i = 0; i < 6; i++) { |
327 | QString weeknum; | 327 | QString weeknum; |
328 | // remember, according to ISO 8601, the first week of the year is the | 328 | // remember, according to ISO 8601, the first week of the year is the |
329 | // first week that contains a thursday. Thus we must subtract off 4, | 329 | // first week that contains a thursday. Thus we must subtract off 4, |
330 | // not just 1. | 330 | // not just 1. |
331 | 331 | ||
332 | //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear(); | 332 | //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear(); |
333 | int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4))); | 333 | int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4))); |
334 | 334 | ||
335 | int add = 0; | 335 | int add = 0; |
336 | if ( ! KGlobal::locale()->weekStartsMonday() ) | 336 | if ( ! KGlobal::locale()->weekStartsMonday() ) |
337 | ++add; | 337 | ++add; |
338 | if (dayOfYear % 7 != 0) | 338 | if (dayOfYear % 7 != 0) |
339 | weeknum.setNum(dayOfYear / 7 + 1+add); | 339 | weeknum.setNum(dayOfYear / 7 + 1+add); |
340 | else | 340 | else |
341 | weeknum.setNum(dayOfYear / 7 +add); | 341 | weeknum.setNum(dayOfYear / 7 +add); |
342 | weeknos[i]->setText(weeknum); | 342 | weeknos[i]->setText(weeknum); |
343 | } | 343 | } |
344 | 344 | ||
345 | setUpdatesEnabled( true ); | 345 | setUpdatesEnabled( true ); |
346 | // kdDebug() << "updateView() -> repaint()" << endl; | 346 | // kdDebug() << "updateView() -> repaint()" << endl; |
347 | repaint(); | 347 | repaint(); |
348 | // daymatrix->repaint(); | 348 | // daymatrix->repaint(); |
349 | } | 349 | } |
350 | 350 | ||
351 | void KDateNavigator::updateConfig() | 351 | void KDateNavigator::updateConfig() |
352 | { | 352 | { |
353 | int day; | 353 | int day; |
354 | for(int i=0; i<7; i++) { | 354 | for(int i=0; i<7; i++) { |
355 | // take the first letter of the day name to be the abbreviation | 355 | // take the first letter of the day name to be the abbreviation |
356 | if (KGlobal::locale()->weekStartsMonday()) { | 356 | if (KGlobal::locale()->weekStartsMonday()) { |
357 | day = i+1; | 357 | day = i+1; |
358 | } else { | 358 | } else { |
359 | if (i==0) day = 7; | 359 | if (i==0) day = 7; |
360 | else day = i; | 360 | else day = i; |
361 | } | 361 | } |
362 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day, | 362 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day, |
363 | true ); | 363 | true ); |
364 | if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 ); | 364 | if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 ); |
365 | headings[i]->setText( dayName ); | 365 | headings[i]->setText( dayName ); |
366 | } | 366 | } |
367 | updateDates(); | 367 | updateDates(); |
368 | updateView(); | 368 | updateView(); |
369 | } | 369 | } |
370 | 370 | ||
371 | void KDateNavigator::setShowWeekNums(bool enabled) | 371 | void KDateNavigator::setShowWeekNums(bool enabled) |
372 | { | 372 | { |
373 | m_bShowWeekNums = enabled; | 373 | m_bShowWeekNums = enabled; |
374 | for(int i=0; i<6; i++) { | 374 | for(int i=0; i<6; i++) { |
375 | if(enabled) | 375 | if(enabled) |
376 | weeknos[i]->show(); | 376 | weeknos[i]->show(); |
377 | else | 377 | else |
378 | weeknos[i]->hide(); | 378 | weeknos[i]->hide(); |
379 | } | 379 | } |
380 | resize(size()); | 380 | resize(size()); |
381 | } | 381 | } |
382 | 382 | ||
383 | void KDateNavigator::selectDates(const DateList& dateList) | 383 | void KDateNavigator::selectDates(const DateList& dateList) |
384 | { | 384 | { |
385 | 385 | ||
386 | if (dateList.count() > 0) { | 386 | if (dateList.count() > 0) { |
387 | mNavigatorBar->selectDates( dateList ); | 387 | mNavigatorBar->selectDates( dateList ); |
388 | mSelectedDates = dateList; | 388 | mSelectedDates = dateList; |
389 | 389 | ||
390 | // set our record of the month and year that this datetbl is | 390 | // set our record of the month and year that this datetbl is |
391 | // displaying. | 391 | // displaying. |
392 | m_MthYr = mSelectedDates.first(); | 392 | m_MthYr = mSelectedDates.first(); |
393 | 393 | ||
394 | 394 | ||
395 | // set our record of the first day of the week of the current | 395 | // set our record of the first day of the week of the current |
396 | // month. This needs to be done before calling dayToIndex, since it | 396 | // month. This needs to be done before calling dayToIndex, since it |
397 | // relies on this information being up to date. | 397 | // relies on this information being up to date. |
398 | QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); | 398 | QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); |
399 | m_fstDayOfWk = dayone.dayOfWeek(); | 399 | m_fstDayOfWk = dayone.dayOfWeek(); |
400 | 400 | ||
401 | updateDates(); | 401 | updateDates(); |
402 | 402 | ||
403 | daymatrix->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | 403 | daymatrix->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); |
404 | 404 | ||
405 | updateView(); | 405 | updateView(); |
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | int KDateNavigator::dayNum(int row, int col) | 409 | int KDateNavigator::dayNum(int row, int col) |
410 | { | 410 | { |
411 | return 7 * (row - 1) + (col + 1) - m_fstDayOfWk; | 411 | return 7 * (row - 1) + (col + 1) - m_fstDayOfWk; |
412 | } | 412 | } |
413 | 413 | ||
414 | int KDateNavigator::dayToIndex(int dayNum) | 414 | int KDateNavigator::dayToIndex(int dayNum) |
415 | { | 415 | { |
416 | int row, col; | 416 | int row, col; |
417 | 417 | ||
418 | row = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) / 7; | 418 | row = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) / 7; |
419 | if (KGlobal::locale()->weekStartsMonday() && (m_fstDayOfWk == 1)) | 419 | if (KGlobal::locale()->weekStartsMonday() && (m_fstDayOfWk == 1)) |
420 | row++; | 420 | row++; |
421 | col = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) % 7; | 421 | col = (dayNum+m_fstDayOfWk-1-(KGlobal::locale()->weekStartsMonday() ? 1 : 0)) % 7; |
422 | return row * 7 + col; | 422 | return row * 7 + col; |
423 | } | 423 | } |
424 | 424 | ||
425 | void KDateNavigator::wheelEvent (QWheelEvent *e) | 425 | void KDateNavigator::wheelEvent (QWheelEvent *e) |
426 | { | 426 | { |
427 | if(e->delta()>0) emit goPrevious(); | 427 | if(e->delta()>0) emit goPrevious(); |
428 | else emit goNext(); | 428 | else emit goNext(); |
429 | 429 | ||
430 | e->accept(); | 430 | e->accept(); |
431 | } | 431 | } |
432 | 432 | ||
433 | bool KDateNavigator::eventFilter (QObject *o,QEvent *e) | 433 | bool KDateNavigator::eventFilter (QObject *o,QEvent *e) |
434 | { | 434 | { |
435 | if (e->type() == QEvent::MouseButtonPress) { | 435 | if (e->type() == QEvent::MouseButtonPress) { |
436 | int i; | 436 | int i; |
437 | for(i=0;i<6;++i) { | 437 | for(i=0;i<6;++i) { |
438 | if (o == weeknos[i]) { | 438 | if (o == weeknos[i]) { |
439 | QDate weekstart = daymatrix->getDate(i*7); | 439 | QDate weekstart = daymatrix->getDate(i*7); |
440 | emit weekClicked(weekstart); | 440 | emit weekClicked(weekstart); |
441 | break; | 441 | break; |
442 | } | 442 | } |
443 | } | 443 | } |
444 | for(i=0;i<7;++i) { | 444 | for(i=0;i<7;++i) { |
445 | if (o == headings[i]) { | 445 | if (o == headings[i]) { |
446 | KCal::DateList selDays; | 446 | KCal::DateList selDays; |
447 | QDate date = daymatrix->getDate(14); | 447 | QDate date = daymatrix->getDate(14); |
448 | int dio = date.daysInMonth(); | 448 | int dio = date.daysInMonth(); |
449 | int j; | 449 | int j; |
450 | int ye = date.year(); | 450 | int ye = date.year(); |
451 | int mo = date.month(); | 451 | int mo = date.month(); |
452 | for ( j = 1; j <= dio; ++j ) { | 452 | for ( j = 1; j <= dio; ++j ) { |
453 | selDays.append( QDate( ye, mo, j ) ); | 453 | selDays.append( QDate( ye, mo, j ) ); |
454 | } | 454 | } |
455 | emit datesSelected( selDays ); | 455 | emit datesSelected( selDays ); |
456 | break; | 456 | break; |
457 | } | 457 | } |
458 | } | 458 | } |
459 | return true; | 459 | return true; |
460 | } else { | 460 | } else { |
461 | return false; | 461 | return false; |
462 | } | 462 | } |
463 | } | 463 | } |
464 | 464 | ||
465 | //#include "kdatenavigator.moc" | 465 | //#include "kdatenavigator.moc" |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 82d1eab..b30ad75 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -1,804 +1,804 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlabel.h> | 20 | #include <qlabel.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qhbox.h> | 22 | #include <qhbox.h> |
23 | #include <qvbox.h> | 23 | #include <qvbox.h> |
24 | #include <qtooltip.h> | 24 | #include <qtooltip.h> |
25 | #include <qwhatsthis.h> | 25 | #include <qwhatsthis.h> |
26 | #include <qdragobject.h> | 26 | #include <qdragobject.h> |
27 | #include <qdrawutil.h> | 27 | #include <qdrawutil.h> |
28 | #include <qpainter.h> | 28 | #include <qpainter.h> |
29 | 29 | ||
30 | #include <kiconloader.h> | 30 | #include <kiconloader.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kglobal.h> | 32 | #include <kglobal.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | #ifndef DESKTOP_VERSION | 34 | #ifndef DESKTOP_VERSION |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | #define AGENDA_ICON_SIZE 5 | 36 | #define AGENDA_ICON_SIZE 5 |
37 | #else | 37 | #else |
38 | #define AGENDA_ICON_SIZE 7 | 38 | #define AGENDA_ICON_SIZE 7 |
39 | #endif | 39 | #endif |
40 | #include <libkcal/icaldrag.h> | 40 | #include <libkcal/icaldrag.h> |
41 | #include <libkcal/vcaldrag.h> | 41 | #include <libkcal/vcaldrag.h> |
42 | #include <libkcal/kincidenceformatter.h> | 42 | #include <libkcal/kincidenceformatter.h> |
43 | extern int globalFlagBlockAgenda; | 43 | extern int globalFlagBlockAgenda; |
44 | extern int globalFlagBlockAgendaItemPaint; | 44 | extern int globalFlagBlockAgendaItemPaint; |
45 | extern int globalFlagBlockAgendaItemUpdate; | 45 | extern int globalFlagBlockAgendaItemUpdate; |
46 | 46 | ||
47 | #include "koprefs.h" | 47 | #include "koprefs.h" |
48 | 48 | ||
49 | #include "koagendaitem.h" | 49 | #include "koagendaitem.h" |
50 | //#include "koagendaitem.moc" | 50 | //#include "koagendaitem.moc" |
51 | 51 | ||
52 | 52 | ||
53 | //-------------------------------------------------------------------------- | 53 | //-------------------------------------------------------------------------- |
54 | 54 | ||
55 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; | 55 | QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; |
56 | 56 | ||
57 | //-------------------------------------------------------------------------- | 57 | //-------------------------------------------------------------------------- |
58 | 58 | ||
59 | class KOAgendaItemWhatsThis :public QWhatsThis | 59 | class KOAgendaItemWhatsThis :public QWhatsThis |
60 | { | 60 | { |
61 | public: | 61 | public: |
62 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; | 62 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; |
63 | 63 | ||
64 | protected: | 64 | protected: |
65 | virtual QString text( const QPoint& ) | 65 | virtual QString text( const QPoint& ) |
66 | { | 66 | { |
67 | return _view->getWhatsThisText() ; | 67 | return _view->getWhatsThisText() ; |
68 | } | 68 | } |
69 | private: | 69 | private: |
70 | KOAgendaItem * _view; | 70 | KOAgendaItem * _view; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, | 73 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, |
74 | const char *name,WFlags) : | 74 | const char *name,WFlags) : |
75 | QWidget(parent, name), mIncidence(incidence), mDate(qd) | 75 | QWidget(parent, name), mIncidence(incidence), mDate(qd) |
76 | { | 76 | { |
77 | #ifndef DESKTOP_VERSION | 77 | #ifndef DESKTOP_VERSION |
78 | //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); | 78 | //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); |
79 | #endif | 79 | #endif |
80 | mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); | 80 | mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this); |
81 | int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase | 81 | int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase |
82 | setWFlags ( wflags); | 82 | setWFlags ( wflags); |
83 | mAllDay = allday; | 83 | mAllDay = allday; |
84 | init ( incidence, qd ); | 84 | init ( incidence, qd ); |
85 | //setMouseTracking(true); | 85 | //setMouseTracking(true); |
86 | //setAcceptDrops(true); | 86 | //setAcceptDrops(true); |
87 | xPaintCoord = -1; | 87 | xPaintCoord = -1; |
88 | yPaintCoord = -1; | 88 | yPaintCoord = -1; |
89 | } | 89 | } |
90 | QString KOAgendaItem::getWhatsThisText() | 90 | QString KOAgendaItem::getWhatsThisText() |
91 | { | 91 | { |
92 | if ( mIncidence ) | 92 | if ( mIncidence ) |
93 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, | 93 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence, |
94 | KOPrefs::instance()->mWTshowDetails, | 94 | KOPrefs::instance()->mWTshowDetails, |
95 | KOPrefs::instance()->mWTshowCreated, | 95 | KOPrefs::instance()->mWTshowCreated, |
96 | KOPrefs::instance()->mWTshowChanged); | 96 | KOPrefs::instance()->mWTshowChanged); |
97 | return "KOAgendaItem::getWhatsThisText()::internal error"; | 97 | return "KOAgendaItem::getWhatsThisText()::internal error"; |
98 | } | 98 | } |
99 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | 99 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) |
100 | { | 100 | { |
101 | mIncidence = incidence; | 101 | mIncidence = incidence; |
102 | mDate = qd; | 102 | mDate = qd; |
103 | mFirstMultiItem = 0; | 103 | mFirstMultiItem = 0; |
104 | mNextMultiItem = 0; | 104 | mNextMultiItem = 0; |
105 | mLastMultiItem = 0; | 105 | mLastMultiItem = 0; |
106 | computeText(); | 106 | computeText(); |
107 | 107 | ||
108 | if ( (incidence->type() == "Todo") && | 108 | if ( (incidence->type() == "Todo") && |
109 | ( !((static_cast<Todo*>(incidence))->isCompleted()) && | 109 | ( !((static_cast<Todo*>(incidence))->isCompleted()) && |
110 | ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { | 110 | ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { |
111 | if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) | 111 | if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) |
112 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; | 112 | mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; |
113 | else | 113 | else |
114 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; | 114 | mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; |
115 | } | 115 | } |
116 | else { | 116 | else { |
117 | QStringList categories = mIncidence->categories(); | 117 | QStringList categories = mIncidence->categories(); |
118 | QString cat = categories.first(); | 118 | QString cat = categories.first(); |
119 | if (cat.isEmpty()) { | 119 | if (cat.isEmpty()) { |
120 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) | 120 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) |
121 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 121 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
122 | else | 122 | else |
123 | mBackgroundColor =KOPrefs::instance()->mEventColor; | 123 | mBackgroundColor =KOPrefs::instance()->mEventColor; |
124 | } else { | 124 | } else { |
125 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); | 125 | mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); |
126 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { | 126 | if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { |
127 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) | 127 | if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) |
128 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; | 128 | mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; |
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 | ||
132 | } | 132 | } |
133 | mColorGroup = QColorGroup( mBackgroundColor.light(), | 133 | mColorGroup = QColorGroup( mBackgroundColor.light(), |
134 | mBackgroundColor.dark(),mBackgroundColor.light(), | 134 | mBackgroundColor.dark(),mBackgroundColor.light(), |
135 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; | 135 | mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; |
136 | setBackgroundColor( mBackgroundColor ); | 136 | setBackgroundColor( mBackgroundColor ); |
137 | 137 | ||
138 | mConflictItems.clear(); | 138 | mConflictItems.clear(); |
139 | setCellXY(0,0,1); | 139 | setCellXY(0,0,1); |
140 | setCellXWidth(0); | 140 | setCellXWidth(0); |
141 | setSubCell(0); | 141 | setSubCell(0); |
142 | setSubCells(1); | 142 | setSubCells(1); |
143 | setMultiItem(0,0,0); | 143 | setMultiItem(0,0,0); |
144 | startMove(); | 144 | startMove(); |
145 | mSelected = true; | 145 | mSelected = true; |
146 | select(false); | 146 | select(false); |
147 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); | 147 | QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); |
148 | mFontPixelSize = fontinf.height();; | 148 | mFontPixelSize = fontinf.height();; |
149 | hide(); | 149 | hide(); |
150 | xPaintCoord = -1; | 150 | xPaintCoord = -1; |
151 | yPaintCoord = -1; | 151 | yPaintCoord = -1; |
152 | } | 152 | } |
153 | 153 | ||
154 | 154 | ||
155 | KOAgendaItem::~KOAgendaItem() | 155 | KOAgendaItem::~KOAgendaItem() |
156 | { | 156 | { |
157 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); | 157 | // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); |
158 | // delete mKOAgendaItemWhatsThis; | 158 | // delete mKOAgendaItemWhatsThis; |
159 | } | 159 | } |
160 | 160 | ||
161 | void KOAgendaItem::recreateIncidence() | 161 | void KOAgendaItem::recreateIncidence() |
162 | { | 162 | { |
163 | #if 0 | 163 | #if 0 |
164 | Incidence* newInc = mIncidence->clone(); | 164 | Incidence* newInc = mIncidence->clone(); |
165 | newInc->recreate(); | 165 | newInc->recreate(); |
166 | if ( mIncidence->doesRecur() ) { | 166 | if ( mIncidence->doesRecur() ) { |
167 | mIncidence->addExDate( mDate ); | 167 | mIncidence->addExDate( mDate ); |
168 | newInc->recurrence()->unsetRecurs(); | 168 | newInc->recurrence()->unsetRecurs(); |
169 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); | 169 | int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); |
170 | QTime tim = mIncidence->dtStart().time(); | 170 | QTime tim = mIncidence->dtStart().time(); |
171 | newInc->setDtStart( QDateTime(mDate, tim) ); | 171 | newInc->setDtStart( QDateTime(mDate, tim) ); |
172 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); | 172 | ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); |
173 | } | 173 | } |
174 | #endif | 174 | #endif |
175 | mIncidence = mIncidence->recreateCloneException( mDate ); | 175 | mIncidence = mIncidence->recreateCloneException( mDate ); |
176 | } | 176 | } |
177 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) | 177 | bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) |
178 | { | 178 | { |
179 | int size = AGENDA_ICON_SIZE; | 179 | int size = AGENDA_ICON_SIZE; |
180 | 180 | ||
181 | int yOff = 0; | 181 | int yOff = 0; |
182 | int xOff = 0; | 182 | int xOff = 0; |
183 | int x = pos().x() +3; | 183 | int x = pos().x() +3; |
184 | int y; | 184 | int y; |
185 | if ( mAllDay ) | 185 | if ( mAllDay ) |
186 | y = pos().y()+3; | 186 | y = pos().y()+3; |
187 | else | 187 | else |
188 | y = mCellYTop * ( height() / cellHeight() ) +3; | 188 | y = mCellYTop * ( height() / cellHeight() ) +3; |
189 | if (mIncidence->cancelled()) { | 189 | if (mIncidence->cancelled()) { |
190 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; | 190 | int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; |
191 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; | 191 | int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; |
192 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); | 192 | p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); |
193 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); | 193 | p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); |
194 | if ( horLayout ) | 194 | if ( horLayout ) |
195 | ++xOff; | 195 | ++xOff; |
196 | else | 196 | else |
197 | ++yOff; | 197 | ++yOff; |
198 | } | 198 | } |
199 | if (mIncidence->isAlarmEnabled()) { | 199 | if (mIncidence->isAlarmEnabled()) { |
200 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); | 200 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); |
201 | if ( horLayout ) | 201 | if ( horLayout ) |
202 | ++xOff; | 202 | ++xOff; |
203 | else | 203 | else |
204 | ++yOff; | 204 | ++yOff; |
205 | } | 205 | } |
206 | if (mIncidence->recurrence()->doesRecur()) { | 206 | if (mIncidence->recurrence()->doesRecur()) { |
207 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); | 207 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, blue ); |
208 | if ( horLayout ) | 208 | if ( horLayout ) |
209 | ++xOff; | 209 | ++xOff; |
210 | else | 210 | else |
211 | ++yOff; | 211 | ++yOff; |
212 | } | 212 | } |
213 | if (mIncidence->description().length() > 0) { | 213 | if (mIncidence->description().length() > 0) { |
214 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); | 214 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkGreen ); |
215 | if ( horLayout ) | 215 | if ( horLayout ) |
216 | ++xOff; | 216 | ++xOff; |
217 | else | 217 | else |
218 | ++yOff; | 218 | ++yOff; |
219 | } | 219 | } |
220 | if (mIncidence->isReadOnly()) { | 220 | if (mIncidence->isReadOnly()) { |
221 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); | 221 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, white ); |
222 | if ( horLayout ) | 222 | if ( horLayout ) |
223 | ++xOff; | 223 | ++xOff; |
224 | else | 224 | else |
225 | ++yOff; | 225 | ++yOff; |
226 | } | 226 | } |
227 | 227 | ||
228 | if (mIncidence->attendeeCount()>0) { | 228 | if (mIncidence->attendeeCount()>0) { |
229 | 229 | ||
230 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { | 230 | if (mIncidence->organizer() == KOPrefs::instance()->email()) { |
231 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); | 231 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, black ); |
232 | if ( horLayout ) | 232 | if ( horLayout ) |
233 | ++xOff; | 233 | ++xOff; |
234 | else | 234 | else |
235 | ++yOff; | 235 | ++yOff; |
236 | } else { | 236 | } else { |
237 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 237 | Attendee *me = mIncidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
238 | if (me!=0) { | 238 | if (me!=0) { |
239 | 239 | ||
240 | 240 | ||
241 | } else { | 241 | } else { |
242 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); | 242 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, yellow ); |
243 | if ( horLayout ) | 243 | if ( horLayout ) |
244 | ++xOff; | 244 | ++xOff; |
245 | else | 245 | else |
246 | ++yOff; | 246 | ++yOff; |
247 | 247 | ||
248 | } | 248 | } |
249 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); | 249 | p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, darkYellow ); |
250 | if ( horLayout ) | 250 | if ( horLayout ) |
251 | ++xOff; | 251 | ++xOff; |
252 | else | 252 | else |
253 | ++yOff; | 253 | ++yOff; |
254 | 254 | ||
255 | } | 255 | } |
256 | 256 | ||
257 | } | 257 | } |
258 | return ( yOff || xOff ); | 258 | return ( yOff || xOff ); |
259 | } | 259 | } |
260 | 260 | ||
261 | 261 | ||
262 | void KOAgendaItem::select(bool selected) | 262 | void KOAgendaItem::select(bool selected) |
263 | { | 263 | { |
264 | //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); | 264 | //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); |
265 | if (mSelected == selected) return; | 265 | if (mSelected == selected) return; |
266 | mSelected = selected; | 266 | mSelected = selected; |
267 | if ( ! isVisible() ) | 267 | if ( ! isVisible() ) |
268 | return; | 268 | return; |
269 | if ( firstMultiItem() ) | 269 | if ( firstMultiItem() ) |
270 | firstMultiItem()->select( selected ); | 270 | firstMultiItem()->select( selected ); |
271 | if ( !firstMultiItem() && nextMultiItem() ) { | 271 | if ( !firstMultiItem() && nextMultiItem() ) { |
272 | KOAgendaItem * placeItem = nextMultiItem(); | 272 | KOAgendaItem * placeItem = nextMultiItem(); |
273 | while ( placeItem ) { | 273 | while ( placeItem ) { |
274 | placeItem->select( selected ); | 274 | placeItem->select( selected ); |
275 | placeItem = placeItem->nextMultiItem(); | 275 | placeItem = placeItem->nextMultiItem(); |
276 | } | 276 | } |
277 | } | 277 | } |
278 | globalFlagBlockAgendaItemUpdate = 0; | 278 | globalFlagBlockAgendaItemUpdate = 0; |
279 | paintMe( selected ); | 279 | paintMe( selected ); |
280 | globalFlagBlockAgendaItemUpdate = 1; | 280 | globalFlagBlockAgendaItemUpdate = 1; |
281 | repaint( false ); | 281 | repaint( false ); |
282 | } | 282 | } |
283 | 283 | ||
284 | 284 | ||
285 | /* | 285 | /* |
286 | The eventFilter has to filter the mouse events of the agenda item childs. The | 286 | The eventFilter has to filter the mouse events of the agenda item childs. The |
287 | events are fed into the event handling method of KOAgendaItem. This allows the | 287 | events are fed into the event handling method of KOAgendaItem. This allows the |
288 | KOAgenda to handle the KOAgendaItems by using an eventFilter. | 288 | KOAgenda to handle the KOAgendaItems by using an eventFilter. |
289 | */ | 289 | */ |
290 | bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) | 290 | bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) |
291 | { | 291 | { |
292 | if (e->type() == QEvent::MouseButtonPress || | 292 | if (e->type() == QEvent::MouseButtonPress || |
293 | e->type() == QEvent::MouseButtonDblClick || | 293 | e->type() == QEvent::MouseButtonDblClick || |
294 | e->type() == QEvent::MouseButtonRelease || | 294 | e->type() == QEvent::MouseButtonRelease || |
295 | e->type() == QEvent::MouseMove) { | 295 | e->type() == QEvent::MouseMove) { |
296 | QMouseEvent *me = (QMouseEvent *)e; | 296 | QMouseEvent *me = (QMouseEvent *)e; |
297 | QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> | 297 | QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> |
298 | mapToGlobal(me->pos())); | 298 | mapToGlobal(me->pos())); |
299 | QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); | 299 | QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); |
300 | return event(&returnEvent); | 300 | return event(&returnEvent); |
301 | } else { | 301 | } else { |
302 | return false; | 302 | return false; |
303 | } | 303 | } |
304 | } | 304 | } |
305 | void KOAgendaItem::repaintMe( ) | 305 | void KOAgendaItem::repaintMe( ) |
306 | { | 306 | { |
307 | paintMe ( mSelected ); | 307 | paintMe ( mSelected ); |
308 | } | 308 | } |
309 | void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | 309 | void KOAgendaItem::paintMe( bool selected, QPainter* paint ) |
310 | { | 310 | { |
311 | if ( globalFlagBlockAgendaItemUpdate && ! selected) | 311 | if ( globalFlagBlockAgendaItemUpdate && ! selected) |
312 | return; | 312 | return; |
313 | QPainter pa; | 313 | QPainter pa; |
314 | 314 | ||
315 | if ( mSelected ) { | 315 | if ( mSelected ) { |
316 | pa.begin( paintPixSel() ); | 316 | pa.begin( paintPixSel() ); |
317 | } else { | 317 | } else { |
318 | if ( mAllDay ) | 318 | if ( mAllDay ) |
319 | pa.begin( paintPixAllday() ); | 319 | pa.begin( paintPixAllday() ); |
320 | else | 320 | else |
321 | pa.begin( paintPix() ); | 321 | pa.begin( paintPix() ); |
322 | } | 322 | } |
323 | int x, yy, w, h; | 323 | int x, yy, w, h; |
324 | float nfh = 7.0; | 324 | float nfh = 7.0; |
325 | x = pos().x(); w = width(); h = height (); | 325 | x = pos().x(); w = width(); h = height (); |
326 | if ( mAllDay ) | 326 | if ( mAllDay ) |
327 | yy = y(); | 327 | yy = y(); |
328 | else | 328 | else |
329 | yy = mCellYTop * ( height() / cellHeight() ); | 329 | yy = mCellYTop * ( height() / cellHeight() ); |
330 | xPaintCoord= x; | 330 | xPaintCoord= x; |
331 | yPaintCoord = yy; | 331 | yPaintCoord = yy; |
332 | wPaintCoord = width(); | 332 | wPaintCoord = width(); |
333 | hPaintCoord = height(); | 333 | hPaintCoord = height(); |
334 | //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); | 334 | //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); |
335 | if ( paint == 0 ) | 335 | if ( paint == 0 ) |
336 | paint = &pa; | 336 | paint = &pa; |
337 | bool horLayout = ( w < h ); | 337 | bool horLayout = ( w < h ); |
338 | int maxhei = mFontPixelSize+4; | 338 | int maxhei = mFontPixelSize+4; |
339 | if ( horLayout ) | 339 | if ( horLayout ) |
340 | maxhei += AGENDA_ICON_SIZE -4; | 340 | maxhei += AGENDA_ICON_SIZE -4; |
341 | bool small = ( h < maxhei ); | 341 | bool small = ( h < maxhei ); |
342 | if ( ! small ) | 342 | if ( ! small ) |
343 | paint->setFont(KOPrefs::instance()->mAgendaViewFont); | 343 | paint->setFont(KOPrefs::instance()->mAgendaViewFont); |
344 | else { | 344 | else { |
345 | QFont f = KOPrefs::instance()->mAgendaViewFont; | 345 | QFont f = KOPrefs::instance()->mAgendaViewFont; |
346 | f.setBold( false ); | 346 | f.setBold( false ); |
347 | int fh = f.pointSize(); | 347 | int fh = f.pointSize(); |
348 | nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; | 348 | nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; |
349 | if ( nfh < 6 ) | 349 | if ( nfh < 6 ) |
350 | nfh = 6; | 350 | nfh = 6; |
351 | f.setPointSize( nfh ); | 351 | f.setPointSize( nfh ); |
352 | paint->setFont(f); | 352 | paint->setFont(f); |
353 | } | 353 | } |
354 | paint->fillRect ( x, yy, w, h, mBackgroundColor ); | 354 | paint->fillRect ( x, yy, w, h, mBackgroundColor ); |
355 | static const QPixmap completedPxmp = SmallIcon("greenhook16"); | 355 | static const QPixmap completedPxmp = SmallIcon("greenhook16"); |
356 | static const QPixmap overduePxmp = SmallIcon("redcross16"); | 356 | static const QPixmap overduePxmp = SmallIcon("redcross16"); |
357 | if ( mIncidence->type() == "Todo" ) { | 357 | if ( mIncidence->type() == "Todo" ) { |
358 | Todo* tempTodo = static_cast<Todo*>(mIncidence); | 358 | Todo* tempTodo = static_cast<Todo*>(mIncidence); |
359 | int xx = pos().x()+(width()-completedPxmp.width()-3 ); | 359 | int xx = pos().x()+(width()-completedPxmp.width()-3 ); |
360 | int yyy = yy+3; | 360 | int yyy = yy+3; |
361 | if ( tempTodo->isCompleted() ) | 361 | if ( tempTodo->isCompleted() ) |
362 | paint->drawPixmap ( xx, yyy, completedPxmp ); | 362 | paint->drawPixmap ( xx, yyy, completedPxmp ); |
363 | else { | 363 | else { |
364 | paint->drawPixmap ( xx, yyy, overduePxmp ); | 364 | paint->drawPixmap ( xx, yyy, overduePxmp ); |
365 | 365 | ||
366 | } | 366 | } |
367 | } | 367 | } |
368 | bool addIcon = false; | 368 | bool addIcon = false; |
369 | if ( ! small || w > 3 * h || h > 3* w ) | 369 | if ( ! small || w > 3 * h || h > 3* w ) |
370 | addIcon = updateIcons( paint, horLayout ); | 370 | addIcon = updateIcons( paint, horLayout ); |
371 | 371 | ||
372 | qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); | 372 | qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); |
373 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); | 373 | //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); |
374 | if ( ! small ) { | 374 | if ( ! small ) { |
375 | x += 3; yy += 3;w -= 6; h-= 5; | 375 | x += 3; yy += 3;w -= 6; h-= 5; |
376 | } else { | 376 | } else { |
377 | x += 2; yy += 1;w -= 4; h-= 4; | 377 | x += 2; yy += 1;w -= 4; h-= 4; |
378 | if ( nfh < 6.01 ) { | 378 | if ( nfh < 6.01 ) { |
379 | yy -= 2; | 379 | yy -= 2; |
380 | h += 4; | 380 | h += 4; |
381 | } | 381 | } |
382 | else | 382 | else |
383 | if ( nfh < h -2 ) | 383 | if ( nfh < h -2 ) |
384 | ++yy; | 384 | ++yy; |
385 | } | 385 | } |
386 | int align; | 386 | int align; |
387 | #ifndef DESKTOP_VERSION | 387 | #ifndef DESKTOP_VERSION |
388 | align = ( AlignLeft|WordBreak|AlignTop); | 388 | align = ( AlignLeft|WordBreak|AlignTop); |
389 | #else | 389 | #else |
390 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 390 | align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
391 | #endif | 391 | #endif |
392 | if ( addIcon ) { | 392 | if ( addIcon ) { |
393 | if ( ! horLayout ) { | 393 | if ( ! horLayout ) { |
394 | x += AGENDA_ICON_SIZE+3; | 394 | x += AGENDA_ICON_SIZE+3; |
395 | w -= (AGENDA_ICON_SIZE+3); | 395 | w -= (AGENDA_ICON_SIZE+3); |
396 | } | 396 | } |
397 | else { | 397 | else { |
398 | yy+= AGENDA_ICON_SIZE+2; | 398 | yy+= AGENDA_ICON_SIZE+2; |
399 | h -=(AGENDA_ICON_SIZE+3); | 399 | h -=(AGENDA_ICON_SIZE+3); |
400 | } | 400 | } |
401 | } | 401 | } |
402 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); | 402 | int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); |
403 | if ( colsum < 250 ) | 403 | if ( colsum < 250 ) |
404 | paint->setPen ( white); | 404 | paint->setPen ( white); |
405 | if ( x < 0 ) { | 405 | if ( x < 0 ) { |
406 | w = w+x-3; | 406 | w = w+x-3; |
407 | x = 3; | 407 | x = 3; |
408 | if ( w > parentWidget()->width() ){ | 408 | if ( w > parentWidget()->width() ){ |
409 | w = parentWidget()->width() - 6; | 409 | w = parentWidget()->width() - 6; |
410 | #ifndef DESKTOP_VERSION | 410 | #ifndef DESKTOP_VERSION |
411 | align = ( AlignHCenter|WordBreak|AlignTop); | 411 | align = ( AlignHCenter|WordBreak|AlignTop); |
412 | #else | 412 | #else |
413 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); | 413 | align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); |
414 | #endif | 414 | #endif |
415 | 415 | ||
416 | } | 416 | } |
417 | } | 417 | } |
418 | QRect dr; | 418 | QRect dr; |
419 | if ( w + x > parentWidget()->width() ) | 419 | if ( w + x > parentWidget()->width() ) |
420 | w = parentWidget()->width()-x; | 420 | w = parentWidget()->width()-x; |
421 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); | 421 | paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); |
422 | //qDebug("%d %d %d %d ", x, yy, w, h ); | 422 | //qDebug("%d %d %d %d ", x, yy, w, h ); |
423 | if ( mIncidence->cancelled() ){ | 423 | if ( mIncidence->cancelled() ){ |
424 | if ( ! small ) { | 424 | if ( ! small ) { |
425 | QFontMetrics fm ( paint->font() ); | 425 | QFontMetrics fm ( paint->font() ); |
426 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); | 426 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); |
427 | } | 427 | } |
428 | 428 | ||
429 | } | 429 | } |
430 | pa.end(); | 430 | pa.end(); |
431 | 431 | ||
432 | } | 432 | } |
433 | void KOAgendaItem::resizePixmap( int w , int h ) | 433 | void KOAgendaItem::resizePixmap( int w , int h ) |
434 | { | 434 | { |
435 | paintPix()->resize( w, h ); | 435 | paintPix()->resize( w, h ); |
436 | paintPixSel()->resize( w, h ); | 436 | paintPixSel()->resize( w, h ); |
437 | 437 | ||
438 | } | 438 | } |
439 | QPixmap * KOAgendaItem::paintPix() | 439 | QPixmap * KOAgendaItem::paintPix() |
440 | { | 440 | { |
441 | static QPixmap* mPaintPix = 0; | 441 | static QPixmap* mPaintPix = 0; |
442 | if ( ! mPaintPix ) | 442 | if ( ! mPaintPix ) |
443 | mPaintPix = new QPixmap(1,1); | 443 | mPaintPix = new QPixmap(1,1); |
444 | return mPaintPix ; | 444 | return mPaintPix ; |
445 | } | 445 | } |
446 | QPixmap * KOAgendaItem::paintPixAllday() | 446 | QPixmap * KOAgendaItem::paintPixAllday() |
447 | { | 447 | { |
448 | static QPixmap* mPaintPixA = 0; | 448 | static QPixmap* mPaintPixA = 0; |
449 | if ( ! mPaintPixA ) | 449 | if ( ! mPaintPixA ) |
450 | mPaintPixA = new QPixmap(1,1); | 450 | mPaintPixA = new QPixmap(1,1); |
451 | return mPaintPixA ; | 451 | return mPaintPixA ; |
452 | } | 452 | } |
453 | QPixmap * KOAgendaItem::paintPixSel() | 453 | QPixmap * KOAgendaItem::paintPixSel() |
454 | { | 454 | { |
455 | static QPixmap* mPaintPixSel = 0; | 455 | static QPixmap* mPaintPixSel = 0; |
456 | if ( ! mPaintPixSel ) | 456 | if ( ! mPaintPixSel ) |
457 | mPaintPixSel = new QPixmap(1,1); | 457 | mPaintPixSel = new QPixmap(1,1); |
458 | return mPaintPixSel ; | 458 | return mPaintPixSel ; |
459 | } | 459 | } |
460 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) | 460 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) |
461 | { | 461 | { |
462 | 462 | ||
463 | if ( globalFlagBlockAgendaItemPaint ) | 463 | if ( globalFlagBlockAgendaItemPaint ) |
464 | return; | 464 | return; |
465 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) | 465 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) |
466 | return; | 466 | return; |
467 | int yy; | 467 | int yy; |
468 | if ( mAllDay ) | 468 | if ( mAllDay ) |
469 | yy = y(); | 469 | yy = y(); |
470 | else | 470 | else |
471 | yy = mCellYTop * ( height() / cellHeight() ); | 471 | yy = mCellYTop * ( height() / cellHeight() ); |
472 | int xx = x(); | 472 | int xx = x(); |
473 | 473 | ||
474 | if ( xPaintCoord != xx || yPaintCoord != yy || | 474 | if ( xPaintCoord != xx || yPaintCoord != yy || |
475 | wPaintCoord != width() || hPaintCoord != height()) { | 475 | wPaintCoord != width() || hPaintCoord != height()) { |
476 | xPaintCoord= xx; | 476 | xPaintCoord= xx; |
477 | yPaintCoord = yy; | 477 | yPaintCoord = yy; |
478 | wPaintCoord = width(); | 478 | wPaintCoord = width(); |
479 | hPaintCoord = height(); | 479 | hPaintCoord = height(); |
480 | globalFlagBlockAgendaItemUpdate = 0; | 480 | globalFlagBlockAgendaItemUpdate = 0; |
481 | paintMe( mSelected ); | 481 | paintMe( mSelected ); |
482 | //qDebug("calling paintMe "); | 482 | //qDebug("calling paintMe "); |
483 | globalFlagBlockAgendaItemUpdate = 1; | 483 | globalFlagBlockAgendaItemUpdate = 1; |
484 | } | 484 | } |
485 | int rx, ry, rw, rh; | 485 | int rx, ry, rw, rh; |
486 | rx = e->rect().x(); | 486 | rx = e->rect().x(); |
487 | ry = e->rect().y(); | 487 | ry = e->rect().y(); |
488 | rw = e->rect().width(); | 488 | rw = e->rect().width(); |
489 | rh = e->rect().height(); | 489 | rh = e->rect().height(); |
490 | //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); | 490 | //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); |
491 | 491 | ||
492 | QPixmap* paintFrom ; | 492 | QPixmap* paintFrom ; |
493 | if ( mSelected ) { | 493 | if ( mSelected ) { |
494 | paintFrom = paintPixSel(); | 494 | paintFrom = paintPixSel(); |
495 | } else { | 495 | } else { |
496 | if ( mAllDay ) | 496 | if ( mAllDay ) |
497 | paintFrom = paintPixAllday(); | 497 | paintFrom = paintPixAllday(); |
498 | else | 498 | else |
499 | paintFrom = paintPix(); | 499 | paintFrom = paintPix(); |
500 | } | 500 | } |
501 | xx += rx; | 501 | xx += rx; |
502 | 502 | ||
503 | if ( xx < 0 ) { | 503 | if ( xx < 0 ) { |
504 | rw = rw + xx; | 504 | rw = rw + xx; |
505 | rx -= xx; | 505 | rx -= xx; |
506 | xx = 0; | 506 | xx = 0; |
507 | if ( rw <= 1 ) { | 507 | if ( rw <= 1 ) { |
508 | qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); | 508 | //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); |
509 | return; | 509 | return; |
510 | } | 510 | } |
511 | } | 511 | } |
512 | if ( paintFrom->width() < xx+rw ) { | 512 | if ( paintFrom->width() < xx+rw ) { |
513 | rw = paintFrom->width() - xx; | 513 | rw = paintFrom->width() - xx; |
514 | if ( rw <= 1 ) { | 514 | if ( rw <= 1 ) { |
515 | qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); | 515 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); |
516 | return; | 516 | return; |
517 | } | 517 | } |
518 | } | 518 | } |
519 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); | 519 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); |
520 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); | 520 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); |
521 | } | 521 | } |
522 | void KOAgendaItem::computeText() | 522 | void KOAgendaItem::computeText() |
523 | { | 523 | { |
524 | 524 | ||
525 | mDisplayedText = mIncidence->summary(); | 525 | mDisplayedText = mIncidence->summary(); |
526 | if ( (mIncidence->type() == "Todo") ) { | 526 | if ( (mIncidence->type() == "Todo") ) { |
527 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { | 527 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { |
528 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) | 528 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) |
529 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; | 529 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; |
530 | else if ( !(mIncidence->doesFloat())) | 530 | else if ( !(mIncidence->doesFloat())) |
531 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; | 531 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; |
532 | } | 532 | } |
533 | } else { | 533 | } else { |
534 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) | 534 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) |
535 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; | 535 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; |
536 | 536 | ||
537 | if ( mAllDay ) { | 537 | if ( mAllDay ) { |
538 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { | 538 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { |
539 | mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; | 539 | mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; |
540 | } | 540 | } |
541 | } | 541 | } |
542 | 542 | ||
543 | } | 543 | } |
544 | 544 | ||
545 | if ( !mIncidence->location().isEmpty() ) { | 545 | if ( !mIncidence->location().isEmpty() ) { |
546 | if ( mAllDay ) | 546 | if ( mAllDay ) |
547 | mDisplayedText += " ("; | 547 | mDisplayedText += " ("; |
548 | else | 548 | else |
549 | mDisplayedText += "\n("; | 549 | mDisplayedText += "\n("; |
550 | mDisplayedText += mIncidence->location() +")"; | 550 | mDisplayedText += mIncidence->location() +")"; |
551 | } | 551 | } |
552 | 552 | ||
553 | QString tipText = mIncidence->summary(); | 553 | QString tipText = mIncidence->summary(); |
554 | if ( !mIncidence->doesFloat() ) { | 554 | if ( !mIncidence->doesFloat() ) { |
555 | if ( mIncidence->type() == "Event" ) { | 555 | if ( mIncidence->type() == "Event" ) { |
556 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { | 556 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { |
557 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); | 557 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); |
558 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); | 558 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); |
559 | } | 559 | } |
560 | else { | 560 | else { |
561 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); | 561 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); |
562 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); | 562 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); |
563 | } | 563 | } |
564 | } | 564 | } |
565 | else if ( mIncidence->type() == "Todo" ) { | 565 | else if ( mIncidence->type() == "Todo" ) { |
566 | if (mIncidence->hasStartDate()) | 566 | if (mIncidence->hasStartDate()) |
567 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); | 567 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); |
568 | if (((Todo*)mIncidence)->hasDueDate()) | 568 | if (((Todo*)mIncidence)->hasDueDate()) |
569 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); | 569 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); |
570 | } | 570 | } |
571 | } else if ( mIncidence->type() == "Todo" ) { | 571 | } else if ( mIncidence->type() == "Todo" ) { |
572 | if (mIncidence->hasStartDate()) | 572 | if (mIncidence->hasStartDate()) |
573 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); | 573 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); |
574 | if (((Todo*)mIncidence)->hasDueDate()) | 574 | if (((Todo*)mIncidence)->hasDueDate()) |
575 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); | 575 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); |
576 | } | 576 | } |
577 | 577 | ||
578 | if (!mIncidence->location().isEmpty()) { | 578 | if (!mIncidence->location().isEmpty()) { |
579 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); | 579 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); |
580 | } | 580 | } |
581 | QToolTip::add(this,tipText,toolTipGroup(),""); | 581 | QToolTip::add(this,tipText,toolTipGroup(),""); |
582 | 582 | ||
583 | } | 583 | } |
584 | void KOAgendaItem::updateItem() | 584 | void KOAgendaItem::updateItem() |
585 | { | 585 | { |
586 | computeText(); | 586 | computeText(); |
587 | 587 | ||
588 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); | 588 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); |
589 | paintMe( mSelected ); | 589 | paintMe( mSelected ); |
590 | repaint( false); | 590 | repaint( false); |
591 | } | 591 | } |
592 | 592 | ||
593 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) | 593 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) |
594 | { | 594 | { |
595 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); | 595 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); |
596 | paintMe( mSelected ); | 596 | paintMe( mSelected ); |
597 | repaint( false ); | 597 | repaint( false ); |
598 | } | 598 | } |
599 | 599 | ||
600 | /* | 600 | /* |
601 | Return height of item in units of agenda cells | 601 | Return height of item in units of agenda cells |
602 | */ | 602 | */ |
603 | int KOAgendaItem::cellHeight() | 603 | int KOAgendaItem::cellHeight() |
604 | { | 604 | { |
605 | int ret = mCellYBottom - mCellYTop + 1; | 605 | int ret = mCellYBottom - mCellYTop + 1; |
606 | if ( ret <= 0 ) { | 606 | if ( ret <= 0 ) { |
607 | ret = 1; | 607 | ret = 1; |
608 | mCellYBottom = 0; | 608 | mCellYBottom = 0; |
609 | mCellYTop = 0; | 609 | mCellYTop = 0; |
610 | } | 610 | } |
611 | return ret; | 611 | return ret; |
612 | } | 612 | } |
613 | 613 | ||
614 | /* | 614 | /* |
615 | Return height of item in units of agenda cells | 615 | Return height of item in units of agenda cells |
616 | */ | 616 | */ |
617 | int KOAgendaItem::cellWidth() | 617 | int KOAgendaItem::cellWidth() |
618 | { | 618 | { |
619 | return mCellXWidth - mCellX + 1; | 619 | return mCellXWidth - mCellX + 1; |
620 | } | 620 | } |
621 | 621 | ||
622 | void KOAgendaItem::setItemDate(QDate qd) | 622 | void KOAgendaItem::setItemDate(QDate qd) |
623 | { | 623 | { |
624 | mDate = qd; | 624 | mDate = qd; |
625 | } | 625 | } |
626 | 626 | ||
627 | void KOAgendaItem::setCellXY(int X, int YTop, int YBottom) | 627 | void KOAgendaItem::setCellXY(int X, int YTop, int YBottom) |
628 | { | 628 | { |
629 | mCellX = X; | 629 | mCellX = X; |
630 | mCellYTop = YTop; | 630 | mCellYTop = YTop; |
631 | mCellYBottom = YBottom; | 631 | mCellYBottom = YBottom; |
632 | } | 632 | } |
633 | 633 | ||
634 | void KOAgendaItem::setCellXWidth(int xwidth) | 634 | void KOAgendaItem::setCellXWidth(int xwidth) |
635 | { | 635 | { |
636 | mCellXWidth = xwidth; | 636 | mCellXWidth = xwidth; |
637 | } | 637 | } |
638 | 638 | ||
639 | void KOAgendaItem::setCellX(int XLeft, int XRight) | 639 | void KOAgendaItem::setCellX(int XLeft, int XRight) |
640 | { | 640 | { |
641 | mCellX = XLeft; | 641 | mCellX = XLeft; |
642 | mCellXWidth = XRight; | 642 | mCellXWidth = XRight; |
643 | } | 643 | } |
644 | 644 | ||
645 | void KOAgendaItem::setCellY(int YTop, int YBottom) | 645 | void KOAgendaItem::setCellY(int YTop, int YBottom) |
646 | { | 646 | { |
647 | mCellYTop = YTop; | 647 | mCellYTop = YTop; |
648 | mCellYBottom = YBottom; | 648 | mCellYBottom = YBottom; |
649 | } | 649 | } |
650 | 650 | ||
651 | void KOAgendaItem::setSubCell(int subCell) | 651 | void KOAgendaItem::setSubCell(int subCell) |
652 | { | 652 | { |
653 | mSubCell = subCell; | 653 | mSubCell = subCell; |
654 | } | 654 | } |
655 | 655 | ||
656 | void KOAgendaItem::setSubCells(int subCells) | 656 | void KOAgendaItem::setSubCells(int subCells) |
657 | { | 657 | { |
658 | mSubCells = subCells; | 658 | mSubCells = subCells; |
659 | } | 659 | } |
660 | 660 | ||
661 | void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next, | 661 | void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next, |
662 | KOAgendaItem *last) | 662 | KOAgendaItem *last) |
663 | { | 663 | { |
664 | mFirstMultiItem = first; | 664 | mFirstMultiItem = first; |
665 | mNextMultiItem = next; | 665 | mNextMultiItem = next; |
666 | mLastMultiItem = last; | 666 | mLastMultiItem = last; |
667 | } | 667 | } |
668 | 668 | ||
669 | void KOAgendaItem::startMove() | 669 | void KOAgendaItem::startMove() |
670 | { | 670 | { |
671 | mStartCellX = mCellX; | 671 | mStartCellX = mCellX; |
672 | mStartCellXWidth = mCellXWidth; | 672 | mStartCellXWidth = mCellXWidth; |
673 | mStartCellYTop = mCellYTop; | 673 | mStartCellYTop = mCellYTop; |
674 | mStartCellYBottom = mCellYBottom; | 674 | mStartCellYBottom = mCellYBottom; |
675 | } | 675 | } |
676 | 676 | ||
677 | void KOAgendaItem::resetMove() | 677 | void KOAgendaItem::resetMove() |
678 | { | 678 | { |
679 | mCellX = mStartCellX; | 679 | mCellX = mStartCellX; |
680 | mCellXWidth = mStartCellXWidth; | 680 | mCellXWidth = mStartCellXWidth; |
681 | mCellYTop = mStartCellYTop; | 681 | mCellYTop = mStartCellYTop; |
682 | mCellYBottom = mStartCellYBottom; | 682 | mCellYBottom = mStartCellYBottom; |
683 | } | 683 | } |
684 | 684 | ||
685 | void KOAgendaItem::moveRelative(int dx, int dy) | 685 | void KOAgendaItem::moveRelative(int dx, int dy) |
686 | { | 686 | { |
687 | int newX = cellX() + dx; | 687 | int newX = cellX() + dx; |
688 | int newXWidth = cellXWidth() + dx; | 688 | int newXWidth = cellXWidth() + dx; |
689 | int newYTop = cellYTop() + dy; | 689 | int newYTop = cellYTop() + dy; |
690 | int newYBottom = cellYBottom() + dy; | 690 | int newYBottom = cellYBottom() + dy; |
691 | setCellXY(newX,newYTop,newYBottom); | 691 | setCellXY(newX,newYTop,newYBottom); |
692 | setCellXWidth(newXWidth); | 692 | setCellXWidth(newXWidth); |
693 | } | 693 | } |
694 | 694 | ||
695 | void KOAgendaItem::expandTop(int dy) | 695 | void KOAgendaItem::expandTop(int dy) |
696 | { | 696 | { |
697 | int newYTop = cellYTop() + dy; | 697 | int newYTop = cellYTop() + dy; |
698 | int newYBottom = cellYBottom(); | 698 | int newYBottom = cellYBottom(); |
699 | if (newYTop > newYBottom) newYTop = newYBottom; | 699 | if (newYTop > newYBottom) newYTop = newYBottom; |
700 | setCellY(newYTop, newYBottom); | 700 | setCellY(newYTop, newYBottom); |
701 | } | 701 | } |
702 | 702 | ||
703 | void KOAgendaItem::expandBottom(int dy) | 703 | void KOAgendaItem::expandBottom(int dy) |
704 | { | 704 | { |
705 | int newYTop = cellYTop(); | 705 | int newYTop = cellYTop(); |
706 | int newYBottom = cellYBottom() + dy; | 706 | int newYBottom = cellYBottom() + dy; |
707 | if (newYBottom < newYTop) newYBottom = newYTop; | 707 | if (newYBottom < newYTop) newYBottom = newYTop; |
708 | setCellY(newYTop, newYBottom); | 708 | setCellY(newYTop, newYBottom); |
709 | } | 709 | } |
710 | 710 | ||
711 | void KOAgendaItem::expandLeft(int dx) | 711 | void KOAgendaItem::expandLeft(int dx) |
712 | { | 712 | { |
713 | int newX = cellX() + dx; | 713 | int newX = cellX() + dx; |
714 | int newXWidth = cellXWidth(); | 714 | int newXWidth = cellXWidth(); |
715 | if (newX > newXWidth) newX = newXWidth; | 715 | if (newX > newXWidth) newX = newXWidth; |
716 | setCellX(newX,newXWidth); | 716 | setCellX(newX,newXWidth); |
717 | } | 717 | } |
718 | 718 | ||
719 | void KOAgendaItem::expandRight(int dx) | 719 | void KOAgendaItem::expandRight(int dx) |
720 | { | 720 | { |
721 | int newX = cellX(); | 721 | int newX = cellX(); |
722 | int newXWidth = cellXWidth() + dx; | 722 | int newXWidth = cellXWidth() + dx; |
723 | if (newXWidth < newX) newXWidth = newX; | 723 | if (newXWidth < newX) newXWidth = newX; |
724 | setCellX(newX,newXWidth); | 724 | setCellX(newX,newXWidth); |
725 | } | 725 | } |
726 | 726 | ||
727 | QToolTipGroup *KOAgendaItem::toolTipGroup() | 727 | QToolTipGroup *KOAgendaItem::toolTipGroup() |
728 | { | 728 | { |
729 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | 729 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); |
730 | return mToolTipGroup; | 730 | return mToolTipGroup; |
731 | } | 731 | } |
732 | 732 | ||
733 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) | 733 | void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) |
734 | { | 734 | { |
735 | #ifndef KORG_NODND | 735 | #ifndef KORG_NODND |
736 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || | 736 | if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || |
737 | !QTextDrag::canDecode( e ) ) { | 737 | !QTextDrag::canDecode( e ) ) { |
738 | e->ignore(); | 738 | e->ignore(); |
739 | return; | 739 | return; |
740 | } | 740 | } |
741 | e->accept(); | 741 | e->accept(); |
742 | #endif | 742 | #endif |
743 | } | 743 | } |
744 | 744 | ||
745 | void KOAgendaItem::dropEvent( QDropEvent *e ) | 745 | void KOAgendaItem::dropEvent( QDropEvent *e ) |
746 | { | 746 | { |
747 | #ifndef KORG_NODND | 747 | #ifndef KORG_NODND |
748 | QString text; | 748 | QString text; |
749 | if(QTextDrag::decode(e,text)) | 749 | if(QTextDrag::decode(e,text)) |
750 | { | 750 | { |
751 | kdDebug() << "Dropped : " << text << endl; | 751 | kdDebug() << "Dropped : " << text << endl; |
752 | QStringList emails = QStringList::split(",",text); | 752 | QStringList emails = QStringList::split(",",text); |
753 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 753 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
754 | kdDebug() << " Email: " << (*it) << endl; | 754 | kdDebug() << " Email: " << (*it) << endl; |
755 | int pos = (*it).find("<"); | 755 | int pos = (*it).find("<"); |
756 | QString name = (*it).left(pos); | 756 | QString name = (*it).left(pos); |
757 | QString email = (*it).mid(pos); | 757 | QString email = (*it).mid(pos); |
758 | if (!email.isEmpty()) { | 758 | if (!email.isEmpty()) { |
759 | mIncidence->addAttendee(new Attendee(name,email)); | 759 | mIncidence->addAttendee(new Attendee(name,email)); |
760 | } | 760 | } |
761 | } | 761 | } |
762 | } | 762 | } |
763 | #endif | 763 | #endif |
764 | } | 764 | } |
765 | 765 | ||
766 | 766 | ||
767 | QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() | 767 | QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() |
768 | { | 768 | { |
769 | return mConflictItems; | 769 | return mConflictItems; |
770 | } | 770 | } |
771 | 771 | ||
772 | void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) | 772 | void KOAgendaItem::setConflictItems(QPtrList<KOAgendaItem> ci) |
773 | { | 773 | { |
774 | mConflictItems = ci; | 774 | mConflictItems = ci; |
775 | KOAgendaItem *item; | 775 | KOAgendaItem *item; |
776 | for ( item=mConflictItems.first(); item != 0; | 776 | for ( item=mConflictItems.first(); item != 0; |
777 | item=mConflictItems.next() ) { | 777 | item=mConflictItems.next() ) { |
778 | item->addConflictItem(this); | 778 | item->addConflictItem(this); |
779 | } | 779 | } |
780 | } | 780 | } |
781 | 781 | ||
782 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) | 782 | void KOAgendaItem::addConflictItem(KOAgendaItem *ci) |
783 | { | 783 | { |
784 | if (mConflictItems.find(ci)<0) | 784 | if (mConflictItems.find(ci)<0) |
785 | mConflictItems.append(ci); | 785 | mConflictItems.append(ci); |
786 | } | 786 | } |
787 | 787 | ||
788 | bool KOAgendaItem::checkLayout() | 788 | bool KOAgendaItem::checkLayout() |
789 | { | 789 | { |
790 | if ( !mConflictItems.count() ) | 790 | if ( !mConflictItems.count() ) |
791 | return true; | 791 | return true; |
792 | int max = 0; | 792 | int max = 0; |
793 | KOAgendaItem *item; | 793 | KOAgendaItem *item; |
794 | for ( item=mConflictItems.first(); item != 0; | 794 | for ( item=mConflictItems.first(); item != 0; |
795 | item=mConflictItems.next() ) { | 795 | item=mConflictItems.next() ) { |
796 | if ( item->subCells() > max ) | 796 | if ( item->subCells() > max ) |
797 | max = item->subCells(); | 797 | max = item->subCells(); |
798 | } | 798 | } |
799 | if ( max > subCells() ) { | 799 | if ( max > subCells() ) { |
800 | setSubCells( max ); | 800 | setSubCells( max ); |
801 | return false; | 801 | return false; |
802 | } | 802 | } |
803 | return true; | 803 | return true; |
804 | } | 804 | } |
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 40e8a99..74037e6 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -1,1431 +1,1431 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 34 | #include <qvbox.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | 44 | ||
45 | #include <kcolorbutton.h> | 45 | #include <kcolorbutton.h> |
46 | #include <kdebug.h> | 46 | #include <kdebug.h> |
47 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobal.h> | 48 | #include <kglobal.h> |
49 | #include <kfontdialog.h> | 49 | #include <kfontdialog.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <kmessagebox.h> | 51 | #include <kmessagebox.h> |
52 | #include <kcolordialog.h> | 52 | #include <kcolordialog.h> |
53 | #include <kiconloader.h> | 53 | #include <kiconloader.h> |
54 | #include <kemailsettings.h> | 54 | #include <kemailsettings.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | 56 | ||
57 | #include <kurlrequester.h> | 57 | #include <kurlrequester.h> |
58 | #include <klineedit.h> | 58 | #include <klineedit.h> |
59 | 59 | ||
60 | #if defined(USE_SOLARIS) | 60 | #if defined(USE_SOLARIS) |
61 | #include <sys/param.h> | 61 | #include <sys/param.h> |
62 | 62 | ||
63 | #define ZONEINFODIR "/usr/share/lib/zoneinfo" | 63 | #define ZONEINFODIR "/usr/share/lib/zoneinfo" |
64 | #define INITFILE "/etc/default/init" | 64 | #define INITFILE "/etc/default/init" |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #include "koprefs.h" | 67 | #include "koprefs.h" |
68 | 68 | ||
69 | #include "koprefsdialog.h" | 69 | #include "koprefsdialog.h" |
70 | #include "kpimglobalprefs.h" | 70 | #include "kpimglobalprefs.h" |
71 | 71 | ||
72 | 72 | ||
73 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 73 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
74 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 74 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
75 | { | 75 | { |
76 | 76 | ||
77 | setCaption( i18n("Preferences - some settings need a restart (nr)")); | 77 | setCaption( i18n("Preferences - some settings need a restart (nr)")); |
78 | mCategoryDict.setAutoDelete(true); | 78 | mCategoryDict.setAutoDelete(true); |
79 | 79 | ||
80 | KGlobal::locale()->insertCatalogue("timezones"); | 80 | KGlobal::locale()->insertCatalogue("timezones"); |
81 | 81 | ||
82 | setupGlobalTab(); | 82 | setupGlobalTab(); |
83 | setupMainTab(); | 83 | setupMainTab(); |
84 | // setupLocaleTab(); | 84 | // setupLocaleTab(); |
85 | //setupTimeZoneTab(); | 85 | //setupTimeZoneTab(); |
86 | setupTimeTab(); | 86 | setupTimeTab(); |
87 | //setupLocaleDateTab(); | 87 | //setupLocaleDateTab(); |
88 | setupFontsTab(); | 88 | setupFontsTab(); |
89 | setupColorsTab(); | 89 | setupColorsTab(); |
90 | setupViewsTab(); | 90 | setupViewsTab(); |
91 | //setupSyncTab(); | 91 | //setupSyncTab(); |
92 | //setupSyncAlgTab(); | 92 | //setupSyncAlgTab(); |
93 | //setupPrinterTab(); | 93 | //setupPrinterTab(); |
94 | //setupGroupSchedulingTab(); | 94 | //setupGroupSchedulingTab(); |
95 | //setupGroupAutomationTab(); | 95 | //setupGroupAutomationTab(); |
96 | 96 | ||
97 | #ifndef DESKTOP_VERSION | 97 | #ifndef DESKTOP_VERSION |
98 | if ( QApplication::desktop()->height() == 480 ) | 98 | if ( QApplication::desktop()->height() == 480 ) |
99 | hideButtons(); | 99 | hideButtons(); |
100 | #endif | 100 | #endif |
101 | } | 101 | } |
102 | 102 | ||
103 | 103 | ||
104 | KOPrefsDialog::~KOPrefsDialog() | 104 | KOPrefsDialog::~KOPrefsDialog() |
105 | { | 105 | { |
106 | } | 106 | } |
107 | void KOPrefsDialog::setupGlobalTab() | 107 | void KOPrefsDialog::setupGlobalTab() |
108 | { | 108 | { |
109 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 109 | QFrame *topFrame = addPage(i18n("Global"),0,0); |
110 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 110 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); |
111 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 111 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
112 | topLayout->addWidget( kdelibcfg ); | 112 | topLayout->addWidget( kdelibcfg ); |
113 | 113 | ||
114 | 114 | ||
115 | } | 115 | } |
116 | void KOPrefsDialog::setupLocaleDateTab() | 116 | void KOPrefsDialog::setupLocaleDateTab() |
117 | { | 117 | { |
118 | #if 0 | 118 | #if 0 |
119 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 119 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
120 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 120 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
121 | topLayout->setSpacing(spacingHint()); | 121 | topLayout->setSpacing(spacingHint()); |
122 | topLayout->setMargin(marginHint()); | 122 | topLayout->setMargin(marginHint()); |
123 | int iii = 0; | 123 | int iii = 0; |
124 | 124 | ||
125 | 125 | ||
126 | KPrefsDialogWidRadios *syncPrefsGroup = | 126 | KPrefsDialogWidRadios *syncPrefsGroup = |
127 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 127 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
128 | QString format; | 128 | QString format; |
129 | if ( QApplication::desktop()->width() < 480 ) | 129 | if ( QApplication::desktop()->width() < 480 ) |
130 | format = "(%d.%m.%Y)"; | 130 | format = "(%d.%m.%Y)"; |
131 | else | 131 | else |
132 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 132 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
133 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 133 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
134 | if ( QApplication::desktop()->width() < 480 ) | 134 | if ( QApplication::desktop()->width() < 480 ) |
135 | format = "(%m.%d.%Y)"; | 135 | format = "(%m.%d.%Y)"; |
136 | else | 136 | else |
137 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 137 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
138 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 138 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
139 | if ( QApplication::desktop()->width() < 480 ) | 139 | if ( QApplication::desktop()->width() < 480 ) |
140 | format = "(%Y-%m-%d)"; | 140 | format = "(%Y-%m-%d)"; |
141 | else | 141 | else |
142 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 142 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
143 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 143 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
144 | syncPrefsGroup->addRadio(i18n("User defined")); | 144 | syncPrefsGroup->addRadio(i18n("User defined")); |
145 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 145 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
146 | ++iii; | 146 | ++iii; |
147 | ++iii; | 147 | ++iii; |
148 | QLabel * lab; | 148 | QLabel * lab; |
149 | mUserDateFormatLong = new QLineEdit(topFrame); | 149 | mUserDateFormatLong = new QLineEdit(topFrame); |
150 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 150 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
151 | topLayout->addWidget(lab ,iii,0); | 151 | topLayout->addWidget(lab ,iii,0); |
152 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 152 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
153 | ++iii; | 153 | ++iii; |
154 | mUserDateFormatShort = new QLineEdit(topFrame); | 154 | mUserDateFormatShort = new QLineEdit(topFrame); |
155 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 155 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
156 | topLayout->addWidget(lab ,iii,0); | 156 | topLayout->addWidget(lab ,iii,0); |
157 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 157 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
158 | ++iii; | 158 | ++iii; |
159 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 159 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
160 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 160 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
161 | ++iii; | 161 | ++iii; |
162 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 162 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
163 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 163 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
164 | ++iii; | 164 | ++iii; |
165 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 165 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
166 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 166 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
167 | ++iii; | 167 | ++iii; |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | void KOPrefsDialog::setupLocaleTab() | 172 | void KOPrefsDialog::setupLocaleTab() |
173 | { | 173 | { |
174 | #if 0 | 174 | #if 0 |
175 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 175 | QFrame *topFrame = addPage(i18n("Locale"),0,0); |
176 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 176 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
177 | topLayout->setSpacing(spacingHint()); | 177 | topLayout->setSpacing(spacingHint()); |
178 | topLayout->setMargin(marginHint()); | 178 | topLayout->setMargin(marginHint()); |
179 | int iii = 0; | 179 | int iii = 0; |
180 | KPrefsDialogWidRadios *syncPrefsGroup = | 180 | KPrefsDialogWidRadios *syncPrefsGroup = |
181 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 181 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
182 | syncPrefsGroup->addRadio(i18n("English")); | 182 | syncPrefsGroup->addRadio(i18n("English")); |
183 | syncPrefsGroup->addRadio(i18n("German")); | 183 | syncPrefsGroup->addRadio(i18n("German")); |
184 | syncPrefsGroup->addRadio(i18n("French")); | 184 | syncPrefsGroup->addRadio(i18n("French")); |
185 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 185 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
186 | if ( QApplication::desktop()->width() < 300 ) | 186 | if ( QApplication::desktop()->width() < 300 ) |
187 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 187 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
188 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 188 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
189 | ++iii; | 189 | ++iii; |
190 | 190 | ||
191 | syncPrefsGroup = | 191 | syncPrefsGroup = |
192 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 192 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
193 | if ( QApplication::desktop()->width() > 300 ) | 193 | if ( QApplication::desktop()->width() > 300 ) |
194 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 194 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
195 | syncPrefsGroup->addRadio(i18n("24:00")); | 195 | syncPrefsGroup->addRadio(i18n("24:00")); |
196 | syncPrefsGroup->addRadio(i18n("12:00am")); | 196 | syncPrefsGroup->addRadio(i18n("12:00am")); |
197 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 197 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
198 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 198 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
199 | ++iii; | 199 | ++iii; |
200 | KPrefsDialogWidBool *sb; | 200 | KPrefsDialogWidBool *sb; |
201 | if ( QApplication::desktop()->width() < 300 ) { | 201 | if ( QApplication::desktop()->width() < 300 ) { |
202 | sb = | 202 | sb = |
203 | addWidBool(i18n("Week starts on Sunday"), | 203 | addWidBool(i18n("Week starts on Sunday"), |
204 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 204 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
205 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 205 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
206 | ++iii; | 206 | ++iii; |
207 | sb = | 207 | sb = |
208 | addWidBool(i18n("Use short date in (WN/E) view"), | 208 | addWidBool(i18n("Use short date in (WN/E) view"), |
209 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 209 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
210 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 210 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
211 | } | 211 | } |
212 | else { | 212 | else { |
213 | QWidget * hb = new QWidget( topFrame ); | 213 | QWidget * hb = new QWidget( topFrame ); |
214 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 214 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
215 | sb = | 215 | sb = |
216 | addWidBool(i18n("Week starts on Sunday"), | 216 | addWidBool(i18n("Week starts on Sunday"), |
217 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 217 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
218 | hbLayout->addWidget(sb->checkBox() ); | 218 | hbLayout->addWidget(sb->checkBox() ); |
219 | sb = | 219 | sb = |
220 | addWidBool(i18n("Use short date in (WN/E) view"), | 220 | addWidBool(i18n("Use short date in (WN/E) view"), |
221 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 221 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
222 | hbLayout->addWidget(sb->checkBox() ); | 222 | hbLayout->addWidget(sb->checkBox() ); |
223 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 223 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
224 | 224 | ||
225 | } | 225 | } |
226 | // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION | 226 | // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION |
227 | #if 0 | 227 | #if 0 |
228 | ++iii; | 228 | ++iii; |
229 | sb = | 229 | sb = |
230 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 230 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
231 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 231 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
232 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 232 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
233 | #endif | 233 | #endif |
234 | #endif | 234 | #endif |
235 | } | 235 | } |
236 | void KOPrefsDialog::showSyncPage() | 236 | void KOPrefsDialog::showSyncPage() |
237 | { | 237 | { |
238 | showPage ( 0 ) ; | 238 | showPage ( 0 ) ; |
239 | kdelibcfg->showTimeZoneTab() ; | 239 | kdelibcfg->showTimeZoneTab() ; |
240 | 240 | ||
241 | } | 241 | } |
242 | void KOPrefsDialog::setupSyncAlgTab() | 242 | void KOPrefsDialog::setupSyncAlgTab() |
243 | { | 243 | { |
244 | #if 0 | 244 | #if 0 |
245 | QLabel * lab; | 245 | QLabel * lab; |
246 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 246 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
247 | mSetupSyncAlgTab = topFrame; | 247 | mSetupSyncAlgTab = topFrame; |
248 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 248 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
249 | topLayout->setSpacing(spacingHint()); | 249 | topLayout->setSpacing(spacingHint()); |
250 | topLayout->setMargin(marginHint()); | 250 | topLayout->setMargin(marginHint()); |
251 | int iii = 0; | 251 | int iii = 0; |
252 | 252 | ||
253 | KPrefsDialogWidBool *sb = | 253 | KPrefsDialogWidBool *sb = |
254 | addWidBool(i18n("Ask for preferences before syncing"), | 254 | addWidBool(i18n("Ask for preferences before syncing"), |
255 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | 255 | &(KOPrefs::instance()->mAskForPreferences),topFrame); |
256 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 256 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
257 | 257 | ||
258 | ++iii; | 258 | ++iii; |
259 | 259 | ||
260 | KPrefsDialogWidRadios *syncPrefsGroup = | 260 | KPrefsDialogWidRadios *syncPrefsGroup = |
261 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | 261 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), |
262 | topFrame); | 262 | topFrame); |
263 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 263 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
264 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 264 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
265 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 265 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
266 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 266 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
267 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 267 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
268 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 268 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
269 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 269 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
270 | ++iii; | 270 | ++iii; |
271 | sb = | 271 | sb = |
272 | addWidBool(i18n("Show summary after syncing"), | 272 | addWidBool(i18n("Show summary after syncing"), |
273 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | 273 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); |
274 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 274 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
275 | 275 | ||
276 | ++iii; | 276 | ++iii; |
277 | #endif | 277 | #endif |
278 | 278 | ||
279 | 279 | ||
280 | 280 | ||
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | void KOPrefsDialog::setupSyncTab() | 284 | void KOPrefsDialog::setupSyncTab() |
285 | { | 285 | { |
286 | #if 0 | 286 | #if 0 |
287 | QLabel * lab; | 287 | QLabel * lab; |
288 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | 288 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); |
289 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 289 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
290 | topLayout->setSpacing(spacingHint()); | 290 | topLayout->setSpacing(spacingHint()); |
291 | topLayout->setMargin(marginHint()); | 291 | topLayout->setMargin(marginHint()); |
292 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | 292 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); |
293 | int iii = 0; | 293 | int iii = 0; |
294 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 294 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
295 | ++iii; | 295 | ++iii; |
296 | 296 | ||
297 | mRemoteIPEdit = new QLineEdit(topFrame); | 297 | mRemoteIPEdit = new QLineEdit(topFrame); |
298 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | 298 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); |
299 | topLayout->addWidget(lab ,iii,0); | 299 | topLayout->addWidget(lab ,iii,0); |
300 | topLayout->addWidget(mRemoteIPEdit,iii,1); | 300 | topLayout->addWidget(mRemoteIPEdit,iii,1); |
301 | ++iii; | 301 | ++iii; |
302 | mRemoteUser = new QLineEdit(topFrame); | 302 | mRemoteUser = new QLineEdit(topFrame); |
303 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | 303 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); |
304 | topLayout->addWidget(lab ,iii,0); | 304 | topLayout->addWidget(lab ,iii,0); |
305 | topLayout->addWidget(mRemoteUser, iii,1); | 305 | topLayout->addWidget(mRemoteUser, iii,1); |
306 | ++iii; | 306 | ++iii; |
307 | 307 | ||
308 | mRemoteFile = new QLineEdit(topFrame); | 308 | mRemoteFile = new QLineEdit(topFrame); |
309 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | 309 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); |
310 | topLayout->addWidget(lab ,iii,0); | 310 | topLayout->addWidget(lab ,iii,0); |
311 | topLayout->addWidget(mRemoteFile,iii,1); | 311 | topLayout->addWidget(mRemoteFile,iii,1); |
312 | ++iii; | 312 | ++iii; |
313 | 313 | ||
314 | mLocalTempFile = new QLineEdit(topFrame); | 314 | mLocalTempFile = new QLineEdit(topFrame); |
315 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 315 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
316 | topLayout->addWidget(lab ,iii,0); | 316 | topLayout->addWidget(lab ,iii,0); |
317 | topLayout->addWidget(mLocalTempFile,iii,1); | 317 | topLayout->addWidget(mLocalTempFile,iii,1); |
318 | ++iii; | 318 | ++iii; |
319 | 319 | ||
320 | KPrefsDialogWidBool *wb = | 320 | KPrefsDialogWidBool *wb = |
321 | addWidBool(i18n("Write back synced file"), | 321 | addWidBool(i18n("Write back synced file"), |
322 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 322 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
323 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 323 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
324 | ++iii; | 324 | ++iii; |
325 | wb = | 325 | wb = |
326 | addWidBool(i18n("Write back existing entries only"), | 326 | addWidBool(i18n("Write back existing entries only"), |
327 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 327 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
328 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 328 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
329 | ++iii; | 329 | ++iii; |
330 | 330 | ||
331 | #endif | 331 | #endif |
332 | } | 332 | } |
333 | 333 | ||
334 | void KOPrefsDialog::setupMainTab() | 334 | void KOPrefsDialog::setupMainTab() |
335 | { | 335 | { |
336 | QFrame *topFrame = addPage(i18n("General"),0,0); | 336 | QFrame *topFrame = addPage(i18n("General"),0,0); |
337 | // DesktopIcon("identity",KIcon::SizeMedium)); | 337 | // DesktopIcon("identity",KIcon::SizeMedium)); |
338 | 338 | ||
339 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 339 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
340 | topLayout->setSpacing(spacingHint()); | 340 | topLayout->setSpacing(spacingHint()); |
341 | topLayout->setMargin(marginHint()); | 341 | topLayout->setMargin(marginHint()); |
342 | 342 | ||
343 | // KPrefsDialogWidBool *emailControlCenter = | 343 | // KPrefsDialogWidBool *emailControlCenter = |
344 | // addWidBool(i18n("&Use email settings from Control Center"), | 344 | // addWidBool(i18n("&Use email settings from Control Center"), |
345 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 345 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
346 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 346 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
347 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 347 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
348 | // SLOT(toggleEmailSettings(bool))); | 348 | // SLOT(toggleEmailSettings(bool))); |
349 | 349 | ||
350 | mNameEdit = new QLineEdit(topFrame); | 350 | mNameEdit = new QLineEdit(topFrame); |
351 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 351 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
352 | topLayout->addWidget(mNameLabel,0,0); | 352 | topLayout->addWidget(mNameLabel,0,0); |
353 | topLayout->addWidget(mNameEdit,0,1); | 353 | topLayout->addWidget(mNameEdit,0,1); |
354 | 354 | ||
355 | mEmailEdit = new QLineEdit(topFrame); | 355 | mEmailEdit = new QLineEdit(topFrame); |
356 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 356 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
357 | topLayout->addWidget(mEmailLabel,1,0); | 357 | topLayout->addWidget(mEmailLabel,1,0); |
358 | topLayout->addWidget(mEmailEdit,1,1); | 358 | topLayout->addWidget(mEmailEdit,1,1); |
359 | KPrefsDialogWidBool *wb; | 359 | KPrefsDialogWidBool *wb; |
360 | 360 | ||
361 | 361 | ||
362 | 362 | ||
363 | KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), | 363 | KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), |
364 | &(KOPrefs::instance()->mShowFullMenu),topFrame); | 364 | &(KOPrefs::instance()->mShowFullMenu),topFrame); |
365 | topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); | 365 | topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); |
366 | 366 | ||
367 | 367 | ||
368 | widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), | 368 | widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), |
369 | &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); | 369 | &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); |
370 | topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); | 370 | topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); |
371 | 371 | ||
372 | 372 | ||
373 | KPrefsDialogWidBool *verticalScreen = | 373 | KPrefsDialogWidBool *verticalScreen = |
374 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 374 | addWidBool(i18n("Show vertical screen (Needs restart)"), |
375 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 375 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
376 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 376 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
377 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); | 377 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); |
378 | 378 | ||
379 | 379 | ||
380 | QHBox *dummy = new QHBox(topFrame); | 380 | QHBox *dummy = new QHBox(topFrame); |
381 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 381 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
382 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 382 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
383 | 383 | ||
384 | topLayout->addMultiCellWidget(dummy,5,5,0,1); | 384 | topLayout->addMultiCellWidget(dummy,5,5,0,1); |
385 | 385 | ||
386 | 386 | ||
387 | 387 | ||
388 | // KPrefsDialogWidBool *bcc = | 388 | // KPrefsDialogWidBool *bcc = |
389 | // addWidBool(i18n("Send copy to owner when mailing events"), | 389 | // addWidBool(i18n("Send copy to owner when mailing events"), |
390 | // &(KOPrefs::instance()->mBcc),topFrame); | 390 | // &(KOPrefs::instance()->mBcc),topFrame); |
391 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 391 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
392 | 392 | ||
393 | 393 | ||
394 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 394 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
395 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 395 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
396 | 396 | ||
397 | // addWidBool(i18n("Enable automatic saving of calendar"), | 397 | // addWidBool(i18n("Enable automatic saving of calendar"), |
398 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 398 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
399 | 399 | ||
400 | QHBox *intervalBox = new QHBox(topFrame); | 400 | QHBox *intervalBox = new QHBox(topFrame); |
401 | // intervalBox->setSpacing(spacingHint()); | 401 | // intervalBox->setSpacing(spacingHint()); |
402 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | 402 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); |
403 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 403 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
404 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 404 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
405 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 405 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
406 | /* | 406 | /* |
407 | QHBox * agendasize = new QHBox ( topFrame ); | 407 | QHBox * agendasize = new QHBox ( topFrame ); |
408 | 408 | ||
409 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 409 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
410 | 410 | ||
411 | 411 | ||
412 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 412 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
413 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 413 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
414 | */ | 414 | */ |
415 | 415 | ||
416 | 416 | ||
417 | KPrefsDialogWidBool *ask = | 417 | KPrefsDialogWidBool *ask = |
418 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 418 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
419 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 419 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
420 | topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1); | 420 | topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1); |
421 | 421 | ||
422 | 422 | ||
423 | /* | 423 | /* |
424 | KPrefsDialogWidBool *confirmCheck = | 424 | KPrefsDialogWidBool *confirmCheck = |
425 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 425 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
426 | topFrame); | 426 | topFrame); |
427 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 427 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
428 | 428 | ||
429 | 429 | ||
430 | mEnableGroupScheduling = | 430 | mEnableGroupScheduling = |
431 | addWidBool(i18n("Enable group scheduling"), | 431 | addWidBool(i18n("Enable group scheduling"), |
432 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 432 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
433 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 433 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
434 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 434 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
435 | SLOT(warningGroupScheduling())); | 435 | SLOT(warningGroupScheduling())); |
436 | 436 | ||
437 | mEnableProjectView = | 437 | mEnableProjectView = |
438 | addWidBool(i18n("Enable project view"), | 438 | addWidBool(i18n("Enable project view"), |
439 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 439 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
440 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 440 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
441 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 441 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
442 | SLOT(warningProjectView())); | 442 | SLOT(warningProjectView())); |
443 | 443 | ||
444 | // Can't be disabled anymore | 444 | // Can't be disabled anymore |
445 | mEnableGroupScheduling->checkBox()->hide(); | 445 | mEnableGroupScheduling->checkBox()->hide(); |
446 | 446 | ||
447 | // Disable setting, because this feature now becomes stable | 447 | // Disable setting, because this feature now becomes stable |
448 | mEnableProjectView->checkBox()->hide(); | 448 | mEnableProjectView->checkBox()->hide(); |
449 | 449 | ||
450 | KPrefsDialogWidRadios *defaultFormatGroup = | 450 | KPrefsDialogWidRadios *defaultFormatGroup = |
451 | addWidRadios(i18n("Default Calendar Format"), | 451 | addWidRadios(i18n("Default Calendar Format"), |
452 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 452 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
453 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 453 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
454 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 454 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
455 | 455 | ||
456 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | 456 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); |
457 | 457 | ||
458 | // Default format unconditionally is iCalendar | 458 | // Default format unconditionally is iCalendar |
459 | defaultFormatGroup->groupBox()->hide(); | 459 | defaultFormatGroup->groupBox()->hide(); |
460 | 460 | ||
461 | KPrefsDialogWidRadios *mailClientGroup = | 461 | KPrefsDialogWidRadios *mailClientGroup = |
462 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | 462 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), |
463 | topFrame); | 463 | topFrame); |
464 | mailClientGroup->addRadio(i18n("KMail")); | 464 | mailClientGroup->addRadio(i18n("KMail")); |
465 | mailClientGroup->addRadio(i18n("Sendmail")); | 465 | mailClientGroup->addRadio(i18n("Sendmail")); |
466 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | 466 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); |
467 | 467 | ||
468 | KPrefsDialogWidBool *htmlsave = | 468 | KPrefsDialogWidBool *htmlsave = |
469 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | 469 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), |
470 | topFrame); | 470 | topFrame); |
471 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | 471 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); |
472 | 472 | ||
473 | KPrefsDialogWidRadios *destinationGroup = | 473 | KPrefsDialogWidRadios *destinationGroup = |
474 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | 474 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), |
475 | topFrame); | 475 | topFrame); |
476 | destinationGroup->addRadio(i18n("be added to the standard resource")); | 476 | destinationGroup->addRadio(i18n("be added to the standard resource")); |
477 | destinationGroup->addRadio(i18n("be asked which resource to use")); | 477 | destinationGroup->addRadio(i18n("be asked which resource to use")); |
478 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | 478 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); |
479 | 479 | ||
480 | topLayout->setRowStretch(14,1); | 480 | topLayout->setRowStretch(14,1); |
481 | */ | 481 | */ |
482 | } | 482 | } |
483 | 483 | ||
484 | 484 | ||
485 | void KOPrefsDialog::setupTimeTab() | 485 | void KOPrefsDialog::setupTimeTab() |
486 | { | 486 | { |
487 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 487 | QFrame *topFrame = addPage(i18n("Time"),0,0); |
488 | // DesktopIcon("clock",KIcon::SizeMedium)); | 488 | // DesktopIcon("clock",KIcon::SizeMedium)); |
489 | 489 | ||
490 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 490 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
491 | topLayout->setSpacing(spacingHint()); | 491 | topLayout->setSpacing(spacingHint()); |
492 | topLayout->setMargin(marginHint()); | 492 | topLayout->setMargin(marginHint()); |
493 | 493 | ||
494 | QHBox *dummy = new QHBox(topFrame); | 494 | QHBox *dummy = new QHBox(topFrame); |
495 | KPrefsDialogWidTime *dayBegins = | 495 | KPrefsDialogWidTime *dayBegins = |
496 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 496 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
497 | dummy); | 497 | dummy); |
498 | //topLayout->addWidget(dayBegins->label(),2,0); | 498 | //topLayout->addWidget(dayBegins->label(),2,0); |
499 | 499 | ||
500 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 500 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
501 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | 501 | topLayout->addMultiCellWidget(dummy,0,0,0,1); |
502 | 502 | ||
503 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | 503 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), |
504 | topFrame),1,0); | 504 | topFrame),1,0); |
505 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | 505 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); |
506 | mStartTimeSpin->setSuffix(":00"); | 506 | mStartTimeSpin->setSuffix(":00"); |
507 | topLayout->addWidget(mStartTimeSpin,1,1); | 507 | topLayout->addWidget(mStartTimeSpin,1,1); |
508 | 508 | ||
509 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | 509 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), |
510 | topFrame),2,0); | 510 | topFrame),2,0); |
511 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | 511 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); |
512 | mDefaultDurationSpin->setSuffix(":00"); | 512 | mDefaultDurationSpin->setSuffix(":00"); |
513 | topLayout->addWidget(mDefaultDurationSpin,2,1); | 513 | topLayout->addWidget(mDefaultDurationSpin,2,1); |
514 | 514 | ||
515 | QStringList alarmList; | 515 | QStringList alarmList; |
516 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | 516 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") |
517 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | 517 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; |
518 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | 518 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), |
519 | 3,0); | 519 | 3,0); |
520 | mAlarmTimeCombo = new QComboBox(topFrame); | 520 | mAlarmTimeCombo = new QComboBox(topFrame); |
521 | mAlarmTimeCombo->insertStringList(alarmList); | 521 | mAlarmTimeCombo->insertStringList(alarmList); |
522 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 522 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
523 | 523 | ||
524 | 524 | ||
525 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 525 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, |
526 | i18n("Working Hours"), | 526 | i18n("Working Hours"), |
527 | topFrame); | 527 | topFrame); |
528 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | 528 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); |
529 | workingHoursGroup->layout()->setSpacing( 0 ); | 529 | workingHoursGroup->layout()->setSpacing( 0 ); |
530 | workingHoursGroup->layout()->setMargin( 4 ); | 530 | workingHoursGroup->layout()->setMargin( 4 ); |
531 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 531 | QHBox *workStartBox = new QHBox(workingHoursGroup); |
532 | // workStartBox->setMargin( 0 ); | 532 | // workStartBox->setMargin( 0 ); |
533 | addWidTime(i18n("Daily starting hour:"), | 533 | addWidTime(i18n("Daily starting hour:"), |
534 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 534 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
535 | 535 | ||
536 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 536 | QHBox *workEndBox = new QHBox(workingHoursGroup); |
537 | //workEndBox->setMargin( 0 ); | 537 | //workEndBox->setMargin( 0 ); |
538 | addWidTime(i18n("Daily ending hour:"), | 538 | addWidTime(i18n("Daily ending hour:"), |
539 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 539 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
540 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 540 | QVBox *excludeBox = new QVBox(workingHoursGroup); |
541 | //excludeBox->setMargin( 0 ); | 541 | //excludeBox->setMargin( 0 ); |
542 | addWidBool(i18n("Exclude holidays"), | 542 | addWidBool(i18n("Exclude holidays"), |
543 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 543 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
544 | 544 | ||
545 | addWidBool(i18n("Exclude Saturdays"), | 545 | addWidBool(i18n("Exclude Saturdays"), |
546 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 546 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
547 | 547 | ||
548 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | 548 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), |
549 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | 549 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), |
550 | // topFrame); | 550 | // topFrame); |
551 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | 551 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); |
552 | 552 | ||
553 | // topLayout->setRowStretch(6,1); | 553 | // topLayout->setRowStretch(6,1); |
554 | } | 554 | } |
555 | 555 | ||
556 | 556 | ||
557 | void KOPrefsDialog::setupViewsTab() | 557 | void KOPrefsDialog::setupViewsTab() |
558 | { | 558 | { |
559 | 559 | ||
560 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 560 | QFrame *topFrame = addPage(i18n("Views"),0,0); |
561 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 561 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
562 | 562 | ||
563 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 563 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); |
564 | topLayout->setSpacing(spacingHint()); | 564 | topLayout->setSpacing(spacingHint()); |
565 | topLayout->setMargin(marginHint()); | 565 | topLayout->setMargin(marginHint()); |
566 | 566 | ||
567 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 567 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
568 | // topLayout->addLayout(dayBeginsLayout,0,0); | 568 | // topLayout->addLayout(dayBeginsLayout,0,0); |
569 | 569 | ||
570 | // KPrefsDialogWidTime *dayBegins = | 570 | // KPrefsDialogWidTime *dayBegins = |
571 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 571 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
572 | // topFrame); | 572 | // topFrame); |
573 | // dayBeginsLayout->addWidget(dayBegins->label()); | 573 | // dayBeginsLayout->addWidget(dayBegins->label()); |
574 | // dayBeginsLayout->addStretch(1); | 574 | // dayBeginsLayout->addStretch(1); |
575 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | 575 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); |
576 | 576 | ||
577 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | 577 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; |
578 | // topLayout->addLayout(nextDaysLayout,1,0); | 578 | // topLayout->addLayout(nextDaysLayout,1,0); |
579 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | 579 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); |
580 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | 580 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); |
581 | // nextDaysLayout->addStretch(1); | 581 | // nextDaysLayout->addStretch(1); |
582 | // nextDaysLayout->addWidget(mNextXDaysSpin); | 582 | // nextDaysLayout->addWidget(mNextXDaysSpin); |
583 | 583 | ||
584 | 584 | ||
585 | int ii = 0; | 585 | int ii = 0; |
586 | KPrefsDialogWidBool *dummy = | 586 | KPrefsDialogWidBool *dummy = |
587 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | 587 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), |
588 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | 588 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); |
589 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 589 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
590 | 590 | ||
591 | 591 | ||
592 | 592 | ||
593 | if ( QApplication::desktop()->width() > 640 ) { | 593 | |
594 | |||
595 | KPrefsDialogWidBool *enableToolTips = | ||
596 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | ||
597 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | ||
598 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | ||
599 | |||
600 | } | ||
601 | |||
602 | 594 | ||
603 | 595 | ||
604 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 596 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
605 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 597 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
606 | //topLayout->setRowStretch(11,1); | 598 | //topLayout->setRowStretch(11,1); |
607 | 599 | ||
608 | 600 | ||
609 | 601 | ||
610 | 602 | ||
611 | #if 0 | 603 | #if 0 |
612 | 604 | ||
613 | topFrame = addPage(i18n("ViewChange"),0,0); | 605 | topFrame = addPage(i18n("ViewChange"),0,0); |
614 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 606 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
615 | 607 | ||
616 | topLayout = new QGridLayout(topFrame,6,1); | 608 | topLayout = new QGridLayout(topFrame,6,1); |
617 | topLayout->setSpacing(spacingHint()); | 609 | topLayout->setSpacing(spacingHint()); |
618 | topLayout->setMargin(marginHint()); | 610 | topLayout->setMargin(marginHint()); |
619 | ii = 0; | 611 | ii = 0; |
620 | 612 | ||
621 | #endif | 613 | #endif |
622 | 614 | ||
623 | dummy = | 615 | dummy = |
624 | addWidBool(i18n("Hold fullscreen on view change"), | 616 | addWidBool(i18n("Hold fullscreen on view change"), |
625 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 617 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
626 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 618 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
627 | 619 | ||
628 | dummy = | 620 | dummy = |
629 | addWidBool(i18n("Hold non-fullscreen on view change"), | 621 | addWidBool(i18n("Hold non-fullscreen on view change"), |
630 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 622 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
631 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 623 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
632 | 624 | ||
633 | 625 | ||
634 | 626 | ||
635 | KPrefsDialogWidBool *fullViewMonth = | 627 | KPrefsDialogWidBool *fullViewMonth = |
636 | addWidBool(i18n("Next days view uses full window"), | 628 | addWidBool(i18n("Next days view uses full window"), |
637 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 629 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
638 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 630 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
639 | 631 | ||
640 | 632 | ||
641 | KPrefsDialogWidBool *fullViewTodo = | 633 | KPrefsDialogWidBool *fullViewTodo = |
642 | addWidBool(i18n("Event list view uses full window"), | 634 | addWidBool(i18n("Event list view uses full window"), |
643 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 635 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
644 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 636 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
645 | dummy = | 637 | dummy = |
646 | addWidBool(i18n("Listview uses monthly timespan"), | 638 | addWidBool(i18n("Listview uses monthly timespan"), |
647 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 639 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
648 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 640 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
649 | dummy = | 641 | dummy = |
650 | addWidBool(i18n("Highlight selection in Time Edit"), | 642 | addWidBool(i18n("Highlight selection in Time Edit"), |
651 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 643 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
652 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 644 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
653 | 645 | ||
654 | KPrefsDialogWidBool *dailyRecur = | 646 | KPrefsDialogWidBool *dailyRecur = |
655 | addWidBool(i18n("Show events that recur daily in date nav."), | 647 | addWidBool(i18n("Show events that recur daily in date nav."), |
656 | &(KOPrefs::instance()->mDailyRecur),topFrame); | 648 | &(KOPrefs::instance()->mDailyRecur),topFrame); |
657 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 649 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
658 | 650 | ||
659 | KPrefsDialogWidBool *weeklyRecur = | 651 | KPrefsDialogWidBool *weeklyRecur = |
660 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | 652 | addWidBool(i18n("Show ev. that recur weekly in date nav."), |
661 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | 653 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); |
662 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | 654 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); |
663 | 655 | ||
656 | |||
657 | KPrefsDialogWidBool *enableToolTips = | ||
658 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | ||
659 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | ||
660 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | ||
661 | |||
662 | // ********************************************************* | ||
663 | |||
664 | topFrame = addPage(i18n("Agenda View"),0,0); | 664 | topFrame = addPage(i18n("Agenda View"),0,0); |
665 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 665 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
666 | 666 | ||
667 | topLayout = new QGridLayout(topFrame,5,1); | 667 | topLayout = new QGridLayout(topFrame,5,1); |
668 | topLayout->setSpacing(spacingHint()); | 668 | topLayout->setSpacing(spacingHint()); |
669 | topLayout->setMargin(marginHint()); | 669 | topLayout->setMargin(marginHint()); |
670 | ii = 0; | 670 | ii = 0; |
671 | 671 | ||
672 | 672 | ||
673 | dummy = | 673 | dummy = |
674 | addWidBool(i18n("Show time in agenda items"), | 674 | addWidBool(i18n("Show time in agenda items"), |
675 | &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); | 675 | &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); |
676 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 676 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
677 | 677 | ||
678 | dummy = | 678 | dummy = |
679 | addWidBool(i18n("Highlight current day in agenda"), | 679 | addWidBool(i18n("Highlight current day in agenda"), |
680 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | 680 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); |
681 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 681 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
682 | 682 | ||
683 | dummy = | 683 | dummy = |
684 | addWidBool(i18n("Use light color for highlight current day"), | 684 | addWidBool(i18n("Use light color for highlight current day"), |
685 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | 685 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); |
686 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 686 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
687 | 687 | ||
688 | 688 | ||
689 | KPrefsDialogWidBool *marcusBainsEnabled = | 689 | KPrefsDialogWidBool *marcusBainsEnabled = |
690 | addWidBool(i18n("Show current time"), | 690 | addWidBool(i18n("Show current time"), |
691 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 691 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
692 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 692 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
693 | 693 | ||
694 | 694 | ||
695 | dummy = | 695 | dummy = |
696 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 696 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
697 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 697 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
698 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 698 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
699 | 699 | ||
700 | dummy = | 700 | dummy = |
701 | addWidBool(i18n("Set agenda to current time on change"), | 701 | addWidBool(i18n("Set agenda to current time on change"), |
702 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 702 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
703 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 703 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
704 | 704 | ||
705 | 705 | ||
706 | 706 | ||
707 | 707 | ||
708 | 708 | ||
709 | 709 | ||
710 | 710 | ||
711 | topFrame = addPage(i18n("Month View"),0,0); | 711 | topFrame = addPage(i18n("Month View"),0,0); |
712 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 712 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
713 | 713 | ||
714 | topLayout = new QGridLayout(topFrame,5,1); | 714 | topLayout = new QGridLayout(topFrame,5,1); |
715 | topLayout->setSpacing(spacingHint()); | 715 | topLayout->setSpacing(spacingHint()); |
716 | topLayout->setMargin(marginHint()); | 716 | topLayout->setMargin(marginHint()); |
717 | ii = 0; | 717 | ii = 0; |
718 | QLabel *lab; | 718 | QLabel *lab; |
719 | QHBox *habo = new QHBox( topFrame ); | 719 | QHBox *habo = new QHBox( topFrame ); |
720 | if ( QApplication::desktop()->width() <= 480 ) { | 720 | if ( QApplication::desktop()->width() <= 480 ) { |
721 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 721 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
722 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 722 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
723 | ii++; | 723 | ii++; |
724 | } else { | 724 | } else { |
725 | new QLabel ( i18n("Show events that recur "), habo ); | 725 | new QLabel ( i18n("Show events that recur "), habo ); |
726 | } | 726 | } |
727 | dailyRecur = | 727 | dailyRecur = |
728 | addWidBool(i18n("daily"), | 728 | addWidBool(i18n("daily"), |
729 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | 729 | &(KOPrefs::instance()->mMonthDailyRecur),habo); |
730 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 730 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
731 | 731 | ||
732 | weeklyRecur = | 732 | weeklyRecur = |
733 | addWidBool(i18n("weekly"), | 733 | addWidBool(i18n("weekly"), |
734 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 734 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
735 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 735 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
736 | ii++; | 736 | ii++; |
737 | 737 | ||
738 | 738 | ||
739 | habo = new QHBox( topFrame ); | 739 | habo = new QHBox( topFrame ); |
740 | if ( QApplication::desktop()->width() <= 480 ) { | 740 | if ( QApplication::desktop()->width() <= 480 ) { |
741 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 741 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
742 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 742 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
743 | ii++; | 743 | ii++; |
744 | 744 | ||
745 | } else { | 745 | } else { |
746 | new QLabel ( i18n("Show in every cell "), habo ); | 746 | new QLabel ( i18n("Show in every cell "), habo ); |
747 | } | 747 | } |
748 | weeklyRecur = | 748 | weeklyRecur = |
749 | addWidBool(i18n("short month"), | 749 | addWidBool(i18n("short month"), |
750 | &(KOPrefs::instance()->mMonthShowShort),habo); | 750 | &(KOPrefs::instance()->mMonthShowShort),habo); |
751 | weeklyRecur = | 751 | weeklyRecur = |
752 | addWidBool(i18n("icons"), | 752 | addWidBool(i18n("icons"), |
753 | &(KOPrefs::instance()->mMonthShowIcons),habo); | 753 | &(KOPrefs::instance()->mMonthShowIcons),habo); |
754 | 754 | ||
755 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 755 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
756 | ii++; | 756 | ii++; |
757 | #ifdef DESKTOP_VERSION | 757 | #ifdef DESKTOP_VERSION |
758 | KPrefsDialogWidBool *enableMonthScroll = | 758 | KPrefsDialogWidBool *enableMonthScroll = |
759 | addWidBool(i18n("Enable scrollbars in month view cells"), | 759 | addWidBool(i18n("Enable scrollbars in month view cells"), |
760 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | 760 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); |
761 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | 761 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); |
762 | #endif | 762 | #endif |
763 | dummy = | 763 | dummy = |
764 | addWidBool(i18n("Week view mode uses bigger font"), | 764 | addWidBool(i18n("Week view mode uses bigger font"), |
765 | &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); | 765 | &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); |
766 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 766 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
767 | dummy = | 767 | dummy = |
768 | addWidBool(i18n("Show Sat/Sun together"), | 768 | addWidBool(i18n("Show Sat/Sun together"), |
769 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | 769 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); |
770 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 770 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
771 | 771 | ||
772 | KPrefsDialogWidBool *coloredCategoriesInMonthView = | 772 | KPrefsDialogWidBool *coloredCategoriesInMonthView = |
773 | addWidBool(i18n("Month view uses category colors"), | 773 | addWidBool(i18n("Month view uses category colors"), |
774 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | 774 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); |
775 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 775 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
776 | 776 | ||
777 | dummy = | 777 | dummy = |
778 | addWidBool(i18n("Categorie colors are applied to text"), | 778 | addWidBool(i18n("Categorie colors are applied to text"), |
779 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 779 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
780 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 780 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
781 | coloredCategoriesInMonthView = | 781 | coloredCategoriesInMonthView = |
782 | addWidBool(i18n("Month view uses day colors"), | 782 | addWidBool(i18n("Month view uses day colors"), |
783 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 783 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
784 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 784 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
785 | 785 | ||
786 | KPrefsDialogWidColor *holidayColor = | 786 | KPrefsDialogWidColor *holidayColor = |
787 | addWidColor(i18n("Day color odd months"), | 787 | addWidColor(i18n("Day color odd months"), |
788 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 788 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
789 | topLayout->addWidget(holidayColor->label(),ii,0); | 789 | topLayout->addWidget(holidayColor->label(),ii,0); |
790 | topLayout->addWidget(holidayColor->button(),ii++,1); | 790 | topLayout->addWidget(holidayColor->button(),ii++,1); |
791 | 791 | ||
792 | holidayColor = | 792 | holidayColor = |
793 | addWidColor(i18n("Day color even months"), | 793 | addWidColor(i18n("Day color even months"), |
794 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 794 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
795 | topLayout->addWidget(holidayColor->label(),ii,0); | 795 | topLayout->addWidget(holidayColor->label(),ii,0); |
796 | topLayout->addWidget(holidayColor->button(),ii++,1); | 796 | topLayout->addWidget(holidayColor->button(),ii++,1); |
797 | 797 | ||
798 | 798 | ||
799 | holidayColor = | 799 | holidayColor = |
800 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 800 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
801 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 801 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
802 | topLayout->addWidget(holidayColor->label(),ii,0); | 802 | topLayout->addWidget(holidayColor->label(),ii,0); |
803 | topLayout->addWidget(holidayColor->button(),ii++,1); | 803 | topLayout->addWidget(holidayColor->button(),ii++,1); |
804 | // *********************** What'sNext View | 804 | // *********************** What'sNext View |
805 | topFrame = addPage(i18n("What's Next View"),0,0); | 805 | topFrame = addPage(i18n("What's Next View"),0,0); |
806 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 806 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
807 | 807 | ||
808 | topLayout = new QGridLayout(topFrame,4,1); | 808 | topLayout = new QGridLayout(topFrame,4,1); |
809 | topLayout->setSpacing(spacingHint()); | 809 | topLayout->setSpacing(spacingHint()); |
810 | topLayout->setMargin(marginHint()); | 810 | topLayout->setMargin(marginHint()); |
811 | ii = 0; | 811 | ii = 0; |
812 | 812 | ||
813 | 813 | ||
814 | QHBox* hdummy = new QHBox(topFrame); | 814 | QHBox* hdummy = new QHBox(topFrame); |
815 | new QLabel(i18n("Days in What's Next:"),hdummy); | 815 | new QLabel(i18n("Days in What's Next:"),hdummy); |
816 | mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); | 816 | mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); |
817 | 817 | ||
818 | topLayout->addWidget(hdummy,ii++,0); | 818 | topLayout->addWidget(hdummy,ii++,0); |
819 | 819 | ||
820 | QHBox *prioBox = new QHBox(topFrame); | 820 | QHBox *prioBox = new QHBox(topFrame); |
821 | // intervalBox->setSpacing(spacingHint()); | 821 | // intervalBox->setSpacing(spacingHint()); |
822 | topLayout->addWidget(prioBox,ii++,0); | 822 | topLayout->addWidget(prioBox,ii++,0); |
823 | QString messa = i18n("Show topmost todo prios in What's Next:"); | 823 | QString messa = i18n("Show topmost todo prios in What's Next:"); |
824 | 824 | ||
825 | if ( QApplication::desktop()->width() < 300 ) | 825 | if ( QApplication::desktop()->width() < 300 ) |
826 | messa = i18n("Show topmost todo prios in What's N.:"); | 826 | messa = i18n("Show topmost todo prios in What's N.:"); |
827 | QLabel *prioLabel = new QLabel(messa, prioBox); | 827 | QLabel *prioLabel = new QLabel(messa, prioBox); |
828 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 828 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
829 | if ( QApplication::desktop()->width() < 300 ) | 829 | if ( QApplication::desktop()->width() < 300 ) |
830 | mPrioSpin->setFixedWidth( 40 ); | 830 | mPrioSpin->setFixedWidth( 40 ); |
831 | 831 | ||
832 | KPrefsDialogWidBool *passwdk = | 832 | KPrefsDialogWidBool *passwdk = |
833 | 833 | ||
834 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), | 834 | addWidBool(i18n("Show events, that are done in \nWhat's Next view"), |
835 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); | 835 | &(KOPrefs::instance()->mWNViewShowsPast),topFrame); |
836 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 836 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
837 | passwdk = | 837 | passwdk = |
838 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 838 | addWidBool(i18n("Show parent To-Do's in What's Next view"), |
839 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 839 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
840 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 840 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
841 | 841 | ||
842 | passwdk = | 842 | passwdk = |
843 | addWidBool(i18n("Show location in What's Next view"), | 843 | addWidBool(i18n("Show location in What's Next view"), |
844 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 844 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
845 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 845 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
846 | 846 | ||
847 | passwdk = | 847 | passwdk = |
848 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), | 848 | addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), |
849 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 849 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
850 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 850 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
851 | passwdk = | 851 | passwdk = |
852 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), | 852 | addWidBool(i18n("Use short date in \nWhat's Next/Event view"), |
853 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 853 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
854 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 854 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
855 | 855 | ||
856 | 856 | ||
857 | 857 | ||
858 | 858 | ||
859 | // *********************** Todo View | 859 | // *********************** Todo View |
860 | 860 | ||
861 | topFrame = addPage(i18n("Todo View"),0,0); | 861 | topFrame = addPage(i18n("Todo View"),0,0); |
862 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 862 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
863 | 863 | ||
864 | topLayout = new QGridLayout(topFrame,4,1); | 864 | topLayout = new QGridLayout(topFrame,4,1); |
865 | topLayout->setSpacing(spacingHint()); | 865 | topLayout->setSpacing(spacingHint()); |
866 | topLayout->setMargin(marginHint()); | 866 | topLayout->setMargin(marginHint()); |
867 | ii = 0; | 867 | ii = 0; |
868 | dummy = | 868 | dummy = |
869 | addWidBool(i18n("Hide not running Todos in To-do view"), | 869 | addWidBool(i18n("Hide not running Todos in To-do view"), |
870 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); | 870 | &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); |
871 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 871 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
872 | 872 | ||
873 | 873 | ||
874 | KPrefsDialogWidBool *showCompletedTodo = | 874 | KPrefsDialogWidBool *showCompletedTodo = |
875 | addWidBool(i18n("To-do view shows completed Todos"), | 875 | addWidBool(i18n("To-do view shows completed Todos"), |
876 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 876 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
877 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 877 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
878 | dummy = | 878 | dummy = |
879 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 879 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
880 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 880 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
881 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 881 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
882 | 882 | ||
883 | dummy = | 883 | dummy = |
884 | addWidBool(i18n("Small To-do view uses smaller font"), | 884 | addWidBool(i18n("Small To-do view uses smaller font"), |
885 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 885 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
886 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 886 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
887 | 887 | ||
888 | 888 | ||
889 | 889 | ||
890 | dummy = | 890 | dummy = |
891 | addWidBool(i18n("Todo view uses category colors"), | 891 | addWidBool(i18n("Todo view uses category colors"), |
892 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 892 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
893 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 893 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
894 | 894 | ||
895 | 895 | ||
896 | QWidget* wid = new QWidget( topFrame ); | 896 | QWidget* wid = new QWidget( topFrame ); |
897 | // Todo due today color | 897 | // Todo due today color |
898 | KPrefsDialogWidColor *todoDueTodayColor = | 898 | KPrefsDialogWidColor *todoDueTodayColor = |
899 | addWidColor(i18n("Todo due today color:"), | 899 | addWidColor(i18n("Todo due today color:"), |
900 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 900 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
901 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 901 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
902 | widLayout->addWidget( todoDueTodayColor->label() ); | 902 | widLayout->addWidget( todoDueTodayColor->label() ); |
903 | widLayout->addWidget( todoDueTodayColor->button() ); | 903 | widLayout->addWidget( todoDueTodayColor->button() ); |
904 | topLayout->addWidget(wid,ii++,0); | 904 | topLayout->addWidget(wid,ii++,0); |
905 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 905 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
906 | 906 | ||
907 | // Todo overdue color | 907 | // Todo overdue color |
908 | wid = new QWidget( topFrame ); | 908 | wid = new QWidget( topFrame ); |
909 | widLayout = new QHBoxLayout(wid); | 909 | widLayout = new QHBoxLayout(wid); |
910 | KPrefsDialogWidColor *todoOverdueColor = | 910 | KPrefsDialogWidColor *todoOverdueColor = |
911 | addWidColor(i18n("Todo overdue color:"), | 911 | addWidColor(i18n("Todo overdue color:"), |
912 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 912 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
913 | widLayout->addWidget(todoOverdueColor->label()); | 913 | widLayout->addWidget(todoOverdueColor->label()); |
914 | widLayout->addWidget(todoOverdueColor->button()); | 914 | widLayout->addWidget(todoOverdueColor->button()); |
915 | topLayout->addWidget(wid,ii++,0); | 915 | topLayout->addWidget(wid,ii++,0); |
916 | 916 | ||
917 | dummy = | 917 | dummy = |
918 | addWidBool(i18n("Colors are applied to text"), | 918 | addWidBool(i18n("Colors are applied to text"), |
919 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | 919 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); |
920 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 920 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
921 | 921 | ||
922 | dummy = | 922 | dummy = |
923 | addWidBool(i18n("Allday Agenda view shows todos"), | 923 | addWidBool(i18n("Allday Agenda view shows todos"), |
924 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | 924 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); |
925 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 925 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
926 | 926 | ||
927 | 927 | ||
928 | topFrame = addPage(i18n("View Options"),0,0); | 928 | topFrame = addPage(i18n("View Options"),0,0); |
929 | 929 | ||
930 | topLayout = new QGridLayout(topFrame,4,1); | 930 | topLayout = new QGridLayout(topFrame,4,1); |
931 | topLayout->setSpacing(spacingHint()); | 931 | topLayout->setSpacing(spacingHint()); |
932 | topLayout->setMargin(marginHint()); | 932 | topLayout->setMargin(marginHint()); |
933 | ii = 0; | 933 | ii = 0; |
934 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); | 934 | lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); |
935 | topLayout->addWidget(lab ,ii++,0); | 935 | topLayout->addWidget(lab ,ii++,0); |
936 | 936 | ||
937 | dummy = addWidBool(i18n("Details"), | 937 | dummy = addWidBool(i18n("Details"), |
938 | &(KOPrefs::instance()->mEVshowDetails),topFrame); | 938 | &(KOPrefs::instance()->mEVshowDetails),topFrame); |
939 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 939 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
940 | dummy = addWidBool(i18n("Created time"), | 940 | dummy = addWidBool(i18n("Created time"), |
941 | &(KOPrefs::instance()->mEVshowCreated),topFrame); | 941 | &(KOPrefs::instance()->mEVshowCreated),topFrame); |
942 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 942 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
943 | dummy = addWidBool(i18n("Last modified time"), | 943 | dummy = addWidBool(i18n("Last modified time"), |
944 | &(KOPrefs::instance()->mEVshowChanged),topFrame); | 944 | &(KOPrefs::instance()->mEVshowChanged),topFrame); |
945 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 945 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
946 | 946 | ||
947 | 947 | ||
948 | lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); | 948 | lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); |
949 | topLayout->addWidget(lab ,ii++,0); | 949 | topLayout->addWidget(lab ,ii++,0); |
950 | 950 | ||
951 | dummy = addWidBool(i18n("Details"), | 951 | dummy = addWidBool(i18n("Details"), |
952 | &(KOPrefs::instance()->mWTshowDetails),topFrame); | 952 | &(KOPrefs::instance()->mWTshowDetails),topFrame); |
953 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 953 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
954 | dummy = addWidBool(i18n("Created time"), | 954 | dummy = addWidBool(i18n("Created time"), |
955 | &(KOPrefs::instance()->mWTshowCreated),topFrame); | 955 | &(KOPrefs::instance()->mWTshowCreated),topFrame); |
956 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 956 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
957 | dummy = addWidBool(i18n("Last modified time"), | 957 | dummy = addWidBool(i18n("Last modified time"), |
958 | &(KOPrefs::instance()->mWTshowChanged),topFrame); | 958 | &(KOPrefs::instance()->mWTshowChanged),topFrame); |
959 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 959 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
960 | 960 | ||
961 | 961 | ||
962 | topFrame = addPage(i18n("Alarm"),0,0); | 962 | topFrame = addPage(i18n("Alarm"),0,0); |
963 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 963 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
964 | 964 | ||
965 | topLayout = new QGridLayout(topFrame,2,1); | 965 | topLayout = new QGridLayout(topFrame,2,1); |
966 | topLayout->setSpacing(spacingHint()); | 966 | topLayout->setSpacing(spacingHint()); |
967 | topLayout->setMargin(marginHint()); | 967 | topLayout->setMargin(marginHint()); |
968 | int iii = 0; | 968 | int iii = 0; |
969 | 969 | ||
970 | dummy = | 970 | dummy = |
971 | addWidBool(i18n("Use internal alarm notification"), | 971 | addWidBool(i18n("Use internal alarm notification"), |
972 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); | 972 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); |
973 | topLayout->addWidget(dummy->checkBox(),iii++,0); | 973 | topLayout->addWidget(dummy->checkBox(),iii++,0); |
974 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); | 974 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); |
975 | 975 | ||
976 | topLayout->addWidget(lab ,iii++,0); | 976 | topLayout->addWidget(lab ,iii++,0); |
977 | #ifndef DESKTOP_VERSION | 977 | #ifndef DESKTOP_VERSION |
978 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 978 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
979 | #else | 979 | #else |
980 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 980 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
981 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 981 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
982 | #endif | 982 | #endif |
983 | 983 | ||
984 | QHBox* dummyBox = new QHBox(topFrame); | 984 | QHBox* dummyBox = new QHBox(topFrame); |
985 | new QLabel(i18n("Play beeps count:"),dummyBox); | 985 | new QLabel(i18n("Play beeps count:"),dummyBox); |
986 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | 986 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); |
987 | topLayout->addWidget(dummyBox,iii++,0); | 987 | topLayout->addWidget(dummyBox,iii++,0); |
988 | 988 | ||
989 | dummyBox = new QHBox(topFrame); | 989 | dummyBox = new QHBox(topFrame); |
990 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | 990 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); |
991 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | 991 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); |
992 | topLayout->addWidget(dummyBox,iii++,0); | 992 | topLayout->addWidget(dummyBox,iii++,0); |
993 | 993 | ||
994 | dummyBox = new QHBox(topFrame); | 994 | dummyBox = new QHBox(topFrame); |
995 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | 995 | new QLabel(i18n("Default suspend time in min:"),dummyBox); |
996 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | 996 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); |
997 | topLayout->addWidget(dummyBox,iii++,0); | 997 | topLayout->addWidget(dummyBox,iii++,0); |
998 | 998 | ||
999 | dummyBox = new QHBox(topFrame); | 999 | dummyBox = new QHBox(topFrame); |
1000 | new QLabel(i18n("Auto suspend count:"),dummyBox); | 1000 | new QLabel(i18n("Auto suspend count:"),dummyBox); |
1001 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | 1001 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); |
1002 | topLayout->addWidget(dummyBox,iii++,0); | 1002 | topLayout->addWidget(dummyBox,iii++,0); |
1003 | 1003 | ||
1004 | 1004 | ||
1005 | 1005 | ||
1006 | 1006 | ||
1007 | 1007 | ||
1008 | 1008 | ||
1009 | 1009 | ||
1010 | QHBox* hbo = new QHBox ( topFrame ); | 1010 | QHBox* hbo = new QHBox ( topFrame ); |
1011 | mDefaultAlarmFile = new QLineEdit(hbo); | 1011 | mDefaultAlarmFile = new QLineEdit(hbo); |
1012 | QPushButton * loadTemplate = new QPushButton(hbo); | 1012 | QPushButton * loadTemplate = new QPushButton(hbo); |
1013 | QPixmap icon; | 1013 | QPixmap icon; |
1014 | if ( QApplication::desktop()->width() < 321 ) | 1014 | if ( QApplication::desktop()->width() < 321 ) |
1015 | icon = SmallIcon("fileimport16"); | 1015 | icon = SmallIcon("fileimport16"); |
1016 | else | 1016 | else |
1017 | icon = SmallIcon("fileimport"); | 1017 | icon = SmallIcon("fileimport"); |
1018 | loadTemplate->setIconSet (icon ) ; | 1018 | loadTemplate->setIconSet (icon ) ; |
1019 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); | 1019 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); |
1020 | int size = loadTemplate->sizeHint().height(); | 1020 | int size = loadTemplate->sizeHint().height(); |
1021 | loadTemplate->setFixedSize( size, size ); | 1021 | loadTemplate->setFixedSize( size, size ); |
1022 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); | 1022 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); |
1023 | // topLayout->addWidget(lab ,iii++,0); | 1023 | // topLayout->addWidget(lab ,iii++,0); |
1024 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); | 1024 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); |
1025 | topLayout->addWidget(lab ,iii++,0); | 1025 | topLayout->addWidget(lab ,iii++,0); |
1026 | topLayout->addWidget(hbo,iii++,0); | 1026 | topLayout->addWidget(hbo,iii++,0); |
1027 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); | 1027 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); |
1028 | 1028 | ||
1029 | // topLayout->addWidget(lab ,iii++,0); | 1029 | // topLayout->addWidget(lab ,iii++,0); |
1030 | // #ifndef DESKTOP_VERSION | 1030 | // #ifndef DESKTOP_VERSION |
1031 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 1031 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
1032 | // #else | 1032 | // #else |
1033 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 1033 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
1034 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 1034 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
1035 | // #endif | 1035 | // #endif |
1036 | 1036 | ||
1037 | 1037 | ||
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | void KOPrefsDialog::selectSoundFile() | 1040 | void KOPrefsDialog::selectSoundFile() |
1041 | { | 1041 | { |
1042 | QString fileName = mDefaultAlarmFile->text(); | 1042 | QString fileName = mDefaultAlarmFile->text(); |
1043 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); | 1043 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); |
1044 | if ( fileName.length() > 0 ) | 1044 | if ( fileName.length() > 0 ) |
1045 | mDefaultAlarmFile->setText( fileName ); | 1045 | mDefaultAlarmFile->setText( fileName ); |
1046 | } | 1046 | } |
1047 | void KOPrefsDialog::setupFontsTab() | 1047 | void KOPrefsDialog::setupFontsTab() |
1048 | { | 1048 | { |
1049 | 1049 | ||
1050 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 1050 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
1051 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 1051 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
1052 | 1052 | ||
1053 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 1053 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
1054 | topLayout->setSpacing(1); | 1054 | topLayout->setSpacing(1); |
1055 | topLayout->setMargin(3); | 1055 | topLayout->setMargin(3); |
1056 | KPrefsDialogWidFont * tVFont; | 1056 | KPrefsDialogWidFont * tVFont; |
1057 | int i = 0; | 1057 | int i = 0; |
1058 | KPrefsDialogWidFont *timeLabelsFont = | 1058 | KPrefsDialogWidFont *timeLabelsFont = |
1059 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), | 1059 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), |
1060 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); | 1060 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); |
1061 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1061 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1062 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1062 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1063 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1063 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1064 | ++i; | 1064 | ++i; |
1065 | 1065 | ||
1066 | 1066 | ||
1067 | timeLabelsFont = | 1067 | timeLabelsFont = |
1068 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), | 1068 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), |
1069 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); | 1069 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); |
1070 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1070 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1071 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1071 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1072 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1072 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1073 | ++i; | 1073 | ++i; |
1074 | 1074 | ||
1075 | KPrefsDialogWidFont *timeBarFont = | 1075 | KPrefsDialogWidFont *timeBarFont = |
1076 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), | 1076 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), |
1077 | &(KOPrefs::instance()->mTimeBarFont),topFrame); | 1077 | &(KOPrefs::instance()->mTimeBarFont),topFrame); |
1078 | topLayout->addWidget(timeBarFont->label(),i,0); | 1078 | topLayout->addWidget(timeBarFont->label(),i,0); |
1079 | topLayout->addWidget(timeBarFont->preview(),i,1); | 1079 | topLayout->addWidget(timeBarFont->preview(),i,1); |
1080 | topLayout->addWidget(timeBarFont->button(),i,2); | 1080 | topLayout->addWidget(timeBarFont->button(),i,2); |
1081 | ++i; | 1081 | ++i; |
1082 | 1082 | ||
1083 | 1083 | ||
1084 | KPrefsDialogWidFont *marcusBainsFont = | 1084 | KPrefsDialogWidFont *marcusBainsFont = |
1085 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), | 1085 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), |
1086 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); | 1086 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); |
1087 | topLayout->addWidget(marcusBainsFont->label(),i,0); | 1087 | topLayout->addWidget(marcusBainsFont->label(),i,0); |
1088 | topLayout->addWidget(marcusBainsFont->preview(),i,1); | 1088 | topLayout->addWidget(marcusBainsFont->preview(),i,1); |
1089 | topLayout->addWidget(marcusBainsFont->button(),i,2); | 1089 | topLayout->addWidget(marcusBainsFont->button(),i,2); |
1090 | ++i; | 1090 | ++i; |
1091 | 1091 | ||
1092 | tVFont = | 1092 | tVFont = |
1093 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), | 1093 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), |
1094 | &(KOPrefs::instance()->mEventViewFont),topFrame); | 1094 | &(KOPrefs::instance()->mEventViewFont),topFrame); |
1095 | topLayout->addWidget(tVFont->label(),i,0); | 1095 | topLayout->addWidget(tVFont->label(),i,0); |
1096 | topLayout->addWidget(tVFont->preview(),i,1); | 1096 | topLayout->addWidget(tVFont->preview(),i,1); |
1097 | topLayout->addWidget(tVFont->button(),i,2); | 1097 | topLayout->addWidget(tVFont->button(),i,2); |
1098 | ++i; | 1098 | ++i; |
1099 | 1099 | ||
1100 | 1100 | ||
1101 | 1101 | ||
1102 | tVFont = | 1102 | tVFont = |
1103 | addWidFont(i18n("Details"),i18n("EditorBox:"), | 1103 | addWidFont(i18n("Details"),i18n("EditorBox:"), |
1104 | &(KOPrefs::instance()->mEditBoxFont),topFrame); | 1104 | &(KOPrefs::instance()->mEditBoxFont),topFrame); |
1105 | topLayout->addWidget(tVFont->label(),i,0); | 1105 | topLayout->addWidget(tVFont->label(),i,0); |
1106 | topLayout->addWidget(tVFont->preview(),i,1); | 1106 | topLayout->addWidget(tVFont->preview(),i,1); |
1107 | topLayout->addWidget(tVFont->button(),i,2); | 1107 | topLayout->addWidget(tVFont->button(),i,2); |
1108 | ++i; | 1108 | ++i; |
1109 | 1109 | ||
1110 | 1110 | ||
1111 | 1111 | ||
1112 | topLayout->setColStretch(1,1); | 1112 | topLayout->setColStretch(1,1); |
1113 | topLayout->setRowStretch(4,1); | 1113 | topLayout->setRowStretch(4,1); |
1114 | 1114 | ||
1115 | 1115 | ||
1116 | i = 0; | 1116 | i = 0; |
1117 | topFrame = addPage(i18n("View Fonts"),0, | 1117 | topFrame = addPage(i18n("View Fonts"),0, |
1118 | DesktopIcon("fonts",KIcon::SizeMedium)); | 1118 | DesktopIcon("fonts",KIcon::SizeMedium)); |
1119 | 1119 | ||
1120 | topLayout = new QGridLayout(topFrame,7,3); | 1120 | topLayout = new QGridLayout(topFrame,7,3); |
1121 | topLayout->setSpacing(1); | 1121 | topLayout->setSpacing(1); |
1122 | topLayout->setMargin(3); | 1122 | topLayout->setMargin(3); |
1123 | 1123 | ||
1124 | tVFont = | 1124 | tVFont = |
1125 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), | 1125 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), |
1126 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); | 1126 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); |
1127 | topLayout->addWidget(tVFont->label(),i,0); | 1127 | topLayout->addWidget(tVFont->label(),i,0); |
1128 | topLayout->addWidget(tVFont->preview(),i,1); | 1128 | topLayout->addWidget(tVFont->preview(),i,1); |
1129 | topLayout->addWidget(tVFont->button(),i,2); | 1129 | topLayout->addWidget(tVFont->button(),i,2); |
1130 | ++i; | 1130 | ++i; |
1131 | KPrefsDialogWidFont *agendaViewFont = | 1131 | KPrefsDialogWidFont *agendaViewFont = |
1132 | addWidFont(i18n("Event text"),i18n("Agenda view:"), | 1132 | addWidFont(i18n("Event text"),i18n("Agenda view:"), |
1133 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); | 1133 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); |
1134 | topLayout->addWidget(agendaViewFont->label(),i,0); | 1134 | topLayout->addWidget(agendaViewFont->label(),i,0); |
1135 | topLayout->addWidget(agendaViewFont->preview(),i,1); | 1135 | topLayout->addWidget(agendaViewFont->preview(),i,1); |
1136 | topLayout->addWidget(agendaViewFont->button(),i,2); | 1136 | topLayout->addWidget(agendaViewFont->button(),i,2); |
1137 | ++i; | 1137 | ++i; |
1138 | 1138 | ||
1139 | 1139 | ||
1140 | KPrefsDialogWidFont *monthViewFont = | 1140 | KPrefsDialogWidFont *monthViewFont = |
1141 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), | 1141 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), |
1142 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); | 1142 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); |
1143 | topLayout->addWidget(monthViewFont->label(),i,0); | 1143 | topLayout->addWidget(monthViewFont->label(),i,0); |
1144 | topLayout->addWidget(monthViewFont->preview(),i,1); | 1144 | topLayout->addWidget(monthViewFont->preview(),i,1); |
1145 | topLayout->addWidget(monthViewFont->button(),i,2); | 1145 | topLayout->addWidget(monthViewFont->button(),i,2); |
1146 | ++i; | 1146 | ++i; |
1147 | 1147 | ||
1148 | 1148 | ||
1149 | KPrefsDialogWidFont *lVFont = | 1149 | KPrefsDialogWidFont *lVFont = |
1150 | addWidFont(i18n("Event"),i18n("List View:"), | 1150 | addWidFont(i18n("Event"),i18n("List View:"), |
1151 | &(KOPrefs::instance()->mListViewFont),topFrame); | 1151 | &(KOPrefs::instance()->mListViewFont),topFrame); |
1152 | topLayout->addWidget(lVFont->label(),i,0); | 1152 | topLayout->addWidget(lVFont->label(),i,0); |
1153 | topLayout->addWidget(lVFont->preview(),i,1); | 1153 | topLayout->addWidget(lVFont->preview(),i,1); |
1154 | topLayout->addWidget(lVFont->button(),i,2); | 1154 | topLayout->addWidget(lVFont->button(),i,2); |
1155 | ++i; | 1155 | ++i; |
1156 | 1156 | ||
1157 | 1157 | ||
1158 | tVFont = | 1158 | tVFont = |
1159 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), | 1159 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), |
1160 | &(KOPrefs::instance()->mTodoViewFont),topFrame); | 1160 | &(KOPrefs::instance()->mTodoViewFont),topFrame); |
1161 | topLayout->addWidget(tVFont->label(),i,0); | 1161 | topLayout->addWidget(tVFont->label(),i,0); |
1162 | topLayout->addWidget(tVFont->preview(),i,1); | 1162 | topLayout->addWidget(tVFont->preview(),i,1); |
1163 | topLayout->addWidget(tVFont->button(),i,2); | 1163 | topLayout->addWidget(tVFont->button(),i,2); |
1164 | ++i; | 1164 | ++i; |
1165 | 1165 | ||
1166 | 1166 | ||
1167 | tVFont = | 1167 | tVFont = |
1168 | addWidFont(i18n("Today"),i18n("JournalView:"), | 1168 | addWidFont(i18n("Today"),i18n("JournalView:"), |
1169 | &(KOPrefs::instance()->mJornalViewFont),topFrame); | 1169 | &(KOPrefs::instance()->mJornalViewFont),topFrame); |
1170 | topLayout->addWidget(tVFont->label(),i,0); | 1170 | topLayout->addWidget(tVFont->label(),i,0); |
1171 | topLayout->addWidget(tVFont->preview(),i,1); | 1171 | topLayout->addWidget(tVFont->preview(),i,1); |
1172 | topLayout->addWidget(tVFont->button(),i,2); | 1172 | topLayout->addWidget(tVFont->button(),i,2); |
1173 | ++i; | 1173 | ++i; |
1174 | 1174 | ||
1175 | 1175 | ||
1176 | 1176 | ||
1177 | 1177 | ||
1178 | topLayout->setColStretch(1,1); | 1178 | topLayout->setColStretch(1,1); |
1179 | topLayout->setRowStretch(4,1); | 1179 | topLayout->setRowStretch(4,1); |
1180 | 1180 | ||
1181 | 1181 | ||
1182 | 1182 | ||
1183 | 1183 | ||
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | void KOPrefsDialog::setupColorsTab() | 1186 | void KOPrefsDialog::setupColorsTab() |
1187 | { | 1187 | { |
1188 | QFrame *topFrame = addPage(i18n("Colors"),0,0); | 1188 | QFrame *topFrame = addPage(i18n("Colors"),0,0); |
1189 | // DesktopIcon("colorize",KIcon::SizeMedium)); | 1189 | // DesktopIcon("colorize",KIcon::SizeMedium)); |
1190 | 1190 | ||
1191 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 1191 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
1192 | // topLayout->setSpacing(spacingHint()); | 1192 | // topLayout->setSpacing(spacingHint()); |
1193 | // topLayout->setMargin(marginHint()); | 1193 | // topLayout->setMargin(marginHint()); |
1194 | 1194 | ||
1195 | topLayout->setSpacing(2); | 1195 | topLayout->setSpacing(2); |
1196 | topLayout->setMargin(3); | 1196 | topLayout->setMargin(3); |
1197 | 1197 | ||
1198 | int ii = 1; | 1198 | int ii = 1; |
1199 | QGroupBox *categoryGroup ; | 1199 | QGroupBox *categoryGroup ; |
1200 | 1200 | ||
1201 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), | 1201 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), |
1202 | topFrame); | 1202 | topFrame); |
1203 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); | 1203 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); |
1204 | 1204 | ||
1205 | mCategoryCombo = new QComboBox(categoryGroup); | 1205 | mCategoryCombo = new QComboBox(categoryGroup); |
1206 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1206 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1207 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); | 1207 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); |
1208 | 1208 | ||
1209 | mCategoryButton = new KColorButton(categoryGroup); | 1209 | mCategoryButton = new KColorButton(categoryGroup); |
1210 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); | 1210 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); |
1211 | updateCategoryColor(); | 1211 | updateCategoryColor(); |
1212 | 1212 | ||
1213 | 1213 | ||
1214 | // Holiday Color | 1214 | // Holiday Color |
1215 | 1215 | ||
1216 | KPrefsDialogWidColor *holidayColor = | 1216 | KPrefsDialogWidColor *holidayColor = |
1217 | addWidColor(i18n("Holiday color:"), | 1217 | addWidColor(i18n("Holiday color:"), |
1218 | &(KOPrefs::instance()->mHolidayColor),topFrame); | 1218 | &(KOPrefs::instance()->mHolidayColor),topFrame); |
1219 | topLayout->addWidget(holidayColor->label(),ii,0); | 1219 | topLayout->addWidget(holidayColor->label(),ii,0); |
1220 | topLayout->addWidget(holidayColor->button(),ii++,1); | 1220 | topLayout->addWidget(holidayColor->button(),ii++,1); |
1221 | 1221 | ||
1222 | // Highlight Color | 1222 | // Highlight Color |
1223 | KPrefsDialogWidColor *highlightColor = | 1223 | KPrefsDialogWidColor *highlightColor = |
1224 | addWidColor(i18n("Highlight color:"), | 1224 | addWidColor(i18n("Highlight color:"), |
1225 | &(KOPrefs::instance()->mHighlightColor),topFrame); | 1225 | &(KOPrefs::instance()->mHighlightColor),topFrame); |
1226 | topLayout->addWidget(highlightColor->label(),ii,0); | 1226 | topLayout->addWidget(highlightColor->label(),ii,0); |
1227 | topLayout->addWidget(highlightColor->button(),ii++,1); | 1227 | topLayout->addWidget(highlightColor->button(),ii++,1); |
1228 | 1228 | ||
1229 | // Event color | 1229 | // Event color |
1230 | KPrefsDialogWidColor *eventColor = | 1230 | KPrefsDialogWidColor *eventColor = |
1231 | addWidColor(i18n("Default event color:"), | 1231 | addWidColor(i18n("Default event color:"), |
1232 | &(KOPrefs::instance()->mEventColor),topFrame); | 1232 | &(KOPrefs::instance()->mEventColor),topFrame); |
1233 | topLayout->addWidget(eventColor->label(),ii,0); | 1233 | topLayout->addWidget(eventColor->label(),ii,0); |
1234 | topLayout->addWidget(eventColor->button(),ii++,1); | 1234 | topLayout->addWidget(eventColor->button(),ii++,1); |
1235 | eventColor = | 1235 | eventColor = |
1236 | addWidColor(i18n("Default todo done color:"), | 1236 | addWidColor(i18n("Default todo done color:"), |
1237 | &(KOPrefs::instance()->mTodoDoneColor),topFrame); | 1237 | &(KOPrefs::instance()->mTodoDoneColor),topFrame); |
1238 | topLayout->addWidget(eventColor->label(),ii,0); | 1238 | topLayout->addWidget(eventColor->label(),ii,0); |
1239 | topLayout->addWidget(eventColor->button(),ii++,1); | 1239 | topLayout->addWidget(eventColor->button(),ii++,1); |
1240 | 1240 | ||
1241 | 1241 | ||
1242 | // agenda view background color | 1242 | // agenda view background color |
1243 | KPrefsDialogWidColor *agendaBgColor = | 1243 | KPrefsDialogWidColor *agendaBgColor = |
1244 | addWidColor(i18n("Agenda view background color:"), | 1244 | addWidColor(i18n("Agenda view background color:"), |
1245 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); | 1245 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); |
1246 | topLayout->addWidget(agendaBgColor->label(),ii,0); | 1246 | topLayout->addWidget(agendaBgColor->label(),ii,0); |
1247 | topLayout->addWidget(agendaBgColor->button(),ii++,1); | 1247 | topLayout->addWidget(agendaBgColor->button(),ii++,1); |
1248 | 1248 | ||
1249 | // working hours color | 1249 | // working hours color |
1250 | KPrefsDialogWidColor *workingHoursColor = | 1250 | KPrefsDialogWidColor *workingHoursColor = |
1251 | addWidColor(i18n("Working hours color:"), | 1251 | addWidColor(i18n("Working hours color:"), |
1252 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); | 1252 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); |
1253 | topLayout->addWidget(workingHoursColor->label(),ii,0); | 1253 | topLayout->addWidget(workingHoursColor->label(),ii,0); |
1254 | topLayout->addWidget(workingHoursColor->button(),ii++,1); | 1254 | topLayout->addWidget(workingHoursColor->button(),ii++,1); |
1255 | 1255 | ||
1256 | KPrefsDialogWidBool *sb = | 1256 | KPrefsDialogWidBool *sb = |
1257 | addWidBool(i18n("Use colors for application:"), | 1257 | addWidBool(i18n("Use colors for application:"), |
1258 | &(KOPrefs::instance()->mUseAppColors),topFrame); | 1258 | &(KOPrefs::instance()->mUseAppColors),topFrame); |
1259 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); | 1259 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); |
1260 | 1260 | ||
1261 | ii++; | 1261 | ii++; |
1262 | KPrefsDialogWidColor * workingHoursColor1 = | 1262 | KPrefsDialogWidColor * workingHoursColor1 = |
1263 | addWidColor(i18n("Buttons, menus, etc.:"), | 1263 | addWidColor(i18n("Buttons, menus, etc.:"), |
1264 | &(KOPrefs::instance()->mAppColor1),topFrame); | 1264 | &(KOPrefs::instance()->mAppColor1),topFrame); |
1265 | topLayout->addWidget(workingHoursColor1->label(),ii,0); | 1265 | topLayout->addWidget(workingHoursColor1->label(),ii,0); |
1266 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); | 1266 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); |
1267 | 1267 | ||
1268 | KPrefsDialogWidColor * workingHoursColor2 = | 1268 | KPrefsDialogWidColor * workingHoursColor2 = |
1269 | addWidColor(i18n("Frames, labels, etc.:"), | 1269 | addWidColor(i18n("Frames, labels, etc.:"), |
1270 | &(KOPrefs::instance()->mAppColor2),topFrame); | 1270 | &(KOPrefs::instance()->mAppColor2),topFrame); |
1271 | topLayout->addWidget(workingHoursColor2->label(),ii,0); | 1271 | topLayout->addWidget(workingHoursColor2->label(),ii,0); |
1272 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); | 1272 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); |
1273 | 1273 | ||
1274 | 1274 | ||
1275 | 1275 | ||
1276 | } | 1276 | } |
1277 | 1277 | ||
1278 | void KOPrefsDialog::setCategoryColor() | 1278 | void KOPrefsDialog::setCategoryColor() |
1279 | { | 1279 | { |
1280 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); | 1280 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | void KOPrefsDialog::updateCategoryColor() | 1283 | void KOPrefsDialog::updateCategoryColor() |
1284 | { | 1284 | { |
1285 | QString cat = mCategoryCombo->currentText(); | 1285 | QString cat = mCategoryCombo->currentText(); |
1286 | QColor *color = mCategoryDict.find(cat); | 1286 | QColor *color = mCategoryDict.find(cat); |
1287 | if (!color) { | 1287 | if (!color) { |
1288 | color = KOPrefs::instance()->categoryColor(cat); | 1288 | color = KOPrefs::instance()->categoryColor(cat); |
1289 | } | 1289 | } |
1290 | if (color) { | 1290 | if (color) { |
1291 | mCategoryButton->setColor(*color); | 1291 | mCategoryButton->setColor(*color); |
1292 | } | 1292 | } |
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | void KOPrefsDialog::setupPrinterTab() | 1295 | void KOPrefsDialog::setupPrinterTab() |
1296 | { | 1296 | { |
1297 | mPrinterTab = addPage(i18n("Printing"),0, | 1297 | mPrinterTab = addPage(i18n("Printing"),0, |
1298 | DesktopIcon("fileprint",KIcon::SizeMedium)); | 1298 | DesktopIcon("fileprint",KIcon::SizeMedium)); |
1299 | 1299 | ||
1300 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); | 1300 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); |
1301 | topLayout->setSpacing(spacingHint()); | 1301 | topLayout->setSpacing(spacingHint()); |
1302 | topLayout->setMargin(marginHint()); | 1302 | topLayout->setMargin(marginHint()); |
1303 | 1303 | ||
1304 | topLayout->setRowStretch(4,1); | 1304 | topLayout->setRowStretch(4,1); |
1305 | } | 1305 | } |
1306 | 1306 | ||
1307 | void KOPrefsDialog::setupGroupSchedulingTab() | 1307 | void KOPrefsDialog::setupGroupSchedulingTab() |
1308 | { | 1308 | { |
1309 | #if 0 | 1309 | #if 0 |
1310 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, | 1310 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, |
1311 | DesktopIcon("personal",KIcon::SizeMedium)); | 1311 | DesktopIcon("personal",KIcon::SizeMedium)); |
1312 | 1312 | ||
1313 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 1313 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
1314 | topLayout->setSpacing(spacingHint()); | 1314 | topLayout->setSpacing(spacingHint()); |
1315 | topLayout->setMargin(marginHint()); | 1315 | topLayout->setMargin(marginHint()); |
1316 | 1316 | ||
1317 | #if 0 | 1317 | #if 0 |
1318 | KPrefsDialogWidRadios *schedulerGroup = | 1318 | KPrefsDialogWidRadios *schedulerGroup = |
1319 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), | 1319 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), |
1320 | topFrame); | 1320 | topFrame); |
1321 | schedulerGroup->addRadio("Dummy"); // Only for debugging | 1321 | schedulerGroup->addRadio("Dummy"); // Only for debugging |
1322 | schedulerGroup->addRadio(i18n("Mail client")); | 1322 | schedulerGroup->addRadio(i18n("Mail client")); |
1323 | 1323 | ||
1324 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); | 1324 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); |
1325 | #endif | 1325 | #endif |
1326 | 1326 | ||
1327 | KPrefsDialogWidRadios *sendGroup = | 1327 | KPrefsDialogWidRadios *sendGroup = |
1328 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), | 1328 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), |
1329 | topFrame); | 1329 | topFrame); |
1330 | sendGroup->addRadio(i18n("Send to outbox")); | 1330 | sendGroup->addRadio(i18n("Send to outbox")); |
1331 | sendGroup->addRadio(i18n("Send directly")); | 1331 | sendGroup->addRadio(i18n("Send directly")); |
1332 | 1332 | ||
1333 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); | 1333 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); |
1334 | 1334 | ||
1335 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); | 1335 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); |
1336 | mAMails = new QListView(topFrame); | 1336 | mAMails = new QListView(topFrame); |
1337 | mAMails->addColumn(i18n("Email"),300); | 1337 | mAMails->addColumn(i18n("Email"),300); |
1338 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); | 1338 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); |
1339 | 1339 | ||
1340 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); | 1340 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); |
1341 | aEmailsEdit = new QLineEdit(topFrame); | 1341 | aEmailsEdit = new QLineEdit(topFrame); |
1342 | aEmailsEdit->setEnabled(false); | 1342 | aEmailsEdit->setEnabled(false); |
1343 | topLayout->addWidget(aEmailsEdit,4,1); | 1343 | topLayout->addWidget(aEmailsEdit,4,1); |
1344 | 1344 | ||
1345 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); | 1345 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); |
1346 | topLayout->addWidget(add,5,0); | 1346 | topLayout->addWidget(add,5,0); |
1347 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); | 1347 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); |
1348 | topLayout->addWidget(del,5,1); | 1348 | topLayout->addWidget(del,5,1); |
1349 | 1349 | ||
1350 | //topLayout->setRowStretch(2,1); | 1350 | //topLayout->setRowStretch(2,1); |
1351 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); | 1351 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); |
1352 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); | 1352 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); |
1353 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); | 1353 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); |
1354 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); | 1354 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); |
1355 | #endif | 1355 | #endif |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | void KOPrefsDialog::setupGroupAutomationTab() | 1358 | void KOPrefsDialog::setupGroupAutomationTab() |
1359 | { | 1359 | { |
1360 | return; | 1360 | return; |
1361 | QFrame *topFrame = addPage(i18n("Group Automation"),0, | 1361 | QFrame *topFrame = addPage(i18n("Group Automation"),0, |
1362 | DesktopIcon("personal",KIcon::SizeMedium)); | 1362 | DesktopIcon("personal",KIcon::SizeMedium)); |
1363 | 1363 | ||
1364 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); | 1364 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); |
1365 | topLayout->setSpacing(spacingHint()); | 1365 | topLayout->setSpacing(spacingHint()); |
1366 | topLayout->setMargin(marginHint()); | 1366 | topLayout->setMargin(marginHint()); |
1367 | 1367 | ||
1368 | KPrefsDialogWidRadios *autoRefreshGroup = | 1368 | KPrefsDialogWidRadios *autoRefreshGroup = |
1369 | addWidRadios(i18n("Auto Send Refresh"), | 1369 | addWidRadios(i18n("Auto Send Refresh"), |
1370 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); | 1370 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); |
1371 | autoRefreshGroup->addRadio(i18n("Never")); | 1371 | autoRefreshGroup->addRadio(i18n("Never")); |
1372 | autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); | 1372 | autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); |
1373 | //autoRefreshGroup->addRadio(i18n("selected emails")); | 1373 | //autoRefreshGroup->addRadio(i18n("selected emails")); |
1374 | topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); | 1374 | topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); |
1375 | 1375 | ||
1376 | KPrefsDialogWidRadios *autoInsertGroup = | 1376 | KPrefsDialogWidRadios *autoInsertGroup = |
1377 | addWidRadios(i18n("Auto Insert IMIP Replies"), | 1377 | addWidRadios(i18n("Auto Insert IMIP Replies"), |
1378 | &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); | 1378 | &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); |
1379 | autoInsertGroup->addRadio(i18n("Never")); | 1379 | autoInsertGroup->addRadio(i18n("Never")); |
1380 | autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); | 1380 | autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); |
1381 | //autoInsertGroup->addRadio(i18n("selected emails")); | 1381 | //autoInsertGroup->addRadio(i18n("selected emails")); |
1382 | topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); | 1382 | topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); |
1383 | 1383 | ||
1384 | KPrefsDialogWidRadios *autoRequestGroup = | 1384 | KPrefsDialogWidRadios *autoRequestGroup = |
1385 | addWidRadios(i18n("Auto Insert IMIP Requests"), | 1385 | addWidRadios(i18n("Auto Insert IMIP Requests"), |
1386 | &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); | 1386 | &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); |
1387 | autoRequestGroup->addRadio(i18n("Never")); | 1387 | autoRequestGroup->addRadio(i18n("Never")); |
1388 | autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); | 1388 | autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); |
1389 | //autoInsertGroup->addRadio(i18n("selected emails")); | 1389 | //autoInsertGroup->addRadio(i18n("selected emails")); |
1390 | topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); | 1390 | topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); |
1391 | 1391 | ||
1392 | KPrefsDialogWidRadios *autoFreeBusyGroup = | 1392 | KPrefsDialogWidRadios *autoFreeBusyGroup = |
1393 | addWidRadios(i18n("Auto Send FreeBusy Information"), | 1393 | addWidRadios(i18n("Auto Send FreeBusy Information"), |
1394 | &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); | 1394 | &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); |
1395 | autoFreeBusyGroup->addRadio(i18n("Never")); | 1395 | autoFreeBusyGroup->addRadio(i18n("Never")); |
1396 | autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); | 1396 | autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); |
1397 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); | 1397 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); |
1398 | topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); | 1398 | topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); |
1399 | 1399 | ||
1400 | KPrefsDialogWidRadios *autoFreeBusyReplyGroup = | 1400 | KPrefsDialogWidRadios *autoFreeBusyReplyGroup = |
1401 | addWidRadios(i18n("Auto Save FreeBusy Replies"), | 1401 | addWidRadios(i18n("Auto Save FreeBusy Replies"), |
1402 | &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); | 1402 | &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); |
1403 | autoFreeBusyReplyGroup->addRadio(i18n("Never")); | 1403 | autoFreeBusyReplyGroup->addRadio(i18n("Never")); |
1404 | autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); | 1404 | autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); |
1405 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); | 1405 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); |
1406 | topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); | 1406 | topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); |
1407 | } | 1407 | } |
1408 | 1408 | ||
1409 | void KOPrefsDialog::showPrinterTab() | 1409 | void KOPrefsDialog::showPrinterTab() |
1410 | { | 1410 | { |
1411 | showPage(pageIndex(mPrinterTab)); | 1411 | showPage(pageIndex(mPrinterTab)); |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | 1414 | ||
1415 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | 1415 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, |
1416 | const QStringList *tags) | 1416 | const QStringList *tags) |
1417 | { | 1417 | { |
1418 | if (tags) { | 1418 | if (tags) { |
1419 | int i = tags->findIndex(text); | 1419 | int i = tags->findIndex(text); |
1420 | if (i > 0) combo->setCurrentItem(i); | 1420 | if (i > 0) combo->setCurrentItem(i); |
1421 | } else { | 1421 | } else { |
1422 | for(int i=0;i<combo->count();++i) { | 1422 | for(int i=0;i<combo->count();++i) { |
1423 | if (combo->text(i) == text) { | 1423 | if (combo->text(i) == text) { |
1424 | combo->setCurrentItem(i); | 1424 | combo->setCurrentItem(i); |
1425 | break; | 1425 | break; |
1426 | } | 1426 | } |
1427 | } | 1427 | } |
1428 | } | 1428 | } |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | void KOPrefsDialog::usrReadConfig() | 1431 | void KOPrefsDialog::usrReadConfig() |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index bd9efc8..7faf675 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -235,1644 +235,1644 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
235 | processIncidenceSelection( 0 ); | 235 | processIncidenceSelection( 0 ); |
236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
237 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 237 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
239 | SLOT( slotModifiedChanged( bool ) ) ); | 239 | SLOT( slotModifiedChanged( bool ) ) ); |
240 | 240 | ||
241 | 241 | ||
242 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 242 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
243 | SLOT( disableBR(bool) ) ); | 243 | SLOT( disableBR(bool) ) ); |
244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
245 | mView->setModified( false ); | 245 | mView->setModified( false ); |
246 | mBlockAtStartup = false; | 246 | mBlockAtStartup = false; |
247 | mView->setModified( false ); | 247 | mView->setModified( false ); |
248 | setCentralWidget( mView ); | 248 | setCentralWidget( mView ); |
249 | globalFlagBlockStartup = 0; | 249 | globalFlagBlockStartup = 0; |
250 | mView->show(); | 250 | mView->show(); |
251 | delete splash; | 251 | delete splash; |
252 | if ( newFile ) | 252 | if ( newFile ) |
253 | mView->updateConfig(); | 253 | mView->updateConfig(); |
254 | // qApp->processEvents(); | 254 | // qApp->processEvents(); |
255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
256 | //fillSyncMenu(); | 256 | //fillSyncMenu(); |
257 | 257 | ||
258 | 258 | ||
259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
264 | mSyncManager->setDefaultFileName( sentSyncFile()); | 264 | mSyncManager->setDefaultFileName( sentSyncFile()); |
265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
266 | mSyncManager->fillSyncMenu(); | 266 | mSyncManager->fillSyncMenu(); |
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
271 | if ( showWarning ) { | 271 | if ( showWarning ) { |
272 | KMessageBox::information( this, | 272 | KMessageBox::information( this, |
273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
274 | qApp->processEvents(); | 274 | qApp->processEvents(); |
275 | mView->dialogManager()->showSyncOptions(); | 275 | mView->dialogManager()->showSyncOptions(); |
276 | } | 276 | } |
277 | 277 | ||
278 | //US listen for result adressed from Ka/Pi | 278 | //US listen for result adressed from Ka/Pi |
279 | #ifndef DESKTOP_VERSION | 279 | #ifndef DESKTOP_VERSION |
280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
281 | #endif | 281 | #endif |
282 | #ifndef DESKTOP_VERSION | 282 | #ifndef DESKTOP_VERSION |
283 | infrared = 0; | 283 | infrared = 0; |
284 | #endif | 284 | #endif |
285 | updateWeek( mView->startDate() ); | 285 | updateWeek( mView->startDate() ); |
286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
288 | mBRdisabled = false; | 288 | mBRdisabled = false; |
289 | //toggleBeamReceive(); | 289 | //toggleBeamReceive(); |
290 | } | 290 | } |
291 | MainWindow::~MainWindow() | 291 | MainWindow::~MainWindow() |
292 | { | 292 | { |
293 | //qDebug("MainWindow::~MainWindow() "); | 293 | //qDebug("MainWindow::~MainWindow() "); |
294 | //save toolbar location | 294 | //save toolbar location |
295 | delete mCalendar; | 295 | delete mCalendar; |
296 | delete mSyncManager; | 296 | delete mSyncManager; |
297 | #ifndef DESKTOP_VERSION | 297 | #ifndef DESKTOP_VERSION |
298 | if ( infrared ) | 298 | if ( infrared ) |
299 | delete infrared; | 299 | delete infrared; |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | 302 | ||
303 | } | 303 | } |
304 | 304 | ||
305 | void MainWindow::disableBR(bool b) | 305 | void MainWindow::disableBR(bool b) |
306 | { | 306 | { |
307 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
308 | if ( b ) { | 308 | if ( b ) { |
309 | if ( infrared ) { | 309 | if ( infrared ) { |
310 | toggleBeamReceive(); | 310 | toggleBeamReceive(); |
311 | mBRdisabled = true; | 311 | mBRdisabled = true; |
312 | } | 312 | } |
313 | mBRdisabled = true; | 313 | mBRdisabled = true; |
314 | } else { | 314 | } else { |
315 | if ( mBRdisabled ) { | 315 | if ( mBRdisabled ) { |
316 | mBRdisabled = false; | 316 | mBRdisabled = false; |
317 | //makes no sense,because other cal ap is probably running | 317 | //makes no sense,because other cal ap is probably running |
318 | // toggleBeamReceive(); | 318 | // toggleBeamReceive(); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | } | 323 | } |
324 | bool MainWindow::beamReceiveEnabled() | 324 | bool MainWindow::beamReceiveEnabled() |
325 | { | 325 | { |
326 | #ifndef DESKTOP_VERSION | 326 | #ifndef DESKTOP_VERSION |
327 | return ( infrared != 0 ); | 327 | return ( infrared != 0 ); |
328 | #endif | 328 | #endif |
329 | return false; | 329 | return false; |
330 | } | 330 | } |
331 | 331 | ||
332 | void MainWindow::toggleBeamReceive() | 332 | void MainWindow::toggleBeamReceive() |
333 | { | 333 | { |
334 | if ( mBRdisabled ) | 334 | if ( mBRdisabled ) |
335 | return; | 335 | return; |
336 | #ifndef DESKTOP_VERSION | 336 | #ifndef DESKTOP_VERSION |
337 | if ( infrared ) { | 337 | if ( infrared ) { |
338 | qDebug("disable BeamReceive "); | 338 | qDebug("disable BeamReceive "); |
339 | delete infrared; | 339 | delete infrared; |
340 | infrared = 0; | 340 | infrared = 0; |
341 | brAction->setOn(false); | 341 | brAction->setOn(false); |
342 | return; | 342 | return; |
343 | } | 343 | } |
344 | qDebug("enable BeamReceive "); | 344 | qDebug("enable BeamReceive "); |
345 | brAction->setOn(true); | 345 | brAction->setOn(true); |
346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
348 | #endif | 348 | #endif |
349 | } | 349 | } |
350 | void MainWindow::showMaximized () | 350 | void MainWindow::showMaximized () |
351 | { | 351 | { |
352 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
353 | if ( ! globalFlagBlockStartup ) | 353 | if ( ! globalFlagBlockStartup ) |
354 | if ( mClosed ) | 354 | if ( mClosed ) |
355 | mView->goToday(); | 355 | mView->goToday(); |
356 | #endif | 356 | #endif |
357 | QWidget::showMaximized () ; | 357 | QWidget::showMaximized () ; |
358 | mClosed = false; | 358 | mClosed = false; |
359 | } | 359 | } |
360 | void MainWindow::closeEvent( QCloseEvent* ce ) | 360 | void MainWindow::closeEvent( QCloseEvent* ce ) |
361 | { | 361 | { |
362 | 362 | ||
363 | 363 | ||
364 | 364 | ||
365 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 365 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
366 | saveOnClose(); | 366 | saveOnClose(); |
367 | mClosed = true; | 367 | mClosed = true; |
368 | ce->accept(); | 368 | ce->accept(); |
369 | return; | 369 | return; |
370 | 370 | ||
371 | } | 371 | } |
372 | 372 | ||
373 | switch( QMessageBox::information( this, "KO/Pi", | 373 | switch( QMessageBox::information( this, "KO/Pi", |
374 | i18n("Do you really want\nto close KO/Pi?"), | 374 | i18n("Do you really want\nto close KO/Pi?"), |
375 | i18n("Close"), i18n("No"), | 375 | i18n("Close"), i18n("No"), |
376 | 0, 0 ) ) { | 376 | 0, 0 ) ) { |
377 | case 0: | 377 | case 0: |
378 | saveOnClose(); | 378 | saveOnClose(); |
379 | mClosed = true; | 379 | mClosed = true; |
380 | ce->accept(); | 380 | ce->accept(); |
381 | break; | 381 | break; |
382 | case 1: | 382 | case 1: |
383 | ce->ignore(); | 383 | ce->ignore(); |
384 | break; | 384 | break; |
385 | case 2: | 385 | case 2: |
386 | 386 | ||
387 | default: | 387 | default: |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | } | 392 | } |
393 | 393 | ||
394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
395 | { | 395 | { |
396 | QDataStream stream( data, IO_ReadOnly ); | 396 | QDataStream stream( data, IO_ReadOnly ); |
397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
398 | //QString datamess; | 398 | //QString datamess; |
399 | //qDebug("message "); | 399 | //qDebug("message "); |
400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
401 | 401 | ||
402 | if ( cmsg == "setDocument(QString)" ) { | 402 | if ( cmsg == "setDocument(QString)" ) { |
403 | QDataStream stream( data, IO_ReadOnly ); | 403 | QDataStream stream( data, IO_ReadOnly ); |
404 | QString fileName; | 404 | QString fileName; |
405 | stream >> fileName; | 405 | stream >> fileName; |
406 | //qDebug("filename %s ", fileName.latin1()); | 406 | //qDebug("filename %s ", fileName.latin1()); |
407 | showMaximized(); | 407 | showMaximized(); |
408 | raise(); | 408 | raise(); |
409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
410 | mSyncManager->slotSyncMenu( 1002 ); | 410 | mSyncManager->slotSyncMenu( 1002 ); |
411 | return; | 411 | return; |
412 | } | 412 | } |
413 | 413 | ||
414 | if ( cmsg == "-writeFile" ) { | 414 | if ( cmsg == "-writeFile" ) { |
415 | // I made from the "-writeFile" an "-writeAlarm" | 415 | // I made from the "-writeFile" an "-writeAlarm" |
416 | mView->viewManager()->showWhatsNextView(); | 416 | mView->viewManager()->showWhatsNextView(); |
417 | mCalendar->checkAlarmForIncidence( 0, true); | 417 | mCalendar->checkAlarmForIncidence( 0, true); |
418 | showMaximized(); | 418 | showMaximized(); |
419 | raise(); | 419 | raise(); |
420 | return; | 420 | return; |
421 | 421 | ||
422 | } | 422 | } |
423 | if ( cmsg == "-writeFileSilent" ) { | 423 | if ( cmsg == "-writeFileSilent" ) { |
424 | // I made from the "-writeFile" an "-writeAlarm" | 424 | // I made from the "-writeFile" an "-writeAlarm" |
425 | // mView->viewManager()->showWhatsNextView(); | 425 | // mView->viewManager()->showWhatsNextView(); |
426 | mCalendar->checkAlarmForIncidence( 0, true); | 426 | mCalendar->checkAlarmForIncidence( 0, true); |
427 | //showMaximized(); | 427 | //showMaximized(); |
428 | //raise(); | 428 | //raise(); |
429 | hide(); | 429 | hide(); |
430 | return; | 430 | return; |
431 | } | 431 | } |
432 | if ( cmsg == "-newCountdown" ) { | 432 | if ( cmsg == "-newCountdown" ) { |
433 | qDebug("newCountdown "); | 433 | qDebug("newCountdown "); |
434 | 434 | ||
435 | } | 435 | } |
436 | QString msg ; | 436 | QString msg ; |
437 | QString allmsg = cmsg; | 437 | QString allmsg = cmsg; |
438 | while ( allmsg.length() > 0 ) { | 438 | while ( allmsg.length() > 0 ) { |
439 | int nextC = allmsg.find( "-", 1 ); | 439 | int nextC = allmsg.find( "-", 1 ); |
440 | if ( nextC == -1 ) { | 440 | if ( nextC == -1 ) { |
441 | msg = allmsg; | 441 | msg = allmsg; |
442 | allmsg = ""; | 442 | allmsg = ""; |
443 | } else{ | 443 | } else{ |
444 | msg = allmsg.left( nextC ); | 444 | msg = allmsg.left( nextC ); |
445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
446 | } | 446 | } |
447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
448 | if ( msg == "-newEvent" ) { | 448 | if ( msg == "-newEvent" ) { |
449 | mView->newEvent(); | 449 | mView->newEvent(); |
450 | } | 450 | } |
451 | if ( msg == "-newTodo" ) { | 451 | if ( msg == "-newTodo" ) { |
452 | mView->newTodo(); | 452 | mView->newTodo(); |
453 | 453 | ||
454 | } | 454 | } |
455 | if ( msg == "-showWN" ) { | 455 | if ( msg == "-showWN" ) { |
456 | mView->viewManager()->showWhatsNextView(); | 456 | mView->viewManager()->showWhatsNextView(); |
457 | } | 457 | } |
458 | if ( msg == "-showTodo" ) { | 458 | if ( msg == "-showTodo" ) { |
459 | mView->viewManager()->showTodoView(); | 459 | mView->viewManager()->showTodoView(); |
460 | } | 460 | } |
461 | if ( msg == "-showList" ) { | 461 | if ( msg == "-showList" ) { |
462 | mView->viewManager()->showListView(); | 462 | mView->viewManager()->showListView(); |
463 | } | 463 | } |
464 | else if ( msg == "-showDay" ) { | 464 | else if ( msg == "-showDay" ) { |
465 | mView->viewManager()->showDayView(); | 465 | mView->viewManager()->showDayView(); |
466 | } | 466 | } |
467 | else if ( msg == "-showWWeek" ) { | 467 | else if ( msg == "-showWWeek" ) { |
468 | mView->viewManager()->showWorkWeekView(); | 468 | mView->viewManager()->showWorkWeekView(); |
469 | } | 469 | } |
470 | else if ( msg == "-ringSync" ) { | 470 | else if ( msg == "-ringSync" ) { |
471 | mSyncManager->multiSync( false ); | 471 | mSyncManager->multiSync( false ); |
472 | } | 472 | } |
473 | else if ( msg == "-showWeek" ) { | 473 | else if ( msg == "-showWeek" ) { |
474 | mView->viewManager()->showWeekView(); | 474 | mView->viewManager()->showWeekView(); |
475 | } | 475 | } |
476 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
477 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
478 | } | 478 | } |
479 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
480 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
481 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
482 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { | 487 | else if ( msg == "-showWNext" || msg == "nextView()" ) { |
488 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
489 | } | 489 | } |
490 | else if ( msg == "-showNextXView" ) { | 490 | else if ( msg == "-showNextXView" ) { |
491 | mView->viewManager()->showNextXView(); | 491 | mView->viewManager()->showNextXView(); |
492 | } | 492 | } |
493 | 493 | ||
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | showMaximized(); | 497 | showMaximized(); |
498 | raise(); | 498 | raise(); |
499 | } | 499 | } |
500 | 500 | ||
501 | QPixmap MainWindow::loadPixmap( QString name ) | 501 | QPixmap MainWindow::loadPixmap( QString name ) |
502 | { | 502 | { |
503 | return SmallIcon( name ); | 503 | return SmallIcon( name ); |
504 | 504 | ||
505 | } | 505 | } |
506 | void MainWindow::initActions() | 506 | void MainWindow::initActions() |
507 | { | 507 | { |
508 | //KOPrefs::instance()->mShowFullMenu | 508 | //KOPrefs::instance()->mShowFullMenu |
509 | iconToolBar->clear(); | 509 | iconToolBar->clear(); |
510 | KOPrefs *p = KOPrefs::instance(); | 510 | KOPrefs *p = KOPrefs::instance(); |
511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
512 | 512 | ||
513 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 513 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
514 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 514 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
515 | QPopupMenu *importMenu = new QPopupMenu( this ); | 515 | QPopupMenu *importMenu = new QPopupMenu( this ); |
516 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 516 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
517 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 517 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
518 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 518 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
519 | selectFilterMenu = new QPopupMenu( this ); | 519 | selectFilterMenu = new QPopupMenu( this ); |
520 | selectFilterMenu->setCheckable( true ); | 520 | selectFilterMenu->setCheckable( true ); |
521 | syncMenu = new QPopupMenu( this ); | 521 | syncMenu = new QPopupMenu( this ); |
522 | configureAgendaMenu = new QPopupMenu( this ); | 522 | configureAgendaMenu = new QPopupMenu( this ); |
523 | configureToolBarMenu = new QPopupMenu( this ); | 523 | configureToolBarMenu = new QPopupMenu( this ); |
524 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 524 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
525 | QIconSet icon; | 525 | QIconSet icon; |
526 | int pixWid = 22, pixHei = 22; | 526 | int pixWid = 22, pixHei = 22; |
527 | QString pathString = ""; | 527 | QString pathString = ""; |
528 | if ( !p->mToolBarMiniIcons ) { | 528 | if ( !p->mToolBarMiniIcons ) { |
529 | if ( QApplication::desktop()->width() < 480 ) { | 529 | if ( QApplication::desktop()->width() < 480 ) { |
530 | pathString += "icons16/"; | 530 | pathString += "icons16/"; |
531 | pixWid = 18; pixHei = 16; | 531 | pixWid = 18; pixHei = 16; |
532 | } | 532 | } |
533 | } else { | 533 | } else { |
534 | pathString += "iconsmini/"; | 534 | pathString += "iconsmini/"; |
535 | pixWid = 18; pixHei = 16; | 535 | pixWid = 18; pixHei = 16; |
536 | } | 536 | } |
537 | if ( KOPrefs::instance()->mShowFullMenu ) { | 537 | if ( KOPrefs::instance()->mShowFullMenu ) { |
538 | QMenuBar *menuBar1; | 538 | QMenuBar *menuBar1; |
539 | menuBar1 = menuBar(); | 539 | menuBar1 = menuBar(); |
540 | menuBar1->insertItem( i18n("File"), importMenu ); | 540 | menuBar1->insertItem( i18n("File"), importMenu ); |
541 | menuBar1->insertItem( i18n("View"), viewMenu ); | 541 | menuBar1->insertItem( i18n("View"), viewMenu ); |
542 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 542 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
543 | #ifdef DESKTOP_VERSION | 543 | #ifdef DESKTOP_VERSION |
544 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 544 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
545 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 545 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
546 | #else | 546 | #else |
547 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 547 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
548 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 548 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
549 | #endif | 549 | #endif |
550 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 550 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
551 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 551 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
552 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 552 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
553 | } else { | 553 | } else { |
554 | QPEMenuBar *menuBar1; | 554 | QPEMenuBar *menuBar1; |
555 | menuBar1 = new QPEMenuBar( iconToolBar ); | 555 | menuBar1 = new QPEMenuBar( iconToolBar ); |
556 | QPopupMenu *menuBar = new QPopupMenu( this ); | 556 | QPopupMenu *menuBar = new QPopupMenu( this ); |
557 | icon = loadPixmap( pathString + "z_menu" ); | 557 | icon = loadPixmap( pathString + "z_menu" ); |
558 | menuBar1->insertItem( icon.pixmap(), menuBar); | 558 | menuBar1->insertItem( icon.pixmap(), menuBar); |
559 | //menuBar1->insertItem( i18n("ME"), menuBar); | 559 | //menuBar1->insertItem( i18n("ME"), menuBar); |
560 | menuBar->insertItem( i18n("File"), importMenu ); | 560 | menuBar->insertItem( i18n("File"), importMenu ); |
561 | menuBar->insertItem( i18n("View"), viewMenu ); | 561 | menuBar->insertItem( i18n("View"), viewMenu ); |
562 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 562 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
563 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 563 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
564 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 564 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
565 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 565 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
566 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 566 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
567 | menuBar->insertItem( i18n("Help"), helpMenu ); | 567 | menuBar->insertItem( i18n("Help"), helpMenu ); |
568 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 568 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
569 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 569 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
570 | } | 570 | } |
571 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 571 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
572 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 572 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
573 | mWeekBgColor = iconToolBar->backgroundColor(); | 573 | mWeekBgColor = iconToolBar->backgroundColor(); |
574 | mWeekPixmap.resize( pixWid , pixHei ); | 574 | mWeekPixmap.resize( pixWid , pixHei ); |
575 | mWeekPixmap.fill( mWeekBgColor ); | 575 | mWeekPixmap.fill( mWeekBgColor ); |
576 | icon = mWeekPixmap; | 576 | icon = mWeekPixmap; |
577 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 577 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
578 | if ( p-> mShowIconWeekNum ) | 578 | if ( p-> mShowIconWeekNum ) |
579 | mWeekAction->addTo( iconToolBar ); | 579 | mWeekAction->addTo( iconToolBar ); |
580 | mWeekFont = font(); | 580 | mWeekFont = font(); |
581 | 581 | ||
582 | int fontPoint = mWeekFont.pointSize(); | 582 | int fontPoint = mWeekFont.pointSize(); |
583 | QFontMetrics f( mWeekFont ); | 583 | QFontMetrics f( mWeekFont ); |
584 | int fontWid = f.width( "30" ); | 584 | int fontWid = f.width( "30" ); |
585 | while ( fontWid > pixWid ) { | 585 | while ( fontWid > pixWid ) { |
586 | --fontPoint; | 586 | --fontPoint; |
587 | mWeekFont.setPointSize( fontPoint ); | 587 | mWeekFont.setPointSize( fontPoint ); |
588 | QFontMetrics f( mWeekFont ); | 588 | QFontMetrics f( mWeekFont ); |
589 | fontWid = f.width( "30" ); | 589 | fontWid = f.width( "30" ); |
590 | qDebug("dec-- "); | 590 | qDebug("dec-- "); |
591 | } | 591 | } |
592 | 592 | ||
593 | connect( mWeekAction, SIGNAL( activated() ), | 593 | connect( mWeekAction, SIGNAL( activated() ), |
594 | this, SLOT( weekAction() ) ); | 594 | this, SLOT( weekAction() ) ); |
595 | 595 | ||
596 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 596 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
597 | 597 | ||
598 | //#endif | 598 | //#endif |
599 | // ****************** | 599 | // ****************** |
600 | QAction *action; | 600 | QAction *action; |
601 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 601 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
602 | configureToolBarMenu->setCheckable( true ); | 602 | configureToolBarMenu->setCheckable( true ); |
603 | 603 | ||
604 | 604 | ||
605 | configureAgendaMenu->setCheckable( true ); | 605 | configureAgendaMenu->setCheckable( true ); |
606 | int iii ; | 606 | int iii ; |
607 | for ( iii = 1;iii<= 10 ;++iii ){ | 607 | for ( iii = 1;iii<= 10 ;++iii ){ |
608 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 608 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
609 | } | 609 | } |
610 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 610 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
611 | 611 | ||
612 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 612 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
613 | this, SLOT( showConfigureAgenda( ) ) ); | 613 | this, SLOT( showConfigureAgenda( ) ) ); |
614 | 614 | ||
615 | icon = loadPixmap( pathString + "configure" ); | 615 | icon = loadPixmap( pathString + "configure" ); |
616 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 616 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
617 | action->addTo( actionMenu ); | 617 | action->addTo( actionMenu ); |
618 | connect( action, SIGNAL( activated() ), | 618 | connect( action, SIGNAL( activated() ), |
619 | mView, SLOT( edit_options() ) ); | 619 | mView, SLOT( edit_options() ) ); |
620 | actionMenu->insertSeparator(); | 620 | actionMenu->insertSeparator(); |
621 | 621 | ||
622 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 622 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
623 | action->addTo( actionMenu ); | 623 | action->addTo( actionMenu ); |
624 | connect( action, SIGNAL( activated() ), | 624 | connect( action, SIGNAL( activated() ), |
625 | mView, SLOT( undo_delete() ) ); | 625 | mView, SLOT( undo_delete() ) ); |
626 | actionMenu->insertSeparator(); | 626 | actionMenu->insertSeparator(); |
627 | 627 | ||
628 | icon = loadPixmap( pathString + "newevent" ); | 628 | icon = loadPixmap( pathString + "newevent" ); |
629 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 629 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
630 | configureToolBarMenu->insertSeparator(); | 630 | configureToolBarMenu->insertSeparator(); |
631 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 631 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
632 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 632 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
633 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 633 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
634 | ne_action->addTo( actionMenu ); | 634 | ne_action->addTo( actionMenu ); |
635 | connect( ne_action, SIGNAL( activated() ), | 635 | connect( ne_action, SIGNAL( activated() ), |
636 | mView, SLOT( newEvent() ) ); | 636 | mView, SLOT( newEvent() ) ); |
637 | icon = loadPixmap( pathString + "newtodo" ); | 637 | icon = loadPixmap( pathString + "newtodo" ); |
638 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 638 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
639 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 639 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
640 | nt_action->addTo( actionMenu ); | 640 | nt_action->addTo( actionMenu ); |
641 | connect( nt_action, SIGNAL( activated() ), | 641 | connect( nt_action, SIGNAL( activated() ), |
642 | mView, SLOT( newTodo() ) ); | 642 | mView, SLOT( newTodo() ) ); |
643 | 643 | ||
644 | icon = loadPixmap( pathString + "today" ); | 644 | icon = loadPixmap( pathString + "today" ); |
645 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 645 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
646 | today_action->addTo( viewMenu ); | 646 | today_action->addTo( viewMenu ); |
647 | connect( today_action, SIGNAL( activated() ), | 647 | connect( today_action, SIGNAL( activated() ), |
648 | mView, SLOT( goToday() ) ); | 648 | mView, SLOT( goToday() ) ); |
649 | viewMenu->insertSeparator(); | 649 | viewMenu->insertSeparator(); |
650 | 650 | ||
651 | icon = loadPixmap( pathString + "navi" ); | 651 | icon = loadPixmap( pathString + "navi" ); |
652 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 652 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
653 | action->addTo( viewMenu ); | 653 | action->addTo( viewMenu ); |
654 | connect( action, SIGNAL( activated() ), | 654 | connect( action, SIGNAL( activated() ), |
655 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 655 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
656 | mToggleNav = action ; | 656 | mToggleNav = action ; |
657 | icon = loadPixmap( pathString + "filter" ); | 657 | icon = loadPixmap( pathString + "filter" ); |
658 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 658 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
659 | action->addTo( viewMenu ); | 659 | action->addTo( viewMenu ); |
660 | connect( action, SIGNAL( activated() ), | 660 | connect( action, SIGNAL( activated() ), |
661 | mView, SLOT( toggleFilter() ) ); | 661 | mView, SLOT( toggleFilter() ) ); |
662 | mToggleFilter = action; | 662 | mToggleFilter = action; |
663 | icon = loadPixmap( pathString + "allday" ); | 663 | icon = loadPixmap( pathString + "allday" ); |
664 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 664 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
665 | action->addTo( viewMenu ); | 665 | action->addTo( viewMenu ); |
666 | connect( action, SIGNAL( activated() ), | 666 | connect( action, SIGNAL( activated() ), |
667 | mView, SLOT( toggleAllDaySize() ) ); | 667 | mView, SLOT( toggleAllDaySize() ) ); |
668 | mToggleAllday = action; | 668 | mToggleAllday = action; |
669 | 669 | ||
670 | 670 | ||
671 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 671 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
672 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 672 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
673 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 673 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
674 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 674 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
675 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 675 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
676 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 676 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
677 | 677 | ||
678 | viewMenu->insertSeparator(); | 678 | viewMenu->insertSeparator(); |
679 | icon = loadPixmap( pathString + "picker" ); | 679 | icon = loadPixmap( pathString + "picker" ); |
680 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 680 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
681 | action->addTo( viewMenu ); | 681 | action->addTo( viewMenu ); |
682 | connect( action, SIGNAL( activated() ), | 682 | connect( action, SIGNAL( activated() ), |
683 | mView, SLOT( showDatePicker() ) ); | 683 | mView, SLOT( showDatePicker() ) ); |
684 | action->addTo( iconToolBar ); | 684 | action->addTo( iconToolBar ); |
685 | viewMenu->insertSeparator(); | 685 | viewMenu->insertSeparator(); |
686 | icon = loadPixmap( pathString + "list" ); | 686 | icon = loadPixmap( pathString + "list" ); |
687 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 687 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
688 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 688 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
689 | showlist_action->addTo( viewMenu ); | 689 | showlist_action->addTo( viewMenu ); |
690 | connect( showlist_action, SIGNAL( activated() ), | 690 | connect( showlist_action, SIGNAL( activated() ), |
691 | mView->viewManager(), SLOT( showListView() ) ); | 691 | mView->viewManager(), SLOT( showListView() ) ); |
692 | 692 | ||
693 | 693 | ||
694 | icon = loadPixmap( pathString + "day" ); | 694 | icon = loadPixmap( pathString + "day" ); |
695 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 695 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
696 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 696 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
697 | day1_action->addTo( viewMenu ); | 697 | day1_action->addTo( viewMenu ); |
698 | // action->addTo( toolBar ); | 698 | // action->addTo( toolBar ); |
699 | connect( day1_action, SIGNAL( activated() ), | 699 | connect( day1_action, SIGNAL( activated() ), |
700 | mView->viewManager(), SLOT( showDayView() ) ); | 700 | mView->viewManager(), SLOT( showDayView() ) ); |
701 | 701 | ||
702 | icon = loadPixmap( pathString + "workweek" ); | 702 | icon = loadPixmap( pathString + "workweek" ); |
703 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 703 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
704 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 704 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
705 | day5_action->addTo( viewMenu ); | 705 | day5_action->addTo( viewMenu ); |
706 | connect( day5_action, SIGNAL( activated() ), | 706 | connect( day5_action, SIGNAL( activated() ), |
707 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 707 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
708 | 708 | ||
709 | icon = loadPixmap( pathString + "week" ); | 709 | icon = loadPixmap( pathString + "week" ); |
710 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 710 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
711 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 711 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
712 | day7_action->addTo( viewMenu ); | 712 | day7_action->addTo( viewMenu ); |
713 | connect( day7_action, SIGNAL( activated() ), | 713 | connect( day7_action, SIGNAL( activated() ), |
714 | mView->viewManager(), SLOT( showWeekView() ) ); | 714 | mView->viewManager(), SLOT( showWeekView() ) ); |
715 | 715 | ||
716 | icon = loadPixmap( pathString + "workweek2" ); | 716 | icon = loadPixmap( pathString + "workweek2" ); |
717 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 717 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
718 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 718 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
719 | day6_action->addTo( viewMenu ); | 719 | day6_action->addTo( viewMenu ); |
720 | connect( day6_action, SIGNAL( activated() ), | 720 | connect( day6_action, SIGNAL( activated() ), |
721 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 721 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
722 | 722 | ||
723 | icon = loadPixmap( pathString + "month" ); | 723 | icon = loadPixmap( pathString + "month" ); |
724 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 724 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
725 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 725 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
726 | month_action->addTo( viewMenu ); | 726 | month_action->addTo( viewMenu ); |
727 | connect( month_action, SIGNAL( activated() ), | 727 | connect( month_action, SIGNAL( activated() ), |
728 | mView->viewManager(), SLOT( showMonthView() ) ); | 728 | mView->viewManager(), SLOT( showMonthView() ) ); |
729 | 729 | ||
730 | icon = loadPixmap( pathString + "todo" ); | 730 | icon = loadPixmap( pathString + "todo" ); |
731 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 731 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
732 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 732 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
733 | todoview_action->addTo( viewMenu ); | 733 | todoview_action->addTo( viewMenu ); |
734 | connect( todoview_action, SIGNAL( activated() ), | 734 | connect( todoview_action, SIGNAL( activated() ), |
735 | mView->viewManager(), SLOT( showTodoView() ) ); | 735 | mView->viewManager(), SLOT( showTodoView() ) ); |
736 | 736 | ||
737 | icon = loadPixmap( pathString + "journal" ); | 737 | icon = loadPixmap( pathString + "journal" ); |
738 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 738 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
739 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 739 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
740 | viewjournal_action->addTo( viewMenu ); | 740 | viewjournal_action->addTo( viewMenu ); |
741 | connect( viewjournal_action, SIGNAL( activated() ), | 741 | connect( viewjournal_action, SIGNAL( activated() ), |
742 | mView->viewManager(), SLOT( showJournalView() ) ); | 742 | mView->viewManager(), SLOT( showJournalView() ) ); |
743 | 743 | ||
744 | icon = loadPixmap( pathString + "xdays" ); | 744 | icon = loadPixmap( pathString + "xdays" ); |
745 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); | 745 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); |
746 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 746 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
747 | xdays_action->addTo( viewMenu ); | 747 | xdays_action->addTo( viewMenu ); |
748 | connect( xdays_action, SIGNAL( activated() ), | 748 | connect( xdays_action, SIGNAL( activated() ), |
749 | mView->viewManager(), SLOT( showNextXView() ) ); | 749 | mView->viewManager(), SLOT( showNextXView() ) ); |
750 | 750 | ||
751 | icon = loadPixmap( pathString + "whatsnext" ); | 751 | icon = loadPixmap( pathString + "whatsnext" ); |
752 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); | 752 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); |
753 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 753 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
754 | whatsnext_action->addTo( viewMenu ); | 754 | whatsnext_action->addTo( viewMenu ); |
755 | connect( whatsnext_action, SIGNAL( activated() ), | 755 | connect( whatsnext_action, SIGNAL( activated() ), |
756 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 756 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
757 | 757 | ||
758 | #if 0 | 758 | #if 0 |
759 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 759 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
760 | action->addTo( viewMenu ); | 760 | action->addTo( viewMenu ); |
761 | connect( action, SIGNAL( activated() ), | 761 | connect( action, SIGNAL( activated() ), |
762 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 762 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
763 | #endif | 763 | #endif |
764 | 764 | ||
765 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 765 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
766 | this ); | 766 | this ); |
767 | mNewSubTodoAction->addTo( actionMenu ); | 767 | mNewSubTodoAction->addTo( actionMenu ); |
768 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 768 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
769 | mView, SLOT( newSubTodo() ) ); | 769 | mView, SLOT( newSubTodo() ) ); |
770 | 770 | ||
771 | actionMenu->insertSeparator(); | 771 | actionMenu->insertSeparator(); |
772 | 772 | ||
773 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 773 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
774 | mShowAction->addTo( actionMenu ); | 774 | mShowAction->addTo( actionMenu ); |
775 | connect( mShowAction, SIGNAL( activated() ), | 775 | connect( mShowAction, SIGNAL( activated() ), |
776 | mView, SLOT( showIncidence() ) ); | 776 | mView, SLOT( showIncidence() ) ); |
777 | 777 | ||
778 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 778 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
779 | mEditAction->addTo( actionMenu ); | 779 | mEditAction->addTo( actionMenu ); |
780 | connect( mEditAction, SIGNAL( activated() ), | 780 | connect( mEditAction, SIGNAL( activated() ), |
781 | mView, SLOT( editIncidence() ) ); | 781 | mView, SLOT( editIncidence() ) ); |
782 | 782 | ||
783 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 783 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
784 | mDeleteAction->addTo( actionMenu ); | 784 | mDeleteAction->addTo( actionMenu ); |
785 | connect( mDeleteAction, SIGNAL( activated() ), | 785 | connect( mDeleteAction, SIGNAL( activated() ), |
786 | mView, SLOT( deleteIncidence() ) ); | 786 | mView, SLOT( deleteIncidence() ) ); |
787 | 787 | ||
788 | 788 | ||
789 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 789 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
790 | mCloneAction->addTo( actionMenu ); | 790 | mCloneAction->addTo( actionMenu ); |
791 | connect( mCloneAction, SIGNAL( activated() ), | 791 | connect( mCloneAction, SIGNAL( activated() ), |
792 | mView, SLOT( cloneIncidence() ) ); | 792 | mView, SLOT( cloneIncidence() ) ); |
793 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 793 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
794 | mMoveAction->addTo( actionMenu ); | 794 | mMoveAction->addTo( actionMenu ); |
795 | connect( mMoveAction, SIGNAL( activated() ), | 795 | connect( mMoveAction, SIGNAL( activated() ), |
796 | mView, SLOT( moveIncidence() ) ); | 796 | mView, SLOT( moveIncidence() ) ); |
797 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 797 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
798 | mBeamAction->addTo( actionMenu ); | 798 | mBeamAction->addTo( actionMenu ); |
799 | connect( mBeamAction, SIGNAL( activated() ), | 799 | connect( mBeamAction, SIGNAL( activated() ), |
800 | mView, SLOT( beamIncidence() ) ); | 800 | mView, SLOT( beamIncidence() ) ); |
801 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 801 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
802 | mCancelAction->addTo( actionMenu ); | 802 | mCancelAction->addTo( actionMenu ); |
803 | connect( mCancelAction, SIGNAL( activated() ), | 803 | connect( mCancelAction, SIGNAL( activated() ), |
804 | mView, SLOT( toggleCancelIncidence() ) ); | 804 | mView, SLOT( toggleCancelIncidence() ) ); |
805 | 805 | ||
806 | actionMenu->insertSeparator(); | 806 | actionMenu->insertSeparator(); |
807 | 807 | ||
808 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 808 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
809 | this ); | 809 | this ); |
810 | action->addTo( actionMenu ); | 810 | action->addTo( actionMenu ); |
811 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 811 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
812 | 812 | ||
813 | icon = loadPixmap( pathString + "search" ); | 813 | icon = loadPixmap( pathString + "search" ); |
814 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 814 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
815 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); | 815 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); |
816 | search_action->addTo( actionMenu ); | 816 | search_action->addTo( actionMenu ); |
817 | connect( search_action, SIGNAL( activated() ), | 817 | connect( search_action, SIGNAL( activated() ), |
818 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 818 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
819 | 819 | ||
820 | 820 | ||
821 | 821 | ||
822 | if ( KOPrefs::instance()->mShowFullMenu ) { | 822 | if ( KOPrefs::instance()->mShowFullMenu ) { |
823 | actionMenu->insertSeparator(); | 823 | actionMenu->insertSeparator(); |
824 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 824 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
825 | 825 | ||
826 | } | 826 | } |
827 | // actionMenu->insertSeparator(); | 827 | // actionMenu->insertSeparator(); |
828 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 828 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
829 | this ); | 829 | this ); |
830 | action->addTo( importMenu_X ); | 830 | action->addTo( importMenu_X ); |
831 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 831 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
832 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 832 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
833 | this ); | 833 | this ); |
834 | action->addTo( importMenu_X ); | 834 | action->addTo( importMenu_X ); |
835 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 835 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
836 | importMenu_X->insertSeparator(); | 836 | importMenu_X->insertSeparator(); |
837 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 837 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
838 | this ); | 838 | this ); |
839 | action->addTo( importMenu_X ); | 839 | action->addTo( importMenu_X ); |
840 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 840 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
841 | //#ifndef DESKTOP_VERSION | 841 | //#ifndef DESKTOP_VERSION |
842 | importMenu_X->insertSeparator(); | 842 | importMenu_X->insertSeparator(); |
843 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 843 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
844 | this ); | 844 | this ); |
845 | action->addTo( importMenu_X ); | 845 | action->addTo( importMenu_X ); |
846 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 846 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
847 | //#else | 847 | //#else |
848 | #ifdef _OL_IMPORT_ | 848 | #ifdef _OL_IMPORT_ |
849 | importMenu_X->insertSeparator(); | 849 | importMenu_X->insertSeparator(); |
850 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 850 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
851 | this ); | 851 | this ); |
852 | action->addTo( importMenu_X ); | 852 | action->addTo( importMenu_X ); |
853 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 853 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
854 | #endif | 854 | #endif |
855 | //#endif | 855 | //#endif |
856 | 856 | ||
857 | //importMenu->insertSeparator(); | 857 | //importMenu->insertSeparator(); |
858 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 858 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
859 | this ); | 859 | this ); |
860 | action->addTo( importMenu ); | 860 | action->addTo( importMenu ); |
861 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 861 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
862 | 862 | ||
863 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 863 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
864 | this ); | 864 | this ); |
865 | action->addTo( importMenu ); | 865 | action->addTo( importMenu ); |
866 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 866 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
867 | importMenu->insertSeparator(); | 867 | importMenu->insertSeparator(); |
868 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 868 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
869 | //importMenu->insertSeparator(); | 869 | //importMenu->insertSeparator(); |
870 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 870 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
871 | this ); | 871 | this ); |
872 | action->addTo( exportMenu_X ); | 872 | action->addTo( exportMenu_X ); |
873 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 873 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
874 | 874 | ||
875 | 875 | ||
876 | //LR | 876 | //LR |
877 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 877 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
878 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 878 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
879 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 879 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
880 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 880 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
881 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 881 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
882 | 882 | ||
883 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 883 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
884 | #ifndef DESKTOP_VERSION | 884 | #ifndef DESKTOP_VERSION |
885 | //importMenu->insertSeparator(); | 885 | //importMenu->insertSeparator(); |
886 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 886 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
887 | this ); | 887 | this ); |
888 | brAction->addTo( beamMenu_X ); | 888 | brAction->addTo( beamMenu_X ); |
889 | brAction->setToggleAction (true ) ; | 889 | brAction->setToggleAction (true ) ; |
890 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 890 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
891 | 891 | ||
892 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 892 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
893 | this ); | 893 | this ); |
894 | action->addTo( beamMenu_X ); | 894 | action->addTo( beamMenu_X ); |
895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 895 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
896 | 896 | ||
897 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 897 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
898 | this ); | 898 | this ); |
899 | action->addTo( beamMenu_X ); | 899 | action->addTo( beamMenu_X ); |
900 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 900 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
901 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 901 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
902 | #else | 902 | #else |
903 | //importMenu->insertSeparator(); | 903 | //importMenu->insertSeparator(); |
904 | icon = loadPixmap( pathString + "print" ); | 904 | icon = loadPixmap( pathString + "print" ); |
905 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 905 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
906 | action->addTo( beamMenu_X ); | 906 | action->addTo( beamMenu_X ); |
907 | connect( action, SIGNAL( activated() ), | 907 | connect( action, SIGNAL( activated() ), |
908 | this, SLOT( printCal() ) ); | 908 | this, SLOT( printCal() ) ); |
909 | 909 | ||
910 | icon = loadPixmap( pathString + "print" ); | 910 | icon = loadPixmap( pathString + "print" ); |
911 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 911 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
912 | action->addTo( beamMenu_X ); | 912 | action->addTo( beamMenu_X ); |
913 | connect( action, SIGNAL( activated() ), | 913 | connect( action, SIGNAL( activated() ), |
914 | this, SLOT( printSel() ) ); | 914 | this, SLOT( printSel() ) ); |
915 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 915 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
916 | action->addTo( beamMenu_X ); | 916 | action->addTo( beamMenu_X ); |
917 | connect( action, SIGNAL( activated() ), | 917 | connect( action, SIGNAL( activated() ), |
918 | mView->viewManager(), SIGNAL( printWNV() ) ); | 918 | mView->viewManager(), SIGNAL( printWNV() ) ); |
919 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 919 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
920 | #endif | 920 | #endif |
921 | importMenu->insertSeparator(); | 921 | importMenu->insertSeparator(); |
922 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 922 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
923 | this ); | 923 | this ); |
924 | action->addTo( importMenu ); | 924 | action->addTo( importMenu ); |
925 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 925 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
926 | importMenu->insertSeparator(); | 926 | importMenu->insertSeparator(); |
927 | action = new QAction( "beam all", i18n("Save"), 0, | 927 | action = new QAction( "beam all", i18n("Save"), 0, |
928 | this ); | 928 | this ); |
929 | action->addTo( importMenu ); | 929 | action->addTo( importMenu ); |
930 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 930 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
931 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 931 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
932 | this ); | 932 | this ); |
933 | action->addTo( importMenu ); | 933 | action->addTo( importMenu ); |
934 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 934 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
935 | 935 | ||
936 | //menuBar->insertItem( "Configure",configureMenu ); | 936 | //menuBar->insertItem( "Configure",configureMenu ); |
937 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 937 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
938 | icon = loadPixmap( "korganizer/korganizer" ); | 938 | icon = loadPixmap( "korganizer/korganizer" ); |
939 | 939 | ||
940 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 940 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
941 | action->addTo( helpMenu ); | 941 | action->addTo( helpMenu ); |
942 | connect( action, SIGNAL( activated() ), | 942 | connect( action, SIGNAL( activated() ), |
943 | SLOT( whatsNew() ) ); | 943 | SLOT( whatsNew() ) ); |
944 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 944 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
945 | action->addTo( helpMenu ); | 945 | action->addTo( helpMenu ); |
946 | connect( action, SIGNAL( activated() ), | 946 | connect( action, SIGNAL( activated() ), |
947 | SLOT( features() ) ); | 947 | SLOT( features() ) ); |
948 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 948 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
949 | action->addTo( helpMenu ); | 949 | action->addTo( helpMenu ); |
950 | connect( action, SIGNAL( activated() ), | 950 | connect( action, SIGNAL( activated() ), |
951 | SLOT( keyBindings() ) ); | 951 | SLOT( keyBindings() ) ); |
952 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 952 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
953 | action->addTo( helpMenu ); | 953 | action->addTo( helpMenu ); |
954 | connect( action, SIGNAL( activated() ), | 954 | connect( action, SIGNAL( activated() ), |
955 | SLOT( synchowto() ) ); | 955 | SLOT( synchowto() ) ); |
956 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 956 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
957 | action->addTo( helpMenu ); | 957 | action->addTo( helpMenu ); |
958 | connect( action, SIGNAL( activated() ), | 958 | connect( action, SIGNAL( activated() ), |
959 | SLOT( kdesynchowto() ) ); | 959 | SLOT( kdesynchowto() ) ); |
960 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 960 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
961 | action->addTo( helpMenu ); | 961 | action->addTo( helpMenu ); |
962 | connect( action, SIGNAL( activated() ), | 962 | connect( action, SIGNAL( activated() ), |
963 | SLOT( multisynchowto() ) ); | 963 | SLOT( multisynchowto() ) ); |
964 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 964 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
965 | action->addTo( helpMenu ); | 965 | action->addTo( helpMenu ); |
966 | connect( action, SIGNAL( activated() ), | 966 | connect( action, SIGNAL( activated() ), |
967 | SLOT( aboutAutoSaving() ) ); | 967 | SLOT( aboutAutoSaving() ) ); |
968 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 968 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
969 | action->addTo( helpMenu ); | 969 | action->addTo( helpMenu ); |
970 | connect( action, SIGNAL( activated() ), | 970 | connect( action, SIGNAL( activated() ), |
971 | SLOT( aboutKnownBugs() ) ); | 971 | SLOT( aboutKnownBugs() ) ); |
972 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 972 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
973 | action->addTo( helpMenu ); | 973 | action->addTo( helpMenu ); |
974 | connect( action, SIGNAL( activated() ), | 974 | connect( action, SIGNAL( activated() ), |
975 | SLOT( usertrans() ) ); | 975 | SLOT( usertrans() ) ); |
976 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 976 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
977 | action->addTo( helpMenu ); | 977 | action->addTo( helpMenu ); |
978 | connect( action, SIGNAL( activated() ), | 978 | connect( action, SIGNAL( activated() ), |
979 | SLOT( faq() ) ); | 979 | SLOT( faq() ) ); |
980 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 980 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
981 | action->addTo( helpMenu ); | 981 | action->addTo( helpMenu ); |
982 | connect( action, SIGNAL( activated() ), | 982 | connect( action, SIGNAL( activated() ), |
983 | SLOT( licence() ) ); | 983 | SLOT( licence() ) ); |
984 | action = new QAction( "about", i18n("About..."), 0, this ); | 984 | action = new QAction( "about", i18n("About..."), 0, this ); |
985 | action->addTo( helpMenu ); | 985 | action->addTo( helpMenu ); |
986 | connect( action, SIGNAL( activated() ), | 986 | connect( action, SIGNAL( activated() ), |
987 | SLOT( about() ) ); | 987 | SLOT( about() ) ); |
988 | //menuBar->insertSeparator(); | 988 | //menuBar->insertSeparator(); |
989 | 989 | ||
990 | // ****************************************************** | 990 | // ****************************************************** |
991 | // menubar icons | 991 | // menubar icons |
992 | 992 | ||
993 | 993 | ||
994 | iconToolBar->setHorizontalStretchable (true ); | 994 | iconToolBar->setHorizontalStretchable (true ); |
995 | //menuBar->insertItem( iconToolBar ); | 995 | //menuBar->insertItem( iconToolBar ); |
996 | //xdays_action | 996 | //xdays_action |
997 | if (p-> mShowIconNewEvent) | 997 | if (p-> mShowIconNewEvent) |
998 | ne_action->addTo( iconToolBar ); | 998 | ne_action->addTo( iconToolBar ); |
999 | if (p->mShowIconNewTodo ) | 999 | if (p->mShowIconNewTodo ) |
1000 | nt_action->addTo( iconToolBar ); | 1000 | nt_action->addTo( iconToolBar ); |
1001 | if (p-> mShowIconSearch) | 1001 | if (p-> mShowIconSearch) |
1002 | search_action->addTo( iconToolBar ); | 1002 | search_action->addTo( iconToolBar ); |
1003 | if (p-> mShowIconWhatsThis) | ||
1004 | QWhatsThis::whatsThisButton ( iconToolBar ); | ||
1003 | if (p-> mShowIconNext) | 1005 | if (p-> mShowIconNext) |
1004 | whatsnext_action->addTo( iconToolBar ); | 1006 | whatsnext_action->addTo( iconToolBar ); |
1005 | if (p-> mShowIconNextDays) | 1007 | if (p-> mShowIconNextDays) |
1006 | xdays_action->addTo( iconToolBar ); | 1008 | xdays_action->addTo( iconToolBar ); |
1007 | if (p-> mShowIconList) | 1009 | if (p-> mShowIconList) |
1008 | showlist_action->addTo( iconToolBar ); | 1010 | showlist_action->addTo( iconToolBar ); |
1009 | if (p-> mShowIconDay1) | 1011 | if (p-> mShowIconDay1) |
1010 | day1_action->addTo( iconToolBar ); | 1012 | day1_action->addTo( iconToolBar ); |
1011 | if (p-> mShowIconDay5) | 1013 | if (p-> mShowIconDay5) |
1012 | day5_action->addTo( iconToolBar ); | 1014 | day5_action->addTo( iconToolBar ); |
1013 | if (p-> mShowIconDay7) | 1015 | if (p-> mShowIconDay7) |
1014 | day7_action->addTo( iconToolBar ); | 1016 | day7_action->addTo( iconToolBar ); |
1015 | if (p-> mShowIconDay6) | 1017 | if (p-> mShowIconDay6) |
1016 | day6_action->addTo( iconToolBar ); | 1018 | day6_action->addTo( iconToolBar ); |
1017 | if (p-> mShowIconMonth) | 1019 | if (p-> mShowIconMonth) |
1018 | month_action->addTo( iconToolBar ); | 1020 | month_action->addTo( iconToolBar ); |
1019 | if (p-> mShowIconTodoview) | 1021 | if (p-> mShowIconTodoview) |
1020 | todoview_action->addTo( iconToolBar ); | 1022 | todoview_action->addTo( iconToolBar ); |
1021 | if (p-> mShowIconJournal) | 1023 | if (p-> mShowIconJournal) |
1022 | viewjournal_action->addTo( iconToolBar ); | 1024 | viewjournal_action->addTo( iconToolBar ); |
1023 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1025 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1024 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); | 1026 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); |
1025 | if (p-> mShowIconBackFast) { | 1027 | if (p-> mShowIconBackFast) { |
1026 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1028 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1027 | connect( action, SIGNAL( activated() ), | 1029 | connect( action, SIGNAL( activated() ), |
1028 | mView, SLOT( goPreviousMonth() ) ); | 1030 | mView, SLOT( goPreviousMonth() ) ); |
1029 | action->addTo( iconToolBar ); | 1031 | action->addTo( iconToolBar ); |
1030 | } | 1032 | } |
1031 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1033 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1032 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); | 1034 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); |
1033 | if (p-> mShowIconBack) { | 1035 | if (p-> mShowIconBack) { |
1034 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1036 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1035 | connect( action, SIGNAL( activated() ), | 1037 | connect( action, SIGNAL( activated() ), |
1036 | mView, SLOT( goPrevious() ) ); | 1038 | mView, SLOT( goPrevious() ) ); |
1037 | action->addTo( iconToolBar ); | 1039 | action->addTo( iconToolBar ); |
1038 | } | 1040 | } |
1039 | icon = loadPixmap( pathString + "today" ); | 1041 | icon = loadPixmap( pathString + "today" ); |
1040 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1042 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1041 | if (p-> mShowIconToday) | 1043 | if (p-> mShowIconToday) |
1042 | today_action->addTo( iconToolBar ); | 1044 | today_action->addTo( iconToolBar ); |
1043 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1045 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1044 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1046 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1045 | if (p-> mShowIconForward) { | 1047 | if (p-> mShowIconForward) { |
1046 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1048 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1047 | connect( action, SIGNAL( activated() ), | 1049 | connect( action, SIGNAL( activated() ), |
1048 | mView, SLOT( goNext() ) ); | 1050 | mView, SLOT( goNext() ) ); |
1049 | action->addTo( iconToolBar ); | 1051 | action->addTo( iconToolBar ); |
1050 | } | 1052 | } |
1051 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1053 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1052 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1054 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1053 | if (p-> mShowIconForwardFast) { | 1055 | if (p-> mShowIconForwardFast) { |
1054 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1056 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1055 | connect( action, SIGNAL( activated() ), | 1057 | connect( action, SIGNAL( activated() ), |
1056 | mView, SLOT( goNextMonth() ) ); | 1058 | mView, SLOT( goNextMonth() ) ); |
1057 | action->addTo( iconToolBar ); | 1059 | action->addTo( iconToolBar ); |
1058 | } | 1060 | } |
1059 | 1061 | ||
1060 | 1062 | ||
1061 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); | 1063 | configureToolBarMenu->insertItem(i18n("What's This?"), 300); |
1062 | 1064 | ||
1063 | if (p-> mShowIconNewEvent) | 1065 | if (p-> mShowIconNewEvent) |
1064 | configureToolBarMenu->setItemChecked( 10, true ); | 1066 | configureToolBarMenu->setItemChecked( 10, true ); |
1065 | if (p->mShowIconNewTodo ) | 1067 | if (p->mShowIconNewTodo ) |
1066 | configureToolBarMenu->setItemChecked( 20, true ); | 1068 | configureToolBarMenu->setItemChecked( 20, true ); |
1067 | if (p-> mShowIconSearch) | 1069 | if (p-> mShowIconSearch) |
1068 | configureToolBarMenu->setItemChecked( 120, true ); | 1070 | configureToolBarMenu->setItemChecked( 120, true ); |
1069 | if (p-> mShowIconList) | 1071 | if (p-> mShowIconList) |
1070 | configureToolBarMenu->setItemChecked( 30, true ); | 1072 | configureToolBarMenu->setItemChecked( 30, true ); |
1071 | if (p-> mShowIconDay1) | 1073 | if (p-> mShowIconDay1) |
1072 | configureToolBarMenu->setItemChecked( 40, true ); | 1074 | configureToolBarMenu->setItemChecked( 40, true ); |
1073 | if (p-> mShowIconDay5) | 1075 | if (p-> mShowIconDay5) |
1074 | configureToolBarMenu->setItemChecked( 50, true ); | 1076 | configureToolBarMenu->setItemChecked( 50, true ); |
1075 | if (p-> mShowIconDay6) | 1077 | if (p-> mShowIconDay6) |
1076 | configureToolBarMenu->setItemChecked( 75, true ); | 1078 | configureToolBarMenu->setItemChecked( 75, true ); |
1077 | if (p-> mShowIconDay7) | 1079 | if (p-> mShowIconDay7) |
1078 | configureToolBarMenu->setItemChecked( 60, true ); | 1080 | configureToolBarMenu->setItemChecked( 60, true ); |
1079 | if (p-> mShowIconMonth) | 1081 | if (p-> mShowIconMonth) |
1080 | configureToolBarMenu->setItemChecked( 70, true ); | 1082 | configureToolBarMenu->setItemChecked( 70, true ); |
1081 | if (p-> mShowIconTodoview) | 1083 | if (p-> mShowIconTodoview) |
1082 | configureToolBarMenu->setItemChecked( 80, true ); | 1084 | configureToolBarMenu->setItemChecked( 80, true ); |
1083 | if (p-> mShowIconBackFast) | 1085 | if (p-> mShowIconBackFast) |
1084 | configureToolBarMenu->setItemChecked( 200, true ); | 1086 | configureToolBarMenu->setItemChecked( 200, true ); |
1085 | if (p-> mShowIconBack) | 1087 | if (p-> mShowIconBack) |
1086 | configureToolBarMenu->setItemChecked( 210, true ); | 1088 | configureToolBarMenu->setItemChecked( 210, true ); |
1087 | if (p-> mShowIconToday) | 1089 | if (p-> mShowIconToday) |
1088 | configureToolBarMenu->setItemChecked( 130, true ); | 1090 | configureToolBarMenu->setItemChecked( 130, true ); |
1089 | if (p-> mShowIconForward) | 1091 | if (p-> mShowIconForward) |
1090 | configureToolBarMenu->setItemChecked( 220, true ); | 1092 | configureToolBarMenu->setItemChecked( 220, true ); |
1091 | if (p-> mShowIconForwardFast) | 1093 | if (p-> mShowIconForwardFast) |
1092 | configureToolBarMenu->setItemChecked( 230, true ); | 1094 | configureToolBarMenu->setItemChecked( 230, true ); |
1093 | if (p-> mShowIconNextDays) | 1095 | if (p-> mShowIconNextDays) |
1094 | configureToolBarMenu->setItemChecked( 100, true ); | 1096 | configureToolBarMenu->setItemChecked( 100, true ); |
1095 | if (p-> mShowIconNext) | 1097 | if (p-> mShowIconNext) |
1096 | configureToolBarMenu->setItemChecked( 110, true ); | 1098 | configureToolBarMenu->setItemChecked( 110, true ); |
1097 | if (p-> mShowIconJournal) | 1099 | if (p-> mShowIconJournal) |
1098 | configureToolBarMenu->setItemChecked( 90, true ); | 1100 | configureToolBarMenu->setItemChecked( 90, true ); |
1099 | if (p-> mShowIconWhatsThis) | 1101 | if (p-> mShowIconWhatsThis) |
1100 | configureToolBarMenu->setItemChecked( 300, true ); | 1102 | configureToolBarMenu->setItemChecked( 300, true ); |
1101 | if (p-> mShowIconWeekNum) | 1103 | if (p-> mShowIconWeekNum) |
1102 | configureToolBarMenu->setItemChecked( 400, true ); | 1104 | configureToolBarMenu->setItemChecked( 400, true ); |
1103 | QLabel* dummy = new QLabel( iconToolBar ); | 1105 | QLabel* dummy = new QLabel( iconToolBar ); |
1104 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1106 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1105 | if (!p-> mShowIconStretch) | 1107 | if (!p-> mShowIconStretch) |
1106 | iconToolBar->setStretchableWidget ( dummy ) ; | 1108 | iconToolBar->setStretchableWidget ( dummy ) ; |
1107 | else | 1109 | else |
1108 | configureToolBarMenu->setItemChecked( 5, true ); | 1110 | configureToolBarMenu->setItemChecked( 5, true ); |
1109 | if (p-> mShowIconWhatsThis) | ||
1110 | QWhatsThis::whatsThisButton ( iconToolBar ); | ||
1111 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1111 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1112 | configureAgenda( p->mHourSize ); | 1112 | configureAgenda( p->mHourSize ); |
1113 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1113 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1114 | } | 1114 | } |
1115 | 1115 | ||
1116 | void MainWindow::exportToPhone( int mode ) | 1116 | void MainWindow::exportToPhone( int mode ) |
1117 | { | 1117 | { |
1118 | 1118 | ||
1119 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1119 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1120 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1120 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1121 | KOex2phonePrefs ex2phone; | 1121 | KOex2phonePrefs ex2phone; |
1122 | 1122 | ||
1123 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1123 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1124 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1124 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1125 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1125 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1126 | if ( mode == 1 ) | 1126 | if ( mode == 1 ) |
1127 | ex2phone.setCaption(i18n("Export complete calendar")); | 1127 | ex2phone.setCaption(i18n("Export complete calendar")); |
1128 | if ( mode == 2 ) | 1128 | if ( mode == 2 ) |
1129 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1129 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1130 | 1130 | ||
1131 | if ( !ex2phone.exec() ) { | 1131 | if ( !ex2phone.exec() ) { |
1132 | return; | 1132 | return; |
1133 | } | 1133 | } |
1134 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1134 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1135 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1135 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1136 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1136 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1137 | 1137 | ||
1138 | int inFuture = 0; | 1138 | int inFuture = 0; |
1139 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1139 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1140 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1140 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1141 | QPtrList<Incidence> delSel; | 1141 | QPtrList<Incidence> delSel; |
1142 | if ( mode == 1 ) | 1142 | if ( mode == 1 ) |
1143 | delSel = mCalendar->rawIncidences(); | 1143 | delSel = mCalendar->rawIncidences(); |
1144 | if ( mode == 2 ) | 1144 | if ( mode == 2 ) |
1145 | delSel = mCalendar->incidences(); | 1145 | delSel = mCalendar->incidences(); |
1146 | CalendarLocal* cal = new CalendarLocal(); | 1146 | CalendarLocal* cal = new CalendarLocal(); |
1147 | cal->setLocalTime(); | 1147 | cal->setLocalTime(); |
1148 | Incidence *incidence = delSel.first(); | 1148 | Incidence *incidence = delSel.first(); |
1149 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1149 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1150 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1150 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1151 | while ( incidence ) { | 1151 | while ( incidence ) { |
1152 | if ( incidence->type() != "Journal" ) { | 1152 | if ( incidence->type() != "Journal" ) { |
1153 | bool add = true; | 1153 | bool add = true; |
1154 | if ( inFuture ) { | 1154 | if ( inFuture ) { |
1155 | QDateTime dt; | 1155 | QDateTime dt; |
1156 | if ( incidence->type() == "Todo" ) { | 1156 | if ( incidence->type() == "Todo" ) { |
1157 | Todo * t = (Todo*)incidence; | 1157 | Todo * t = (Todo*)incidence; |
1158 | if ( t->hasDueDate() ) | 1158 | if ( t->hasDueDate() ) |
1159 | dt = t->dtDue(); | 1159 | dt = t->dtDue(); |
1160 | else | 1160 | else |
1161 | dt = cur.addSecs( 62 ); | 1161 | dt = cur.addSecs( 62 ); |
1162 | } | 1162 | } |
1163 | else { | 1163 | else { |
1164 | bool ok; | 1164 | bool ok; |
1165 | dt = incidence->getNextOccurence( cur, &ok ); | 1165 | dt = incidence->getNextOccurence( cur, &ok ); |
1166 | if ( !ok ) | 1166 | if ( !ok ) |
1167 | dt = cur.addSecs( -62 ); | 1167 | dt = cur.addSecs( -62 ); |
1168 | } | 1168 | } |
1169 | if ( dt < cur || dt > end ) { | 1169 | if ( dt < cur || dt > end ) { |
1170 | add = false; | 1170 | add = false; |
1171 | } | 1171 | } |
1172 | } | 1172 | } |
1173 | if ( add ) { | 1173 | if ( add ) { |
1174 | Incidence *in = incidence->clone(); | 1174 | Incidence *in = incidence->clone(); |
1175 | cal->addIncidence( in ); | 1175 | cal->addIncidence( in ); |
1176 | } | 1176 | } |
1177 | } | 1177 | } |
1178 | incidence = delSel.next(); | 1178 | incidence = delSel.next(); |
1179 | } | 1179 | } |
1180 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1180 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1181 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1181 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1182 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1182 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1183 | 1183 | ||
1184 | setCaption( i18n("Writing to phone...")); | 1184 | setCaption( i18n("Writing to phone...")); |
1185 | if ( PhoneFormat::writeToPhone( cal ) ) | 1185 | if ( PhoneFormat::writeToPhone( cal ) ) |
1186 | setCaption( i18n("Export to phone successful!")); | 1186 | setCaption( i18n("Export to phone successful!")); |
1187 | else | 1187 | else |
1188 | setCaption( i18n("Error exporting to phone!")); | 1188 | setCaption( i18n("Error exporting to phone!")); |
1189 | delete cal; | 1189 | delete cal; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | 1192 | ||
1193 | void MainWindow::setDefaultPreferences() | 1193 | void MainWindow::setDefaultPreferences() |
1194 | { | 1194 | { |
1195 | KOPrefs *p = KOPrefs::instance(); | 1195 | KOPrefs *p = KOPrefs::instance(); |
1196 | 1196 | ||
1197 | p->mCompactDialogs = true; | 1197 | p->mCompactDialogs = true; |
1198 | p->mConfirm = true; | 1198 | p->mConfirm = true; |
1199 | // p->mEnableQuickTodo = false; | 1199 | // p->mEnableQuickTodo = false; |
1200 | 1200 | ||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | QString MainWindow::resourcePath() | 1203 | QString MainWindow::resourcePath() |
1204 | { | 1204 | { |
1205 | return KGlobal::iconLoader()->iconPath(); | 1205 | return KGlobal::iconLoader()->iconPath(); |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | void MainWindow::displayText( QString text ,QString cap ) | 1208 | void MainWindow::displayText( QString text ,QString cap ) |
1209 | { | 1209 | { |
1210 | QDialog dia( this, "name", true ); ; | 1210 | QDialog dia( this, "name", true ); ; |
1211 | dia.setCaption( cap ); | 1211 | dia.setCaption( cap ); |
1212 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1212 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1213 | lay->setSpacing( 3 ); | 1213 | lay->setSpacing( 3 ); |
1214 | lay->setMargin( 3 ); | 1214 | lay->setMargin( 3 ); |
1215 | QTextBrowser tb ( &dia ); | 1215 | QTextBrowser tb ( &dia ); |
1216 | lay->addWidget( &tb ); | 1216 | lay->addWidget( &tb ); |
1217 | tb.setText( text ); | 1217 | tb.setText( text ); |
1218 | #ifdef DESKTOP_VERSION | 1218 | #ifdef DESKTOP_VERSION |
1219 | dia.resize( 640, 480); | 1219 | dia.resize( 640, 480); |
1220 | #else | 1220 | #else |
1221 | dia.showMaximized(); | 1221 | dia.showMaximized(); |
1222 | #endif | 1222 | #endif |
1223 | dia.exec(); | 1223 | dia.exec(); |
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | void MainWindow::features() | 1226 | void MainWindow::features() |
1227 | { | 1227 | { |
1228 | 1228 | ||
1229 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1229 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | void MainWindow::usertrans() | 1232 | void MainWindow::usertrans() |
1233 | { | 1233 | { |
1234 | 1234 | ||
1235 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1235 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | void MainWindow::kdesynchowto() | 1238 | void MainWindow::kdesynchowto() |
1239 | { | 1239 | { |
1240 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1240 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1241 | } | 1241 | } |
1242 | void MainWindow::multisynchowto() | 1242 | void MainWindow::multisynchowto() |
1243 | { | 1243 | { |
1244 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1244 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1245 | } | 1245 | } |
1246 | void MainWindow::synchowto() | 1246 | void MainWindow::synchowto() |
1247 | { | 1247 | { |
1248 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1248 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1249 | } | 1249 | } |
1250 | void MainWindow::faq() | 1250 | void MainWindow::faq() |
1251 | { | 1251 | { |
1252 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1252 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1253 | 1253 | ||
1254 | } | 1254 | } |
1255 | void MainWindow::whatsNew() | 1255 | void MainWindow::whatsNew() |
1256 | { | 1256 | { |
1257 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1257 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1258 | 1258 | ||
1259 | } | 1259 | } |
1260 | void MainWindow::licence() | 1260 | void MainWindow::licence() |
1261 | { | 1261 | { |
1262 | KApplication::showLicence(); | 1262 | KApplication::showLicence(); |
1263 | 1263 | ||
1264 | } | 1264 | } |
1265 | void MainWindow::about() | 1265 | void MainWindow::about() |
1266 | { | 1266 | { |
1267 | QString version; | 1267 | QString version; |
1268 | #include <../version> | 1268 | #include <../version> |
1269 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1269 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1270 | i18n("KOrganizer/Platform-independent\n") + | 1270 | i18n("KOrganizer/Platform-independent\n") + |
1271 | "(KO/Pi) " + version + " - " + | 1271 | "(KO/Pi) " + version + " - " + |
1272 | 1272 | ||
1273 | #ifdef DESKTOP_VERSION | 1273 | #ifdef DESKTOP_VERSION |
1274 | i18n("Desktop Edition\n") + | 1274 | i18n("Desktop Edition\n") + |
1275 | #else | 1275 | #else |
1276 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1276 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1277 | #endif | 1277 | #endif |
1278 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1278 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1279 | } | 1279 | } |
1280 | void MainWindow::keyBindings() | 1280 | void MainWindow::keyBindings() |
1281 | { | 1281 | { |
1282 | QString cap = i18n("KO/Pi Keys + Colors"); | 1282 | QString cap = i18n("KO/Pi Keys + Colors"); |
1283 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1283 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1284 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1284 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1285 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1285 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1286 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1286 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1287 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1287 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1288 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1288 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1289 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1289 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1290 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1290 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1291 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1291 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1292 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1292 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1293 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1293 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1294 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1294 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1295 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1295 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1296 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1296 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1297 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1297 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1298 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1298 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1299 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1299 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1300 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1300 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1301 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1301 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1302 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1302 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1303 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1303 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1304 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1304 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1305 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1305 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1306 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1306 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1307 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1307 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1308 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1308 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1309 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1309 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1310 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1310 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1311 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1311 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1312 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1312 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1313 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1313 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1314 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1314 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1315 | i18n("<p><h3>In list view:</h3></p>\n") + | 1315 | i18n("<p><h3>In list view:</h3></p>\n") + |
1316 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1316 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1317 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1317 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1318 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1318 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1319 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1319 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1320 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1320 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1321 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1321 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1322 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1322 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1323 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1323 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1324 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1324 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1325 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1325 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1326 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1326 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1327 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1327 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1328 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1328 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1329 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1329 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1330 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1330 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1331 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1331 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1332 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1332 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1333 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1333 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1334 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1334 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1335 | displayText( text, cap); | 1335 | displayText( text, cap); |
1336 | } | 1336 | } |
1337 | void MainWindow::aboutAutoSaving() | 1337 | void MainWindow::aboutAutoSaving() |
1338 | { | 1338 | { |
1339 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); | 1339 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1340 | 1340 | ||
1341 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1341 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1342 | 1342 | ||
1343 | } | 1343 | } |
1344 | void MainWindow::aboutKnownBugs() | 1344 | void MainWindow::aboutKnownBugs() |
1345 | { | 1345 | { |
1346 | QMessageBox* msg; | 1346 | QMessageBox* msg; |
1347 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1347 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1348 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1348 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1349 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1349 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1350 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1350 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1351 | i18n("\nor report them in the bugtracker on\n") + | 1351 | i18n("\nor report them in the bugtracker on\n") + |
1352 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1352 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1353 | QMessageBox::NoIcon, | 1353 | QMessageBox::NoIcon, |
1354 | QMessageBox::Ok, | 1354 | QMessageBox::Ok, |
1355 | QMessageBox::NoButton, | 1355 | QMessageBox::NoButton, |
1356 | QMessageBox::NoButton); | 1356 | QMessageBox::NoButton); |
1357 | msg->exec(); | 1357 | msg->exec(); |
1358 | delete msg; | 1358 | delete msg; |
1359 | 1359 | ||
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | QString MainWindow::defaultFileName() | 1362 | QString MainWindow::defaultFileName() |
1363 | { | 1363 | { |
1364 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1364 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1365 | } | 1365 | } |
1366 | QString MainWindow::syncFileName() | 1366 | QString MainWindow::syncFileName() |
1367 | { | 1367 | { |
1368 | #ifdef DESKTOP_VERSION | 1368 | #ifdef DESKTOP_VERSION |
1369 | return locateLocal( "tmp", "synccalendar.ics" ); | 1369 | return locateLocal( "tmp", "synccalendar.ics" ); |
1370 | #else | 1370 | #else |
1371 | return QString( "/tmp/synccalendar.ics" ); | 1371 | return QString( "/tmp/synccalendar.ics" ); |
1372 | #endif | 1372 | #endif |
1373 | } | 1373 | } |
1374 | void MainWindow::updateWeek(QDate seda) | 1374 | void MainWindow::updateWeek(QDate seda) |
1375 | { | 1375 | { |
1376 | int weekNum = 0; | 1376 | int weekNum = 0; |
1377 | QDate d = QDate ( seda.year(), 1,1); | 1377 | QDate d = QDate ( seda.year(), 1,1); |
1378 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday | 1378 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday |
1379 | if ( seda.addDays(6).year() != seda.year() ) { | 1379 | if ( seda.addDays(6).year() != seda.year() ) { |
1380 | if ( seda.year() != d.year() ) { | 1380 | if ( seda.year() != d.year() ) { |
1381 | if ( d.dayOfWeek() > 4 ) | 1381 | if ( d.dayOfWeek() > 4 ) |
1382 | d = QDate ( seda.year(), 1,1); | 1382 | d = QDate ( seda.year(), 1,1); |
1383 | else | 1383 | else |
1384 | weekNum = 1; | 1384 | weekNum = 1; |
1385 | } else { | 1385 | } else { |
1386 | QDate dd( seda.year()+1, 1,1); | 1386 | QDate dd( seda.year()+1, 1,1); |
1387 | if ( dd.dayOfWeek() <= 4 ) | 1387 | if ( dd.dayOfWeek() <= 4 ) |
1388 | weekNum = 1; | 1388 | weekNum = 1; |
1389 | } | 1389 | } |
1390 | } | 1390 | } |
1391 | if ( weekNum == 0 ){ | 1391 | if ( weekNum == 0 ){ |
1392 | int dow = d.dayOfWeek(); | 1392 | int dow = d.dayOfWeek(); |
1393 | if ( dow <= 4 ) | 1393 | if ( dow <= 4 ) |
1394 | d = d.addDays( 1-dow ); | 1394 | d = d.addDays( 1-dow ); |
1395 | else // 5,6,7 | 1395 | else // 5,6,7 |
1396 | d = d.addDays( 8-dow ); | 1396 | d = d.addDays( 8-dow ); |
1397 | // we have the first week of the year.we are on monday | 1397 | // we have the first week of the year.we are on monday |
1398 | weekNum = d.daysTo( seda ) / 7 +1; | 1398 | weekNum = d.daysTo( seda ) / 7 +1; |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | mWeekPixmap.fill( mWeekBgColor ); | 1401 | mWeekPixmap.fill( mWeekBgColor ); |
1402 | QPainter p ( &mWeekPixmap ); | 1402 | QPainter p ( &mWeekPixmap ); |
1403 | p.setFont( mWeekFont ); | 1403 | p.setFont( mWeekFont ); |
1404 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1404 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1405 | p.end(); | 1405 | p.end(); |
1406 | QIconSet icon3 ( mWeekPixmap ); | 1406 | QIconSet icon3 ( mWeekPixmap ); |
1407 | mWeekAction->setIconSet ( icon3 ); | 1407 | mWeekAction->setIconSet ( icon3 ); |
1408 | 1408 | ||
1409 | } | 1409 | } |
1410 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1410 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1411 | { | 1411 | { |
1412 | updateWeek( selectedDates.first() ); | 1412 | updateWeek( selectedDates.first() ); |
1413 | } | 1413 | } |
1414 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1414 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1415 | { | 1415 | { |
1416 | 1416 | ||
1417 | if ( !incidence ) { | 1417 | if ( !incidence ) { |
1418 | enableIncidenceActions( false ); | 1418 | enableIncidenceActions( false ); |
1419 | 1419 | ||
1420 | mNewSubTodoAction->setEnabled( false ); | 1420 | mNewSubTodoAction->setEnabled( false ); |
1421 | setCaptionToDates(); | 1421 | setCaptionToDates(); |
1422 | return; | 1422 | return; |
1423 | 1423 | ||
1424 | } | 1424 | } |
1425 | 1425 | ||
1426 | //KGlobal::locale()->formatDateTime(nextA, true); | 1426 | //KGlobal::locale()->formatDateTime(nextA, true); |
1427 | QString startString = ""; | 1427 | QString startString = ""; |
1428 | if ( incidence->type() != "Todo" ) { | 1428 | if ( incidence->type() != "Todo" ) { |
1429 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1429 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1430 | if ( incidence->doesFloat() ) { | 1430 | if ( incidence->doesFloat() ) { |
1431 | startString += ": "+incidence->dtStartDateStr( true ); | 1431 | startString += ": "+incidence->dtStartDateStr( true ); |
1432 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1432 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1433 | 1433 | ||
1434 | } else { | 1434 | } else { |
1435 | startString = ": "+incidence->dtStartStr(true); | 1435 | startString = ": "+incidence->dtStartStr(true); |
1436 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1436 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1437 | 1437 | ||
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | } else { | 1440 | } else { |
1441 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1441 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1442 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1442 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1443 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1443 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1444 | if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { | 1444 | if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { |
1445 | bool ok; | 1445 | bool ok; |
1446 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1446 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1447 | if ( ok ) { | 1447 | if ( ok ) { |
1448 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1448 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1449 | startString += i18n(" (%1 y.)"). arg( years ); | 1449 | startString += i18n(" (%1 y.)"). arg( years ); |
1450 | } | 1450 | } |
1451 | } | 1451 | } |
1452 | else | 1452 | else |
1453 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1453 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1454 | } | 1454 | } |
1455 | 1455 | ||
1456 | } | 1456 | } |
1457 | else | 1457 | else |
1458 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1458 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1459 | if ( !incidence->location().isEmpty() ) | 1459 | if ( !incidence->location().isEmpty() ) |
1460 | startString += " (" +incidence->location()+")"; | 1460 | startString += " (" +incidence->location()+")"; |
1461 | setCaption( incidence->summary()+startString); | 1461 | setCaption( incidence->summary()+startString); |
1462 | 1462 | ||
1463 | enableIncidenceActions( true ); | 1463 | enableIncidenceActions( true ); |
1464 | 1464 | ||
1465 | if ( incidence->type() == "Event" ) { | 1465 | if ( incidence->type() == "Event" ) { |
1466 | mShowAction->setText( i18n("Show Event...") ); | 1466 | mShowAction->setText( i18n("Show Event...") ); |
1467 | mEditAction->setText( i18n("Edit Event...") ); | 1467 | mEditAction->setText( i18n("Edit Event...") ); |
1468 | mDeleteAction->setText( i18n("Delete Event...") ); | 1468 | mDeleteAction->setText( i18n("Delete Event...") ); |
1469 | 1469 | ||
1470 | mNewSubTodoAction->setEnabled( false ); | 1470 | mNewSubTodoAction->setEnabled( false ); |
1471 | } else if ( incidence->type() == "Todo" ) { | 1471 | } else if ( incidence->type() == "Todo" ) { |
1472 | mShowAction->setText( i18n("Show Todo...") ); | 1472 | mShowAction->setText( i18n("Show Todo...") ); |
1473 | mEditAction->setText( i18n("Edit Todo...") ); | 1473 | mEditAction->setText( i18n("Edit Todo...") ); |
1474 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1474 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1475 | 1475 | ||
1476 | mNewSubTodoAction->setEnabled( true ); | 1476 | mNewSubTodoAction->setEnabled( true ); |
1477 | } else { | 1477 | } else { |
1478 | mShowAction->setText( i18n("Show...") ); | 1478 | mShowAction->setText( i18n("Show...") ); |
1479 | mShowAction->setText( i18n("Edit...") ); | 1479 | mShowAction->setText( i18n("Edit...") ); |
1480 | mShowAction->setText( i18n("Delete...") ); | 1480 | mShowAction->setText( i18n("Delete...") ); |
1481 | 1481 | ||
1482 | mNewSubTodoAction->setEnabled( false ); | 1482 | mNewSubTodoAction->setEnabled( false ); |
1483 | } | 1483 | } |
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | void MainWindow::enableIncidenceActions( bool enabled ) | 1486 | void MainWindow::enableIncidenceActions( bool enabled ) |
1487 | { | 1487 | { |
1488 | mShowAction->setEnabled( enabled ); | 1488 | mShowAction->setEnabled( enabled ); |
1489 | mEditAction->setEnabled( enabled ); | 1489 | mEditAction->setEnabled( enabled ); |
1490 | mDeleteAction->setEnabled( enabled ); | 1490 | mDeleteAction->setEnabled( enabled ); |
1491 | 1491 | ||
1492 | mCloneAction->setEnabled( enabled ); | 1492 | mCloneAction->setEnabled( enabled ); |
1493 | mMoveAction->setEnabled( enabled ); | 1493 | mMoveAction->setEnabled( enabled ); |
1494 | mBeamAction->setEnabled( enabled ); | 1494 | mBeamAction->setEnabled( enabled ); |
1495 | mCancelAction->setEnabled( enabled ); | 1495 | mCancelAction->setEnabled( enabled ); |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | void MainWindow::importOL() | 1498 | void MainWindow::importOL() |
1499 | { | 1499 | { |
1500 | #ifdef _OL_IMPORT_ | 1500 | #ifdef _OL_IMPORT_ |
1501 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1501 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1502 | id->exec(); | 1502 | id->exec(); |
1503 | delete id; | 1503 | delete id; |
1504 | mView->updateView(); | 1504 | mView->updateView(); |
1505 | #endif | 1505 | #endif |
1506 | } | 1506 | } |
1507 | void MainWindow::importBday() | 1507 | void MainWindow::importBday() |
1508 | { | 1508 | { |
1509 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1509 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1510 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1510 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1511 | i18n("Import!"), i18n("Cancel"), 0, | 1511 | i18n("Import!"), i18n("Cancel"), 0, |
1512 | 0, 1 ); | 1512 | 0, 1 ); |
1513 | if ( result == 0 ) { | 1513 | if ( result == 0 ) { |
1514 | mView->importBday(); | 1514 | mView->importBday(); |
1515 | 1515 | ||
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | 1518 | ||
1519 | } | 1519 | } |
1520 | void MainWindow::importQtopia() | 1520 | void MainWindow::importQtopia() |
1521 | { | 1521 | { |
1522 | //#ifndef DESKTOP_VERSION | 1522 | //#ifndef DESKTOP_VERSION |
1523 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1523 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1524 | #ifdef DESKTOP_VERSION | 1524 | #ifdef DESKTOP_VERSION |
1525 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1525 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1526 | #endif | 1526 | #endif |
1527 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1527 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1528 | i18n("Import!"), i18n("Cancel"), 0, | 1528 | i18n("Import!"), i18n("Cancel"), 0, |
1529 | 0, 1 ); | 1529 | 0, 1 ); |
1530 | if ( result == 0 ) { | 1530 | if ( result == 0 ) { |
1531 | #ifndef DESKTOP_VERSION | 1531 | #ifndef DESKTOP_VERSION |
1532 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1532 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1533 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1533 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1534 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1534 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1535 | #else | 1535 | #else |
1536 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1536 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1537 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1537 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1538 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1538 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1539 | #endif | 1539 | #endif |
1540 | mView->importQtopia( categories, datebook, todolist ); | 1540 | mView->importQtopia( categories, datebook, todolist ); |
1541 | } | 1541 | } |
1542 | #if 0 | 1542 | #if 0 |
1543 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1543 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1544 | i18n("Not supported \non desktop!\n"), | 1544 | i18n("Not supported \non desktop!\n"), |
1545 | i18n("Ok"), i18n("Cancel"), 0, | 1545 | i18n("Ok"), i18n("Cancel"), 0, |
1546 | 0, 1 ); | 1546 | 0, 1 ); |
1547 | 1547 | ||
1548 | #endif | 1548 | #endif |
1549 | } | 1549 | } |
1550 | 1550 | ||
1551 | void MainWindow::saveOnClose() | 1551 | void MainWindow::saveOnClose() |
1552 | { | 1552 | { |
1553 | KOPrefs *p = KOPrefs::instance(); | 1553 | KOPrefs *p = KOPrefs::instance(); |
1554 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1554 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1555 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1555 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1556 | iconToolBar->y() > height()/2; | 1556 | iconToolBar->y() > height()/2; |
1557 | mView->writeSettings(); | 1557 | mView->writeSettings(); |
1558 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1558 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1559 | save(); | 1559 | save(); |
1560 | } | 1560 | } |
1561 | void MainWindow::slotModifiedChanged( bool changed ) | 1561 | void MainWindow::slotModifiedChanged( bool changed ) |
1562 | { | 1562 | { |
1563 | if ( mBlockAtStartup ) | 1563 | if ( mBlockAtStartup ) |
1564 | return; | 1564 | return; |
1565 | 1565 | ||
1566 | int msec; | 1566 | int msec; |
1567 | // we store the changes after 1 minute, | 1567 | // we store the changes after 1 minute, |
1568 | // and for safety reasons after 10 minutes again | 1568 | // and for safety reasons after 10 minutes again |
1569 | if ( !mSyncManager->blockSave() ) | 1569 | if ( !mSyncManager->blockSave() ) |
1570 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1570 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1571 | else | 1571 | else |
1572 | msec = 1000 * 600; | 1572 | msec = 1000 * 600; |
1573 | mSaveTimer.start( msec, true ); // 1 minute | 1573 | mSaveTimer.start( msec, true ); // 1 minute |
1574 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1574 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1575 | mCalendarModifiedFlag = true; | 1575 | mCalendarModifiedFlag = true; |
1576 | } | 1576 | } |
1577 | void MainWindow::saveStopTimer() | 1577 | void MainWindow::saveStopTimer() |
1578 | { | 1578 | { |
1579 | mSaveTimer.stop(); | 1579 | mSaveTimer.stop(); |
1580 | if (mSaveTimer.isActive() ) | 1580 | if (mSaveTimer.isActive() ) |
1581 | qDebug("ti active "); | 1581 | qDebug("ti active "); |
1582 | else | 1582 | else |
1583 | qDebug("KO: Save timer stopped"); | 1583 | qDebug("KO: Save timer stopped"); |
1584 | } | 1584 | } |
1585 | void MainWindow::save() | 1585 | void MainWindow::save() |
1586 | { | 1586 | { |
1587 | if ( !mCalendarModifiedFlag ) { | 1587 | if ( !mCalendarModifiedFlag ) { |
1588 | qDebug("KO: Calendar not modified. Nothing saved."); | 1588 | qDebug("KO: Calendar not modified. Nothing saved."); |
1589 | return; | 1589 | return; |
1590 | } | 1590 | } |
1591 | if ( mSyncManager->blockSave() ) | 1591 | if ( mSyncManager->blockSave() ) |
1592 | return; | 1592 | return; |
1593 | mSyncManager->setBlockSave(true); | 1593 | mSyncManager->setBlockSave(true); |
1594 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1594 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1595 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1595 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1596 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1596 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1597 | qDebug("KO: Start saving data to file!"); | 1597 | qDebug("KO: Start saving data to file!"); |
1598 | mView->saveCalendar( defaultFileName() ); | 1598 | mView->saveCalendar( defaultFileName() ); |
1599 | mCalendarModifiedFlag = false; | 1599 | mCalendarModifiedFlag = false; |
1600 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1600 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1601 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1601 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1602 | QString savemes; | 1602 | QString savemes; |
1603 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1603 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1604 | setCaption(savemes); | 1604 | setCaption(savemes); |
1605 | } else | 1605 | } else |
1606 | setCaption(i18n("Saving cancelled!")); | 1606 | setCaption(i18n("Saving cancelled!")); |
1607 | mSyncManager->setBlockSave( false ); | 1607 | mSyncManager->setBlockSave( false ); |
1608 | } | 1608 | } |
1609 | 1609 | ||
1610 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1610 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1611 | { | 1611 | { |
1612 | if ( !e->isAutoRepeat() ) { | 1612 | if ( !e->isAutoRepeat() ) { |
1613 | mFlagKeyPressed = false; | 1613 | mFlagKeyPressed = false; |
1614 | } | 1614 | } |
1615 | } | 1615 | } |
1616 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1616 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1617 | { | 1617 | { |
1618 | qApp->processEvents(); | 1618 | qApp->processEvents(); |
1619 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1619 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1620 | e->ignore(); | 1620 | e->ignore(); |
1621 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1621 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1622 | return; | 1622 | return; |
1623 | } | 1623 | } |
1624 | if (! e->isAutoRepeat() ) | 1624 | if (! e->isAutoRepeat() ) |
1625 | mFlagKeyPressed = true; | 1625 | mFlagKeyPressed = true; |
1626 | KOPrefs *p = KOPrefs::instance(); | 1626 | KOPrefs *p = KOPrefs::instance(); |
1627 | bool showSelectedDates = false; | 1627 | bool showSelectedDates = false; |
1628 | int size; | 1628 | int size; |
1629 | int pro = 0; | 1629 | int pro = 0; |
1630 | //qDebug("MainWindow::keyPressEvent "); | 1630 | //qDebug("MainWindow::keyPressEvent "); |
1631 | switch ( e->key() ) { | 1631 | switch ( e->key() ) { |
1632 | case Qt::Key_Right: | 1632 | case Qt::Key_Right: |
1633 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1633 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1634 | mView->goNextMonth(); | 1634 | mView->goNextMonth(); |
1635 | else | 1635 | else |
1636 | mView->goNext(); | 1636 | mView->goNext(); |
1637 | showSelectedDates = true; | 1637 | showSelectedDates = true; |
1638 | break; | 1638 | break; |
1639 | case Qt::Key_Left: | 1639 | case Qt::Key_Left: |
1640 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1640 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1641 | mView->goPreviousMonth(); | 1641 | mView->goPreviousMonth(); |
1642 | else | 1642 | else |
1643 | mView->goPrevious(); | 1643 | mView->goPrevious(); |
1644 | showSelectedDates = true; | 1644 | showSelectedDates = true; |
1645 | break; | 1645 | break; |
1646 | case Qt::Key_Down: | 1646 | case Qt::Key_Down: |
1647 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1647 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1648 | break; | 1648 | break; |
1649 | case Qt::Key_Up: | 1649 | case Qt::Key_Up: |
1650 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1650 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1651 | break; | 1651 | break; |
1652 | case Qt::Key_K: | 1652 | case Qt::Key_K: |
1653 | mView->viewManager()->showMonthViewWeek(); | 1653 | mView->viewManager()->showMonthViewWeek(); |
1654 | break; | 1654 | break; |
1655 | case Qt::Key_I: | 1655 | case Qt::Key_I: |
1656 | mView->showIncidence(); | 1656 | mView->showIncidence(); |
1657 | break; | 1657 | break; |
1658 | case Qt::Key_Delete: | 1658 | case Qt::Key_Delete: |
1659 | case Qt::Key_Backspace: | 1659 | case Qt::Key_Backspace: |
1660 | mView->deleteIncidence(); | 1660 | mView->deleteIncidence(); |
1661 | break; | 1661 | break; |
1662 | case Qt::Key_D: | 1662 | case Qt::Key_D: |
1663 | mView->viewManager()->showDayView(); | 1663 | mView->viewManager()->showDayView(); |
1664 | showSelectedDates = true; | 1664 | showSelectedDates = true; |
1665 | break; | 1665 | break; |
1666 | case Qt::Key_O: | 1666 | case Qt::Key_O: |
1667 | mView->toggleFilerEnabled( ); | 1667 | mView->toggleFilerEnabled( ); |
1668 | break; | 1668 | break; |
1669 | case Qt::Key_0: | 1669 | case Qt::Key_0: |
1670 | case Qt::Key_1: | 1670 | case Qt::Key_1: |
1671 | case Qt::Key_2: | 1671 | case Qt::Key_2: |
1672 | case Qt::Key_3: | 1672 | case Qt::Key_3: |
1673 | case Qt::Key_4: | 1673 | case Qt::Key_4: |
1674 | case Qt::Key_5: | 1674 | case Qt::Key_5: |
1675 | case Qt::Key_6: | 1675 | case Qt::Key_6: |
1676 | case Qt::Key_7: | 1676 | case Qt::Key_7: |
1677 | case Qt::Key_8: | 1677 | case Qt::Key_8: |
1678 | case Qt::Key_9: | 1678 | case Qt::Key_9: |
1679 | pro = e->key()-48; | 1679 | pro = e->key()-48; |
1680 | if ( pro == 0 ) | 1680 | if ( pro == 0 ) |
1681 | pro = 10; | 1681 | pro = 10; |
1682 | if ( e->state() == Qt::ControlButton) | 1682 | if ( e->state() == Qt::ControlButton) |
1683 | pro += 10; | 1683 | pro += 10; |
1684 | break; | 1684 | break; |
1685 | case Qt::Key_M: | 1685 | case Qt::Key_M: |
1686 | mView->viewManager()->showMonthView(); | 1686 | mView->viewManager()->showMonthView(); |
1687 | showSelectedDates = true; | 1687 | showSelectedDates = true; |
1688 | break; | 1688 | break; |
1689 | case Qt::Key_Insert: | 1689 | case Qt::Key_Insert: |
1690 | mView->newEvent(); | 1690 | mView->newEvent(); |
1691 | break; | 1691 | break; |
1692 | case Qt::Key_S : | 1692 | case Qt::Key_S : |
1693 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1693 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1694 | mView->newSubTodo(); | 1694 | mView->newSubTodo(); |
1695 | else | 1695 | else |
1696 | mView->dialogManager()->showSearchDialog(); | 1696 | mView->dialogManager()->showSearchDialog(); |
1697 | break; | 1697 | break; |
1698 | case Qt::Key_Y : | 1698 | case Qt::Key_Y : |
1699 | case Qt::Key_Z : | 1699 | case Qt::Key_Z : |
1700 | mView->viewManager()->showWorkWeekView(); | 1700 | mView->viewManager()->showWorkWeekView(); |
1701 | showSelectedDates = true; | 1701 | showSelectedDates = true; |
1702 | break; | 1702 | break; |
1703 | case Qt::Key_U : | 1703 | case Qt::Key_U : |
1704 | mView->viewManager()->showWeekView(); | 1704 | mView->viewManager()->showWeekView(); |
1705 | showSelectedDates = true; | 1705 | showSelectedDates = true; |
1706 | break; | 1706 | break; |
1707 | case Qt::Key_H : | 1707 | case Qt::Key_H : |
1708 | keyBindings(); | 1708 | keyBindings(); |
1709 | break; | 1709 | break; |
1710 | case Qt::Key_W: | 1710 | case Qt::Key_W: |
1711 | mView->viewManager()->showWhatsNextView(); | 1711 | mView->viewManager()->showWhatsNextView(); |
1712 | break; | 1712 | break; |
1713 | case Qt::Key_L: | 1713 | case Qt::Key_L: |
1714 | mView->viewManager()->showListView(); | 1714 | mView->viewManager()->showListView(); |
1715 | break; | 1715 | break; |
1716 | case Qt::Key_N: | 1716 | case Qt::Key_N: |
1717 | mView->viewManager()->showNextXView(); | 1717 | mView->viewManager()->showNextXView(); |
1718 | showSelectedDates = true; | 1718 | showSelectedDates = true; |
1719 | break; | 1719 | break; |
1720 | case Qt::Key_V: | 1720 | case Qt::Key_V: |
1721 | mView->viewManager()->showTodoView(); | 1721 | mView->viewManager()->showTodoView(); |
1722 | break; | 1722 | break; |
1723 | case Qt::Key_C: | 1723 | case Qt::Key_C: |
1724 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1724 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1725 | break; | 1725 | break; |
1726 | case Qt::Key_P: | 1726 | case Qt::Key_P: |
1727 | mView->showDatePicker( ); | 1727 | mView->showDatePicker( ); |
1728 | break; | 1728 | break; |
1729 | case Qt::Key_F: | 1729 | case Qt::Key_F: |
1730 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1730 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1731 | mView->editFilters(); | 1731 | mView->editFilters(); |
1732 | else | 1732 | else |
1733 | mView->toggleFilter(); | 1733 | mView->toggleFilter(); |
1734 | break; | 1734 | break; |
1735 | case Qt::Key_X: | 1735 | case Qt::Key_X: |
1736 | mView->toggleDateNavigatorWidget(); | 1736 | mView->toggleDateNavigatorWidget(); |
1737 | break; | 1737 | break; |
1738 | case Qt::Key_Space: | 1738 | case Qt::Key_Space: |
1739 | mView->toggleExpand(); | 1739 | mView->toggleExpand(); |
1740 | break; | 1740 | break; |
1741 | case Qt::Key_A: | 1741 | case Qt::Key_A: |
1742 | mView->toggleAllDaySize(); | 1742 | mView->toggleAllDaySize(); |
1743 | break; | 1743 | break; |
1744 | case Qt::Key_T: | 1744 | case Qt::Key_T: |
1745 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1745 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1746 | mView->newTodo(); | 1746 | mView->newTodo(); |
1747 | else { | 1747 | else { |
1748 | mView->goToday(); | 1748 | mView->goToday(); |
1749 | showSelectedDates = true; | 1749 | showSelectedDates = true; |
1750 | } | 1750 | } |
1751 | break; | 1751 | break; |
1752 | case Qt::Key_J: | 1752 | case Qt::Key_J: |
1753 | mView->viewManager()->showJournalView(); | 1753 | mView->viewManager()->showJournalView(); |
1754 | break; | 1754 | break; |
1755 | case Qt::Key_B: | 1755 | case Qt::Key_B: |
1756 | mView->editIncidenceDescription();; | 1756 | mView->editIncidenceDescription();; |
1757 | break; | 1757 | break; |
1758 | // case Qt::Key_Return: | 1758 | // case Qt::Key_Return: |
1759 | case Qt::Key_E: | 1759 | case Qt::Key_E: |
1760 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1760 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1761 | mView->newEvent(); | 1761 | mView->newEvent(); |
1762 | else | 1762 | else |
1763 | mView->editIncidence(); | 1763 | mView->editIncidence(); |
1764 | break; | 1764 | break; |
1765 | case Qt::Key_Plus: | 1765 | case Qt::Key_Plus: |
1766 | size = p->mHourSize +2; | 1766 | size = p->mHourSize +2; |
1767 | if ( size <= 22 ) | 1767 | if ( size <= 22 ) |
1768 | configureAgenda( size ); | 1768 | configureAgenda( size ); |
1769 | break; | 1769 | break; |
1770 | case Qt::Key_Minus: | 1770 | case Qt::Key_Minus: |
1771 | size = p->mHourSize - 2; | 1771 | size = p->mHourSize - 2; |
1772 | if ( size >= 4 ) | 1772 | if ( size >= 4 ) |
1773 | configureAgenda( size ); | 1773 | configureAgenda( size ); |
1774 | break; | 1774 | break; |
1775 | 1775 | ||
1776 | 1776 | ||
1777 | default: | 1777 | default: |
1778 | e->ignore(); | 1778 | e->ignore(); |
1779 | } | 1779 | } |
1780 | if ( pro > 0 ) { | 1780 | if ( pro > 0 ) { |
1781 | mView->selectFilter( pro-1 ); | 1781 | mView->selectFilter( pro-1 ); |
1782 | } | 1782 | } |
1783 | if ( showSelectedDates ) { | 1783 | if ( showSelectedDates ) { |
1784 | ;// setCaptionToDates(); | 1784 | ;// setCaptionToDates(); |
1785 | } | 1785 | } |
1786 | 1786 | ||
1787 | } | 1787 | } |
1788 | 1788 | ||
1789 | void MainWindow::fillFilterMenu() | 1789 | void MainWindow::fillFilterMenu() |
1790 | { | 1790 | { |
1791 | selectFilterMenu->clear(); | 1791 | selectFilterMenu->clear(); |
1792 | bool disable = false; | 1792 | bool disable = false; |
1793 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1793 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1794 | selectFilterMenu->insertSeparator(); | 1794 | selectFilterMenu->insertSeparator(); |
1795 | if ( mView->filterView()->filtersEnabled() ) { | 1795 | if ( mView->filterView()->filtersEnabled() ) { |
1796 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1796 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1797 | } | 1797 | } |
1798 | else { | 1798 | else { |
1799 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1799 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1800 | disable = true; | 1800 | disable = true; |
1801 | } | 1801 | } |
1802 | selectFilterMenu->insertSeparator(); | 1802 | selectFilterMenu->insertSeparator(); |
1803 | QPtrList<CalFilter> fili = mView->filters(); | 1803 | QPtrList<CalFilter> fili = mView->filters(); |
1804 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1804 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1805 | CalFilter *filter = fili.first(); | 1805 | CalFilter *filter = fili.first(); |
1806 | int iii = 2; | 1806 | int iii = 2; |
1807 | while(filter) { | 1807 | while(filter) { |
1808 | selectFilterMenu->insertItem( filter->name(), iii ); | 1808 | selectFilterMenu->insertItem( filter->name(), iii ); |
1809 | if ( filter == curfilter) | 1809 | if ( filter == curfilter) |
1810 | selectFilterMenu->setItemChecked( iii, true ); | 1810 | selectFilterMenu->setItemChecked( iii, true ); |
1811 | if ( disable ) | 1811 | if ( disable ) |
1812 | selectFilterMenu->setItemEnabled( iii, false ); | 1812 | selectFilterMenu->setItemEnabled( iii, false ); |
1813 | filter = fili.next(); | 1813 | filter = fili.next(); |
1814 | ++iii; | 1814 | ++iii; |
1815 | } | 1815 | } |
1816 | } | 1816 | } |
1817 | void MainWindow::selectFilter( int fil ) | 1817 | void MainWindow::selectFilter( int fil ) |
1818 | { | 1818 | { |
1819 | if ( fil == 0 ) { | 1819 | if ( fil == 0 ) { |
1820 | mView->editFilters( ); | 1820 | mView->editFilters( ); |
1821 | } else if ( fil == 1 ){ | 1821 | } else if ( fil == 1 ){ |
1822 | mView->toggleFilerEnabled( ); | 1822 | mView->toggleFilerEnabled( ); |
1823 | } else { | 1823 | } else { |
1824 | mView->selectFilter( fil-2 ); | 1824 | mView->selectFilter( fil-2 ); |
1825 | } | 1825 | } |
1826 | } | 1826 | } |
1827 | void MainWindow::configureToolBar( int item ) | 1827 | void MainWindow::configureToolBar( int item ) |
1828 | { | 1828 | { |
1829 | 1829 | ||
1830 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1830 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1831 | KOPrefs *p = KOPrefs::instance(); | 1831 | KOPrefs *p = KOPrefs::instance(); |
1832 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1832 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1833 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1833 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1834 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1834 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1835 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1835 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1836 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1836 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1837 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1837 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1838 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1838 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1839 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 1839 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
1840 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1840 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1841 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1841 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1842 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1842 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1843 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1843 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1844 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1844 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1845 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1845 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1846 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1846 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1847 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1847 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1848 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1848 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1849 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1849 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1850 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1850 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1851 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1851 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1852 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 1852 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
1853 | // initActions(); | 1853 | // initActions(); |
1854 | } | 1854 | } |
1855 | 1855 | ||
1856 | void MainWindow::setCaptionToDates() | 1856 | void MainWindow::setCaptionToDates() |
1857 | { | 1857 | { |
1858 | QString selDates; | 1858 | QString selDates; |
1859 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1859 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); |
1860 | if (mView->startDate() < mView->endDate() ) | 1860 | if (mView->startDate() < mView->endDate() ) |
1861 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1861 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1862 | else { | 1862 | else { |
1863 | QString addString; | 1863 | QString addString; |
1864 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) | 1864 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) |
1865 | addString = i18n("Today"); | 1865 | addString = i18n("Today"); |
1866 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) | 1866 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) |
1867 | addString = i18n("Tomorrow"); | 1867 | addString = i18n("Tomorrow"); |
1868 | if ( !addString.isEmpty() ) | 1868 | if ( !addString.isEmpty() ) |
1869 | selDates = addString+", "+selDates ; | 1869 | selDates = addString+", "+selDates ; |
1870 | } | 1870 | } |
1871 | setCaption( i18n("Dates: ") + selDates ); | 1871 | setCaption( i18n("Dates: ") + selDates ); |
1872 | 1872 | ||
1873 | } | 1873 | } |
1874 | void MainWindow::showConfigureAgenda( ) | 1874 | void MainWindow::showConfigureAgenda( ) |
1875 | { | 1875 | { |
1876 | int iii; | 1876 | int iii; |
1877 | for ( iii = 1;iii<= 10 ;++iii ){ | 1877 | for ( iii = 1;iii<= 10 ;++iii ){ |
1878 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 1878 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |