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
@@ -69,49 +69,52 @@ protected:
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()) )
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index f6c9624..d87938a 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -318,58 +318,71 @@ void KOEventViewer::appendEvent(Event *event, int mode )
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());
@@ -397,52 +410,54 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
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)
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d8e940b..1f5afc0 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -304,49 +304,52 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
*/
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;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f9bc1ca..2fe80af 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -73,49 +73,52 @@ protected:
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();
@@ -174,49 +177,48 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
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;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 5efc247..a91074f 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -270,49 +270,55 @@ KOPrefs::KOPrefs() :
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()
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index e300067..e4e3dd7 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -248,37 +248,45 @@ class KOPrefs : public KPimPrefs
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
@@ -883,48 +883,80 @@ dummy =
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
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 3011458..3483e95 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -535,49 +535,52 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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;
}