author | zautrix <zautrix> | 2005-07-04 14:29:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-04 14:29:18 (UTC) |
commit | 7221ff029af217ae703e8217333bd9b170203181 (patch) (unidiff) | |
tree | f294b7f4c0235858868c2a44f70b3014b7c53aab /korganizer/journalentry.cpp | |
parent | 172078c08cd183e9f7ec913a9bf42426e3585b78 (diff) | |
download | kdepimpi-7221ff029af217ae703e8217333bd9b170203181.zip kdepimpi-7221ff029af217ae703e8217333bd9b170203181.tar.gz kdepimpi-7221ff029af217ae703e8217333bd9b170203181.tar.bz2 |
box
-rw-r--r-- | korganizer/journalentry.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 3c38f34..4751d40 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -45,2 +45,4 @@ | |||
45 | #include <klineedit.h> | 45 | #include <klineedit.h> |
46 | #include <kdialog.h> | ||
47 | #include "kolocationbox.h" | ||
46 | 48 | ||
@@ -72,3 +74,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
72 | QPixmap iconp; | 74 | QPixmap iconp; |
73 | 75 | vb->setMargin ( KDialog::marginHint()-1 ); | |
74 | QPushButton * toggleJournal = new QPushButton( vb ); | 76 | QPushButton * toggleJournal = new QPushButton( vb ); |
@@ -77,3 +79,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
77 | new QLabel(" "+i18n("Title: "),vb); | 79 | new QLabel(" "+i18n("Title: "),vb); |
78 | mTitle = new KLineEdit ( vb ); | 80 | mTitle = new KOLocationBox(TRUE, vb, 30); |
81 | mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) ); | ||
79 | mTitleLabel = new QLabel(i18n("Title"),vb); | 82 | mTitleLabel = new QLabel(i18n("Title"),vb); |
@@ -97,2 +100,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
97 | toggleJournal->setFixedSize( size , size ); | 100 | toggleJournal->setFixedSize( size , size ); |
101 | mTitle->setMaximumHeight( size+4); | ||
98 | mEditor = new KTextEdit(this); | 102 | mEditor = new KTextEdit(this); |
@@ -109,2 +113,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
109 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); | 113 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); |
114 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | ||
115 | mTitle->lineEdit ()->setText(""); | ||
110 | } | 116 | } |
@@ -179,3 +185,3 @@ void JournalEntry::toggleShowJournal() | |||
179 | { | 185 | { |
180 | if (!mEditor->text().isEmpty() || !mTitle->text().isEmpty()) | 186 | if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty()) |
181 | flushEntry(); | 187 | flushEntry(); |
@@ -197,3 +203,3 @@ void JournalEntry::setShowOnly() | |||
197 | showOnlyMode = true; | 203 | showOnlyMode = true; |
198 | if ( mTitle->text().isEmpty() ) | 204 | if ( mTitle->currentText().isEmpty() ) |
199 | mTitle->setFocus(); | 205 | mTitle->setFocus(); |
@@ -205,2 +211,3 @@ void JournalEntry::setJournal(Journal *journal) | |||
205 | writeJournal(); | 211 | writeJournal(); |
212 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | ||
206 | 213 | ||
@@ -208,7 +215,7 @@ void JournalEntry::setJournal(Journal *journal) | |||
208 | if ( journal->isReadOnly() ) | 215 | if ( journal->isReadOnly() ) |
209 | mTitle->setText(mJournal->summary()+" ("+i18n("readonly")+")"); | 216 | mTitle->lineEdit ()->setText(mJournal->summary()+" ("+i18n("readonly")+")"); |
210 | else | 217 | else |
211 | mTitle->setText(mJournal->summary()); | 218 | mTitle->lineEdit ()->setText(mJournal->summary()); |
212 | mEditor->setText(mJournal->description()); | 219 | mEditor->setText(mJournal->description()); |
213 | mTitle->setReadOnly (journal->isReadOnly() ); | 220 | mTitle->setEnabled (!journal->isReadOnly() ); |
214 | mEditor->setReadOnly ( journal->isReadOnly() ); | 221 | mEditor->setReadOnly ( journal->isReadOnly() ); |
@@ -218,3 +225,2 @@ void JournalEntry::setJournal(Journal *journal) | |||
218 | mTitleLabel->setText( " (" + calname +")"); | 225 | mTitleLabel->setText( " (" + calname +")"); |
219 | |||
220 | } | 226 | } |
@@ -231,3 +237,4 @@ void JournalEntry::clear() | |||
231 | mEditor->setText(""); | 237 | mEditor->setText(""); |
232 | mTitle->setText(""); | 238 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
239 | mTitle->lineEdit ()->setText(""); | ||
233 | } | 240 | } |
@@ -255,3 +262,3 @@ void JournalEntry::writeJournal() | |||
255 | if ( !visibleMode ) return; | 262 | if ( !visibleMode ) return; |
256 | if (mEditor->text().isEmpty() && mTitle->text().isEmpty()) { | 263 | if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) { |
257 | if ( mJournal ) { | 264 | if ( mJournal ) { |
@@ -274,6 +281,9 @@ void JournalEntry::writeJournal() | |||
274 | } | 281 | } |
275 | if ( mJournal->description() != mEditor->text() ) | 282 | if ( mJournal->description() != mEditor->text() ) { |
276 | mJournal->setDescription(mEditor->text()); | 283 | mJournal->setDescription(mEditor->text()); |
277 | if ( mJournal->summary() != mTitle->text() ) | 284 | } |
278 | mJournal->setSummary(mTitle->text()); | 285 | if ( mJournal->summary() != mTitle->currentText() ) { |
286 | mJournal->setSummary(mTitle->currentText()); | ||
287 | mTitle->save(KOLocationBox::SUMMARYJOURNAL); | ||
288 | } | ||
279 | } | 289 | } |