author | zautrix <zautrix> | 2005-02-06 13:44:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-06 13:44:49 (UTC) |
commit | 26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f (patch) (side-by-side diff) | |
tree | 34c4f5e6b2d77dc1210822e1539d9516842b5691 /korganizer | |
parent | 118f5aab05c9ace5612d5c4fd69e7c5a59bed67b (diff) | |
download | kdepimpi-26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f.zip kdepimpi-26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f.tar.gz kdepimpi-26b0c69fb3b11c29475ec02b2cfe52e33eb24e5f.tar.bz2 |
many small fixes
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 7 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 10 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 61 | ||||
-rw-r--r-- | korganizer/komonthview.h | 6 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 5 |
5 files changed, 46 insertions, 43 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index cd78f54..ce66863 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp @@ -157,14 +157,17 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) mCompleteTimeEdit = new KOTimeEdit(parent); topLayout->addWidget( mCompleteTimeEdit); 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 ); } } void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) { diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 2faf18f..de11c13 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -418,13 +418,13 @@ void KOEventViewer::appendTodo(Todo *event, int mode ) 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: ")); + 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>")); @@ -531,29 +531,29 @@ 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"; } } if (a->status() != Attendee::NeedsAction ) mText +="[" + a->statusStr() + "] "; 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 + "\">"; mText += i18n( " and " ); mText += "<IMG src=\"" + NOiconPath + "\"> )"; @@ -563,13 +563,13 @@ void KOEventViewer::formatAttendees(Incidence *event) } if ( a_count_nr > 1 ) { 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"; } } } void KOEventViewer::appendJournal(Journal *jour, int mode ) { diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 65accdc..5926abe 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -792,15 +792,17 @@ 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 ); mWeekView = new QWidget( mWidStack ); #if QT_VERSION >= 0x030000 @@ -814,13 +816,12 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); mShowWeekView = KOPrefs::instance()->mMonthViewWeek; 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 ) { bfont.setPointSize( bfont.pointSize() - 2 ); } @@ -903,20 +904,16 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) SIGNAL( showDaySignal( QDate ) ) ); cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); } //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 ); emit incidenceSelected( 0 ); @@ -1007,21 +1004,18 @@ void KOMonthView::updateConfig() if ( mShowWeekView ) { 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); //int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; //resizeEvent( 0 ); @@ -1045,36 +1039,36 @@ void KOMonthView::updateDayLabels() #if 0 if (mShowWeekView ) 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)); } } } @@ -1266,28 +1260,31 @@ void KOMonthView::updateView() //qDebug("update time %d ", ti.elapsed()); } 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(); else mCells[0]->setFocus(); } 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 int hei = size().height()-1; @@ -1295,14 +1292,13 @@ void KOMonthView::computeLayoutWeek() return; 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" ); wid -= weeklabelwid; @@ -1377,13 +1373,13 @@ void KOMonthView::computeLayoutWeek() y= dayLabelHei; h = cellHei ; 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")); if ( forceUpdate ) updateView(); @@ -1397,13 +1393,13 @@ void KOMonthView::computeLayout() if ( mShowWeekView ){ computeLayoutWeek(); 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(); int tHei = topLevelWidget()->size().height(); @@ -1484,13 +1480,14 @@ void KOMonthView::computeLayout() mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); y += h; } 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")); if ( forceUpdate ) updateView(); diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 51eb9e6..9dbe319 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -223,12 +223,13 @@ class KOMonthView: public KOEventView virtual DateList selectedDates(); 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(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); @@ -255,35 +256,36 @@ class KOMonthView: public KOEventView protected: void resizeEvent(QResizeEvent *); void viewChanged(); void updateDayLabels(); private: + int ignoreResizeEvent; int currentWeek(); bool clPending; QWidgetStack * mWidStack; QWidget* mMonthView; QWidget* mWeekView; bool mShowWeekView; bool updatePossible; int mDaysPerWeek; int mNumWeeks; int mNumCells; bool mWeekStartsMonday; - bool mShowSatSunComp; void computeLayout(); void computeLayoutWeek(); QPtrVector<MonthViewCell> mCells; QPtrVector<QLabel> mDayLabels; QPtrVector<KOWeekButton> mWeekLabels; QPtrVector<MonthViewCell> mCellsW; QPtrVector<QLabel> mDayLabelsW; QPtrVector<KOWeekButton> mWeekLabelsW; - bool mShortDayLabels; + bool mShortDayLabelsM; + bool mShortDayLabelsW; int mWidthLongDayLabel; QDate mStartDate; MonthViewCell *mSelectedCell; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index a74c5fe..dcb51dc 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -119,13 +119,13 @@ void KOViewManager::showDateView( int view, QDate date) mCurrentAgendaView = 7 ; mMainView->dateNavigator()->selectDates( date, 7 ); } 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(); } else if (view == 8 ) { globalFlagBlockAgenda = 1; @@ -220,12 +220,13 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) { mCurrentAgendaView = 0; 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(); } else { mMainView->navigatorBar()->hide(); @@ -488,13 +489,13 @@ void KOViewManager::showNextXView() } bool KOViewManager::showsNextDays() { return mFlagShowNextxDays; } void KOViewManager::showMonthView() -{ + { if (!mMonthView) { mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); addView(mMonthView); // mMonthView->show(); // SIGNALS/SLOTS FOR MONTH VIEW |