-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 | |||
@@ -62,16 +62,18 @@ | |||
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 | { |
@@ -147,17 +149,22 @@ bool ListItemVisitor::visit(Event *e) | |||
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 { |
@@ -233,16 +240,17 @@ bool ListItemVisitor::visit(Journal * j) | |||
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? |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index ee9589c..2bf46b9 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -17,16 +17,18 @@ | |||
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 ()); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index f945383..0367bea 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -124,21 +124,50 @@ class KOex2phonePrefs : public QDialog | |||
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; |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 1105783..9a8bc7f 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -157,12 +157,13 @@ class MainWindow : public QMainWindow | |||
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 |