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 | |
parent | 172078c08cd183e9f7ec913a9bf42426e3585b78 (diff) | |
download | kdepimpi-7221ff029af217ae703e8217333bd9b170203181.zip kdepimpi-7221ff029af217ae703e8217333bd9b170203181.tar.gz kdepimpi-7221ff029af217ae703e8217333bd9b170203181.tar.bz2 |
box
-rw-r--r-- | korganizer/journalentry.cpp | 36 | ||||
-rw-r--r-- | korganizer/journalentry.h | 3 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 4 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 36 | ||||
-rw-r--r-- | korganizer/kolocationbox.cpp | 8 | ||||
-rw-r--r-- | korganizer/kolocationbox.h | 2 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 |
8 files changed, 56 insertions, 36 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 | } |
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index cc9b5ef..fb19fb1 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h | |||
@@ -34,2 +34,3 @@ class KTextEdit; | |||
34 | class KLineEdit; | 34 | class KLineEdit; |
35 | class KOLocationBox; | ||
35 | 36 | ||
@@ -78,3 +79,3 @@ class JournalEntry : public QFrame { | |||
78 | QLabel *mTitleLabel; | 79 | QLabel *mTitleLabel; |
79 | KLineEdit * mTitle; | 80 | KOLocationBox * mTitle; |
80 | KTextEdit *mEditor; | 81 | KTextEdit *mEditor; |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 407a5d5..fd50b05 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -85,3 +85,3 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | |||
85 | 85 | ||
86 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); | 86 | mSummaryEdit = new KOLocationBox(TRUE,parent, 50); |
87 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 87 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
@@ -107,3 +107,3 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | |||
107 | 107 | ||
108 | mLocationEdit = new KOLocationBox(TRUE,parent,10); | 108 | mLocationEdit = new KOLocationBox(TRUE,parent,30); |
109 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 109 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 6fa9b23..9b0e748 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -52,4 +52,18 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, | |||
52 | mCalendar = calendar; | 52 | mCalendar = calendar; |
53 | QHBox * vb = new QHBox ( this ); | ||
54 | QPushButton * newJournal = new QPushButton( vb ); | ||
55 | QPixmap icon; | ||
56 | if ( QApplication::desktop()->width() < 321 ) | ||
57 | icon = SmallIcon("ko16old"); | ||
58 | else | ||
59 | icon = SmallIcon("ko24old"); | ||
60 | newJournal->setPixmap (icon ) ; | ||
61 | int size = newJournal->sizeHint().height(); | ||
62 | newJournal->setFixedSize( size, size ); | ||
63 | mDateLabel = new QLabel ( vb ); | ||
64 | mDateLabel->setMargin(1); | ||
65 | mDateLabel->setAlignment(AlignCenter); | ||
53 | QScrollView * sv = new QScrollView( this ); | 66 | QScrollView * sv = new QScrollView( this ); |
54 | QHBoxLayout * hbl = new QHBoxLayout( this ); | 67 | QVBoxLayout * hbl = new QVBoxLayout( this ); |
68 | hbl->addWidget( vb ); | ||
55 | hbl->addWidget( sv ); | 69 | hbl->addWidget( sv ); |
@@ -58,19 +72,5 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, | |||
58 | sv->setResizePolicy( QScrollView:: AutoOneFit ); | 72 | sv->setResizePolicy( QScrollView:: AutoOneFit ); |
59 | mTopLayout = new QVBoxLayout(parWid); | 73 | mTopLayout = new QVBoxLayout(parWid); |
60 | QHBox * vb = new QHBox ( parWid ); | 74 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); |
61 | QPushButton * newJournal = new QPushButton( vb ); | 75 | getNewEntry(); |
62 | QPixmap icon; | ||
63 | if ( QApplication::desktop()->width() < 321 ) | ||
64 | icon = SmallIcon("ko16old"); | ||
65 | else | ||
66 | icon = SmallIcon("ko24old"); | ||
67 | newJournal->setPixmap (icon ) ; | ||
68 | int size = newJournal->sizeHint().height(); | ||
69 | newJournal->setFixedSize( size, size ); | ||
70 | mDateLabel = new QLabel ( vb ); | ||
71 | mTopLayout->addWidget( vb ); | ||
72 | mDateLabel->setMargin(1); | ||
73 | mDateLabel->setAlignment(AlignCenter); | ||
74 | connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) ); | ||
75 | getNewEntry(); | ||
76 | } | 76 | } |
diff --git a/korganizer/kolocationbox.cpp b/korganizer/kolocationbox.cpp index 35a8123..9d5aafc 100644 --- a/korganizer/kolocationbox.cpp +++ b/korganizer/kolocationbox.cpp | |||
@@ -36,3 +36,3 @@ KOLocationBox::KOLocationBox( bool rw , QWidget *parent , int _maxItems) : | |||
36 | maxItems = _maxItems; | 36 | maxItems = _maxItems; |
37 | maxItems = 50; // sorry - hack from me to set maxitems globally to 30 | 37 | //maxItems = 50; // sorry - hack from me to set maxitems globally to 30 |
38 | setInsertionPolicy(AtTop); | 38 | setInsertionPolicy(AtTop); |
@@ -63,2 +63,5 @@ void KOLocationBox::load(int what) | |||
63 | break; // don't disable | 63 | break; // don't disable |
64 | case SUMMARYJOURNAL: | ||
65 | insertStringList( KOPrefs::instance()->mJournalSummaryUser, 0 ); | ||
66 | break; // don't disable | ||
64 | } | 67 | } |
@@ -88,2 +91,5 @@ void KOLocationBox::save(int what) | |||
88 | break; // don't disable | 91 | break; // don't disable |
92 | case SUMMARYJOURNAL: | ||
93 | KOPrefs::instance()->mJournalSummaryUser = strlist; | ||
94 | break; // don't disable | ||
89 | } | 95 | } |
diff --git a/korganizer/kolocationbox.h b/korganizer/kolocationbox.h index b604d33..6a42de6 100644 --- a/korganizer/kolocationbox.h +++ b/korganizer/kolocationbox.h | |||
@@ -38,3 +38,3 @@ class KOLocationBox : public QComboBox | |||
38 | 38 | ||
39 | enum {LOCATION, SUMMARYEVENT, SUMMARYTODO}; | 39 | enum {LOCATION, SUMMARYEVENT, SUMMARYTODO,SUMMARYJOURNAL}; |
40 | 40 | ||
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 6337ca5..bb3d720 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -133,2 +133,3 @@ KOPrefs::KOPrefs() : | |||
133 | addItemStringList("TodoSummary User",&mTodoSummaryUser); | 133 | addItemStringList("TodoSummary User",&mTodoSummaryUser); |
134 | addItemStringList("JournalSummary User",&mJournalSummaryUser); | ||
134 | 135 | ||
@@ -365,2 +366,3 @@ void KOPrefs::setAllDefaults() | |||
365 | mTodoSummaryUser = getDefaultList() ; | 366 | mTodoSummaryUser = getDefaultList() ; |
367 | mJournalSummaryUser = getDefaultList() ; | ||
366 | mLocationDefaults = getLocationDefaultList(); | 368 | mLocationDefaults = getLocationDefaultList(); |
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 5cc9bfa..53d193b 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h | |||
@@ -317,2 +317,3 @@ class KOPrefs : public KPimPrefs | |||
317 | QStringList mTodoSummaryUser; | 317 | QStringList mTodoSummaryUser; |
318 | QStringList mJournalSummaryUser; | ||
318 | 319 | ||