summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-08 10:54:05 (UTC)
committer zautrix <zautrix>2005-04-08 10:54:05 (UTC)
commit59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef (patch) (side-by-side diff)
treeab604082029c081fa8725c5535a51a23bb963ef2
parentc82f9b40f6023dc7b39ac555cba8c4c313f15ca8 (diff)
downloadkdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.zip
kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.tar.gz
kdepimpi-59fb8a0ac35bf3b81f1c4e2e4fc6b61356d064ef.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp17
-rw-r--r--kabc/addressee.h3
-rw-r--r--kabc/field.cpp6
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp2
-rw-r--r--korganizer/koagendaitem.cpp28
-rw-r--r--korganizer/komonthview.cpp21
6 files changed, 36 insertions, 41 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 7f592e9..155ce24 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -48,13 +48,12 @@ static bool matchBinaryPatternP( int value, int pattern );
struct Addressee::AddresseeData : public KShared
{
QString uid;
QString name;
QString formattedName;
- QString defaultFormattedName;
QString familyName;
QString givenName;
QString additionalName;
QString prefix;
QString suffix;
QString nickName;
@@ -745,39 +744,23 @@ void Addressee::setFormattedName( const QString &formattedName )
{
if ( formattedName == mData->formattedName ) return;
detach();
mData->empty = false;
mData->formattedName = formattedName;
}
-void Addressee::setDefaultFormattedName( const QString &formattedName )
-{
- if ( formattedName == mData->defaultFormattedName ) return;
- detach();
- mData->empty = false;
- mData->defaultFormattedName = formattedName;
-}
QString Addressee::formattedName() const
{
return mData->formattedName;
}
-QString Addressee::defaultFormattedName() const
-{
- return mData->defaultFormattedName;
-}
QString Addressee::formattedNameLabel()
{
return i18n("Formatted Name");
}
-QString Addressee::defaultFormattedNameLabel()
-{
- return i18n("Def.Formatted Name");
-}
-
void Addressee::setFamilyName( const QString &familyName )
{
if ( familyName == mData->familyName ) return;
detach();
mData->empty = false;
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 0d688f8..a2fbcf5 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -151,23 +151,20 @@ class Addressee
static QString nameLabel();
/**
Set formatted name.
*/
void setFormattedName( const QString &formattedName );
- void setDefaultFormattedName( const QString &formattedName );
/**
Return formatted name.
*/
QString formattedName() const;
- QString defaultFormattedName() const;
/**
Return translated label for formattedName field.
*/
static QString formattedNameLabel();
- static QString defaultFormattedNameLabel();
/**
Set family name.
*/
void setFamilyName( const QString &familyName );
/**
diff --git a/kabc/field.cpp b/kabc/field.cpp
index 5c561c3..fd51026 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -84,13 +84,12 @@ class Field::FieldImpl
Role,
Organization,
Note,
Url,
Resource,
Sip,
- DefaultFormattedName,
MobileWorkPhone,
MobileHomePhone
};
int fieldId() { return mFieldId; }
int category() { return mCategory; }
@@ -126,14 +125,12 @@ Field::~Field()
QString Field::label()
{
switch ( mImpl->fieldId() ) {
case FieldImpl::FormattedName:
return Addressee::formattedNameLabel();
- case FieldImpl::DefaultFormattedName:
- return Addressee::defaultFormattedNameLabel();
case FieldImpl::FamilyName:
return Addressee::familyNameLabel();
case FieldImpl::GivenName:
return Addressee::givenNameLabel();
case FieldImpl::AdditionalName:
return Addressee::additionalNameLabel();
@@ -245,14 +242,12 @@ QString Field::categoryLabel( int category )
QString Field::value( const KABC::Addressee &a )
{
switch ( mImpl->fieldId() ) {
case FieldImpl::FormattedName:
return a.formattedName();
- case FieldImpl::DefaultFormattedName:
- return a.defaultFormattedName();
case FieldImpl::FamilyName:
return a.familyName();
case FieldImpl::GivenName:
return a.givenName();
case FieldImpl::AdditionalName:
return a.additionalName();
@@ -405,13 +400,12 @@ bool Field::isCustom()
}
Field::List Field::allFields()
{
if ( mAllFields.isEmpty() ) {
createField( FieldImpl::FormattedName, Frequent );
- createField( FieldImpl::DefaultFormattedName, Frequent );
createField( FieldImpl::FamilyName, Frequent );
createField( FieldImpl::GivenName, Frequent );
createField( FieldImpl::AdditionalName );
createField( FieldImpl::Prefix );
createField( FieldImpl::Suffix );
createField( FieldImpl::NickName, Personal );
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index b3da428..294ce7d 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -53,13 +53,13 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
{
mAlarmDialog = new AlarmDialog( 0 );
mPopUp = new QPopupMenu( this );
mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) );
mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) );
mPopUp->insertSeparator();
- mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) );
+ mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) );
mPopUp->insertSeparator();
mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) );
mPopUp->insertSeparator();
mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) );
mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) );
mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) );
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 23afe7a..e545ca8 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -440,28 +440,37 @@ void KOAgendaItem::resizePixmap( int w , int h )
paintPixSel()->resize( w, h );
}
QPixmap * KOAgendaItem::paintPix()
{
static QPixmap* mPaintPix = 0;
- if ( ! mPaintPix )
- mPaintPix = new QPixmap(1,1);
+ if ( ! mPaintPix ) {
+ int w = QApplication::desktop()->width();
+ int h = QApplication::desktop()->height();
+ mPaintPix = new QPixmap(w,h);
+ }
return mPaintPix ;
}
QPixmap * KOAgendaItem::paintPixAllday()
{
static QPixmap* mPaintPixA = 0;
- if ( ! mPaintPixA )
- mPaintPixA = new QPixmap(1,1);
+ if ( ! mPaintPixA ) {
+ int w = QApplication::desktop()->width();
+ int h = QApplication::desktop()->height()/3;
+ mPaintPixA = new QPixmap(w,h);
+ }
return mPaintPixA ;
}
QPixmap * KOAgendaItem::paintPixSel()
{
static QPixmap* mPaintPixSel = 0;
- if ( ! mPaintPixSel )
- mPaintPixSel = new QPixmap(1,1);
+ if ( ! mPaintPixSel ) {
+ int w = QApplication::desktop()->width();
+ int h = QApplication::desktop()->height();
+ mPaintPixSel = new QPixmap(w,h);
+ }
return mPaintPixSel ;
}
void KOAgendaItem::paintEvent ( QPaintEvent *e )
{
if ( globalFlagBlockAgendaItemPaint )
@@ -522,24 +531,23 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
}
//qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
}
void KOAgendaItem::computeText()
{
-
mDisplayedText = mIncidence->summary();
if ( (mIncidence->type() == "Todo") ) {
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
else if ( !(mIncidence->doesFloat()))
mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
}
} else {
if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
- mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
+ mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
if ( mAllDay ) {
if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
}
}
@@ -550,13 +558,13 @@ void KOAgendaItem::computeText()
if ( mAllDay )
mDisplayedText += " (";
else
mDisplayedText += "\n(";
mDisplayedText += mIncidence->location() +")";
}
-
+#ifdef DESKTOP_VERSION
QString tipText = mIncidence->summary();
if ( !mIncidence->doesFloat() ) {
if ( mIncidence->type() == "Event" ) {
if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
@@ -580,13 +588,13 @@ void KOAgendaItem::computeText()
}
if (!mIncidence->location().isEmpty()) {
tipText += "\n"+i18n("Location: ")+mIncidence->location();
}
QToolTip::add(this,tipText,toolTipGroup(),"");
-
+#endif
}
void KOAgendaItem::updateItem()
{
computeText();
//qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 4dfb9df..65d6acf 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -638,12 +638,16 @@ void MonthViewCell::startUpdateCell()
}
#endif
}
int MonthViewCell::insertEvent(Event *event)
{
+ bool useToolTips = true;
+#ifndef DEKSTOP_VERSION
+ useToolTips = false;
+#endif
QString mToolTipText;
setFocusPolicy(WheelFocus);
if ( !(event->doesRecur() == Recurrence::rNone) ) {
if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
return mdayCount;
else
@@ -684,24 +688,30 @@ int MonthViewCell::insertEvent(Event *event)
time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
else if ( mDate == event->dtEnd().date () )
time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
}
text = time + event->summary();
- mToolTipText += prefix + text;
+ if ( useToolTips )
+ mToolTipText += prefix + text;
} else {
if (event->doesFloat()) {
text = event->summary();
- mToolTipText += text;
+ if ( useToolTips )
+ mToolTipText += text;
}
else {
text = KGlobal::locale()->formatTime(event->dtStart().time());
text += " " + event->summary();
- mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
+ if ( useToolTips )
+ mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
}
}
+ if ( useToolTips && ! event->location().isEmpty() ) {
+ mToolTipText += " (" + event->location() +")";
+ }
MonthViewItem *item ;
if ( mAvailItemList.count() ) {
item = mAvailItemList.first();
mAvailItemList.remove( item );
item->recycle( event, mDate, text );
@@ -761,13 +771,14 @@ int MonthViewCell::insertEvent(Event *event)
break;
}
++pos;
}
insertItem( item ,pos);
}
- mToolTip.append( mToolTipText );
+ if ( useToolTips )
+ mToolTip.append( mToolTipText );
return mdayCount;
}
void MonthViewCell::insertTodo(Todo *todo)
{
setFocusPolicy(WheelFocus);
QString text;
@@ -813,13 +824,15 @@ void MonthViewCell::insertTodo(Todo *todo)
}
item->setPalette( pal );
item->setRecur( todo->recurrence()->doesRecur() );
item->setAlarm( todo->isAlarmEnabled() );
item->setMoreInfo( todo->description().length() > 0 );
insertItem( item , count());
+#ifdef DESKTOP_VERSION
mToolTip.append( text );
+#endif
}
void MonthViewCell::repaintfinishUpdateCell()
{
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
while ( mitem ) {
mitem->setBlockRepaint( false );