-rw-r--r-- | korganizer/journalentry.cpp | 7 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 05bfd31..232ea58 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -163,66 +163,71 @@ void JournalEntry::slotLoadTemplate() | |||
163 | mEditor-> insertAt ( text, line, col, true ); | 163 | mEditor-> insertAt ( text, line, col, true ); |
164 | //mEditor->setIgnoreMark( true ); | 164 | //mEditor->setIgnoreMark( true ); |
165 | setDirty(); | 165 | setDirty(); |
166 | } | 166 | } |
167 | void JournalEntry::setDate(const QDate &date) | 167 | void JournalEntry::setDate(const QDate &date) |
168 | { | 168 | { |
169 | showOnlyMode = false; | 169 | showOnlyMode = false; |
170 | mDate = date; | 170 | mDate = date; |
171 | writeJournal(); | 171 | writeJournal(); |
172 | int id = mCalendar->defaultCalendar(); | 172 | int id = mCalendar->defaultCalendar(); |
173 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | 173 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; |
174 | mTitleLabel->setText( " (" + calname +")"); | 174 | mTitleLabel->setText( " (" + calname +")"); |
175 | } | 175 | } |
176 | 176 | ||
177 | void JournalEntry::toggleShowJournal() | 177 | void JournalEntry::toggleShowJournal() |
178 | { | 178 | { |
179 | flushEntry(); | 179 | flushEntry(); |
180 | if ( showOnlyMode ) | 180 | if ( showOnlyMode ) |
181 | emit showJournalOnly( 0 ); | 181 | emit showJournalOnly( 0 ); |
182 | else | 182 | else |
183 | emit showJournalOnly( mJournal ); | 183 | emit showJournalOnly( mJournal ); |
184 | } | 184 | } |
185 | void JournalEntry::setShowOnly() | 185 | void JournalEntry::setShowOnly() |
186 | { | 186 | { |
187 | showOnlyMode = true; | 187 | showOnlyMode = true; |
188 | mEditor->setFocus(); | 188 | mEditor->setFocus(); |
189 | } | 189 | } |
190 | void JournalEntry::setJournal(Journal *journal) | 190 | void JournalEntry::setJournal(Journal *journal) |
191 | { | 191 | { |
192 | writeJournal(); | 192 | writeJournal(); |
193 | 193 | ||
194 | mJournal = journal; | 194 | mJournal = journal; |
195 | mTitle->setText(mJournal->summary()); | 195 | if ( journal->isReadOnly() ) |
196 | mTitle->setText(mJournal->summary()+" ("+i18n("readonly")+")"); | ||
197 | else | ||
198 | mTitle->setText(mJournal->summary()); | ||
196 | mEditor->setText(mJournal->description()); | 199 | mEditor->setText(mJournal->description()); |
200 | mTitle->setReadOnly (journal->isReadOnly() ); | ||
201 | mEditor->setReadOnly ( journal->isReadOnly() ); | ||
197 | int id = mJournal->calID(); | 202 | int id = mJournal->calID(); |
198 | 203 | ||
199 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | 204 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; |
200 | mTitleLabel->setText( " (" + calname +")"); | 205 | mTitleLabel->setText( " (" + calname +")"); |
201 | 206 | ||
202 | mDirty = false; | 207 | mDirty = false; |
203 | } | 208 | } |
204 | 209 | ||
205 | Journal *JournalEntry::journal() const | 210 | Journal *JournalEntry::journal() const |
206 | { | 211 | { |
207 | return mJournal; | 212 | return mJournal; |
208 | } | 213 | } |
209 | 214 | ||
210 | void JournalEntry::setDirty() | 215 | void JournalEntry::setDirty() |
211 | { | 216 | { |
212 | mDirty = true; | 217 | mDirty = true; |
213 | 218 | ||
214 | // kdDebug() << "JournalEntry::setDirty()" << endl; | 219 | // kdDebug() << "JournalEntry::setDirty()" << endl; |
215 | } | 220 | } |
216 | 221 | ||
217 | void JournalEntry::clear() | 222 | void JournalEntry::clear() |
218 | { | 223 | { |
219 | mJournal = 0; | 224 | mJournal = 0; |
220 | mEditor->setText(""); | 225 | mEditor->setText(""); |
221 | } | 226 | } |
222 | 227 | ||
223 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) | 228 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) |
224 | { | 229 | { |
225 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; | 230 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; |
226 | 231 | ||
227 | if ( e->type() == QEvent::FocusOut ) { | 232 | if ( e->type() == QEvent::FocusOut ) { |
228 | writeJournal(); | 233 | writeJournal(); |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index dcbb99f..8c1e5b2 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -670,77 +670,83 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
670 | mText += "</a> ( "; | 670 | mText += "</a> ( "; |
671 | mText += "<IMG src=\"" + iconPath + "\">"; | 671 | mText += "<IMG src=\"" + iconPath + "\">"; |
672 | mText += i18n( " and " ); | 672 | mText += i18n( " and " ); |
673 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; | 673 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; |
674 | mText += "<br>\n"; | 674 | mText += "<br>\n"; |
675 | 675 | ||
676 | 676 | ||
677 | } | 677 | } |
678 | if ( a_count_nr > 1 ) { | 678 | if ( a_count_nr > 1 ) { |
679 | mText += "<a href=\"mailto:RSVP\">"; | 679 | mText += "<a href=\"mailto:RSVP\">"; |
680 | mText += i18n( "Mail to selected" ); | 680 | mText += i18n( "Mail to selected" ); |
681 | mText += "</a> ( "; | 681 | mText += "</a> ( "; |
682 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); | 682 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); |
683 | mText += "<br>\n"; | 683 | mText += "<br>\n"; |
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
687 | } | 687 | } |
688 | void KOEventViewer::appendJournal(Journal *jour, int mode ) | 688 | void KOEventViewer::appendJournal(Journal *jour, int mode ) |
689 | { | 689 | { |
690 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 690 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
691 | if (mode == 0 ) { | 691 | if (mode == 0 ) { |
692 | addTag("h2",i18n("Journal from: ")); | 692 | addTag("h2",i18n("Journal from: ")); |
693 | } | 693 | } |
694 | else { | 694 | else { |
695 | if ( mode == 1 ) { | 695 | if ( mode == 1 ) { |
696 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); | 696 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); |
697 | } else { | 697 | } else { |
698 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); | 698 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); |
699 | } | 699 | } |
700 | } | 700 | } |
701 | topLevelWidget()->setCaption("Journal Viewer"); | 701 | topLevelWidget()->setCaption("Journal Viewer"); |
702 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); | 702 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); |
703 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); | ||
704 | if (!jour->summary().isEmpty()) { | 703 | if (!jour->summary().isEmpty()) { |
705 | addTag("p",i18n(" Title: ") + deTag(jour->summary())); | 704 | addTag("b",i18n(" Title: ") + deTag(jour->summary())); |
706 | } | 705 | } |
706 | formatReadOnly(jour); | ||
707 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); | ||
708 | |||
707 | if (!jour->description().isEmpty()) { | 709 | if (!jour->description().isEmpty()) { |
708 | addTag("p",deTag(jour->description())); | 710 | addTag("p",deTag(jour->description())); |
709 | } | 711 | } |
710 | setText(mText); | 712 | setText(mText); |
711 | } | 713 | } |
712 | 714 | ||
713 | void KOEventViewer::formatReadOnly(Incidence *event) | 715 | void KOEventViewer::formatReadOnly(Incidence *event) |
714 | { | 716 | { |
717 | int id = event->calID(); | ||
718 | if ( id > 1 ) { | ||
719 | addTag("p", i18n("Calendar:")+" " + KOPrefs::instance()->getCalendar( id )->mName ); | ||
720 | } | ||
715 | if (event->isReadOnly()) { | 721 | if (event->isReadOnly()) { |
716 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 722 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
717 | } | 723 | } |
718 | } | 724 | } |
719 | void KOEventViewer::setSyncMode( bool b ) | 725 | void KOEventViewer::setSyncMode( bool b ) |
720 | { | 726 | { |
721 | mSyncMode = b; | 727 | mSyncMode = b; |
722 | } | 728 | } |
723 | 729 | ||
724 | void KOEventViewer::setTodo(Todo *event, bool clearV ) | 730 | void KOEventViewer::setTodo(Todo *event, bool clearV ) |
725 | { | 731 | { |
726 | if ( clearV ) | 732 | if ( clearV ) |
727 | clearEvents(); | 733 | clearEvents(); |
728 | if ( mSyncMode ) { | 734 | if ( mSyncMode ) { |
729 | if ( clearV ) | 735 | if ( clearV ) |
730 | appendTodo(event,1 ); | 736 | appendTodo(event,1 ); |
731 | else | 737 | else |
732 | appendTodo(event,2); | 738 | appendTodo(event,2); |
733 | } else | 739 | } else |
734 | appendTodo(event); | 740 | appendTodo(event); |
735 | } | 741 | } |
736 | void KOEventViewer::setJournal(Journal *event, bool clearV ) | 742 | void KOEventViewer::setJournal(Journal *event, bool clearV ) |
737 | { | 743 | { |
738 | if ( clearV ) | 744 | if ( clearV ) |
739 | clearEvents(); | 745 | clearEvents(); |
740 | if ( mSyncMode ) { | 746 | if ( mSyncMode ) { |
741 | if ( clearV ) | 747 | if ( clearV ) |
742 | appendJournal(event, 1); | 748 | appendJournal(event, 1); |
743 | else | 749 | else |
744 | appendJournal(event, 2); | 750 | appendJournal(event, 2); |
745 | } else | 751 | } else |
746 | appendJournal(event); | 752 | appendJournal(event); |