summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-07-06 19:41:06 (UTC)
committer zautrix <zautrix>2005-07-06 19:41:06 (UTC)
commit984e2132871c79990f6d9eac5702f7f32186f235 (patch) (unidiff)
tree2bc4b50ee8b8284e74fd53bdfb78d6d3107806a0 /korganizer
parentc79a8a4950c098fa6f5a7ae8396feb4dd3a91577 (diff)
downloadkdepimpi-984e2132871c79990f6d9eac5702f7f32186f235.zip
kdepimpi-984e2132871c79990f6d9eac5702f7f32186f235.tar.gz
kdepimpi-984e2132871c79990f6d9eac5702f7f32186f235.tar.bz2
fixxx
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
@@ -65,12 +65,13 @@
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
@@ -160,13 +161,13 @@ bool ListItemVisitor::visit(Event *e)
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 {
@@ -222,21 +223,23 @@ bool ListItemVisitor::visit(Todo *t)
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,"---");
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index e960424..9c2ac82 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -128,26 +128,27 @@ public:
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) ;
@@ -157,12 +158,22 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
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();
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index adab95d..41d5807 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -163,11 +163,11 @@ class MainWindow : public QMainWindow
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