summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp10
-rw-r--r--korganizer/main.cpp2
-rw-r--r--korganizer/mainwindow.cpp31
-rw-r--r--korganizer/mainwindow.h1
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
@@ -58,24 +58,26 @@
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koglobals.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "kolistview.h"
#include "koeventviewer.h"
+extern QPixmap* sgListViewCompletedPix[6];
+
class KOListViewWhatsThis :public QWhatsThis
{
public:
KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
protected:
virtual QString text( const QPoint& p)
{
return _view->getWhatsThisText(p) ;
}
private:
QWidget* _wid;
@@ -143,25 +145,30 @@ bool ListItemVisitor::visit(Event *e)
QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
mItem->setSortKey(1,key);
t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
mItem->setSortKey(3,key);
return true;
}
bool ListItemVisitor::visit(Todo *t)
{
- mItem->setText(0,i18n("Todo: %1").arg(t->summary()));
+ mItem->setText(0,t->summary());
+ if ( t->isCompleted() ) {
+ mItem->setSortKey(0,"99"+ t->summary().left(10));
+ } else
+ mItem->setSortKey(0,QString::number( t->percentComplete() )+ t->summary().left(10));
+ mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20]));
if (t->hasStartDate()) {
mItem->setText(1,t->dtStartDateStr());
if (t->doesFloat()) {
mItem->setText(2,"---");
} else {
mItem->setText(2,t->dtStartTimeStr());
}
} else {
mItem->setText(1,"---");
mItem->setText(2,"---");
}
mItem->setText(3,"---");
@@ -229,24 +236,25 @@ bool ListItemVisitor::visit(Journal * j)
QDate d = j->dtStart().date();
key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
mItem->setSortKey(1,key);
mItem->setSortKey(7,key);
return true;
}
KOListView::KOListView(Calendar *calendar, QWidget *parent,
const char *name)
: KOEventView(calendar, parent, name)
{
+
mActiveItem = 0;
mListView = new KOListViewListView(this);
mListView->addColumn(i18n("Summary"));
mListView->addColumn(i18n("Start Date"));
mListView->addColumn(i18n("Start Time"));
mListView->addColumn(i18n("End Date"));
mListView->addColumn(i18n("End Time"));
mListView->addColumn(i18n("Alarm")); // alarm set?
mListView->addColumn(i18n("Recurs")); // recurs?
mListView->addColumn(i18n("Due Date"));
mListView->addColumn(i18n("Due Time"));
mListView->addColumn(i18n("Cancelled"));
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index ee9589c..2bf46b9 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -13,24 +13,26 @@
#include <qsgistyle.h>
#include <stdlib.h>
#endif
#include <qtextcodec.h>
#include <qdir.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <stdio.h>
#include "mainwindow.h"
#include <libkdepim/kpimglobalprefs.h>
void dumpMissing();
+
+
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
QApplication::setStyle( new QPlatinumStyle ());
#ifdef _WIN32_
QString hdir ( getenv( "HOME") );
if ( hdir.isEmpty() ) {
QString hd ("C:/" );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index f945383..0367bea 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -120,29 +120,58 @@ class KOex2phonePrefs : public QDialog
qApp->processEvents();
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
move( (dw-width())/2, (dh - height() )/2 );
}
public:
QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
QCheckBox* mWriteBackFuture;
QSpinBox* mWriteBackFutureWeeks;
};
+QPixmap* sgListViewCompletedPix[6];
+
+
int globalFlagBlockStartup;
MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
QMainWindow( parent, name )
{
-
+ sgListViewCompletedPix[5] = &listviewPix;
+ sgListViewCompletedPix[0] = &listviewPix0;
+ sgListViewCompletedPix[1] = &listviewPix20;
+ sgListViewCompletedPix[2] = &listviewPix40;
+ sgListViewCompletedPix[3] = &listviewPix60;
+ sgListViewCompletedPix[4] = &listviewPix80;
+ if ( sgListViewCompletedPix[5]->height() < 5 ) {
+ int size = 12;
+ sgListViewCompletedPix[5]->resize( 11, 11 );
+ sgListViewCompletedPix[5]->fill( Qt::white );
+ QPainter p ( sgListViewCompletedPix[5] );
+ p.drawRect( 0,0,11,11);
+ int half = size/2;
+ int heihei = size/2;
+ int x = 1;
+ p.drawLine ( 2, 5, 4 , 7 ) ;
+ p.drawLine ( 4 , 7 , 8, 3) ;
+ int iii = 0;
+ for ( iii = 0; iii < 5; ++iii ) {
+ sgListViewCompletedPix[iii]->resize( 11, 11 );
+ sgListViewCompletedPix[iii]->fill( Qt::white );
+ QPainter p ( sgListViewCompletedPix[iii] );
+ p.drawRect( 0,0,11,11);
+ if ( iii )
+ p.fillRect( 1,1,iii*2,9,Qt::gray );
+ }
+ }
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KO/Pi");
KOPrefs *p = KOPrefs::instance();
KPimGlobalPrefs::instance()->setGlobalConfig();
p->mCurrentDisplayedView = 0;
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 1105783..9a8bc7f 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -153,16 +153,17 @@ class MainWindow : public QMainWindow
QAction *mCancelAction;
QAction *mToggleNav;
QAction *mToggleFilter;
QAction *mToggleAllday;
QAction *actionFilterMenuTB;
void closeEvent( QCloseEvent* ce );
QTimer mSaveTimer;
//bool mBlockSaveFlag;
bool mCalendarModifiedFlag;
QPixmap loadPixmap( QString );
+ QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80;
};
#endif