-rw-r--r-- | korganizer/journalentry.h | 1 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index a69846c..ee17da8 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h | |||
@@ -53,12 +53,13 @@ class JournalEntry : public QFrame { | |||
53 | void flushEntry(); | 53 | void flushEntry(); |
54 | void setShowOnly(); | 54 | void setShowOnly(); |
55 | QSize sizeHint() const; | 55 | QSize sizeHint() const; |
56 | void setVisibleMode( bool b ) { visibleMode = b;} | 56 | void setVisibleMode( bool b ) { visibleMode = b;} |
57 | void fillCalendar( int id = 0 ); | 57 | void fillCalendar( int id = 0 ); |
58 | void resizeEvent(QResizeEvent* e ) ; | 58 | void resizeEvent(QResizeEvent* e ) ; |
59 | KTextEdit * editor() {return mEditor;}; | ||
59 | protected slots: | 60 | protected slots: |
60 | void slotSaveTemplate(); | 61 | void slotSaveTemplate(); |
61 | void slotLoadTemplate(); | 62 | void slotLoadTemplate(); |
62 | void toggleShowJournal(); | 63 | void toggleShowJournal(); |
63 | void setVisibleOn(); | 64 | void setVisibleOn(); |
64 | signals: | 65 | signals: |
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index a23a3b2..406df5a 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -34,12 +34,13 @@ | |||
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | 35 | ||
36 | #include <klocale.h> | 36 | #include <klocale.h> |
37 | #include <kdebug.h> | 37 | #include <kdebug.h> |
38 | #include "koprefs.h" | 38 | #include "koprefs.h" |
39 | #include <kglobal.h> | 39 | #include <kglobal.h> |
40 | #include <ktextedit.h> | ||
40 | 41 | ||
41 | #include <libkcal/calendar.h> | 42 | #include <libkcal/calendar.h> |
42 | 43 | ||
43 | #include "journalentry.h" | 44 | #include "journalentry.h" |
44 | 45 | ||
45 | #include "kojournalview.h" | 46 | #include "kojournalview.h" |
@@ -174,27 +175,35 @@ void KOJournalView::showList(QPtrList<Journal> jl) | |||
174 | ff = true; | 175 | ff = true; |
175 | //qDebug("KOJournalView::showList %d",jl.count() ); | 176 | //qDebug("KOJournalView::showList %d",jl.count() ); |
176 | JournalEntry* mEntry = jEntries.first(); | 177 | JournalEntry* mEntry = jEntries.first(); |
177 | JournalEntry* firstEntry = mEntry; | 178 | JournalEntry* firstEntry = mEntry; |
178 | int count = jl.count(); | 179 | int count = jl.count(); |
179 | int iii = 0; | 180 | int iii = 0; |
181 | QWidget* fw = qApp->focusWidget (); | ||
180 | while ( iii < count ) { | 182 | while ( iii < count ) { |
181 | if ( !mEntry ) { | 183 | if ( !mEntry ) { |
182 | mEntry = getNewEntry(); | 184 | mEntry = getNewEntry(); |
183 | mEntry->setVisibleMode( true ); | 185 | mEntry->setVisibleMode( true ); |
184 | mEntry->setDate(mDate); | 186 | mEntry->setDate(mDate); |
185 | mEntry->setJournal(jl.at(iii), false); | 187 | mEntry->setJournal(jl.at(iii), false); |
186 | mEntry->setVisibleMode( true ); | 188 | mEntry->setVisibleMode( true ); |
187 | mEntry->show(); | 189 | mEntry->show(); |
188 | mEntry = 0; | 190 | mEntry = 0; |
189 | } else { | 191 | } else { |
192 | int xxx = -1, yyy = -1; | ||
193 | if ( ((QWidget*) mEntry->editor() ) == fw ) { | ||
194 | mEntry->editor()->getCursorPosition( &xxx,&yyy); | ||
195 | } | ||
190 | mEntry->setVisibleMode( true ); | 196 | mEntry->setVisibleMode( true ); |
191 | mEntry->setDate(mDate); | 197 | mEntry->setDate(mDate); |
192 | mEntry->setJournal(jl.at(iii), false); | 198 | mEntry->setJournal(jl.at(iii), false); |
193 | mEntry->setVisibleMode( true ); | 199 | mEntry->setVisibleMode( true ); |
194 | mEntry->show(); | 200 | mEntry->show(); |
201 | if ( xxx > -1 && yyy > -1 ) { | ||
202 | mEntry->editor()->setCursorPosition( xxx, yyy ); | ||
203 | } | ||
195 | mEntry = jEntries.next(); | 204 | mEntry = jEntries.next(); |
196 | } | 205 | } |
197 | ++iii; | 206 | ++iii; |
198 | } | 207 | } |
199 | while ( mEntry ) { | 208 | while ( mEntry ) { |
200 | mEntry->setDate(mDate); | 209 | mEntry->setDate(mDate); |