author | zautrix <zautrix> | 2005-06-29 12:29:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 12:29:53 (UTC) |
commit | 0d4d5898a32f162dca010db329e02310a14629d5 (patch) (unidiff) | |
tree | 2d6e758a8a5ec64995de79a4cd1c02c89f509190 | |
parent | 435e68d6ace30fb2121b718226e00be44971c617 (diff) | |
download | kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.zip kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.tar.gz kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.tar.bz2 |
j fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 5 | ||||
-rw-r--r-- | korganizer/journalentry.cpp | 53 | ||||
-rw-r--r-- | korganizer/journalentry.h | 4 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 27 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 3 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 22 | ||||
-rw-r--r-- | korganizer/kojournalview.h | 2 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 14 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 37 |
9 files changed, 113 insertions, 54 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 4df2005..510f4bf 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1441,27 +1441,32 @@ | |||
1441 | { "Messanger","Messanger" }, | 1441 | { "Messanger","Messanger" }, |
1442 | { "Assistant","Assistent" }, | 1442 | { "Assistant","Assistent" }, |
1443 | { "Manager","Manager" }, | 1443 | { "Manager","Manager" }, |
1444 | { "Secrecy","Sichtbar" }, | 1444 | { "Secrecy","Sichtbar" }, |
1445 | { "male","männlich" }, | 1445 | { "male","männlich" }, |
1446 | { "female","weiblich" }, | 1446 | { "female","weiblich" }, |
1447 | { "Hide!","Verbergen!" }, | 1447 | { "Hide!","Verbergen!" }, |
1448 | { "Show!","Anzeigen!" }, | 1448 | { "Show!","Anzeigen!" }, |
1449 | { "Details","Details" }, | 1449 | { "Details","Details" }, |
1450 | { "Profession","Beruf" }, | 1450 | { "Profession","Beruf" }, |
1451 | { "Children","Kinder" }, | 1451 | { "Children","Kinder" }, |
1452 | { "Department","Abteilung" }, | 1452 | { "Department","Abteilung" }, |
1453 | { "Backup cancelled","Backup abgebrochen" }, | 1453 | { "Backup cancelled","Backup abgebrochen" }, |
1454 | { "Backup globally disabled","Backup global abgeschaltet" }, | 1454 | { "Backup globally disabled","Backup global abgeschaltet" }, |
1455 | { "Backup succesfully finished","Backup erfolgreich beendet" }, | 1455 | { "Backup succesfully finished","Backup erfolgreich beendet" }, |
1456 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, | 1456 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, |
1457 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, | 1457 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, |
1458 | { "Birthdays","Geburtstage" }, | 1458 | { "Birthdays","Geburtstage" }, |
1459 | { "KO/Pi import information!","KO/Pi Import Information!" }, | 1459 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1460 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, | 1460 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, |
1461 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, | 1461 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, |
1462 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, | 1462 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, |
1463 | { "Reload","Neu laden" }, | 1463 | { "Reload","Neu laden" }, |
1464 | { "Timezone settings","Zeitzoneneinstellung" }, | 1464 | { "Timezone settings","Zeitzoneneinstellung" }, |
1465 | { " Title: "," Titel: " }, | ||
1466 | { "","" }, | ||
1467 | { "","" }, | ||
1468 | { "","" }, | ||
1469 | { "","" }, | ||
1465 | { "","" }, | 1470 | { "","" }, |
1466 | { "","" }, | 1471 | { "","" }, |
1467 | { "","" }, \ No newline at end of file | 1472 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 0b923ad..05bfd31 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -21,125 +21,116 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | // | 24 | // |
25 | // Journal Entry | 25 | // Journal Entry |
26 | 26 | ||
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qvbox.h> | 29 | #include <qvbox.h> |
30 | #include <qfile.h> | 30 | #include <qfile.h> |
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qtextcodec.h> | 33 | #include <qtextcodec.h> |
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qapplication.h> | 36 | #include <qapplication.h> |
37 | 37 | ||
38 | #include <kdebug.h> | 38 | #include <kdebug.h> |
39 | #include <kglobal.h> | 39 | #include <kglobal.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <ktextedit.h> | 41 | #include <ktextedit.h> |
42 | #include <kfiledialog.h> | 42 | #include <kfiledialog.h> |
43 | #include <kmessagebox.h> | 43 | #include <kmessagebox.h> |
44 | #include "koprefs.h" | 44 | #include "koprefs.h" |
45 | #include <klineedit.h> | ||
45 | 46 | ||
46 | #include <libkcal/journal.h> | 47 | #include <libkcal/journal.h> |
47 | #include <libkcal/calendarresources.h> | 48 | #include <libkcal/calendarresources.h> |
48 | #include <libkcal/resourcecalendar.h> | 49 | #include <libkcal/resourcecalendar.h> |
49 | #include <kresources/resourceselectdialog.h> | 50 | #include <kresources/resourceselectdialog.h> |
50 | 51 | ||
51 | #include "journalentry.h" | 52 | #include "journalentry.h" |
52 | //#include "journalentry.moc" | 53 | //#include "journalentry.moc" |
53 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
54 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
55 | #endif | 56 | #endif |
56 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | 57 | JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : |
57 | QFrame(parent) | 58 | QFrame(parent) |
58 | { | 59 | { |
59 | heiHint = QApplication::desktop()->height() / 5 ; | 60 | heiHint = QApplication::desktop()->height() / 5 ; |
60 | showOnlyMode = false; | 61 | showOnlyMode = false; |
61 | mCalendar = calendar; | 62 | mCalendar = calendar; |
62 | mJournal = 0; | 63 | mJournal = 0; |
63 | mDirty = false; | 64 | mDirty = false; |
64 | 65 | ||
65 | QHBox * vb = new QHBox ( this ); | 66 | QHBox * vb = new QHBox ( this ); |
66 | QPushButton * newJournal = new QPushButton( vb ); | ||
67 | QIconSet icon; | 67 | QIconSet icon; |
68 | if ( QApplication::desktop()->width() < 321 ) | ||
69 | icon = SmallIcon("ko16old"); | ||
70 | else | ||
71 | icon = SmallIcon("ko24old"); | ||
72 | newJournal->setIconSet (icon ) ; | ||
73 | int size = newJournal->sizeHint().height(); | ||
74 | newJournal->setFixedSize( size, size ); | ||
75 | |||
76 | 68 | ||
77 | QPushButton * toggleJournal = new QPushButton( vb ); | 69 | QPushButton * toggleJournal = new QPushButton( vb ); |
78 | icon = SmallIcon("1updownarrow"); | 70 | icon = SmallIcon("1updownarrow"); |
79 | toggleJournal->setIconSet (icon ) ; | 71 | toggleJournal->setIconSet (icon ) ; |
80 | //int size = toggleJournal->sizeHint().height(); | 72 | int size = toggleJournal->sizeHint().height(); |
81 | toggleJournal->setFixedSize( size * 2 /3 , size ); | 73 | toggleJournal->setFixedSize( size * 2 /3 , size ); |
82 | 74 | new QLabel(i18n(" Title: "),vb); | |
83 | 75 | mTitle = new KLineEdit ( vb ); | |
84 | |||
85 | mTitleLabel = new QLabel(i18n("Title"),vb); | 76 | mTitleLabel = new QLabel(i18n("Title"),vb); |
86 | mTitleLabel->setMargin(2); | 77 | mTitleLabel->setMargin(0); |
87 | mTitleLabel->setAlignment(AlignCenter); | 78 | mTitleLabel->setAlignment(AlignCenter); |
88 | QPushButton * loadTemplate = new QPushButton( vb ); | 79 | QPushButton * loadTemplate = new QPushButton( vb ); |
89 | QPushButton * saveTemplate = new QPushButton( vb ); | 80 | QPushButton * saveTemplate = new QPushButton( vb ); |
90 | if ( QApplication::desktop()->width() < 321 ) | 81 | if ( QApplication::desktop()->width() < 321 ) |
91 | icon = SmallIcon("fileexport16"); | 82 | icon = SmallIcon("fileexport16"); |
92 | else | 83 | else |
93 | icon = SmallIcon("fileexport"); | 84 | icon = SmallIcon("fileexport"); |
94 | saveTemplate->setIconSet (icon ) ; | 85 | saveTemplate->setIconSet (icon ) ; |
95 | //size = saveTemplate->sizeHint().height(); | 86 | //size = saveTemplate->sizeHint().height(); |
96 | saveTemplate->setFixedSize( size, size ); | 87 | saveTemplate->setFixedSize( size, size ); |
97 | if ( QApplication::desktop()->width() < 321 ) | 88 | if ( QApplication::desktop()->width() < 321 ) |
98 | icon = SmallIcon("fileimport16"); | 89 | icon = SmallIcon("fileimport16"); |
99 | else | 90 | else |
100 | icon = SmallIcon("fileimport"); | 91 | icon = SmallIcon("fileimport"); |
101 | loadTemplate->setIconSet (icon ) ; | 92 | loadTemplate->setIconSet (icon ) ; |
102 | loadTemplate->setFixedSize( size, size ); | 93 | loadTemplate->setFixedSize( size, size ); |
103 | mEditor = new KTextEdit(this); | 94 | mEditor = new KTextEdit(this); |
104 | connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); | 95 | connect(mEditor,SIGNAL(textChanged()),SLOT(setDirty())); |
105 | #ifndef DESKTOP_VERSION | 96 | #ifndef DESKTOP_VERSION |
106 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); | 97 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); |
107 | #endif | 98 | #endif |
108 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 99 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
109 | QBoxLayout *topLayout = new QVBoxLayout(this); | 100 | QBoxLayout *topLayout = new QVBoxLayout(this); |
110 | topLayout->addWidget(vb); | 101 | topLayout->addWidget(vb); |
111 | topLayout->addWidget(mEditor); | 102 | topLayout->addWidget(mEditor); |
112 | mEditor->installEventFilter(this); | 103 | mEditor->installEventFilter(this); |
113 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 104 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
105 | connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) ); | ||
114 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 106 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
115 | connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) ); | ||
116 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); | 107 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); |
117 | } | 108 | } |
118 | 109 | ||
119 | JournalEntry::~JournalEntry() | 110 | JournalEntry::~JournalEntry() |
120 | { | 111 | { |
121 | qDebug("JournalEntry::~JournalEntry() "); | 112 | //qDebug("JournalEntry::~JournalEntry() "); |
122 | } | 113 | } |
123 | QSize JournalEntry::sizeHint() const | 114 | QSize JournalEntry::sizeHint() const |
124 | { | 115 | { |
125 | return QSize ( 240, heiHint ); | 116 | return QSize ( 240, heiHint ); |
126 | } | 117 | } |
127 | void JournalEntry::slotSaveTemplate() | 118 | void JournalEntry::slotSaveTemplate() |
128 | { | 119 | { |
129 | QString fileName =locateLocal( "templates", "journals" ); | 120 | QString fileName =locateLocal( "templates", "journals" ); |
130 | QDir t_dir; | 121 | QDir t_dir; |
131 | if ( !t_dir.exists(fileName) ) | 122 | if ( !t_dir.exists(fileName) ) |
132 | t_dir.mkdir ( fileName ); | 123 | t_dir.mkdir ( fileName ); |
133 | fileName += "/journal"; | 124 | fileName += "/journal"; |
134 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); | 125 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Journal template"), this ); |
135 | if ( fileName.length() == 0 ) | 126 | if ( fileName.length() == 0 ) |
136 | return; | 127 | return; |
137 | 128 | ||
138 | QFile fileIn( fileName ); | 129 | QFile fileIn( fileName ); |
139 | if (!fileIn.open( IO_WriteOnly ) ) { | 130 | if (!fileIn.open( IO_WriteOnly ) ) { |
140 | KMessageBox::error( this, i18n("Error saving template file\n '%1'.") | 131 | KMessageBox::error( this, i18n("Error saving template file\n '%1'.") |
141 | .arg( fileName ) ); | 132 | .arg( fileName ) ); |
142 | return; | 133 | return; |
143 | } | 134 | } |
144 | // QString text; | 135 | // QString text; |
145 | QTextStream tsIn( &fileIn ); | 136 | QTextStream tsIn( &fileIn ); |
@@ -158,78 +149,77 @@ void JournalEntry::slotLoadTemplate() | |||
158 | if ( fileName.length() == 0 ) | 149 | if ( fileName.length() == 0 ) |
159 | return; | 150 | return; |
160 | QFile fileIn( fileName ); | 151 | QFile fileIn( fileName ); |
161 | if (!fileIn.open( IO_ReadOnly ) ) { | 152 | if (!fileIn.open( IO_ReadOnly ) ) { |
162 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 153 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
163 | .arg( fileName ) ); | 154 | .arg( fileName ) ); |
164 | return; | 155 | return; |
165 | } | 156 | } |
166 | QTextStream tsIn( &fileIn ); | 157 | QTextStream tsIn( &fileIn ); |
167 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 158 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
168 | QString text = tsIn.read(); | 159 | QString text = tsIn.read(); |
169 | fileIn.close(); | 160 | fileIn.close(); |
170 | int line, col; | 161 | int line, col; |
171 | mEditor->getCursorPosition (& line, & col ); | 162 | mEditor->getCursorPosition (& line, & col ); |
172 | mEditor-> insertAt ( text, line, col, true ); | 163 | mEditor-> insertAt ( text, line, col, true ); |
173 | //mEditor->setIgnoreMark( true ); | 164 | //mEditor->setIgnoreMark( true ); |
174 | setDirty(); | 165 | setDirty(); |
175 | } | 166 | } |
176 | void JournalEntry::setDate(const QDate &date) | 167 | void JournalEntry::setDate(const QDate &date) |
177 | { | 168 | { |
178 | showOnlyMode = false; | 169 | showOnlyMode = false; |
179 | mDate = date; | 170 | mDate = date; |
180 | writeJournal(); | 171 | writeJournal(); |
181 | int id = mCalendar->defaultCalendar(); | 172 | int id = mCalendar->defaultCalendar(); |
182 | if ( id == 1 ) { | 173 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; |
183 | mTitleLabel->setText(KGlobal::locale()->formatDate(date)); | 174 | mTitleLabel->setText( " (" + calname +")"); |
184 | } else { | ||
185 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | ||
186 | mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); | ||
187 | } | ||
188 | } | 175 | } |
189 | 176 | ||
190 | void JournalEntry::toggleShowJournal() | 177 | void JournalEntry::toggleShowJournal() |
191 | { | 178 | { |
179 | flushEntry(); | ||
192 | if ( showOnlyMode ) | 180 | if ( showOnlyMode ) |
193 | emit showJournalOnly( 0 ); | 181 | emit showJournalOnly( 0 ); |
194 | else | 182 | else |
195 | emit showJournalOnly( mJournal ); | 183 | emit showJournalOnly( mJournal ); |
196 | } | 184 | } |
197 | 185 | void JournalEntry::setShowOnly() | |
186 | { | ||
187 | showOnlyMode = true; | ||
188 | mEditor->setFocus(); | ||
189 | } | ||
198 | void JournalEntry::setJournal(Journal *journal) | 190 | void JournalEntry::setJournal(Journal *journal) |
199 | { | 191 | { |
200 | writeJournal(); | 192 | writeJournal(); |
201 | 193 | ||
202 | mJournal = journal; | 194 | mJournal = journal; |
203 | 195 | mTitle->setText(mJournal->summary()); | |
204 | mEditor->setText(mJournal->description()); | 196 | mEditor->setText(mJournal->description()); |
205 | int id = mJournal->calID(); | 197 | int id = mJournal->calID(); |
206 | if ( id > 1 ) { | 198 | |
207 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | 199 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; |
208 | mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); | 200 | mTitleLabel->setText( " (" + calname +")"); |
209 | } else { | 201 | |
210 | mTitleLabel->setText(KGlobal::locale()->formatDate(mDate)); | ||
211 | } | ||
212 | mDirty = false; | 202 | mDirty = false; |
213 | } | 203 | } |
214 | 204 | ||
215 | Journal *JournalEntry::journal() const | 205 | Journal *JournalEntry::journal() const |
216 | { | 206 | { |
217 | return mJournal; | 207 | return mJournal; |
218 | } | 208 | } |
219 | 209 | ||
220 | void JournalEntry::setDirty() | 210 | void JournalEntry::setDirty() |
221 | { | 211 | { |
222 | mDirty = true; | 212 | mDirty = true; |
223 | 213 | ||
224 | // kdDebug() << "JournalEntry::setDirty()" << endl; | 214 | // kdDebug() << "JournalEntry::setDirty()" << endl; |
225 | } | 215 | } |
226 | 216 | ||
227 | void JournalEntry::clear() | 217 | void JournalEntry::clear() |
228 | { | 218 | { |
229 | mJournal = 0; | 219 | mJournal = 0; |
230 | mEditor->setText(""); | 220 | mEditor->setText(""); |
231 | } | 221 | } |
232 | 222 | ||
233 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) | 223 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) |
234 | { | 224 | { |
235 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; | 225 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; |
@@ -253,40 +243,39 @@ void JournalEntry::writeJournal() | |||
253 | // kdDebug() << "JournalEntry::writeJournal()" << endl; | 243 | // kdDebug() << "JournalEntry::writeJournal()" << endl; |
254 | if (!mDirty) return; | 244 | if (!mDirty) return; |
255 | 245 | ||
256 | if (mEditor->text().isEmpty()) { | 246 | if (mEditor->text().isEmpty()) { |
257 | if ( mJournal ) { | 247 | if ( mJournal ) { |
258 | mDirty = false; | 248 | mDirty = false; |
259 | bool conf = KOPrefs::instance()->mConfirm; | 249 | bool conf = KOPrefs::instance()->mConfirm; |
260 | KOPrefs::instance()->mConfirm = false; | 250 | KOPrefs::instance()->mConfirm = false; |
261 | emit deleteJournal(mJournal); | 251 | emit deleteJournal(mJournal); |
262 | KOPrefs::instance()->mConfirm = conf; | 252 | KOPrefs::instance()->mConfirm = conf; |
263 | mJournal = 0; | 253 | mJournal = 0; |
264 | } | 254 | } |
265 | return; | 255 | return; |
266 | } | 256 | } |
267 | 257 | ||
268 | // kdDebug() << "JournalEntry::writeJournal()..." << endl; | 258 | // kdDebug() << "JournalEntry::writeJournal()..." << endl; |
269 | 259 | ||
270 | if (!mJournal) { | 260 | if (!mJournal) { |
271 | mJournal = new Journal; | 261 | mJournal = new Journal; |
272 | mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); | 262 | mJournal->setDtStart(QDateTime(mDate,QTime(0,0,0))); |
273 | mCalendar->addJournal(mJournal); | 263 | mCalendar->addJournal(mJournal); |
274 | } | 264 | } |
275 | 265 | ||
276 | mJournal->setDescription(mEditor->text()); | 266 | mJournal->setDescription(mEditor->text()); |
277 | //qDebug("tttt%s ", mEditor->text().latin1()); | 267 | mJournal->setSummary(mTitle->text()); |
278 | |||
279 | mDirty = false; | 268 | mDirty = false; |
280 | } | 269 | } |
281 | 270 | ||
282 | void JournalEntry::flushEntry() | 271 | void JournalEntry::flushEntry() |
283 | { | 272 | { |
284 | if (!mDirty) return; | 273 | if (!mDirty) return; |
285 | 274 | ||
286 | writeJournal(); | 275 | writeJournal(); |
287 | } | 276 | } |
288 | void JournalEntry::keyPressEvent ( QKeyEvent * e ) | 277 | void JournalEntry::keyPressEvent ( QKeyEvent * e ) |
289 | { | 278 | { |
290 | e->ignore(); | 279 | e->ignore(); |
291 | 280 | ||
292 | } | 281 | } |
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index b0e9cc7..b37cabd 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h | |||
@@ -10,73 +10,75 @@ | |||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef JOURNALENTRY_H | 23 | #ifndef JOURNALENTRY_H |
24 | #define JOURNALENTRY_H | 24 | #define JOURNALENTRY_H |
25 | // | 25 | // |
26 | // Widget showing one Journal entry | 26 | // Widget showing one Journal entry |
27 | 27 | ||
28 | #include <qframe.h> | 28 | #include <qframe.h> |
29 | 29 | ||
30 | #include <libkcal/calendar.h> | 30 | #include <libkcal/calendar.h> |
31 | 31 | ||
32 | class QLabel; | 32 | class QLabel; |
33 | class KTextEdit; | 33 | class KTextEdit; |
34 | class KLineEdit; | ||
34 | 35 | ||
35 | using namespace KCal; | 36 | using namespace KCal; |
36 | 37 | ||
37 | class JournalEntry : public QFrame { | 38 | class JournalEntry : public QFrame { |
38 | Q_OBJECT | 39 | Q_OBJECT |
39 | public: | 40 | public: |
40 | JournalEntry(Calendar *,QWidget *parent); | 41 | JournalEntry(Calendar *,QWidget *parent); |
41 | virtual ~JournalEntry(); | 42 | virtual ~JournalEntry(); |
42 | 43 | ||
43 | void setJournal(Journal *); | 44 | void setJournal(Journal *); |
44 | Journal *journal() const; | 45 | Journal *journal() const; |
45 | 46 | ||
46 | void setDate(const QDate &); | 47 | void setDate(const QDate &); |
47 | 48 | ||
48 | void clear(); | 49 | void clear(); |
49 | 50 | ||
50 | void flushEntry(); | 51 | void flushEntry(); |
51 | void setShowOnly() {showOnlyMode = true;} | 52 | void setShowOnly(); |
52 | QSize sizeHint() const; | 53 | QSize sizeHint() const; |
53 | 54 | ||
54 | protected slots: | 55 | protected slots: |
55 | void slotSaveTemplate(); | 56 | void slotSaveTemplate(); |
56 | void slotLoadTemplate(); | 57 | void slotLoadTemplate(); |
57 | void setDirty(); | 58 | void setDirty(); |
58 | void toggleShowJournal(); | 59 | void toggleShowJournal(); |
59 | signals: | 60 | signals: |
60 | void deleteJournal(Journal *); | 61 | void deleteJournal(Journal *); |
61 | void newJournal(); | 62 | void newJournal(); |
62 | void showJournalOnly( Journal * ); | 63 | void showJournalOnly( Journal * ); |
63 | 64 | ||
64 | protected: | 65 | protected: |
65 | bool eventFilter( QObject *o, QEvent *e ); | 66 | bool eventFilter( QObject *o, QEvent *e ); |
66 | 67 | ||
67 | void writeJournal(); | 68 | void writeJournal(); |
68 | 69 | ||
69 | private: | 70 | private: |
70 | bool showOnlyMode; | 71 | bool showOnlyMode; |
71 | Calendar *mCalendar; | 72 | Calendar *mCalendar; |
72 | Journal *mJournal; | 73 | Journal *mJournal; |
73 | QDate mDate; | 74 | QDate mDate; |
74 | void keyPressEvent ( QKeyEvent * ) ; | 75 | void keyPressEvent ( QKeyEvent * ) ; |
75 | QLabel *mTitleLabel; | 76 | QLabel *mTitleLabel; |
77 | KLineEdit * mTitle; | ||
76 | KTextEdit *mEditor; | 78 | KTextEdit *mEditor; |
77 | int heiHint; | 79 | int heiHint; |
78 | 80 | ||
79 | bool mDirty; | 81 | bool mDirty; |
80 | }; | 82 | }; |
81 | 83 | ||
82 | #endif | 84 | #endif |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 3468657..067c34c 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -199,56 +199,65 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) | |||
199 | } | 199 | } |
200 | } | 200 | } |
201 | if ( !event->location().isEmpty() ) | 201 | if ( !event->location().isEmpty() ) |
202 | mToolTipText += " (" + event->location() + ")"; | 202 | mToolTipText += " (" + event->location() + ")"; |
203 | //qDebug("TTT: %s ", mToolTipText.latin1()); | 203 | //qDebug("TTT: %s ", mToolTipText.latin1()); |
204 | mToolTip.append( deTag( mToolTipText ) ); | 204 | mToolTip.append( deTag( mToolTipText ) ); |
205 | } | 205 | } |
206 | mToolTip.sort(); | 206 | mToolTip.sort(); |
207 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 207 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
208 | QPtrList<Todo> todolist = mCalendar->todos(mDate); | 208 | QPtrList<Todo> todolist = mCalendar->todos(mDate); |
209 | Todo *todo; | 209 | Todo *todo; |
210 | for(todo=todolist.first();todo != 0;todo=todolist.next()) { | 210 | for(todo=todolist.first();todo != 0;todo=todolist.next()) { |
211 | QString mToolTipText; | 211 | QString mToolTipText; |
212 | if ( !todo->doesFloat() ) | 212 | if ( !todo->doesFloat() ) |
213 | mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; | 213 | mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" "; |
214 | mToolTipText += todo->summary(); | 214 | mToolTipText += todo->summary(); |
215 | if ( !todo->location().isEmpty() ) | 215 | if ( !todo->location().isEmpty() ) |
216 | mToolTipText += " (" + todo->location() + ")"; | 216 | mToolTipText += " (" + todo->location() + ")"; |
217 | mToolTipText = deTag( mToolTipText); | 217 | mToolTipText = deTag( mToolTipText); |
218 | mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; | 218 | mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText; |
219 | mToolTip.append( mToolTipText ); | 219 | mToolTip.append( mToolTipText ); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 222 | if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
223 | Journal *j = mCalendar->journal( mDate ); | 223 | QPtrList<Journal> j_list = mCalendar->journals4Date( mDate ); |
224 | if ( j ) { | 224 | Journal *j = j_list.first(); |
225 | QString mToolTipText = j->description().left(100); | 225 | while ( j ) { |
226 | if ( j->description().length() > 100 ) | 226 | QString mToolTipText; |
227 | mToolTipText += " ..."; | 227 | if ( !j->summary().isEmpty() ) { |
228 | mToolTipText = deTag( mToolTipText); | 228 | mToolTipText = j->summary().left(30); |
229 | if ( j->summary().length() > 30 ) | ||
230 | mToolTipText += " ..."; | ||
231 | } else { | ||
232 | mToolTipText = j->description().left(25); | ||
233 | if ( j->description().length() > 25 ) | ||
234 | mToolTipText += " ..."; | ||
235 | mToolTipText = deTag( mToolTipText); | ||
236 | } | ||
229 | mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText; | 237 | mToolTipText = "<b>" + i18n("Journal: ") + "</b>"+ mToolTipText; |
230 | mToolTip.append( mToolTipText ); | 238 | mToolTip.append( mToolTipText ); |
239 | j = j_list.next(); | ||
231 | } | 240 | } |
232 | } | 241 | } |
233 | return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); | 242 | return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); |
234 | } | 243 | } |
235 | 244 | ||
236 | 245 | ||
237 | QString KODayMatrix::deTag( QString mToolTipText ) | 246 | QString KODayMatrix::deTag( QString mToolTipText ) |
238 | { | 247 | { |
239 | 248 | ||
240 | #if QT_VERSION >= 0x030000 | 249 | #if QT_VERSION >= 0x030000 |
241 | mToolTipText.replace( '<' , "<" ); | 250 | mToolTipText.replace( '<' , "<" ); |
242 | mToolTipText.replace( '>' , ">" ); | 251 | mToolTipText.replace( '>' , ">" ); |
243 | #else | 252 | #else |
244 | if ( mToolTipText.find ('<') >= 0 ) { | 253 | if ( mToolTipText.find ('<') >= 0 ) { |
245 | mToolTipText.replace( QRegExp("<") , "<" ); | 254 | mToolTipText.replace( QRegExp("<") , "<" ); |
246 | } | 255 | } |
247 | if ( mToolTipText.find ('>') >= 0 ) { | 256 | if ( mToolTipText.find ('>') >= 0 ) { |
248 | mToolTipText.replace( QRegExp(">") , ">" ); | 257 | mToolTipText.replace( QRegExp(">") , ">" ); |
249 | } | 258 | } |
250 | #endif | 259 | #endif |
251 | return mToolTipText; | 260 | return mToolTipText; |
252 | } | 261 | } |
253 | void KODayMatrix::setCalendar( Calendar *cal ) | 262 | void KODayMatrix::setCalendar( Calendar *cal ) |
254 | { | 263 | { |
@@ -528,49 +537,51 @@ void KODayMatrix::updateViewTimed() | |||
528 | holiStr += "\n"; | 537 | holiStr += "\n"; |
529 | holiStr += i18n("Todo") + ": "+todo->summary(); | 538 | holiStr += i18n("Todo") + ": "+todo->summary(); |
530 | if ( !todo->location().isEmpty() ) | 539 | if ( !todo->location().isEmpty() ) |
531 | holiStr += " (" + todo->location() + ")"; | 540 | holiStr += " (" + todo->location() + ")"; |
532 | bDays.setBit(i); | 541 | bDays.setBit(i); |
533 | mHolidays[i] =holiStr ; | 542 | mHolidays[i] =holiStr ; |
534 | eDays.setBit(i); | 543 | eDays.setBit(i); |
535 | } | 544 | } |
536 | } | 545 | } |
537 | } | 546 | } |
538 | } | 547 | } |
539 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 548 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
540 | bDays.fill( false); | 549 | bDays.fill( false); |
541 | // insert due todos | 550 | // insert due todos |
542 | QPtrList<Journal> todos = mCalendar->journals( ); | 551 | QPtrList<Journal> todos = mCalendar->journals( ); |
543 | Journal *todo; | 552 | Journal *todo; |
544 | for(todo = todos.first(); todo; todo = todos.next()) { | 553 | for(todo = todos.first(); todo; todo = todos.next()) { |
545 | int day = mStartDate.daysTo( todo->dtStart().date() ); | 554 | int day = mStartDate.daysTo( todo->dtStart().date() ); |
546 | if ( day >= 0 && day < timeSpan + 1) { | 555 | if ( day >= 0 && day < timeSpan + 1) { |
547 | int i = day; | 556 | int i = day; |
548 | QString holiStr = mHolidays[i]; | 557 | QString holiStr = mHolidays[i]; |
549 | pDays.setBit(i); | 558 | pDays.setBit(i); |
550 | if ( !holiStr.isEmpty() ) | 559 | if ( !holiStr.isEmpty() ) |
551 | holiStr += "\n"; | 560 | holiStr += "\n"; |
552 | holiStr += i18n("Journal"); | 561 | holiStr += i18n("Journal: ")+todo->summary().left(25); |
562 | if ( todo->summary().length() > 25 ) | ||
563 | holiStr +="..."; | ||
553 | bDays.setBit(i); | 564 | bDays.setBit(i); |
554 | mHolidays[i] =holiStr ; | 565 | mHolidays[i] =holiStr ; |
555 | eDays.setBit(i); | 566 | eDays.setBit(i); |
556 | 567 | ||
557 | } | 568 | } |
558 | } | 569 | } |
559 | } | 570 | } |
560 | #else | 571 | #else |
561 | //qDebug("KODayMatrix::updateViewTimed "); | 572 | //qDebug("KODayMatrix::updateViewTimed "); |
562 | for(int i = 0; i < NUMDAYS; i++) { | 573 | for(int i = 0; i < NUMDAYS; i++) { |
563 | // if events are set for the day then remember to draw it bold | 574 | // if events are set for the day then remember to draw it bold |
564 | QPtrList<Event> eventlist = mCalendar->events(days[i]); | 575 | QPtrList<Event> eventlist = mCalendar->events(days[i]); |
565 | Event *event; | 576 | Event *event; |
566 | int numEvents = eventlist.count(); | 577 | int numEvents = eventlist.count(); |
567 | QString holiStr = ""; | 578 | QString holiStr = ""; |
568 | bDays.clearBit(i); | 579 | bDays.clearBit(i); |
569 | hDays.clearBit(i); | 580 | hDays.clearBit(i); |
570 | eDays.clearBit(i); | 581 | eDays.clearBit(i); |
571 | for(event=eventlist.first();event != 0;event=eventlist.next()) { | 582 | for(event=eventlist.first();event != 0;event=eventlist.next()) { |
572 | ushort recurType = event->recurrence()->doesRecur(); | 583 | ushort recurType = event->recurrence()->doesRecur(); |
573 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || | 584 | if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || |
574 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { | 585 | (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { |
575 | numEvents--; | 586 | numEvents--; |
576 | } | 587 | } |
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 6315827..dcbb99f 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -680,48 +680,51 @@ void KOEventViewer::formatAttendees(Incidence *event) | |||
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 ) ); | 703 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); |
704 | if (!jour->summary().isEmpty()) { | ||
705 | addTag("p",i18n(" Title: ") + deTag(jour->summary())); | ||
706 | } | ||
704 | if (!jour->description().isEmpty()) { | 707 | if (!jour->description().isEmpty()) { |
705 | addTag("p",deTag(jour->description())); | 708 | addTag("p",deTag(jour->description())); |
706 | } | 709 | } |
707 | setText(mText); | 710 | setText(mText); |
708 | } | 711 | } |
709 | 712 | ||
710 | void KOEventViewer::formatReadOnly(Incidence *event) | 713 | void KOEventViewer::formatReadOnly(Incidence *event) |
711 | { | 714 | { |
712 | if (event->isReadOnly()) { | 715 | if (event->isReadOnly()) { |
713 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 716 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
714 | } | 717 | } |
715 | } | 718 | } |
716 | void KOEventViewer::setSyncMode( bool b ) | 719 | void KOEventViewer::setSyncMode( bool b ) |
717 | { | 720 | { |
718 | mSyncMode = b; | 721 | mSyncMode = b; |
719 | } | 722 | } |
720 | 723 | ||
721 | void KOEventViewer::setTodo(Todo *event, bool clearV ) | 724 | void KOEventViewer::setTodo(Todo *event, bool clearV ) |
722 | { | 725 | { |
723 | if ( clearV ) | 726 | if ( clearV ) |
724 | clearEvents(); | 727 | clearEvents(); |
725 | if ( mSyncMode ) { | 728 | if ( mSyncMode ) { |
726 | if ( clearV ) | 729 | if ( clearV ) |
727 | appendTodo(event,1 ); | 730 | appendTodo(event,1 ); |
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 9e354d3..4fc9013 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -6,72 +6,93 @@ | |||
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | // | 24 | // |
25 | // View of Journal entries | 25 | // View of Journal entries |
26 | 26 | ||
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qscrollview.h> | 28 | #include <qscrollview.h> |
29 | #include <qpopupmenu.h> | 29 | #include <qpopupmenu.h> |
30 | #include <qhbox.h> | ||
31 | #include <qpushbutton.h> | ||
32 | #include <qlabel.h> | ||
33 | #include <qpushbutton.h> | ||
34 | #include <qapplication.h> | ||
30 | 35 | ||
31 | #include <klocale.h> | 36 | #include <klocale.h> |
32 | #include <kdebug.h> | 37 | #include <kdebug.h> |
33 | #include "koprefs.h" | 38 | #include "koprefs.h" |
39 | #include <kglobal.h> | ||
34 | 40 | ||
35 | #include <libkcal/calendar.h> | 41 | #include <libkcal/calendar.h> |
36 | 42 | ||
37 | #include "journalentry.h" | 43 | #include "journalentry.h" |
38 | 44 | ||
39 | #include "kojournalview.h" | 45 | #include "kojournalview.h" |
40 | using namespace KOrg; | 46 | using namespace KOrg; |
41 | 47 | ||
42 | KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, | 48 | KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, |
43 | const char *name) | 49 | const char *name) |
44 | : KOrg::BaseView(calendar, parent, name) | 50 | : KOrg::BaseView(calendar, parent, name) |
45 | { | 51 | { |
46 | mCalendar = calendar; | 52 | mCalendar = calendar; |
47 | QScrollView * sv = new QScrollView( this ); | 53 | QScrollView * sv = new QScrollView( this ); |
48 | QHBoxLayout * hbl = new QHBoxLayout( this ); | 54 | QHBoxLayout * hbl = new QHBoxLayout( this ); |
49 | hbl->addWidget( sv ); | 55 | hbl->addWidget( sv ); |
50 | parWid = new QWidget( sv->viewport() ); | 56 | parWid = new QWidget( sv->viewport() ); |
51 | sv->addChild(parWid); | 57 | sv->addChild(parWid); |
52 | sv->setResizePolicy( QScrollView:: AutoOneFit ); | 58 | sv->setResizePolicy( QScrollView:: AutoOneFit ); |
53 | mTopLayout = new QVBoxLayout(parWid); | 59 | mTopLayout = new QVBoxLayout(parWid); |
60 | QHBox * vb = new QHBox ( parWid ); | ||
61 | QPushButton * newJournal = new QPushButton( vb ); | ||
62 | QIconSet icon; | ||
63 | if ( QApplication::desktop()->width() < 321 ) | ||
64 | icon = SmallIcon("ko16old"); | ||
65 | else | ||
66 | icon = SmallIcon("ko24old"); | ||
67 | newJournal->setIconSet (icon ) ; | ||
68 | int size = newJournal->sizeHint().height(); | ||
69 | newJournal->setFixedSize( size, size ); | ||
70 | mDateLabel = new QLabel ( vb ); | ||
71 | mTopLayout->addWidget( vb ); | ||
72 | mDateLabel->setMargin(2); | ||
73 | mDateLabel->setAlignment(AlignCenter); | ||
74 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); | ||
54 | getNewEntry(); | 75 | getNewEntry(); |
55 | } | 76 | } |
56 | 77 | ||
57 | KOJournalView::~KOJournalView() | 78 | KOJournalView::~KOJournalView() |
58 | { | 79 | { |
59 | } | 80 | } |
60 | 81 | ||
61 | int KOJournalView::currentDateCount() | 82 | int KOJournalView::currentDateCount() |
62 | { | 83 | { |
63 | return 0; | 84 | return 0; |
64 | } | 85 | } |
65 | JournalEntry* KOJournalView::getNewEntry() | 86 | JournalEntry* KOJournalView::getNewEntry() |
66 | { | 87 | { |
67 | JournalEntry* Entry = new JournalEntry(mCalendar,parWid); | 88 | JournalEntry* Entry = new JournalEntry(mCalendar,parWid); |
68 | jEntries.append( Entry ); | 89 | jEntries.append( Entry ); |
69 | mTopLayout->addWidget(Entry); | 90 | mTopLayout->addWidget(Entry); |
70 | Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); | 91 | Entry->setFont ( KOPrefs::instance()->mJornalViewFont ); |
71 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; | 92 | connect ( Entry,SIGNAL(deleteJournal(Journal *) ),this ,SIGNAL(deleteJournal(Journal *) ) ) ; |
72 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; | 93 | connect ( Entry,SIGNAL(newJournal() ),this ,SLOT(newJournal() ) ) ; |
73 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; | 94 | connect ( Entry,SIGNAL(showJournalOnly( Journal * ) ),this ,SLOT(showOnly ( Journal* ) ) ) ; |
74 | return Entry; | 95 | return Entry; |
75 | } | 96 | } |
76 | 97 | ||
77 | QPtrList<Incidence> KOJournalView::selectedIncidences() | 98 | QPtrList<Incidence> KOJournalView::selectedIncidences() |
@@ -149,47 +170,48 @@ void KOJournalView::showList(QPtrList<Journal> jl) | |||
149 | mEntry->setJournal(jl.at(iii)); | 170 | mEntry->setJournal(jl.at(iii)); |
150 | mEntry = 0; | 171 | mEntry = 0; |
151 | } else { | 172 | } else { |
152 | mEntry->setDate(mDate); | 173 | mEntry->setDate(mDate); |
153 | mEntry->setJournal(jl.at(iii)); | 174 | mEntry->setJournal(jl.at(iii)); |
154 | mEntry->show(); | 175 | mEntry->show(); |
155 | mEntry = jEntries.next(); | 176 | mEntry = jEntries.next(); |
156 | } | 177 | } |
157 | ++iii; | 178 | ++iii; |
158 | } | 179 | } |
159 | while ( mEntry ) { | 180 | while ( mEntry ) { |
160 | mEntry->setDate(mDate); | 181 | mEntry->setDate(mDate); |
161 | mEntry->clear(); | 182 | mEntry->clear(); |
162 | if ( mEntry != firstEntry ) | 183 | if ( mEntry != firstEntry ) |
163 | mEntry->hide(); | 184 | mEntry->hide(); |
164 | else | 185 | else |
165 | mEntry->show(); | 186 | mEntry->show(); |
166 | mEntry = jEntries.next(); | 187 | mEntry = jEntries.next(); |
167 | } | 188 | } |
168 | } | 189 | } |
169 | 190 | ||
170 | void KOJournalView::showDates(const QDate &start, const QDate &) | 191 | void KOJournalView::showDates(const QDate &start, const QDate &) |
171 | { | 192 | { |
172 | mDate = start; | 193 | mDate = start; |
194 | mDateLabel-> setText(KGlobal::locale()->formatDate(mDate)); | ||
173 | QPtrList<Journal> jl = calendar()->journals4Date( start ); | 195 | QPtrList<Journal> jl = calendar()->journals4Date( start ); |
174 | showList( jl ); | 196 | showList( jl ); |
175 | } | 197 | } |
176 | 198 | ||
177 | void KOJournalView::showEvents(QPtrList<Event>) | 199 | void KOJournalView::showEvents(QPtrList<Event>) |
178 | { | 200 | { |
179 | // After new creation of list view no events are selected. | 201 | // After new creation of list view no events are selected. |
180 | // emit incidenceSelected( 0 ); | 202 | // emit incidenceSelected( 0 ); |
181 | } | 203 | } |
182 | 204 | ||
183 | void KOJournalView::changeEventDisplay(Event *, int /*action*/) | 205 | void KOJournalView::changeEventDisplay(Event *, int /*action*/) |
184 | { | 206 | { |
185 | updateView(); | 207 | updateView(); |
186 | } | 208 | } |
187 | 209 | ||
188 | void KOJournalView::keyPressEvent ( QKeyEvent * e ) | 210 | void KOJournalView::keyPressEvent ( QKeyEvent * e ) |
189 | { | 211 | { |
190 | //qDebug("keyPressEven "); | 212 | //qDebug("keyPressEven "); |
191 | if ( e->state() == Qt::ControlButton ) { | 213 | if ( e->state() == Qt::ControlButton ) { |
192 | if ( e->key () == Qt::Key_Right || e->key () == Qt::Key_Left ) | 214 | if ( e->key () == Qt::Key_Right || e->key () == Qt::Key_Left ) |
193 | e->ignore(); | 215 | e->ignore(); |
194 | } | 216 | } |
195 | } | 217 | } |
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 0437d95..331bdfa 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h | |||
@@ -6,72 +6,74 @@ | |||
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KOJOURNALVIEW_H | 23 | #ifndef _KOJOURNALVIEW_H |
24 | #define _KOJOURNALVIEW_H | 24 | #define _KOJOURNALVIEW_H |
25 | 25 | ||
26 | #include <korganizer/baseview.h> | 26 | #include <korganizer/baseview.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | 28 | ||
29 | class JournalEntry; | 29 | class JournalEntry; |
30 | class QLabel; | ||
30 | 31 | ||
31 | /** | 32 | /** |
32 | * This class provides a journal view. | 33 | * This class provides a journal view. |
33 | 34 | ||
34 | * @short View for Journal components. | 35 | * @short View for Journal components. |
35 | * @author Cornelius Schumacher <schumacher@kde.org> | 36 | * @author Cornelius Schumacher <schumacher@kde.org> |
36 | * @see KOBaseView | 37 | * @see KOBaseView |
37 | */ | 38 | */ |
38 | class KOJournalView : public KOrg::BaseView | 39 | class KOJournalView : public KOrg::BaseView |
39 | { | 40 | { |
40 | Q_OBJECT | 41 | Q_OBJECT |
41 | public: | 42 | public: |
42 | KOJournalView(Calendar *calendar, QWidget *parent = 0, | 43 | KOJournalView(Calendar *calendar, QWidget *parent = 0, |
43 | const char *name = 0); | 44 | const char *name = 0); |
44 | ~KOJournalView(); | 45 | ~KOJournalView(); |
45 | 46 | ||
46 | virtual int currentDateCount(); | 47 | virtual int currentDateCount(); |
47 | void clearList(); | 48 | void clearList(); |
48 | virtual QPtrList<Incidence> selectedIncidences(); | 49 | virtual QPtrList<Incidence> selectedIncidences(); |
49 | DateList selectedDates() | 50 | DateList selectedDates() |
50 | {DateList q; | 51 | {DateList q; |
51 | return q;}; | 52 | return q;}; |
52 | signals: | 53 | signals: |
53 | void deleteJournal(Journal *); | 54 | void deleteJournal(Journal *); |
54 | public slots: | 55 | public slots: |
55 | void showOnly ( Journal* ); | 56 | void showOnly ( Journal* ); |
56 | void newJournal(); | 57 | void newJournal(); |
57 | void updateView(); | 58 | void updateView(); |
58 | void flushView(); | 59 | void flushView(); |
59 | void updateConfig(); | 60 | void updateConfig(); |
60 | void showDates( const QDate &start, const QDate &end ); | 61 | void showDates( const QDate &start, const QDate &end ); |
61 | void showEvents(QPtrList<Event> eventList); | 62 | void showEvents(QPtrList<Event> eventList); |
62 | 63 | ||
63 | void changeEventDisplay(Event *, int); | 64 | void changeEventDisplay(Event *, int); |
64 | 65 | ||
65 | private: | 66 | private: |
66 | void showList(QPtrList<Journal> jl); | 67 | void showList(QPtrList<Journal> jl); |
67 | Calendar *mCalendar; | 68 | Calendar *mCalendar; |
68 | JournalEntry* getNewEntry(); | 69 | JournalEntry* getNewEntry(); |
69 | QPtrList<JournalEntry> jEntries; | 70 | QPtrList<JournalEntry> jEntries; |
70 | void keyPressEvent ( QKeyEvent * ) ; | 71 | void keyPressEvent ( QKeyEvent * ) ; |
71 | QBoxLayout *mTopLayout; | 72 | QBoxLayout *mTopLayout; |
72 | QWidget *parWid; | 73 | QWidget *parWid; |
74 | QLabel * mDateLabel; | ||
73 | QDate mDate; | 75 | QDate mDate; |
74 | 76 | ||
75 | }; | 77 | }; |
76 | 78 | ||
77 | #endif | 79 | #endif |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 22d9ac0..0c1ac7a 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -194,52 +194,58 @@ bool ListItemVisitor::visit(Todo *t) | |||
194 | } | 194 | } |
195 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 195 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
196 | mItem->setText(10,t->categoriesStr()); | 196 | mItem->setText(10,t->categoriesStr()); |
197 | mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); | 197 | mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); |
198 | 198 | ||
199 | QString key; | 199 | QString key; |
200 | QDate d; | 200 | QDate d; |
201 | if (t->hasDueDate()) { | 201 | if (t->hasDueDate()) { |
202 | d = t->dtDue().date(); | 202 | d = t->dtDue().date(); |
203 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 203 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
204 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 204 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
205 | mItem->setSortKey(7,key); | 205 | mItem->setSortKey(7,key); |
206 | } | 206 | } |
207 | if ( t->hasStartDate() ) { | 207 | if ( t->hasStartDate() ) { |
208 | d = t->dtStart().date(); | 208 | d = t->dtStart().date(); |
209 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 209 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
210 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 210 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
211 | mItem->setSortKey(1,key); | 211 | mItem->setSortKey(1,key); |
212 | } | 212 | } |
213 | return true; | 213 | return true; |
214 | } | 214 | } |
215 | 215 | ||
216 | bool ListItemVisitor::visit(Journal * j) | 216 | bool ListItemVisitor::visit(Journal * j) |
217 | { | 217 | { |
218 | QString des = j->description().left(30); | 218 | |
219 | des = des.simplifyWhiteSpace (); | 219 | QString des; |
220 | des.replace (QRegExp ("\\n"),"" ); | 220 | if ( !j->summary().isEmpty() ) { |
221 | des.replace (QRegExp ("\\r"),"" ); | 221 | des = j->summary(); |
222 | } else { | ||
223 | des = j->description().left(30); | ||
224 | des = des.simplifyWhiteSpace (); | ||
225 | des.replace (QRegExp ("\\n"),"" ); | ||
226 | des.replace (QRegExp ("\\r"),"" ); | ||
227 | } | ||
222 | mItem->setText(0,i18n("Journal: ")+des.left(25)); | 228 | mItem->setText(0,i18n("Journal: ")+des.left(25)); |
223 | mItem->setText(1,j->dtStartDateStr()); | 229 | mItem->setText(1,j->dtStartDateStr()); |
224 | mItem->setText(2,"---"); | 230 | mItem->setText(2,"---"); |
225 | mItem->setText(3,"---"); | 231 | mItem->setText(3,"---"); |
226 | mItem->setText(4,"---"); | 232 | mItem->setText(4,"---"); |
227 | mItem->setText(5,"---"); | 233 | mItem->setText(5,"---"); |
228 | mItem->setText(6,"---"); | 234 | mItem->setText(6,"---"); |
229 | mItem->setText(7,j->dtStartDateStr()); | 235 | mItem->setText(7,j->dtStartDateStr()); |
230 | mItem->setText(8,"---"); | 236 | mItem->setText(8,"---"); |
231 | mItem->setText(9,"---"); | 237 | mItem->setText(9,"---"); |
232 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | 238 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); |
233 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); | 239 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); |
234 | 240 | ||
235 | QString key; | 241 | QString key; |
236 | QDate d = j->dtStart().date(); | 242 | QDate d = j->dtStart().date(); |
237 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 243 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
238 | mItem->setSortKey(1,key); | 244 | mItem->setSortKey(1,key); |
239 | mItem->setSortKey(7,key); | 245 | mItem->setSortKey(7,key); |
240 | 246 | ||
241 | return true; | 247 | return true; |
242 | } | 248 | } |
243 | 249 | ||
244 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 250 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
245 | const char *name) | 251 | const char *name) |
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 0e9f64c..72359df 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp | |||
@@ -197,48 +197,51 @@ void SearchDialog::toggleCheckboxes() | |||
197 | } | 197 | } |
198 | void SearchDialog::raiseAndSelect() | 198 | void SearchDialog::raiseAndSelect() |
199 | { | 199 | { |
200 | 200 | ||
201 | static int currentState = 0; | 201 | static int currentState = 0; |
202 | 202 | ||
203 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) | 203 | if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() ) |
204 | currentState = 0; | 204 | currentState = 0; |
205 | int newState = 0; | 205 | int newState = 0; |
206 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 206 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
207 | newState = VIEW_J_VIEW; | 207 | newState = VIEW_J_VIEW; |
208 | } | 208 | } |
209 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 209 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
210 | newState = VIEW_T_VIEW; | 210 | newState = VIEW_T_VIEW; |
211 | } | 211 | } |
212 | else { | 212 | else { |
213 | newState = VIEW_A_VIEW; | 213 | newState = VIEW_A_VIEW; |
214 | } | 214 | } |
215 | if ( newState != currentState ) { | 215 | if ( newState != currentState ) { |
216 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { | 216 | if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { |
217 | if ( ! mSearchJournal->isChecked() ) { | 217 | if ( ! mSearchJournal->isChecked() ) { |
218 | mSearchJournal->setChecked( true ); | 218 | mSearchJournal->setChecked( true ); |
219 | mSearchTodo->setChecked( false ); | 219 | mSearchTodo->setChecked( false ); |
220 | mSearchEvent->setChecked( false ); | 220 | mSearchEvent->setChecked( false ); |
221 | mSummaryCheck->setChecked( true ); | ||
222 | mDescriptionCheck->setChecked( true ); | ||
223 | |||
221 | } | 224 | } |
222 | } | 225 | } |
223 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { | 226 | else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { |
224 | if ( ! mSearchTodo->isChecked() ) { | 227 | if ( ! mSearchTodo->isChecked() ) { |
225 | mSearchTodo->setChecked( true ); | 228 | mSearchTodo->setChecked( true ); |
226 | mSearchJournal->setChecked( false ); | 229 | mSearchJournal->setChecked( false ); |
227 | mSearchEvent->setChecked( false ); | 230 | mSearchEvent->setChecked( false ); |
228 | } | 231 | } |
229 | } | 232 | } |
230 | else { | 233 | else { |
231 | if ( ! mSearchEvent->isChecked() ) { | 234 | if ( ! mSearchEvent->isChecked() ) { |
232 | mSearchEvent->setChecked( true ); | 235 | mSearchEvent->setChecked( true ); |
233 | mSearchJournal->setChecked( false ); | 236 | mSearchJournal->setChecked( false ); |
234 | mSearchTodo->setChecked( false ); | 237 | mSearchTodo->setChecked( false ); |
235 | } | 238 | } |
236 | } | 239 | } |
237 | } | 240 | } |
238 | currentState = newState; | 241 | currentState = newState; |
239 | raise(); | 242 | raise(); |
240 | } | 243 | } |
241 | void SearchDialog::setFocusToList() | 244 | void SearchDialog::setFocusToList() |
242 | { | 245 | { |
243 | listView->resetFocus(); | 246 | listView->resetFocus(); |
244 | } | 247 | } |
@@ -529,60 +532,76 @@ void SearchDialog::search(const QRegExp &re) | |||
529 | if ( mSubItems->isChecked() ) | 532 | if ( mSubItems->isChecked() ) |
530 | mMatchedTodos.remove(tod); | 533 | mMatchedTodos.remove(tod); |
531 | else if (!mMatchedTodos.contains( tod )) | 534 | else if (!mMatchedTodos.contains( tod )) |
532 | mMatchedTodos.append(tod); | 535 | mMatchedTodos.append(tod); |
533 | break; | 536 | break; |
534 | } | 537 | } |
535 | } | 538 | } |
536 | } | 539 | } |
537 | } | 540 | } |
538 | } | 541 | } |
539 | } | 542 | } |
540 | 543 | ||
541 | QPtrList<Journal> journals; | 544 | QPtrList<Journal> journals; |
542 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { | 545 | if ( !mAddItems->isChecked() && !mSubItems->isChecked() ) { |
543 | if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; | 546 | if ( mRefineItems->isChecked() ) journals = mMatchedJournals ; |
544 | mMatchedJournals.clear(); | 547 | mMatchedJournals.clear(); |
545 | } | 548 | } |
546 | if (mSearchJournal->isChecked() ) { | 549 | if (mSearchJournal->isChecked() ) { |
547 | if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); | 550 | if ( ! mRefineItems->isChecked() ) journals = mCalendar->journals(); |
548 | Journal* journ; | 551 | Journal* journ; |
549 | 552 | ||
550 | for(journ=journals.first();journ;journ=journals.next()) { | 553 | for(journ=journals.first();journ;journ=journals.next()) { |
551 | if ( journ->dtStart().date() <= mEndDate->date() | 554 | if ( journ->dtStart().date() <= mEndDate->date() |
552 | &&journ->dtStart().date() >= mStartDate->date()) { | 555 | &&journ->dtStart().date() >= mStartDate->date()) { |
556 | if (mDescriptionCheck->isChecked()) { | ||
553 | #if QT_VERSION >= 0x030000 | 557 | #if QT_VERSION >= 0x030000 |
554 | if (re.search(journ->description()) != -1) | 558 | if (re.search(journ->description()) != -1) |
555 | #else | 559 | #else |
556 | if (re.match(journ->description()) != -1) | 560 | if (re.match(journ->description()) != -1) |
557 | #endif | 561 | #endif |
558 | { | 562 | { |
559 | if ( mSubItems->isChecked() ) | 563 | if ( mSubItems->isChecked() ) |
560 | mMatchedJournals.remove(journ); | 564 | mMatchedJournals.remove(journ); |
561 | else if (!mMatchedJournals.contains( journ )) | 565 | else if (!mMatchedJournals.contains( journ )) |
562 | mMatchedJournals.append(journ); | 566 | mMatchedJournals.append(journ); |
563 | continue; | 567 | continue; |
564 | } | 568 | } |
569 | } | ||
570 | if (mSummaryCheck->isChecked()) { | ||
571 | #if QT_VERSION >= 0x030000 | ||
572 | if (re.search(journ->summary()) != -1) | ||
573 | #else | ||
574 | if (re.match(journ->summary()) != -1) | ||
575 | #endif | ||
576 | { | ||
577 | if ( mSubItems->isChecked() ) | ||
578 | mMatchedJournals.remove(journ); | ||
579 | else if (!mMatchedJournals.contains( journ )) | ||
580 | mMatchedJournals.append(journ); | ||
581 | continue; | ||
582 | } | ||
583 | } | ||
565 | } | 584 | } |
566 | } | 585 | } |
567 | } | 586 | } |
568 | if ( mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() < 1 ) { | 587 | if ( mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() < 1 ) { |
569 | qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() ); | 588 | qDebug("count %d ", mMatchedEvents.count() + mMatchedJournals.count() + mMatchedTodos.count() ); |
570 | if ( mRefineItems->isChecked() ) | 589 | if ( mRefineItems->isChecked() ) |
571 | mRefineItems->setChecked( false ); | 590 | mRefineItems->setChecked( false ); |
572 | else if ( mSubItems->isChecked() ) | 591 | else if ( mSubItems->isChecked() ) |
573 | mSubItems->setChecked( false ); | 592 | mSubItems->setChecked( false ); |
574 | } | 593 | } |
575 | } | 594 | } |
576 | 595 | ||
577 | void SearchDialog::keyPressEvent ( QKeyEvent *e) | 596 | void SearchDialog::keyPressEvent ( QKeyEvent *e) |
578 | { | 597 | { |
579 | switch ( e->key() ) { | 598 | switch ( e->key() ) { |
580 | case Qt::Key_Escape: | 599 | case Qt::Key_Escape: |
581 | close(); | 600 | close(); |
582 | break; | 601 | break; |
583 | case Qt::Key_F: | 602 | case Qt::Key_F: |
584 | if ( e->state() == Qt::ControlButton ) { | 603 | if ( e->state() == Qt::ControlButton ) { |
585 | 604 | ||
586 | } | 605 | } |
587 | break; | 606 | break; |
588 | case Qt::Key_Return: | 607 | case Qt::Key_Return: |