summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp7
-rw-r--r--korganizer/mainwindow.cpp13
-rw-r--r--korganizer/mainwindow.h2
3 files changed, 18 insertions, 4 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 5690bdb..5f90dc6 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -47,48 +47,49 @@
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
70extern QPixmap* sgListViewCompletedPix[6]; 70extern QPixmap* sgListViewCompletedPix[6];
71extern QPixmap* sgListViewJournalPix;
71 72
72class KOListViewWhatsThis :public QWhatsThis 73class KOListViewWhatsThis :public QWhatsThis
73{ 74{
74public: 75public:
75 KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; 76 KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
76 77
77protected: 78protected:
78 virtual QString text( const QPoint& p) 79 virtual QString text( const QPoint& p)
79 { 80 {
80 return _view->getWhatsThisText(p) ; 81 return _view->getWhatsThisText(p) ;
81 } 82 }
82private: 83private:
83 QWidget* _wid; 84 QWidget* _wid;
84 KOListView * _view; 85 KOListView * _view;
85}; 86};
86 87
87 88
88ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) 89ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
89{ 90{
90 mItem = item; 91 mItem = item;
91 mDate = date; 92 mDate = date;
92} 93}
93 94
94ListItemVisitor::~ListItemVisitor() 95ListItemVisitor::~ListItemVisitor()
@@ -142,49 +143,49 @@ bool ListItemVisitor::visit(Event *e)
142 mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); 143 mItem->setText(11, KOPrefs::instance()->calName( e->calID() ));
143 mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); 144 mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true ));
144 145
145 QString key; 146 QString key;
146 QDate d = e->lastModified().date(); 147 QDate d = e->lastModified().date();
147 QTime t = e->lastModified().time(); 148 QTime t = e->lastModified().time();
148 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); 149 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
149 mItem->setSortKey(12,key); 150 mItem->setSortKey(12,key);
150 t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); 151 t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
151 key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); 152 key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
152 mItem->setSortKey(1,key); 153 mItem->setSortKey(1,key);
153 154
154 t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); 155 t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
155 key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); 156 key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
156 mItem->setSortKey(3,key); 157 mItem->setSortKey(3,key);
157 return true; 158 return true;
158} 159}
159 160
160bool ListItemVisitor::visit(Todo *t) 161bool ListItemVisitor::visit(Todo *t)
161{ 162{
162 mItem->setText(0,t->summary()); 163 mItem->setText(0,t->summary());
163 if ( t->isCompleted() ) { 164 if ( t->isCompleted() ) {
164 mItem->setSortKey(0,"99"+ t->summary().left(10)); 165 mItem->setSortKey(0,"99"+ t->summary().left(10));
165 } else 166 } else
166 mItem->setSortKey(0,QString::number( t->percentComplete() )+ t->summary().left(10)); 167 mItem->setSortKey(0,QString::number( t->percentComplete()+1 )+ t->summary().left(10));
167 mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); 168 mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20]));
168 if (t->hasStartDate()) { 169 if (t->hasStartDate()) {
169 mItem->setText(1,t->dtStartDateStr()); 170 mItem->setText(1,t->dtStartDateStr());
170 if (t->doesFloat()) { 171 if (t->doesFloat()) {
171 mItem->setText(2,"---"); 172 mItem->setText(2,"---");
172 } else { 173 } else {
173 mItem->setText(2,t->dtStartTimeStr()); 174 mItem->setText(2,t->dtStartTimeStr());
174 } 175 }
175 } else { 176 } else {
176 mItem->setText(1,"---"); 177 mItem->setText(1,"---");
177 mItem->setText(2,"---"); 178 mItem->setText(2,"---");
178 } 179 }
179 mItem->setText(3,"---"); 180 mItem->setText(3,"---");
180 mItem->setText(4,"---"); 181 mItem->setText(4,"---");
181 if ( t->isAlarmEnabled() ) { 182 if ( t->isAlarmEnabled() ) {
182 mItem->setText(5,t->alarms().first()->offsetText() ); 183 mItem->setText(5,t->alarms().first()->offsetText() );
183 } else { 184 } else {
184 mItem->setText(5, i18n("No")); 185 mItem->setText(5, i18n("No"));
185 } 186 }
186 mItem->setText(6, t->recurrence()->recurrenceText()); 187 mItem->setText(6, t->recurrence()->recurrenceText());
187 if( ! t->doesRecur() ) 188 if( ! t->doesRecur() )
188 mItem->setSortKey( 6, "-" ); 189 mItem->setSortKey( 6, "-" );
189 if (t->hasDueDate()) { 190 if (t->hasDueDate()) {
190 mItem->setText(7,t->dtDueDateStr()); 191 mItem->setText(7,t->dtDueDateStr());
@@ -204,57 +205,59 @@ bool ListItemVisitor::visit(Todo *t)
204 QString key; 205 QString key;
205 QDate d = t->lastModified().date(); 206 QDate d = t->lastModified().date();
206 QTime tm = t->lastModified().time(); 207 QTime tm = t->lastModified().time();
207 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); 208 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() );
208 mItem->setSortKey(12,key); 209 mItem->setSortKey(12,key);
209 if (t->hasDueDate()) { 210 if (t->hasDueDate()) {
210 d = t->dtDue().date(); 211 d = t->dtDue().date();
211 tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); 212 tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time();
212 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); 213 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
213 mItem->setSortKey(7,key); 214 mItem->setSortKey(7,key);
214 } 215 }
215 if ( t->hasStartDate() ) { 216 if ( t->hasStartDate() ) {
216 d = t->dtStart().date(); 217 d = t->dtStart().date();
217 tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); 218 tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time();
218 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); 219 key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
219 mItem->setSortKey(1,key); 220 mItem->setSortKey(1,key);
220 } 221 }
221 return true; 222 return true;
222} 223}
223 224
224bool ListItemVisitor::visit(Journal * j) 225bool ListItemVisitor::visit(Journal * j)
225{ 226{
226 227
227 QString des; 228 QString des;
229 mItem->setPixmap( 0, *sgListViewJournalPix);
228 if ( !j->summary().isEmpty() ) { 230 if ( !j->summary().isEmpty() ) {
229 des = j->summary(); 231 des = j->summary();
230 } else { 232 } else {
231 des = j->description().left(30); 233 des = j->description().left(30);
232 des = des.simplifyWhiteSpace (); 234 des = des.simplifyWhiteSpace ();
233 des.replace (QRegExp ("\\n"),"" ); 235 des.replace (QRegExp ("\\n"),"" );
234 des.replace (QRegExp ("\\r"),"" ); 236 des.replace (QRegExp ("\\r"),"" );
235 } 237 }
236 mItem->setText(0,i18n("Journal: ")+des.left(25)); 238 mItem->setText(0,des.left(25));
239 mItem->setSortKey(0,"0"+ des.left(25));
237 mItem->setText(1,j->dtStartDateStr()); 240 mItem->setText(1,j->dtStartDateStr());
238 mItem->setText(2,"---"); 241 mItem->setText(2,"---");
239 mItem->setText(3,"---"); 242 mItem->setText(3,"---");
240 mItem->setText(4,"---"); 243 mItem->setText(4,"---");
241 mItem->setText(5,"---"); 244 mItem->setText(5,"---");
242 mItem->setText(6,"---"); 245 mItem->setText(6,"---");
243 mItem->setText(7,j->dtStartDateStr()); 246 mItem->setText(7,j->dtStartDateStr());
244 mItem->setText(8,"---"); 247 mItem->setText(8,"---");
245 mItem->setText(9,"---"); 248 mItem->setText(9,"---");
246 mItem->setText(10,j->categoriesStr()); 249 mItem->setText(10,j->categoriesStr());
247 mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); 250 mItem->setText(11, KOPrefs::instance()->calName( j->calID() ));
248 mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); 251 mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true ));
249 252
250 QString key; 253 QString key;
251 QDate d = j->lastModified().date(); 254 QDate d = j->lastModified().date();
252 QTime tm = j->lastModified().time(); 255 QTime tm = j->lastModified().time();
253 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); 256 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() );
254 mItem->setSortKey(12,key); 257 mItem->setSortKey(12,key);
255 d = j->dtStart().date(); 258 d = j->dtStart().date();
256 key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 259 key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
257 mItem->setSortKey(1,key); 260 mItem->setSortKey(1,key);
258 mItem->setSortKey(7,key); 261 mItem->setSortKey(7,key);
259 262
260 return true; 263 return true;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index e960424..9c2ac82 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -110,77 +110,88 @@ class KOex2phonePrefs : public QDialog
110 mWriteBackFutureWeeks->setValue( 8 ); 110 mWriteBackFutureWeeks->setValue( 8 );
111 lay->addWidget( temphb ); 111 lay->addWidget( temphb );
112 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 112 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
113 lab->setAlignment (AlignHCenter ); 113 lab->setAlignment (AlignHCenter );
114 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 114 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
115 lay->addWidget( ok ); 115 lay->addWidget( ok );
116 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 116 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
117 lay->addWidget( cancel ); 117 lay->addWidget( cancel );
118 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 118 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
119 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 119 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
120 resize( 220, 240 ); 120 resize( 220, 240 );
121 qApp->processEvents(); 121 qApp->processEvents();
122 int dw = QApplication::desktop()->width(); 122 int dw = QApplication::desktop()->width();
123 int dh = QApplication::desktop()->height(); 123 int dh = QApplication::desktop()->height();
124 move( (dw-width())/2, (dh - height() )/2 ); 124 move( (dw-width())/2, (dh - height() )/2 );
125 } 125 }
126 126
127public: 127public:
128 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 128 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
129 QCheckBox* mWriteBackFuture; 129 QCheckBox* mWriteBackFuture;
130 QSpinBox* mWriteBackFutureWeeks; 130 QSpinBox* mWriteBackFutureWeeks;
131}; 131};
132 132
133QPixmap* sgListViewCompletedPix[6]; 133QPixmap* sgListViewCompletedPix[6];
134QPixmap* sgListViewJournalPix;
134 135
135 136
136int globalFlagBlockStartup; 137int globalFlagBlockStartup;
137MainWindow::MainWindow( QWidget *parent, const char *name ) : 138MainWindow::MainWindow( QWidget *parent, const char *name ) :
138 QMainWindow( parent, name ) 139 QMainWindow( parent, name )
139{ 140{
140 sgListViewCompletedPix[5] = &listviewPix; 141 sgListViewCompletedPix[5] = &listviewPix;
141 sgListViewCompletedPix[0] = &listviewPix0; 142 sgListViewCompletedPix[0] = &listviewPix0;
142 sgListViewCompletedPix[1] = &listviewPix20; 143 sgListViewCompletedPix[1] = &listviewPix20;
143 sgListViewCompletedPix[2] = &listviewPix40; 144 sgListViewCompletedPix[2] = &listviewPix40;
144 sgListViewCompletedPix[3] = &listviewPix60; 145 sgListViewCompletedPix[3] = &listviewPix60;
145 sgListViewCompletedPix[4] = &listviewPix80; 146 sgListViewCompletedPix[4] = &listviewPix80;
146 if ( sgListViewCompletedPix[5]->height() < 5 ) {
147 //int size = 12; 147 //int size = 12;
148 {
148 sgListViewCompletedPix[5]->resize( 11, 11 ); 149 sgListViewCompletedPix[5]->resize( 11, 11 );
149 sgListViewCompletedPix[5]->fill( Qt::white ); 150 sgListViewCompletedPix[5]->fill( Qt::white );
150 QPainter p ( sgListViewCompletedPix[5] ); 151 QPainter p ( sgListViewCompletedPix[5] );
151 p.drawRect( 0,0,11,11); 152 p.drawRect( 0,0,11,11);
152 p.drawLine ( 2, 5, 4 , 7 ) ; 153 p.drawLine ( 2, 5, 4 , 7 ) ;
153 p.drawLine ( 4 , 7 , 8, 3) ; 154 p.drawLine ( 4 , 7 , 8, 3) ;
154 int iii = 0; 155 int iii = 0;
155 for ( iii = 0; iii < 5; ++iii ) { 156 for ( iii = 0; iii < 5; ++iii ) {
156 sgListViewCompletedPix[iii]->resize( 11, 11 ); 157 sgListViewCompletedPix[iii]->resize( 11, 11 );
157 sgListViewCompletedPix[iii]->fill( Qt::white ); 158 sgListViewCompletedPix[iii]->fill( Qt::white );
158 QPainter p ( sgListViewCompletedPix[iii] ); 159 QPainter p ( sgListViewCompletedPix[iii] );
159 p.drawRect( 0,0,11,11); 160 p.drawRect( 0,0,11,11);
160 if ( iii ) 161 if ( iii )
161 p.fillRect( 1,1,iii*2,9,Qt::gray ); 162 p.fillRect( 1,1,iii*2,9,Qt::gray );
162 } 163 }
164 sgListViewJournalPix = &journalPix;
165 sgListViewJournalPix->resize( 11, 11 );
166 sgListViewJournalPix->fill( Qt::white );
167 {
168 QPainter p ( sgListViewJournalPix );
169 p.drawRect( 0,0,11,11);
170 p.drawLine( 2,3,5,3);
171 p.drawLine( 2,5,8,5);
172 p.drawLine( 2,7,6,7);
173 }
163 } 174 }
164 mClosed = false; 175 mClosed = false;
165 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 176 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
166 QString confFile = locateLocal("config","korganizerrc"); 177 QString confFile = locateLocal("config","korganizerrc");
167 QFileInfo finf ( confFile ); 178 QFileInfo finf ( confFile );
168 bool showWarning = !finf.exists(); 179 bool showWarning = !finf.exists();
169 setIcon(SmallIcon( "ko24" ) ); 180 setIcon(SmallIcon( "ko24" ) );
170 mBlockAtStartup = true; 181 mBlockAtStartup = true;
171 mFlagKeyPressed = false; 182 mFlagKeyPressed = false;
172 setCaption("KO/Pi"); 183 setCaption("KO/Pi");
173 KOPrefs *p = KOPrefs::instance(); 184 KOPrefs *p = KOPrefs::instance();
174 //KPimGlobalPrefs::instance()->setGlobalConfig(); 185 //KPimGlobalPrefs::instance()->setGlobalConfig();
175 p->mCurrentDisplayedView = 0; 186 p->mCurrentDisplayedView = 0;
176 if ( p->mHourSize > 22 ) 187 if ( p->mHourSize > 22 )
177 p->mHourSize = 22; 188 p->mHourSize = 22;
178 QMainWindow::ToolBarDock tbd; 189 QMainWindow::ToolBarDock tbd;
179 if ( p->mToolBarHor ) { 190 if ( p->mToolBarHor ) {
180 if ( p->mToolBarUp ) 191 if ( p->mToolBarUp )
181 tbd = Bottom; 192 tbd = Bottom;
182 else 193 else
183 tbd = Top; 194 tbd = Top;
184 } 195 }
185 else { 196 else {
186 if ( p->mToolBarUp ) 197 if ( p->mToolBarUp )
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index adab95d..41d5807 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -145,29 +145,29 @@ class MainWindow : public QMainWindow
145 QAction *mNewSubTodoAction; 145 QAction *mNewSubTodoAction;
146 QAction *mWeekAction; 146 QAction *mWeekAction;
147 QFont mWeekFont; 147 QFont mWeekFont;
148 QPixmap mWeekPixmap; 148 QPixmap mWeekPixmap;
149 QColor mWeekBgColor; 149 QColor mWeekBgColor;
150 150
151 QAction *mShowAction; 151 QAction *mShowAction;
152 QAction *mEditAction; 152 QAction *mEditAction;
153 QAction *mDeleteAction; 153 QAction *mDeleteAction;
154 QAction *mCloneAction; 154 QAction *mCloneAction;
155 QAction *mMoveAction; 155 QAction *mMoveAction;
156 QAction *mBeamAction; 156 QAction *mBeamAction;
157 QAction *mCancelAction; 157 QAction *mCancelAction;
158 158
159 QAction *mToggleNav; 159 QAction *mToggleNav;
160 QAction *mToggleFilter; 160 QAction *mToggleFilter;
161 QAction *mToggleAllday; 161 QAction *mToggleAllday;
162 QAction *actionFilterMenuTB; 162 QAction *actionFilterMenuTB;
163 163
164 void closeEvent( QCloseEvent* ce ); 164 void closeEvent( QCloseEvent* ce );
165 QTimer mSaveTimer; 165 QTimer mSaveTimer;
166 //bool mBlockSaveFlag; 166 //bool mBlockSaveFlag;
167 bool mCalendarModifiedFlag; 167 bool mCalendarModifiedFlag;
168 QPixmap loadPixmap( QString ); 168 QPixmap loadPixmap( QString );
169 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80; 169 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
170}; 170};
171 171
172 172
173#endif 173#endif