summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-02-17 21:31:18 (UTC)
committer zautrix <zautrix>2005-02-17 21:31:18 (UTC)
commit8e8d2bd0c31eb272a7f26756252ff4930d0602bc (patch) (side-by-side diff)
tree8392e9ca561d1444bcd949e9f1aaf78f698cde98 /korganizer
parent002e4f8cea2352e4b9a046b98f66be946fbeb5fc (diff)
downloadkdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.zip
kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.gz
kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp5
-rw-r--r--korganizer/koeventviewer.cpp17
-rw-r--r--korganizer/kolistview.cpp5
-rw-r--r--korganizer/komonthview.cpp6
-rw-r--r--korganizer/koprefs.cpp8
-rw-r--r--korganizer/koprefs.h8
-rw-r--r--korganizer/koprefsdialog.cpp32
-rw-r--r--korganizer/kotodoview.cpp5
8 files changed, 79 insertions, 7 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 6a312b3..cead612 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -45,97 +45,100 @@ extern int globalFlagBlockAgendaItemPaint;
extern int globalFlagBlockAgendaItemUpdate;
#include "koprefs.h"
#include "koagendaitem.h"
//#include "koagendaitem.moc"
//--------------------------------------------------------------------------
QToolTipGroup *KOAgendaItem::mToolTipGroup = 0;
//--------------------------------------------------------------------------
class KOAgendaItemWhatsThis :public QWhatsThis
{
public:
KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { };
protected:
virtual QString text( const QPoint& )
{
return _view->getWhatsThisText() ;
}
private:
KOAgendaItem * _view;
};
KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
const char *name,WFlags) :
QWidget(parent, name), mIncidence(incidence), mDate(qd)
{
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
#endif
new KOAgendaItemWhatsThis(this);
int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
setWFlags ( wflags);
mAllDay = allday;
init ( incidence, qd );
setMouseTracking(true);
//setAcceptDrops(true);
xPaintCoord = -1;
yPaintCoord = -1;
}
QString KOAgendaItem::getWhatsThisText()
{
if ( mIncidence )
- return KIncidenceFormatter::instance()->getFormattedText( mIncidence );
+ return KIncidenceFormatter::instance()->getFormattedText( mIncidence,
+ KOPrefs::instance()->mWTshowDetails,
+ KOPrefs::instance()->mWTshowCreated,
+ KOPrefs::instance()->mWTshowChanged);
return "KOAgendaItem::getWhatsThisText()::internal error";
}
void KOAgendaItem::init ( Incidence *incidence, QDate qd )
{
mIncidence = incidence;
mDate = qd;
mFirstMultiItem = 0;
mNextMultiItem = 0;
mLastMultiItem = 0;
computeText();
if ( (incidence->type() == "Todo") &&
( !((static_cast<Todo*>(incidence))->isCompleted()) &&
((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
else
mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
}
else {
QStringList categories = mIncidence->categories();
QString cat = categories.first();
if (cat.isEmpty()) {
if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) )
mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
else
mBackgroundColor =KOPrefs::instance()->mEventColor;
} else {
mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
}
}
}
mColorGroup = QColorGroup( mBackgroundColor.light(),
mBackgroundColor.dark(),mBackgroundColor.light(),
mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
setBackgroundColor( mBackgroundColor );
setCellXY(0,0,1);
setCellXWidth(0);
setSubCell(0);
setSubCells(1);
setMultiItem(0,0,0);
startMove();
mSelected = true;
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f6c9624..d87938a 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -294,179 +294,194 @@ void KOEventViewer::appendEvent(Event *event, int mode )
mText.append(i18n("<p><b>On:</b> %1</p> ")
.arg(event->dtStartDateStr( shortDate )));
mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>")
.arg(event->dtStartTimeStr())
.arg(event->dtEndTimeStr()));
}
}
if (event->recurrence()->doesRecur()) {
QString recurText = event->recurrence()->recurrenceText();
addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>");
bool ok;
QDate start = QDate::currentDate();
QDateTime next;
next = event->getNextOccurence( QDateTime::currentDateTime() , &ok );
if ( ok ) {
addTag("p",i18n("<b>Next recurrence is on:</b>") );
addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate ));
mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true );
} else {
bool last;
QDate nextd;
nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last );
if ( last ) {
addTag("p",i18n("<b>Last recurrence was on:</b>") );
addTag("p", KGlobal::locale()->formatDate( nextd, shortDate ));
}
}
} else {
mMailSubject += i18n(" - " )+event->dtStartStr( true );
}
if (event->isAlarmEnabled()) {
Alarm *alarm =event->alarms().first() ;
QDateTime t = alarm->time();
int min = t.secsTo( event->dtStart() )/60;
QString s =i18n("( %1 min before )").arg( min );
addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
//addTag("p",s);
}
addTag("b",i18n("Access: "));
mText.append(event->secrecyStr()+"<br>");
+
+
+ if ( KOPrefs::instance()->mEVshowDetails ) {
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
addTag("p",event->description());
}
-
+ }
formatCategories(event);
formatReadOnly(event);
formatAttendees(event);
+ if ( KOPrefs::instance()->mEVshowCreated ) {
+ addTag("p",i18n("<b>Created: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
+
+ }
+ if ( KOPrefs::instance()->mEVshowChanged ) {
+ addTag("p",i18n("<b>Last modified: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
+
+ }
setText(mText);
//QWhatsThis::add(this,mText);
}
void KOEventViewer::appendTodo(Todo *event, int mode )
{
mMailSubject = "";
mCurrentIncidence = event;
topLevelWidget()->setCaption(i18n("Todo Viewer"));
bool shortDate = KOPrefs::instance()->mShortDateInViewer;
if (mode == 0 )
addTag("h2",event->summary());
else {
if ( mColorMode == 1 ) {
mText +="<font color=\"#00A000\">";
}
if ( mColorMode == 2 ) {
mText +="<font color=\"#B00000\">";
}
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +event->summary());
} else {
addTag("h2",i18n( "Remote: " ) +event->summary());
}
addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
if ( mColorMode )
mText += "</font>";
}
mMailSubject += i18n( "Todo " )+ event->summary();
if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
mText +="<font color=\"#B00000\">";
addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) );
mText += "</font>";
} else {
mText.append(i18n("<p><i>%1 % completed</i></p>")
.arg(event->percentComplete()));
}
if (event->cancelled ()) {
mText +="<font color=\"#B00000\">";
addTag("i",i18n("This todo has been cancelled!"));
mText.append("<br>");
mText += "</font>";
mMailSubject += i18n("(cancelled)");
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
mMailSubject += i18n(" at ") + event->location();
}
if (event->recurrence()->doesRecur()) {
QString recurText = event->recurrence()->recurrenceText();
addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
}
if (event->hasStartDate()) {
mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
mMailSubject += i18n(" - " )+event->dtDueStr( true );
}
addTag("b",i18n("Access: "));
mText.append(event->secrecyStr()+"<br>");
+ if ( KOPrefs::instance()->mEVshowDetails ) {
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
addTag("p",event->description());
}
+ }
formatCategories(event);
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
formatReadOnly(event);
formatAttendees(event);
if ( event->relatedTo() ) {
addTag("b",i18n("Parent todo:<br>"));
mText.append(event->relatedTo()->summary()+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>");
}
QPtrList<Incidence> Relations = event->relations();
Incidence *to;
if ( Relations.first() )
addTag("b",i18n("Sub todos:<br>"));
for (to=Relations.first();to;to=Relations.next()) {
mText.append( to->summary()+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>");
}
setText(mText);
}
void KOEventViewer::formatCategories(Incidence *event)
{
if (!event->categoriesStr().isEmpty()) {
if (event->categories().count() == 1) {
addTag("h3",i18n("Category"));
} else {
addTag("h3",i18n("Categories"));
}
addTag("p",event->categoriesStr());
}
}
void KOEventViewer::formatAttendees(Incidence *event)
{
QPtrList<Attendee> attendees = event->attendees();
if (attendees.count()) {
QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small);
QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small);
addTag("h3",i18n("Organizer"));
mText.append("<ul><li>");
#ifndef KORG_NOKABC
#ifdef DESKTOP_VERSION
KABC::AddressBook *add_book = KABC::StdAddressBook::self();
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d8e940b..1f5afc0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -280,97 +280,100 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
SLOT(setCat()),true);
//mPopupMenu->insertSeparator();
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Set alarm for selected..."),this,
SLOT(setAlarm()),true);
#ifndef DESKTOP_VERSION
mPopupMenu->insertSeparator();
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Beam selected via IR"),this,
SLOT(beamSelected()),true);
#endif
/*
mPopupMenu = new QPopupMenu;
mPopupMenu->insertItem(i18n("Edit Event"), this,
SLOT (editEvent()));
mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
SLOT (deleteEvent()));
mPopupMenu->insertSeparator();
mPopupMenu->insertItem(i18n("Show Dates"), this,
SLOT(showDates()));
mPopupMenu->insertItem(i18n("Hide Dates"), this,
SLOT(hideDates()));
*/
QObject::connect(mListView,SIGNAL( newEvent()),
this,SIGNAL(signalNewEvent()));
QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
this,SLOT(defaultItemAction(QListViewItem *)));
QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *,
const QPoint &, int )),
this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
SLOT(processSelectionChange(QListViewItem *)));
QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
SIGNAL(showIncidenceSignal(Incidence *)) );
readSettings(KOGlobals::config(),"KOListView Layout");
}
KOListView::~KOListView()
{
delete mPopupMenu;
}
QString KOListView::getWhatsThisText(QPoint p)
{
KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p );
if ( item )
- return KIncidenceFormatter::instance()->getFormattedText( item->data() );
+ return KIncidenceFormatter::instance()->getFormattedText( item->data(),
+ KOPrefs::instance()->mWTshowDetails,
+ KOPrefs::instance()->mWTshowCreated,
+ KOPrefs::instance()->mWTshowChanged);
return i18n("That is the list view" );
}
void KOListView::updateList()
{
// qDebug(" KOListView::updateList() ");
}
void KOListView::addCat( )
{
setCategories( false );
}
void KOListView::setCat()
{
setCategories( true );
}
void KOListView::setAlarm()
{
KOAlarmPrefs kap( this);
if ( !kap.exec() )
return;
QStringList itemList;
QPtrList<KOListViewItem> sel ;
QListViewItem *qitem = mListView->firstChild ();
while ( qitem ) {
if ( qitem->isSelected() ) {
Incidence* inc = ((KOListViewItem *) qitem)->data();
if ( inc->type() != "Journal" ) {
if ( inc->type() == "Todo" ) {
if ( ((Todo*)inc)->hasDueDate() )
sel.append(((KOListViewItem *)qitem));
} else
sel.append(((KOListViewItem *)qitem));
}
}
qitem = qitem->nextSibling();
}
int count = 0;
KOListViewItem * item, *temp;
item = sel.first();
Incidence* inc;
while ( item ) {
inc = item->data();
++count;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f9bc1ca..2fe80af 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -49,97 +49,100 @@
#include "koprefs.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include "koglobals.h"
#include <libkcal/kincidenceformatter.h>
#include "komonthview.h"
#define PIXMAP_SIZE 5
#ifdef DESKTOP_VERSION
QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
#endif
class KNOWhatsThis :public QWhatsThis
{
public:
KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
//~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
protected:
virtual QString text( const QPoint& p)
{
return _wid->getWhatsThisText(p) ;
};
private:
KNoScrollListBox* _wid;
};
KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
: QListBox(parent, name, WRepaintNoErase)
{
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
mWT = new KNOWhatsThis(this);
}
KNoScrollListBox::~KNoScrollListBox()
{
}
QString KNoScrollListBox::getWhatsThisText(QPoint p)
{
QListBoxItem* item = itemAt ( p );
if ( ! item ) {
return i18n("Click in the cell\nto add an event!");
}
- return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence());
+ return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence(),
+ KOPrefs::instance()->mWTshowDetails,
+ KOPrefs::instance()->mWTshowCreated,
+ KOPrefs::instance()->mWTshowChanged);
}
void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
{
switch(e->key()) {
case Key_Right:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
return;
}
scrollBy(10,0);
break;
case Key_Left:
if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
return;
}
scrollBy(-10,0);
break;
case Key_Up:
if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
}
setCurrentItem((currentItem()+count()-1)%count());
if(!itemVisible(currentItem())) {
if((unsigned int) currentItem() == (count()-1)) {
setTopItem(currentItem()-numItemsVisible()+1);
} else {
setTopItem(topItem()-1);
}
}
break;
case Key_Down:
if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
}
setCurrentItem((currentItem()+1)%count());
if(!itemVisible(currentItem())) {
if(currentItem() == 0) {
setTopItem(0);
} else {
setTopItem(topItem()+1);
}
}
@@ -150,97 +153,96 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
break;
case Key_Shift:
emit shiftDown();
break;
default:
e->ignore();
break;
}
}
void KNoScrollListBox::oneDown()
{
setCurrentItem((currentItem()+1)%count());
if(!itemVisible(currentItem())) {
if(currentItem() == 0) {
setTopItem(0);
} else {
setTopItem(topItem()+1);
}
}
}
void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
{
switch(e->key()) {
case Key_Shift:
emit shiftUp();
break;
default:
break;
}
}
void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
{
QListBox::mousePressEvent(e);
if(e->button() == RightButton) {
emit rightClick();
}
}
MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
: QListBoxItem()
{
setText( s );
mIncidence = incidence;
mDate = qd;
- // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
mRecur = false;
mAlarm = false;
mReply = false;
mInfo = false;
}
void MonthViewItem::paint(QPainter *p)
{
#if QT_VERSION >= 0x030000
bool sel = isSelected();
#else
bool sel = selected();
#endif
if (KOPrefs::instance()->mMonthViewUsesCategoryColor)
{
p->setBackgroundColor( palette().color( QPalette::Normal, \
sel ? QColorGroup::Highlight : QColorGroup::Background ) );
p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) );
}
int x = 1;
int y = 3;//(height() - mRecurPixmap.height()) /2;
int size = PIXMAP_SIZE;
if ( QApplication::desktop()->width() < 300 )
size = 3;
if ( KOPrefs::instance()->mMonthShowIcons ) {
if ( mInfo ) {
p->fillRect ( x, y,size,size, Qt::darkGreen );
x += size + 1;
}
if ( mRecur ) {
p->fillRect ( x, y,size,size, Qt::blue );
x += size + 1;
}
if ( mAlarm ) {
p->fillRect ( x, y,size,size, Qt::red );
x += size + 1;
}
if ( mReply ) {
p->fillRect ( x, y,size,size, Qt::yellow );
x += size + 1;
}
}
QFontMetrics fm = p->fontMetrics();
int yPos;
int pmheight = size;
if( pmheight < fm.height() )
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 5efc247..a91074f 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -246,97 +246,103 @@ KOPrefs::KOPrefs() :
addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
#ifdef DESKTOP_VERSION
addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
#else
addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
#endif
addItemInt("Day Begins",&mDayBegins,7);
addItemInt("Working Hours Start",&mWorkingHoursStart,8);
addItemInt("Working Hours End",&mWorkingHoursEnd,17);
addItemBool("Exclude Holidays",&mExcludeHolidays,true);
addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
addItemBool("Full View Month",&mFullViewMonth,true);
addItemBool("Full View Todo",&mFullViewTodo,true);
addItemBool("Quick Todo",&mEnableQuickTodo,false);
addItemInt("Next X Days",&mNextXDays,3);
KPrefs::setCurrentGroup("Printer");
KPrefs::setCurrentGroup("Layout");
addItemBool("CompactDialogs",&mCompactDialogs,false);
addItemBool("VerticalScreen",&mVerticalScreen,true);
KPrefs::setCurrentGroup("KOrganizer Plugins");
addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
KPrefs::setCurrentGroup("Group Scheduling");
addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
addItemStringList("AdditionalMails",&mAdditionalMails,"");
addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
KPrefs::setCurrentGroup( "Editors" );
addItemStringList( "EventTemplates", &mEventTemplates );
addItemStringList( "TodoTemplates", &mTodoTemplates );
addItemInt("DestinationPolicy",&mDestination,standardDestination);
-
+ KPrefs::setCurrentGroup( "ViewOptions" );
+ addItemBool("EVshowDetails",&mEVshowDetails,true);
+ addItemBool("EVshowCreated",&mEVshowCreated,true);
+ addItemBool("EVshowChanged",&mEVshowChanged,true);
+ addItemBool("WTshowDetails",&mWTshowDetails,false);
+ addItemBool("WTshowCreated",&mWTshowCreated,false);
+ addItemBool("WTshowChanged",&mWTshowChanged,false);
}
KOPrefs::~KOPrefs()
{
if (mInstance == this)
mInstance = insd.setObject(0);
//qDebug("KOPrefs::~KOPrefs() ");
}
KOPrefs *KOPrefs::instance()
{
if (!mInstance) {
mInstance = insd.setObject(new KOPrefs());
mInstance->readConfig();
}
return mInstance;
}
void KOPrefs::usrSetDefaults()
{
}
void KOPrefs::fillMailDefaults()
{
if (mName.isEmpty()) mName = i18n("Anonymous");
if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
}
void KOPrefs::setTimeZoneIdDefault()
{
;
}
void KOPrefs::setAllDefaults()
{
setCategoryDefaults();
mEventSummaryUser = getDefaultList() ;
mTodoSummaryUser = getDefaultList() ;
mLocationDefaults = getLocationDefaultList();
}
void KOPrefs::setCategoryDefaults()
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index e300067..e4e3dd7 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -224,61 +224,69 @@ class KOPrefs : public KPimPrefs
int mIMIPAutoFreeBusy;
int mIMIPAutoFreeBusyReply;
QStringList mTodoTemplates;
QStringList mEventTemplates;
int mDestination;
bool mEditOnDoubleClick;
bool mViewChangeHoldFullscreen;
bool mViewChangeHoldNonFullscreen;
bool mCenterOnCurrentTime;
bool mSetTimeToDayStartAt;
bool mHighlightCurrentDay;
bool mUseHighlightLightColor;
bool mListViewMonthTimespan;
bool mWNViewShowsParents;
bool mWNViewShowsPast;
bool mWNViewShowLocation;
bool mTodoViewShowsPercentage;
bool mTodoViewUsesCatColors;
bool mMonthViewUsesBigFont;
bool mTodoViewUsesSmallFont;
bool mTodoViewUsesForegroundColor;
bool mMonthViewUsesForegroundColor;
bool mHightlightDateTimeEdit;
bool mShortDateInViewer;
bool mShowDateNavigator;
QStringList mLocationDefaults;
QStringList mEventSummaryUser;
QStringList mTodoSummaryUser;
bool mUseInternalAlarmNotification;
int mAlarmPlayBeeps;
int mAlarmSuspendTime;
int mAlarmSuspendCount;
int mAlarmBeepInterval;
int mOldLanguage;
int mOldLoadedLanguage;
QString mActiveSyncPort;
QString mActiveSyncIP;
+ // settings for eventviewer
+ bool mEVshowDetails;
+ bool mEVshowCreated;
+ bool mEVshowChanged;
+ bool mWTshowDetails;
+ bool mWTshowCreated;
+ bool mWTshowChanged;
+
private:
QDict<QColor> mCategoryColors;
QColor mDefaultCategoryColor;
QFont mDefaultTimeBarFont;
QFont mDefaultViewFont;
QFont mDefaultMonthViewFont;
QString mName;
QString mEmail;
};
#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 452d019..443508d 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -859,96 +859,128 @@ dummy =
&(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Small To-do view uses smaller font"),
&(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Todo view uses category colors"),
&(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
QWidget* wid = new QWidget( topFrame );
// Todo due today color
KPrefsDialogWidColor *todoDueTodayColor =
addWidColor(i18n("Todo due today color:"),
&(KOPrefs::instance()->mTodoDueTodayColor),wid);
QHBoxLayout *widLayout = new QHBoxLayout(wid);
widLayout->addWidget( todoDueTodayColor->label() );
widLayout->addWidget( todoDueTodayColor->button() );
topLayout->addWidget(wid,ii++,0);
//topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
// Todo overdue color
wid = new QWidget( topFrame );
widLayout = new QHBoxLayout(wid);
KPrefsDialogWidColor *todoOverdueColor =
addWidColor(i18n("Todo overdue color:"),
&(KOPrefs::instance()->mTodoOverdueColor),wid);
widLayout->addWidget(todoOverdueColor->label());
widLayout->addWidget(todoOverdueColor->button());
topLayout->addWidget(wid,ii++,0);
dummy =
addWidBool(i18n("Colors are applied to text"),
&(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Allday Agenda view shows todos"),
&(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
+ topFrame = addPage(i18n("View Options"),0,0);
+
+ topLayout = new QGridLayout(topFrame,4,1);
+ topLayout->setSpacing(spacingHint());
+ topLayout->setMargin(marginHint());
+ ii = 0;
+ lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
+ topLayout->addWidget(lab ,ii++,0);
+
+ dummy = addWidBool(i18n("Details"),
+ &(KOPrefs::instance()->mEVshowDetails),topFrame);
+ topLayout->addWidget(dummy->checkBox(),ii++,0);
+ dummy = addWidBool(i18n("Created time"),
+ &(KOPrefs::instance()->mEVshowCreated),topFrame);
+ topLayout->addWidget(dummy->checkBox(),ii++,0);
+ dummy = addWidBool(i18n("Last modified time"),
+ &(KOPrefs::instance()->mEVshowChanged),topFrame);
+ topLayout->addWidget(dummy->checkBox(),ii++,0);
+
+
+ lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
+ topLayout->addWidget(lab ,ii++,0);
+
+ dummy = addWidBool(i18n("Details"),
+ &(KOPrefs::instance()->mWTshowDetails),topFrame);
+ topLayout->addWidget(dummy->checkBox(),ii++,0);
+ dummy = addWidBool(i18n("Created time"),
+ &(KOPrefs::instance()->mWTshowCreated),topFrame);
+ topLayout->addWidget(dummy->checkBox(),ii++,0);
+ dummy = addWidBool(i18n("Last modified time"),
+ &(KOPrefs::instance()->mWTshowChanged),topFrame);
+ topLayout->addWidget(dummy->checkBox(),ii++,0);
topFrame = addPage(i18n("Alarm"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,2,1);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
dummy =
addWidBool(i18n("Use internal alarm notification"),
&(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
topLayout->addWidget(dummy->checkBox(),iii++,0);
lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
topLayout->addWidget(lab ,iii++,0);
#ifndef DESKTOP_VERSION
lab->setAlignment( AlignLeft|WordBreak|AlignTop);
#else
lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
#endif
QHBox* dummyBox = new QHBox(topFrame);
new QLabel(i18n("Play beeps count:"),dummyBox);
mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
dummyBox = new QHBox(topFrame);
new QLabel(i18n("Beeps interval in sec:"),dummyBox);
mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
dummyBox = new QHBox(topFrame);
new QLabel(i18n("Default suspend time in min:"),dummyBox);
mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
dummyBox = new QHBox(topFrame);
new QLabel(i18n("Auto suspend count:"),dummyBox);
mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
topLayout->addWidget(dummyBox,iii++,0);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 3011458..3483e95 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -511,97 +511,100 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
*/
connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
const QPoint &,int ) ),
SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
SLOT( itemClicked( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
SLOT( itemDoubleClicked( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
SLOT( updateView() ) );
connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
SLOT( todoModified(Todo *, int) ) );
connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
SLOT( itemStateChanged( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
SLOT( itemStateChanged( QListViewItem * ) ) );
connect( mTodoListView, SIGNAL( paintNeeded() ),
SLOT( paintNeeded()) );
#if 0
connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
SLOT(selectionChanged(QListViewItem *)));
#endif
connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
connect( mTodoListView, SIGNAL(selectionChanged() ),
SLOT( processSelectionChange() ) );
connect( mQuickAdd, SIGNAL( returnPressed () ),
SLOT( addQuickTodo() ) );
}
KOTodoView::~KOTodoView()
{
delete mDocPrefs;
}
QString KOTodoView::getWhatsThisText(QPoint p)
{
KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
if ( item )
- return KIncidenceFormatter::instance()->getFormattedText( item->todo() );
+ return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
+ KOPrefs::instance()->mWTshowDetails,
+ KOPrefs::instance()->mWTshowCreated,
+ KOPrefs::instance()->mWTshowChanged);
return i18n("That is the todo view" );
}
void KOTodoView::jumpToDate ()
{
// if (mActiveItem) {
// mActiveItem->todo());
// if ( mActiveItem->todo()->hasDueDate() )
// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
}
void KOTodoView::paintNeeded()
{
if ( mPendingUpdateBeforeRepaint ) {
updateView();
mPendingUpdateBeforeRepaint = false;
}
}
void KOTodoView::paintEvent(QPaintEvent * pevent)
{
if ( mPendingUpdateBeforeRepaint ) {
updateView();
mPendingUpdateBeforeRepaint = false;
}
KOrg::BaseView::paintEvent( pevent);
}
void KOTodoView::updateView()
{
pendingSubtodo = 0;
if ( mBlockUpdate ) {
return;
}
if ( !isVisible() ) {
mPendingUpdateBeforeRepaint = true;
return;
}
//qDebug("KOTodoView::updateView() %x", this);
if ( isFlatDisplay ) {
displayAllFlat();
return;
}
//qDebug("update ");
// kdDebug() << "KOTodoView::updateView()" << endl;
QFont fo = KOPrefs::instance()->mTodoViewFont;
mTodoListView->clear();
if ( mName == "todolistsmall" ) {
if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {