summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (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
@@ -59,24 +59,25 @@
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:
@@ -154,25 +155,25 @@ bool ListItemVisitor::visit(Event *e)
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 }
@@ -216,33 +217,35 @@ bool ListItemVisitor::visit(Todo *t)
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 ));
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index e960424..9c2ac82 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -122,53 +122,64 @@ class KOex2phonePrefs : public QDialog
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();
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index adab95d..41d5807 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -157,17 +157,17 @@ class MainWindow : public QMainWindow
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