-rw-r--r-- | korganizer/journalentry.cpp | 11 | ||||
-rw-r--r-- | korganizer/journalentry.h | 1 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 10 |
3 files changed, 15 insertions, 7 deletions
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() | |||
162 | void JournalEntry::setDate(const QDate &date) | 162 | void JournalEntry::setDate(const QDate &date) |
163 | { | 163 | { |
164 | showOnlyMode = false; | 164 | showOnlyMode = false; |
165 | mDate = date; | ||
166 | writeJournal(); | 165 | writeJournal(); |
166 | mDate = date; | ||
167 | int id = mCalendar->defaultCalendar(); | 167 | int id = mCalendar->defaultCalendar(); |
168 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | 168 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; |
169 | mTitleLabel->setText( " (" + calname +")"); | 169 | mTitleLabel->setText( " (" + calname +")"); |
@@ -179,13 +179,20 @@ void JournalEntry::toggleShowJournal() | |||
179 | // we have to protect mJournal from deleting if mJournal has empty text | 179 | // we have to protect mJournal from deleting if mJournal has empty text |
180 | visibleMode = false; // set to true via :setShowOnly() | 180 | visibleMode = false; // set to true via :setShowOnly() |
181 | emit showJournalOnly( mJournal ); | 181 | emit showJournalOnly( mJournal ); |
182 | //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) ); | ||
182 | } | 183 | } |
183 | } | 184 | } |
185 | void JournalEntry::setVisibleOn() | ||
186 | { | ||
187 | visibleMode = true; | ||
188 | } | ||
184 | void JournalEntry::setShowOnly() | 189 | void JournalEntry::setShowOnly() |
185 | { | 190 | { |
186 | showOnlyMode = true; | 191 | showOnlyMode = true; |
192 | if ( mTitle->text().isEmpty() ) | ||
193 | mTitle->setFocus(); | ||
194 | else | ||
187 | mEditor->setFocus(); | 195 | mEditor->setFocus(); |
188 | visibleMode = true; | ||
189 | } | 196 | } |
190 | void JournalEntry::setJournal(Journal *journal) | 197 | void JournalEntry::setJournal(Journal *journal) |
191 | { | 198 | { |
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 { | |||
57 | void slotSaveTemplate(); | 57 | void slotSaveTemplate(); |
58 | void slotLoadTemplate(); | 58 | void slotLoadTemplate(); |
59 | void toggleShowJournal(); | 59 | void toggleShowJournal(); |
60 | void setVisibleOn(); | ||
60 | signals: | 61 | signals: |
61 | void deleteJournal(Journal *); | 62 | void deleteJournal(Journal *); |
62 | void newJournal(); | 63 | 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() | |||
155 | 155 | ||
156 | void KOJournalView::showOnly ( Journal* j ) | 156 | void KOJournalView::showOnly ( Journal* j ) |
157 | { | 157 | { |
158 | //qDebug("showOnly %x ", j); | 158 | qDebug("showOnly %x ", j); |
159 | flushView(); | 159 | flushView(); |
160 | if ( j == 0 ) { | 160 | if ( j == 0 ) { |
161 | showDates( mDate, QDate() ); | 161 | showDates( mDate, QDate() ); |
@@ -169,7 +169,7 @@ void KOJournalView::showOnly ( Journal* j ) | |||
169 | } | 169 | } |
170 | void KOJournalView::showList(QPtrList<Journal> jl) | 170 | void KOJournalView::showList(QPtrList<Journal> jl) |
171 | { | 171 | { |
172 | //qDebug("KOJournalView::showList %d",jl.count() ); | 172 | qDebug("KOJournalView::showList %d",jl.count() ); |
173 | JournalEntry* mEntry = jEntries.first(); | 173 | JournalEntry* mEntry = jEntries.first(); |
174 | JournalEntry* firstEntry = mEntry; | 174 | JournalEntry* firstEntry = mEntry; |
175 | int count = jl.count(); | 175 | int count = jl.count(); |
@@ -177,16 +177,16 @@ void KOJournalView::showList(QPtrList<Journal> jl) | |||
177 | while ( iii < count ) { | 177 | while ( iii < count ) { |
178 | if ( !mEntry ) { | 178 | if ( !mEntry ) { |
179 | mEntry = getNewEntry(); | 179 | mEntry = getNewEntry(); |
180 | mEntry->show(); | ||
181 | mEntry->setVisibleMode( true ); | ||
182 | mEntry->setDate(mDate); | 180 | mEntry->setDate(mDate); |
183 | mEntry->setJournal(jl.at(iii)); | 181 | mEntry->setJournal(jl.at(iii)); |
182 | mEntry->setVisibleMode( true ); | ||
183 | mEntry->show(); | ||
184 | mEntry = 0; | 184 | mEntry = 0; |
185 | } else { | 185 | } else { |
186 | mEntry->setDate(mDate); | 186 | mEntry->setDate(mDate); |
187 | mEntry->setJournal(jl.at(iii)); | 187 | mEntry->setJournal(jl.at(iii)); |
188 | mEntry->show(); | ||
189 | mEntry->setVisibleMode( true ); | 188 | mEntry->setVisibleMode( true ); |
189 | mEntry->show(); | ||
190 | mEntry = jEntries.next(); | 190 | mEntry = jEntries.next(); |
191 | } | 191 | } |
192 | ++iii; | 192 | ++iii; |