summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/koeditorgeneraltodo.cpp7
-rw-r--r--korganizer/koeventviewer.cpp10
-rw-r--r--korganizer/komonthview.cpp61
-rw-r--r--korganizer/komonthview.h6
-rw-r--r--korganizer/koviewmanager.cpp5
6 files changed, 48 insertions, 45 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index e9ba8db..523c054 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1221,10 +1221,10 @@
{ "Save as Event template","Speichere als Vorlage" },
{ "Load Event template","Lade Termin Vorlage" },
{ "Save as Journal template","Speichere als Journal Vorlage" },
{ "Insert Journal template","Füge Journal Vorlage ein" },
-{ "","" },
-{ "","" },
+{ "Sub todos:<br>","Unter Todos:<br>" },
+{ "Parent todo:<br>","Über Todo:<br>" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index cd78f54..ce66863 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -159,10 +159,13 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) );
mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
- if ( QApplication::desktop()->width() < 320 ) {
- mCompleteDateEdit->setMaximumWidth( 85 );
+ if ( QApplication::desktop()->width() <= 480 ) {
+ if ( QApplication::desktop()->width() < 320 )
+ mCompleteDateEdit->setMaximumWidth( 85 );
+ else
+ mCompleteDateEdit->setMaximumWidth( 130 );
topLayout->setSpacing( 0 );
}
}
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 2faf18f..de11c13 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -420,9 +420,9 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
formatReadOnly(event);
formatAttendees(event);
if ( event->relatedTo() ) {
- addTag("b",i18n("Parent todo: "));
+ 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;
@@ -533,13 +533,13 @@ void KOEventViewer::formatAttendees(Incidence *event)
if (!a->email().isEmpty()) {
if (iconPath) {
mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">";
if ( a->RSVP() ) {
- ++a_count;
+ ++a_count_nr;
mText += "<IMG src=\"" + iconPath + "\">";
}
else {
- ++a_count_nr;
+ ++a_count;
mText += "<IMG src=\"" + NOiconPath + "\">";
}
mText += "</a>\n";
}
@@ -549,9 +549,9 @@ void KOEventViewer::formatAttendees(Incidence *event)
if (a->role() == Attendee::Chair )
mText +="(" + a->roleStr().left(1) + ".)";
}
mText.append("</li></ul>");
- if ( a_count > 1 ) {
+ if ( (a_count+a_count_nr) > 1 ) {
mText += "<a href=\"mailto:ALL\">";
mText += i18n( "Mail to all" );
mText += "</a> ( ";
mText += "<IMG src=\"" + iconPath + "\">";
@@ -565,9 +565,9 @@ void KOEventViewer::formatAttendees(Incidence *event)
mText += "<a href=\"mailto:RSVP\">";
mText += i18n( "Mail to selected" );
mText += "</a> ( ";
mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath );
- mText += "\n";
+ mText += "<br>\n";
}
}
}
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 65accdc..5926abe 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -794,11 +794,13 @@ void MonthViewCell::selection( QListBoxItem *item )
KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
: KOEventView( calendar, parent, name ),
mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
- mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
+ mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
{
-
+ ignoreResizeEvent = 0;
+ mShortDayLabelsW = false;
+ mShortDayLabelsM = false;
clPending = true;
mWidStack = new QWidgetStack( this );
QHBoxLayout* hb = new QHBoxLayout( this );
mMonthView = new QWidget( mWidStack );
@@ -816,9 +818,8 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
if ( mShowWeekView )
mWeekStartsMonday = true;
updatePossible = false;
mCells.setAutoDelete( true );
- mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
mDayLabels.resize( mDaysPerWeek );
mDayLabelsW.resize( mDaysPerWeek );
QFont bfont = font();
if ( QApplication::desktop()->width() < 650 ) {
@@ -905,16 +906,12 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
}
//connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
mContextMenu = eventPopup();
- // updateConfig(); //useless here
+ updateConfig(); //useless here
//mWeekLabels[mNumWeeks]->setText( i18n("W"));
-#if 0
- mWidStack = new QWidgetStack( this );
- mMonthView = new QWidget( mWidStack );
- mWeekView = new QWidget( mWidStack );
-#endif
+
if ( mShowWeekView )
mWidStack->raiseWidget( mWeekView );
else
mWidStack->raiseWidget( mMonthView );
@@ -1009,17 +1006,14 @@ void KOMonthView::updateConfig()
mWeekStartsMonday = true;
}
QFontMetrics fontmetric(mDayLabels[0]->font());
mWidthLongDayLabel = 0;
-
+ qDebug("KOMonthView::updateConfig() ");
for (int i = 0; i < 7; i++) {
int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
}
- bool temp = mShowSatSunComp ;
- mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
if ( ! mShowWeekView ) {
- if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
computeLayout();
}
updateDayLabels();
//qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
@@ -1047,32 +1041,32 @@ void KOMonthView::updateDayLabels()
mDayLabelsT = &mDayLabelsW;
else
mDayLabelsT = &mDayLabels;
#endif
-
+ qDebug("updateDayLabels W %d M %d ",mShortDayLabelsW ,mShortDayLabelsM);
mDayLabelsT = &mDayLabelsW;
for (int i = 0; i < 7; i++) {
if (mWeekStartsMonday) {
- bool show = mShortDayLabels;
- if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
+ bool show = mShortDayLabelsW;
+ if ( i > 4 && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
show = true;
(*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
} else {
- if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
- else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
+ if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW));
+ else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW));
}
}
mDayLabelsT = &mDayLabels;
for (int i = 0; i < 7; i++) {
if (mWeekStartsMonday) {
- bool show = mShortDayLabels;
- if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
+ bool show = mShortDayLabelsM;
+ if ( i > 4 && KOPrefs::instance()->mMonthViewSatSunTog && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
show = true;
(*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
} else {
- if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
- else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
+ if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsM));
+ else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsM));
}
}
@@ -1268,8 +1262,16 @@ void KOMonthView::updateView()
}
void KOMonthView::resizeEvent(QResizeEvent * e)
{
+ qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
+ if ( ignoreResizeEvent ) {
+ qDebug("KOMonthView::resizeEvent ignored ");
+ --ignoreResizeEvent;
+ return;
+ }
+ if ( e->size().width()+ e->size().height() < 240 )
+ return;
computeLayout();
clPending = true;
if ( mShowWeekView )
mCellsW[0]->setFocus();
@@ -1279,13 +1281,8 @@ void KOMonthView::resizeEvent(QResizeEvent * e)
void KOMonthView::computeLayoutWeek()
{
int daysToShow;
- bool combinedSatSun = false;
- if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
- daysToShow = 6;
- combinedSatSun = true;
- }
int tWid = topLevelWidget()->size().width();
int tHei = topLevelWidget()->size().height();
int wid = size().width();//e
@@ -1297,10 +1294,9 @@ void KOMonthView::computeLayoutWeek()
if ( wid < hei )
daysToShow = 2;
else
daysToShow = 3;
- mShowSatSunComp = true;
- combinedSatSun = true;
+ bool combinedSatSun = true;
//qDebug("KOMonthView::computeLayout()------------------------------------ ");
QFontMetrics fm ( mWeekLabels[0]->font() );
int weeklabelwid = fm.width( "888" );
@@ -1379,9 +1375,9 @@ void KOMonthView::computeLayoutWeek()
mWeekLabelsW[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei);
mWeekLabelsW[1]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
// qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
//qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
- mShortDayLabels = mDayLabelsW[0]->width() < mWidthLongDayLabel ;
+ mShortDayLabelsW = mDayLabelsW[0]->width() < mWidthLongDayLabel ;
updateDayLabels();
bool forceUpdate = !updatePossible;
updatePossible = true;
//mWeekLabels[mNumWeeks]->setText( i18n("M"));
@@ -1399,9 +1395,9 @@ void KOMonthView::computeLayout()
return;
}
int daysToShow = 7;
bool combinedSatSun = false;
- if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
+ if (KOPrefs::instance()->mMonthViewSatSunTog ) {
daysToShow = 6;
combinedSatSun = true;
}
int tWid = topLevelWidget()->size().width();
@@ -1486,9 +1482,10 @@ void KOMonthView::computeLayout()
}
mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
// qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
//qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
- mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ;
+ mShortDayLabelsM = mDayLabels[0]->width() < mWidthLongDayLabel ;
+ qDebug("dlwid %d %d ",mDayLabels[0]->width() , mWidthLongDayLabel);
updateDayLabels();
bool forceUpdate = !updatePossible;
updatePossible = true;
//mWeekLabels[mNumWeeks]->setText( i18n("W"));
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 51eb9e6..9dbe319 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -225,8 +225,9 @@ class KOMonthView: public KOEventView
virtual void printPreview(CalPrinter *calPrinter,
const QDate &, const QDate &);
bool isMonthView() { return true; }
bool isUpdatePossible() { return updatePossible; }
+ void setIgnoreResizeEvent( int c ) { ignoreResizeEvent = c ;}
MonthViewCell * selectedCell();
public slots:
virtual void updateView();
@@ -257,8 +258,9 @@ class KOMonthView: public KOEventView
void viewChanged();
void updateDayLabels();
private:
+ int ignoreResizeEvent;
int currentWeek();
bool clPending;
QWidgetStack * mWidStack;
QWidget* mMonthView;
@@ -268,9 +270,8 @@ class KOMonthView: public KOEventView
int mDaysPerWeek;
int mNumWeeks;
int mNumCells;
bool mWeekStartsMonday;
- bool mShowSatSunComp;
void computeLayout();
void computeLayoutWeek();
QPtrVector<MonthViewCell> mCells;
@@ -279,9 +280,10 @@ class KOMonthView: public KOEventView
QPtrVector<MonthViewCell> mCellsW;
QPtrVector<QLabel> mDayLabelsW;
QPtrVector<KOWeekButton> mWeekLabelsW;
- bool mShortDayLabels;
+ bool mShortDayLabelsM;
+ bool mShortDayLabelsW;
int mWidthLongDayLabel;
QDate mStartDate;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a74c5fe..dcb51dc 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -121,9 +121,9 @@ void KOViewManager::showDateView( int view, QDate date)
} else if (view == 5 ) {
mCurrentAgendaView = 14 ;
mMainView->dateNavigator()->selectDates( date, 14);
} else if (view == 6 ) {
- mMainView->dateNavigator()->selectDates( date, 7 );
+ //mMainView->dateNavigator()->selectDates( date, 7 );
showMonthView();
} else if (view == 7 ) {
mMainView->dateNavigator()->selectDate( date );
showJournalView();
@@ -222,8 +222,9 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
int wid = mMainView->width() ;
int hei = mMainView->height();
if ( mCurrentView == mMonthView ) {
if ( true /* !KOPrefs::instance()->mMonthViewWeek*/ ) {
+ mMonthView->setIgnoreResizeEvent( 2 );
mMainView->navigatorBar()->show();
hei -= mMainView->navigatorBar()->sizeHint().height();
}
//mMainView->navigatorBar()->hide();
@@ -490,9 +491,9 @@ bool KOViewManager::showsNextDays()
{
return mFlagShowNextxDays;
}
void KOViewManager::showMonthView()
-{
+ {
if (!mMonthView) {
mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
addView(mMonthView);