-rw-r--r-- | korganizer/kolistview.cpp | 10 | ||||
-rw-r--r-- | korganizer/main.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 31 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
4 files changed, 42 insertions, 2 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index c705c73..0b2f9a4 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -38,64 +38,66 @@ | |||
38 | #include <qpaintdevicemetrics.h> | 38 | #include <qpaintdevicemetrics.h> |
39 | 39 | ||
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | #include <kiconloader.h> | 42 | #include <kiconloader.h> |
43 | #include <kglobal.h> | 43 | #include <kglobal.h> |
44 | 44 | ||
45 | #include <libkdepim/kpimglobalprefs.h> | 45 | #include <libkdepim/kpimglobalprefs.h> |
46 | #include <libkcal/calendar.h> | 46 | #include <libkcal/calendar.h> |
47 | #include <libkcal/calendarlocal.h> | 47 | #include <libkcal/calendarlocal.h> |
48 | #include <libkcal/icalformat.h> | 48 | #include <libkcal/icalformat.h> |
49 | #include <libkcal/vcalformat.h> | 49 | #include <libkcal/vcalformat.h> |
50 | #include <libkcal/recurrence.h> | 50 | #include <libkcal/recurrence.h> |
51 | #include <libkcal/filestorage.h> | 51 | #include <libkcal/filestorage.h> |
52 | #include <libkdepim/categoryselectdialog.h> | 52 | #include <libkdepim/categoryselectdialog.h> |
53 | #include <libkcal/kincidenceformatter.h> | 53 | #include <libkcal/kincidenceformatter.h> |
54 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
55 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
56 | #else | 56 | #else |
57 | #include <qapplication.h> | 57 | #include <qapplication.h> |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifndef KORG_NOPRINTER | 60 | #ifndef KORG_NOPRINTER |
61 | #include "calprinter.h" | 61 | #include "calprinter.h" |
62 | #endif | 62 | #endif |
63 | #include "koglobals.h" | 63 | #include "koglobals.h" |
64 | #include "koprefs.h" | 64 | #include "koprefs.h" |
65 | #include "kfiledialog.h" | 65 | #include "kfiledialog.h" |
66 | 66 | ||
67 | #include "kolistview.h" | 67 | #include "kolistview.h" |
68 | #include "koeventviewer.h" | 68 | #include "koeventviewer.h" |
69 | 69 | ||
70 | extern QPixmap* sgListViewCompletedPix[6]; | ||
71 | |||
70 | class KOListViewWhatsThis :public QWhatsThis | 72 | class KOListViewWhatsThis :public QWhatsThis |
71 | { | 73 | { |
72 | public: | 74 | public: |
73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 75 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
74 | 76 | ||
75 | protected: | 77 | protected: |
76 | virtual QString text( const QPoint& p) | 78 | virtual QString text( const QPoint& p) |
77 | { | 79 | { |
78 | return _view->getWhatsThisText(p) ; | 80 | return _view->getWhatsThisText(p) ; |
79 | } | 81 | } |
80 | private: | 82 | private: |
81 | QWidget* _wid; | 83 | QWidget* _wid; |
82 | KOListView * _view; | 84 | KOListView * _view; |
83 | }; | 85 | }; |
84 | 86 | ||
85 | 87 | ||
86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 88 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
87 | { | 89 | { |
88 | mItem = item; | 90 | mItem = item; |
89 | mDate = date; | 91 | mDate = date; |
90 | } | 92 | } |
91 | 93 | ||
92 | ListItemVisitor::~ListItemVisitor() | 94 | ListItemVisitor::~ListItemVisitor() |
93 | { | 95 | { |
94 | } | 96 | } |
95 | 97 | ||
96 | bool ListItemVisitor::visit(Event *e) | 98 | bool ListItemVisitor::visit(Event *e) |
97 | { | 99 | { |
98 | bool ok = false; | 100 | bool ok = false; |
99 | QString start, end; | 101 | QString start, end; |
100 | QDate ds, de; | 102 | QDate ds, de; |
101 | if ( e->doesRecur() ) { | 103 | if ( e->doesRecur() ) { |
@@ -123,65 +125,70 @@ bool ListItemVisitor::visit(Event *e) | |||
123 | mItem->setText(3,end); | 125 | mItem->setText(3,end); |
124 | if ( e->doesFloat() ) | 126 | if ( e->doesFloat() ) |
125 | mItem->setText(4,"---"); | 127 | mItem->setText(4,"---"); |
126 | else | 128 | else |
127 | mItem->setText(4,e->dtEndTimeStr()); | 129 | mItem->setText(4,e->dtEndTimeStr()); |
128 | if ( e->isAlarmEnabled() ) { | 130 | if ( e->isAlarmEnabled() ) { |
129 | mItem->setText(5,e->alarms().first()->offsetText() ); | 131 | mItem->setText(5,e->alarms().first()->offsetText() ); |
130 | } else { | 132 | } else { |
131 | mItem->setText(5, i18n("No")); | 133 | mItem->setText(5, i18n("No")); |
132 | } | 134 | } |
133 | mItem->setText(6, e->recurrence()->recurrenceText()); | 135 | mItem->setText(6, e->recurrence()->recurrenceText()); |
134 | if( ! e->doesRecur() ) | 136 | if( ! e->doesRecur() ) |
135 | mItem->setSortKey( 6, "-" ); | 137 | mItem->setSortKey( 6, "-" ); |
136 | mItem->setText(7,"---"); | 138 | mItem->setText(7,"---"); |
137 | mItem->setText(8,"---"); | 139 | mItem->setText(8,"---"); |
138 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 140 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
139 | mItem->setText(10,e->categoriesStr()); | 141 | mItem->setText(10,e->categoriesStr()); |
140 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); | 142 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); |
141 | 143 | ||
142 | QString key; | 144 | QString key; |
143 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 145 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
144 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 146 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
145 | mItem->setSortKey(1,key); | 147 | mItem->setSortKey(1,key); |
146 | 148 | ||
147 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 149 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
148 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 150 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
149 | mItem->setSortKey(3,key); | 151 | mItem->setSortKey(3,key); |
150 | return true; | 152 | return true; |
151 | } | 153 | } |
152 | 154 | ||
153 | bool ListItemVisitor::visit(Todo *t) | 155 | bool ListItemVisitor::visit(Todo *t) |
154 | { | 156 | { |
155 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); | 157 | mItem->setText(0,t->summary()); |
158 | if ( t->isCompleted() ) { | ||
159 | mItem->setSortKey(0,"99"+ t->summary().left(10)); | ||
160 | } else | ||
161 | mItem->setSortKey(0,QString::number( t->percentComplete() )+ t->summary().left(10)); | ||
162 | mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); | ||
156 | if (t->hasStartDate()) { | 163 | if (t->hasStartDate()) { |
157 | mItem->setText(1,t->dtStartDateStr()); | 164 | mItem->setText(1,t->dtStartDateStr()); |
158 | if (t->doesFloat()) { | 165 | if (t->doesFloat()) { |
159 | mItem->setText(2,"---"); | 166 | mItem->setText(2,"---"); |
160 | } else { | 167 | } else { |
161 | mItem->setText(2,t->dtStartTimeStr()); | 168 | mItem->setText(2,t->dtStartTimeStr()); |
162 | } | 169 | } |
163 | } else { | 170 | } else { |
164 | mItem->setText(1,"---"); | 171 | mItem->setText(1,"---"); |
165 | mItem->setText(2,"---"); | 172 | mItem->setText(2,"---"); |
166 | } | 173 | } |
167 | mItem->setText(3,"---"); | 174 | mItem->setText(3,"---"); |
168 | mItem->setText(4,"---"); | 175 | mItem->setText(4,"---"); |
169 | if ( t->isAlarmEnabled() ) { | 176 | if ( t->isAlarmEnabled() ) { |
170 | mItem->setText(5,t->alarms().first()->offsetText() ); | 177 | mItem->setText(5,t->alarms().first()->offsetText() ); |
171 | } else { | 178 | } else { |
172 | mItem->setText(5, i18n("No")); | 179 | mItem->setText(5, i18n("No")); |
173 | } | 180 | } |
174 | mItem->setText(6, t->recurrence()->recurrenceText()); | 181 | mItem->setText(6, t->recurrence()->recurrenceText()); |
175 | if( ! t->doesRecur() ) | 182 | if( ! t->doesRecur() ) |
176 | mItem->setSortKey( 6, "-" ); | 183 | mItem->setSortKey( 6, "-" ); |
177 | if (t->hasDueDate()) { | 184 | if (t->hasDueDate()) { |
178 | mItem->setText(7,t->dtDueDateStr()); | 185 | mItem->setText(7,t->dtDueDateStr()); |
179 | if (t->doesFloat()) { | 186 | if (t->doesFloat()) { |
180 | mItem->setText(8,"---"); | 187 | mItem->setText(8,"---"); |
181 | } else { | 188 | } else { |
182 | mItem->setText(8,t->dtDueTimeStr()); | 189 | mItem->setText(8,t->dtDueTimeStr()); |
183 | } | 190 | } |
184 | } else { | 191 | } else { |
185 | mItem->setText(7,"---"); | 192 | mItem->setText(7,"---"); |
186 | mItem->setText(8,"---"); | 193 | mItem->setText(8,"---"); |
187 | } | 194 | } |
@@ -209,64 +216,65 @@ bool ListItemVisitor::visit(Todo *t) | |||
209 | bool ListItemVisitor::visit(Journal * j) | 216 | bool ListItemVisitor::visit(Journal * j) |
210 | { | 217 | { |
211 | QString des = j->description().left(30); | 218 | QString des = j->description().left(30); |
212 | des = des.simplifyWhiteSpace (); | 219 | des = des.simplifyWhiteSpace (); |
213 | des.replace (QRegExp ("\\n"),"" ); | 220 | des.replace (QRegExp ("\\n"),"" ); |
214 | des.replace (QRegExp ("\\r"),"" ); | 221 | des.replace (QRegExp ("\\r"),"" ); |
215 | mItem->setText(0,i18n("Journal: ")+des.left(25)); | 222 | mItem->setText(0,i18n("Journal: ")+des.left(25)); |
216 | mItem->setText(1,j->dtStartDateStr()); | 223 | mItem->setText(1,j->dtStartDateStr()); |
217 | mItem->setText(2,"---"); | 224 | mItem->setText(2,"---"); |
218 | mItem->setText(3,"---"); | 225 | mItem->setText(3,"---"); |
219 | mItem->setText(4,"---"); | 226 | mItem->setText(4,"---"); |
220 | mItem->setText(5,"---"); | 227 | mItem->setText(5,"---"); |
221 | mItem->setText(6,"---"); | 228 | mItem->setText(6,"---"); |
222 | mItem->setText(7,j->dtStartDateStr()); | 229 | mItem->setText(7,j->dtStartDateStr()); |
223 | mItem->setText(8,"---"); | 230 | mItem->setText(8,"---"); |
224 | mItem->setText(9,"---"); | 231 | mItem->setText(9,"---"); |
225 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | 232 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); |
226 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); | 233 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); |
227 | 234 | ||
228 | QString key; | 235 | QString key; |
229 | QDate d = j->dtStart().date(); | 236 | QDate d = j->dtStart().date(); |
230 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 237 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
231 | mItem->setSortKey(1,key); | 238 | mItem->setSortKey(1,key); |
232 | mItem->setSortKey(7,key); | 239 | mItem->setSortKey(7,key); |
233 | 240 | ||
234 | return true; | 241 | return true; |
235 | } | 242 | } |
236 | 243 | ||
237 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 244 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
238 | const char *name) | 245 | const char *name) |
239 | : KOEventView(calendar, parent, name) | 246 | : KOEventView(calendar, parent, name) |
240 | { | 247 | { |
248 | |||
241 | mActiveItem = 0; | 249 | mActiveItem = 0; |
242 | mListView = new KOListViewListView(this); | 250 | mListView = new KOListViewListView(this); |
243 | mListView->addColumn(i18n("Summary")); | 251 | mListView->addColumn(i18n("Summary")); |
244 | mListView->addColumn(i18n("Start Date")); | 252 | mListView->addColumn(i18n("Start Date")); |
245 | mListView->addColumn(i18n("Start Time")); | 253 | mListView->addColumn(i18n("Start Time")); |
246 | mListView->addColumn(i18n("End Date")); | 254 | mListView->addColumn(i18n("End Date")); |
247 | mListView->addColumn(i18n("End Time")); | 255 | mListView->addColumn(i18n("End Time")); |
248 | mListView->addColumn(i18n("Alarm")); // alarm set? | 256 | mListView->addColumn(i18n("Alarm")); // alarm set? |
249 | mListView->addColumn(i18n("Recurs")); // recurs? | 257 | mListView->addColumn(i18n("Recurs")); // recurs? |
250 | mListView->addColumn(i18n("Due Date")); | 258 | mListView->addColumn(i18n("Due Date")); |
251 | mListView->addColumn(i18n("Due Time")); | 259 | mListView->addColumn(i18n("Due Time")); |
252 | mListView->addColumn(i18n("Cancelled")); | 260 | mListView->addColumn(i18n("Cancelled")); |
253 | mListView->addColumn(i18n("Categories")); | 261 | mListView->addColumn(i18n("Categories")); |
254 | mListView->addColumn(i18n("Calendar")); | 262 | mListView->addColumn(i18n("Calendar")); |
255 | 263 | ||
256 | mListView->setColumnAlignment(0,AlignLeft); | 264 | mListView->setColumnAlignment(0,AlignLeft); |
257 | mListView->setColumnAlignment(1,AlignLeft); | 265 | mListView->setColumnAlignment(1,AlignLeft); |
258 | mListView->setColumnAlignment(2,AlignHCenter); | 266 | mListView->setColumnAlignment(2,AlignHCenter); |
259 | mListView->setColumnAlignment(3,AlignLeft); | 267 | mListView->setColumnAlignment(3,AlignLeft); |
260 | mListView->setColumnAlignment(4,AlignHCenter); | 268 | mListView->setColumnAlignment(4,AlignHCenter); |
261 | mListView->setColumnAlignment(5,AlignLeft); | 269 | mListView->setColumnAlignment(5,AlignLeft); |
262 | mListView->setColumnAlignment(6,AlignLeft); | 270 | mListView->setColumnAlignment(6,AlignLeft); |
263 | mListView->setColumnAlignment(7,AlignLeft); | 271 | mListView->setColumnAlignment(7,AlignLeft); |
264 | mListView->setColumnAlignment(8,AlignLeft); | 272 | mListView->setColumnAlignment(8,AlignLeft); |
265 | mListView->setColumnAlignment(9,AlignLeft); | 273 | mListView->setColumnAlignment(9,AlignLeft); |
266 | mListView->setColumnAlignment(10,AlignLeft); | 274 | mListView->setColumnAlignment(10,AlignLeft); |
267 | mListView->setColumnAlignment(11,AlignLeft); | 275 | mListView->setColumnAlignment(11,AlignLeft); |
268 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); | 276 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
269 | 277 | ||
270 | int iii = 0; | 278 | int iii = 0; |
271 | for ( iii = 0; iii< 12 ; ++iii ) | 279 | for ( iii = 0; iii< 12 ; ++iii ) |
272 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 280 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index ee9589c..2bf46b9 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,56 +1,58 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qcopchannel_qws.h> | 5 | #include <qcopchannel_qws.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #else | 8 | #else |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
13 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #endif | 15 | #endif |
16 | #include <qtextcodec.h> | 16 | #include <qtextcodec.h> |
17 | 17 | ||
18 | #include <qdir.h> | 18 | #include <qdir.h> |
19 | #include <kstandarddirs.h> | 19 | #include <kstandarddirs.h> |
20 | #include <kglobal.h> | 20 | #include <kglobal.h> |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include <libkdepim/kpimglobalprefs.h> | 23 | #include <libkdepim/kpimglobalprefs.h> |
24 | void dumpMissing(); | 24 | void dumpMissing(); |
25 | |||
26 | |||
25 | int main( int argc, char **argv ) | 27 | int main( int argc, char **argv ) |
26 | { | 28 | { |
27 | #ifndef DESKTOP_VERSION | 29 | #ifndef DESKTOP_VERSION |
28 | QPEApplication a( argc, argv ); | 30 | QPEApplication a( argc, argv ); |
29 | a.setKeepRunning (); | 31 | a.setKeepRunning (); |
30 | #else | 32 | #else |
31 | QApplication a( argc, argv ); | 33 | QApplication a( argc, argv ); |
32 | QApplication::setStyle( new QPlatinumStyle ()); | 34 | QApplication::setStyle( new QPlatinumStyle ()); |
33 | #ifdef _WIN32_ | 35 | #ifdef _WIN32_ |
34 | QString hdir ( getenv( "HOME") ); | 36 | QString hdir ( getenv( "HOME") ); |
35 | if ( hdir.isEmpty() ) { | 37 | if ( hdir.isEmpty() ) { |
36 | QString hd ("C:/" ); | 38 | QString hd ("C:/" ); |
37 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); | 39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); |
38 | if ( QDir::homeDirPath().lower() == hd.lower() ) { | 40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { |
39 | _putenv( "HOME=C:"); | 41 | _putenv( "HOME=C:"); |
40 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); | 42 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); |
41 | } | 43 | } |
42 | } else { | 44 | } else { |
43 | QDir app_dir; | 45 | QDir app_dir; |
44 | if ( !app_dir.exists(hdir) ) | 46 | if ( !app_dir.exists(hdir) ) |
45 | app_dir.mkdir (hdir); | 47 | app_dir.mkdir (hdir); |
46 | } | 48 | } |
47 | #endif | 49 | #endif |
48 | #endif | 50 | #endif |
49 | bool exitHelp = false; | 51 | bool exitHelp = false; |
50 | if ( argc > 1 ) { | 52 | if ( argc > 1 ) { |
51 | QString command = argv[1]; | 53 | QString command = argv[1]; |
52 | if ( command == "-help" ){ | 54 | if ( command == "-help" ){ |
53 | printf("KO/Pi command line commands:\n"); | 55 | printf("KO/Pi command line commands:\n"); |
54 | printf(" no command: Start KO/Pi in usual way\n"); | 56 | printf(" no command: Start KO/Pi in usual way\n"); |
55 | printf(" -help: This output\n"); | 57 | printf(" -help: This output\n"); |
56 | printf("Next Option: Open or Show after start:\n"); | 58 | printf("Next Option: Open or Show after start:\n"); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index f945383..0367bea 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -100,69 +100,98 @@ class KOex2phonePrefs : public QDialog | |||
100 | new QLabel( i18n("Model(opt.): "), temphb ); | 100 | new QLabel( i18n("Model(opt.): "), temphb ); |
101 | mPhoneModel = new QLineEdit( temphb); | 101 | mPhoneModel = new QLineEdit( temphb); |
102 | lay->addWidget( temphb ); | 102 | lay->addWidget( temphb ); |
103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
104 | mWriteBackFuture->setChecked( true ); | 104 | mWriteBackFuture->setChecked( true ); |
105 | lay->addWidget( mWriteBackFuture ); | 105 | lay->addWidget( mWriteBackFuture ); |
106 | temphb = new QHBox( this ); | 106 | temphb = new QHBox( this ); |
107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
109 | mWriteBackFutureWeeks->setValue( 8 ); | 109 | mWriteBackFutureWeeks->setValue( 8 ); |
110 | lay->addWidget( temphb ); | 110 | lay->addWidget( temphb ); |
111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
112 | lab->setAlignment (AlignHCenter ); | 112 | lab->setAlignment (AlignHCenter ); |
113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
114 | lay->addWidget( ok ); | 114 | lay->addWidget( ok ); |
115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
116 | lay->addWidget( cancel ); | 116 | lay->addWidget( cancel ); |
117 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 117 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
118 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 118 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
119 | resize( 220, 240 ); | 119 | resize( 220, 240 ); |
120 | qApp->processEvents(); | 120 | qApp->processEvents(); |
121 | int dw = QApplication::desktop()->width(); | 121 | int dw = QApplication::desktop()->width(); |
122 | int dh = QApplication::desktop()->height(); | 122 | int dh = QApplication::desktop()->height(); |
123 | move( (dw-width())/2, (dh - height() )/2 ); | 123 | move( (dw-width())/2, (dh - height() )/2 ); |
124 | } | 124 | } |
125 | 125 | ||
126 | public: | 126 | public: |
127 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 127 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
128 | QCheckBox* mWriteBackFuture; | 128 | QCheckBox* mWriteBackFuture; |
129 | QSpinBox* mWriteBackFutureWeeks; | 129 | QSpinBox* mWriteBackFutureWeeks; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | QPixmap* sgListViewCompletedPix[6]; | ||
133 | |||
134 | |||
132 | int globalFlagBlockStartup; | 135 | int globalFlagBlockStartup; |
133 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 136 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
134 | QMainWindow( parent, name ) | 137 | QMainWindow( parent, name ) |
135 | { | 138 | { |
136 | 139 | sgListViewCompletedPix[5] = &listviewPix; | |
140 | sgListViewCompletedPix[0] = &listviewPix0; | ||
141 | sgListViewCompletedPix[1] = &listviewPix20; | ||
142 | sgListViewCompletedPix[2] = &listviewPix40; | ||
143 | sgListViewCompletedPix[3] = &listviewPix60; | ||
144 | sgListViewCompletedPix[4] = &listviewPix80; | ||
145 | if ( sgListViewCompletedPix[5]->height() < 5 ) { | ||
146 | int size = 12; | ||
147 | sgListViewCompletedPix[5]->resize( 11, 11 ); | ||
148 | sgListViewCompletedPix[5]->fill( Qt::white ); | ||
149 | QPainter p ( sgListViewCompletedPix[5] ); | ||
150 | p.drawRect( 0,0,11,11); | ||
151 | int half = size/2; | ||
152 | int heihei = size/2; | ||
153 | int x = 1; | ||
154 | p.drawLine ( 2, 5, 4 , 7 ) ; | ||
155 | p.drawLine ( 4 , 7 , 8, 3) ; | ||
156 | int iii = 0; | ||
157 | for ( iii = 0; iii < 5; ++iii ) { | ||
158 | sgListViewCompletedPix[iii]->resize( 11, 11 ); | ||
159 | sgListViewCompletedPix[iii]->fill( Qt::white ); | ||
160 | QPainter p ( sgListViewCompletedPix[iii] ); | ||
161 | p.drawRect( 0,0,11,11); | ||
162 | if ( iii ) | ||
163 | p.fillRect( 1,1,iii*2,9,Qt::gray ); | ||
164 | } | ||
165 | } | ||
137 | mClosed = false; | 166 | mClosed = false; |
138 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 167 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
139 | QString confFile = locateLocal("config","korganizerrc"); | 168 | QString confFile = locateLocal("config","korganizerrc"); |
140 | QFileInfo finf ( confFile ); | 169 | QFileInfo finf ( confFile ); |
141 | bool showWarning = !finf.exists(); | 170 | bool showWarning = !finf.exists(); |
142 | setIcon(SmallIcon( "ko24" ) ); | 171 | setIcon(SmallIcon( "ko24" ) ); |
143 | mBlockAtStartup = true; | 172 | mBlockAtStartup = true; |
144 | mFlagKeyPressed = false; | 173 | mFlagKeyPressed = false; |
145 | setCaption("KO/Pi"); | 174 | setCaption("KO/Pi"); |
146 | KOPrefs *p = KOPrefs::instance(); | 175 | KOPrefs *p = KOPrefs::instance(); |
147 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 176 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
148 | p->mCurrentDisplayedView = 0; | 177 | p->mCurrentDisplayedView = 0; |
149 | if ( p->mHourSize > 22 ) | 178 | if ( p->mHourSize > 22 ) |
150 | p->mHourSize = 22; | 179 | p->mHourSize = 22; |
151 | QMainWindow::ToolBarDock tbd; | 180 | QMainWindow::ToolBarDock tbd; |
152 | if ( p->mToolBarHor ) { | 181 | if ( p->mToolBarHor ) { |
153 | if ( p->mToolBarUp ) | 182 | if ( p->mToolBarUp ) |
154 | tbd = Bottom; | 183 | tbd = Bottom; |
155 | else | 184 | else |
156 | tbd = Top; | 185 | tbd = Top; |
157 | } | 186 | } |
158 | else { | 187 | else { |
159 | if ( p->mToolBarUp ) | 188 | if ( p->mToolBarUp ) |
160 | tbd = Right; | 189 | tbd = Right; |
161 | else | 190 | else |
162 | tbd = Left; | 191 | tbd = Left; |
163 | } | 192 | } |
164 | if ( KOPrefs::instance()->mUseAppColors ) | 193 | if ( KOPrefs::instance()->mUseAppColors ) |
165 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 194 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
166 | globalFlagBlockStartup = 1; | 195 | globalFlagBlockStartup = 1; |
167 | iconToolBar = new QPEToolBar( this ); | 196 | iconToolBar = new QPEToolBar( this ); |
168 | addToolBar (iconToolBar , tbd ); | 197 | addToolBar (iconToolBar , tbd ); |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 1105783..9a8bc7f 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -133,36 +133,37 @@ class MainWindow : public QMainWindow | |||
133 | void keyPressEvent ( QKeyEvent * ) ; | 133 | void keyPressEvent ( QKeyEvent * ) ; |
134 | void keyReleaseEvent ( QKeyEvent * ) ; | 134 | void keyReleaseEvent ( QKeyEvent * ) ; |
135 | QPopupMenu *configureToolBarMenu; | 135 | QPopupMenu *configureToolBarMenu; |
136 | QPopupMenu *selectFilterMenu; | 136 | QPopupMenu *selectFilterMenu; |
137 | QPopupMenu *selectFilterMenuTB; | 137 | QPopupMenu *selectFilterMenuTB; |
138 | QPopupMenu *configureAgendaMenu, *syncMenu; | 138 | QPopupMenu *configureAgendaMenu, *syncMenu; |
139 | CalendarLocal *mCalendar; | 139 | CalendarLocal *mCalendar; |
140 | CalendarView *mView; | 140 | CalendarView *mView; |
141 | QAction *mNewSubTodoAction; | 141 | QAction *mNewSubTodoAction; |
142 | QAction *mWeekAction; | 142 | QAction *mWeekAction; |
143 | QFont mWeekFont; | 143 | QFont mWeekFont; |
144 | QPixmap mWeekPixmap; | 144 | QPixmap mWeekPixmap; |
145 | QColor mWeekBgColor; | 145 | QColor mWeekBgColor; |
146 | 146 | ||
147 | QAction *mShowAction; | 147 | QAction *mShowAction; |
148 | QAction *mEditAction; | 148 | QAction *mEditAction; |
149 | QAction *mDeleteAction; | 149 | QAction *mDeleteAction; |
150 | QAction *mCloneAction; | 150 | QAction *mCloneAction; |
151 | QAction *mMoveAction; | 151 | QAction *mMoveAction; |
152 | QAction *mBeamAction; | 152 | QAction *mBeamAction; |
153 | QAction *mCancelAction; | 153 | QAction *mCancelAction; |
154 | 154 | ||
155 | QAction *mToggleNav; | 155 | QAction *mToggleNav; |
156 | QAction *mToggleFilter; | 156 | QAction *mToggleFilter; |
157 | QAction *mToggleAllday; | 157 | QAction *mToggleAllday; |
158 | QAction *actionFilterMenuTB; | 158 | QAction *actionFilterMenuTB; |
159 | 159 | ||
160 | void closeEvent( QCloseEvent* ce ); | 160 | void closeEvent( QCloseEvent* ce ); |
161 | QTimer mSaveTimer; | 161 | QTimer mSaveTimer; |
162 | //bool mBlockSaveFlag; | 162 | //bool mBlockSaveFlag; |
163 | bool mCalendarModifiedFlag; | 163 | bool mCalendarModifiedFlag; |
164 | QPixmap loadPixmap( QString ); | 164 | QPixmap loadPixmap( QString ); |
165 | QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80; | ||
165 | }; | 166 | }; |
166 | 167 | ||
167 | 168 | ||
168 | #endif | 169 | #endif |