From 4c19ba3345d1af263c02ebe564e56d9dec679347 Mon Sep 17 00:00:00 2001 From: zautrix Date: Thu, 30 Jun 2005 12:37:10 +0000 Subject: fixx --- (limited to 'korganizer') diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 9e2c902..ca8d5f7 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -162,8 +162,8 @@ void JournalEntry::slotLoadTemplate() void JournalEntry::setDate(const QDate &date) { showOnlyMode = false; - mDate = date; writeJournal(); + mDate = date; int id = mCalendar->defaultCalendar(); QString calname = KOPrefs::instance()->getCalendar( id )->mName; mTitleLabel->setText( " (" + calname +")"); @@ -179,13 +179,20 @@ void JournalEntry::toggleShowJournal() // we have to protect mJournal from deleting if mJournal has empty text visibleMode = false; // set to true via :setShowOnly() emit showJournalOnly( mJournal ); + //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) ); } } +void JournalEntry::setVisibleOn() +{ + visibleMode = true; +} void JournalEntry::setShowOnly() { showOnlyMode = true; - mEditor->setFocus(); - visibleMode = true; + if ( mTitle->text().isEmpty() ) + mTitle->setFocus(); + else + mEditor->setFocus(); } void JournalEntry::setJournal(Journal *journal) { diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index e98d018..cc9b5ef 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -57,6 +57,7 @@ class JournalEntry : public QFrame { void slotSaveTemplate(); void slotLoadTemplate(); void toggleShowJournal(); + void setVisibleOn(); signals: void deleteJournal(Journal *); void newJournal(); diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 7a96aa5..6fa9b23 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -155,7 +155,7 @@ void KOJournalView::newJournal() void KOJournalView::showOnly ( Journal* j ) { - //qDebug("showOnly %x ", j); + qDebug("showOnly %x ", j); flushView(); if ( j == 0 ) { showDates( mDate, QDate() ); @@ -169,7 +169,7 @@ void KOJournalView::showOnly ( Journal* j ) } void KOJournalView::showList(QPtrList jl) { - //qDebug("KOJournalView::showList %d",jl.count() ); + qDebug("KOJournalView::showList %d",jl.count() ); JournalEntry* mEntry = jEntries.first(); JournalEntry* firstEntry = mEntry; int count = jl.count(); @@ -177,16 +177,16 @@ void KOJournalView::showList(QPtrList jl) while ( iii < count ) { if ( !mEntry ) { mEntry = getNewEntry(); - mEntry->show(); - mEntry->setVisibleMode( true ); mEntry->setDate(mDate); mEntry->setJournal(jl.at(iii)); + mEntry->setVisibleMode( true ); + mEntry->show(); mEntry = 0; } else { mEntry->setDate(mDate); mEntry->setJournal(jl.at(iii)); - mEntry->show(); mEntry->setVisibleMode( true ); + mEntry->show(); mEntry = jEntries.next(); } ++iii; @@ -209,7 +209,7 @@ void KOJournalView::showList(QPtrList jl) void KOJournalView::showDates(const QDate &start, const QDate &) { mDate = start; - mDateLabel-> setText(KGlobal::locale()->formatDate(mDate)); + mDateLabel->setText(KGlobal::locale()->formatDate(mDate)); QPtrList jl = calendar()->journals4Date( start ); showList( jl ); } -- cgit v0.9.0.2