summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/journalentry.cpp36
-rw-r--r--korganizer/journalentry.h3
-rw-r--r--korganizer/koeditorgeneral.cpp4
-rw-r--r--korganizer/kojournalview.cpp18
-rw-r--r--korganizer/kolocationbox.cpp8
-rw-r--r--korganizer/kolocationbox.h2
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefs.h1
8 files changed, 47 insertions, 27 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 @@
#include <klineedit.h>
+#include <kdialog.h>
+#include "kolocationbox.h"
@@ -72,3 +74,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
QPixmap iconp;
-
+ vb->setMargin ( KDialog::marginHint()-1 );
QPushButton * toggleJournal = new QPushButton( vb );
@@ -77,3 +79,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
new QLabel(" "+i18n("Title: "),vb);
- mTitle = new KLineEdit ( vb );
+ mTitle = new KOLocationBox(TRUE, vb, 30);
+ mTitle->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding ,QSizePolicy::Fixed ,FALSE) );
mTitleLabel = new QLabel(i18n("Title"),vb);
@@ -97,2 +100,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
toggleJournal->setFixedSize( size , size );
+ mTitle->setMaximumHeight( size+4);
mEditor = new KTextEdit(this);
@@ -109,2 +113,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
+ mTitle->load( KOLocationBox::SUMMARYJOURNAL );
+ mTitle->lineEdit ()->setText("");
}
@@ -179,3 +185,3 @@ void JournalEntry::toggleShowJournal()
{
- if (!mEditor->text().isEmpty() || !mTitle->text().isEmpty())
+ if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty())
flushEntry();
@@ -197,3 +203,3 @@ void JournalEntry::setShowOnly()
showOnlyMode = true;
- if ( mTitle->text().isEmpty() )
+ if ( mTitle->currentText().isEmpty() )
mTitle->setFocus();
@@ -205,2 +211,3 @@ void JournalEntry::setJournal(Journal *journal)
writeJournal();
+ mTitle->load( KOLocationBox::SUMMARYJOURNAL );
@@ -208,7 +215,7 @@ void JournalEntry::setJournal(Journal *journal)
if ( journal->isReadOnly() )
- mTitle->setText(mJournal->summary()+" ("+i18n("readonly")+")");
+ mTitle->lineEdit ()->setText(mJournal->summary()+" ("+i18n("readonly")+")");
else
- mTitle->setText(mJournal->summary());
+ mTitle->lineEdit ()->setText(mJournal->summary());
mEditor->setText(mJournal->description());
- mTitle->setReadOnly (journal->isReadOnly() );
+ mTitle->setEnabled (!journal->isReadOnly() );
mEditor->setReadOnly ( journal->isReadOnly() );
@@ -218,3 +225,2 @@ void JournalEntry::setJournal(Journal *journal)
mTitleLabel->setText( " (" + calname +")");
-
}
@@ -231,3 +237,4 @@ void JournalEntry::clear()
mEditor->setText("");
- mTitle->setText("");
+ mTitle->load( KOLocationBox::SUMMARYJOURNAL );
+ mTitle->lineEdit ()->setText("");
}
@@ -255,3 +262,3 @@ void JournalEntry::writeJournal()
if ( !visibleMode ) return;
- if (mEditor->text().isEmpty() && mTitle->text().isEmpty()) {
+ if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) {
if ( mJournal ) {
@@ -274,6 +281,9 @@ void JournalEntry::writeJournal()
}
- if ( mJournal->description() != mEditor->text() )
+ if ( mJournal->description() != mEditor->text() ) {
mJournal->setDescription(mEditor->text());
- if ( mJournal->summary() != mTitle->text() )
- mJournal->setSummary(mTitle->text());
+ }
+ if ( mJournal->summary() != mTitle->currentText() ) {
+ mJournal->setSummary(mTitle->currentText());
+ mTitle->save(KOLocationBox::SUMMARYJOURNAL);
+ }
}
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;
class KLineEdit;
+class KOLocationBox;
@@ -78,3 +79,3 @@ class JournalEntry : public QFrame {
QLabel *mTitleLabel;
- KLineEdit * mTitle;
+ KOLocationBox * mTitle;
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)
- mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
+ mSummaryEdit = new KOLocationBox(TRUE,parent, 50);
mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
@@ -107,3 +107,3 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
- mLocationEdit = new KOLocationBox(TRUE,parent,10);
+ mLocationEdit = new KOLocationBox(TRUE,parent,30);
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,10 +52,3 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
mCalendar = calendar;
- QScrollView * sv = new QScrollView( this );
- QHBoxLayout * hbl = new QHBoxLayout( this );
- hbl->addWidget( sv );
- parWid = new QWidget( sv->viewport() );
- sv->addChild(parWid);
- sv->setResizePolicy( QScrollView:: AutoOneFit );
- mTopLayout = new QVBoxLayout(parWid);
- QHBox * vb = new QHBox ( parWid );
+ QHBox * vb = new QHBox ( this );
QPushButton * newJournal = new QPushButton( vb );
@@ -70,5 +63,12 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent,
mDateLabel = new QLabel ( vb );
- mTopLayout->addWidget( vb );
mDateLabel->setMargin(1);
mDateLabel->setAlignment(AlignCenter);
+ QScrollView * sv = new QScrollView( this );
+ QVBoxLayout * hbl = new QVBoxLayout( this );
+ hbl->addWidget( vb );
+ hbl->addWidget( sv );
+ parWid = new QWidget( sv->viewport() );
+ sv->addChild(parWid);
+ sv->setResizePolicy( QScrollView:: AutoOneFit );
+ mTopLayout = new QVBoxLayout(parWid);
connect( newJournal, SIGNAL( clicked() ), this , SLOT( newJournal() ) );
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) :
maxItems = _maxItems;
- maxItems = 50; // sorry - hack from me to set maxitems globally to 30
+ //maxItems = 50; // sorry - hack from me to set maxitems globally to 30
setInsertionPolicy(AtTop);
@@ -63,2 +63,5 @@ void KOLocationBox::load(int what)
break; // don't disable
+ case SUMMARYJOURNAL:
+ insertStringList( KOPrefs::instance()->mJournalSummaryUser, 0 );
+ break; // don't disable
}
@@ -88,2 +91,5 @@ void KOLocationBox::save(int what)
break; // don't disable
+ case SUMMARYJOURNAL:
+ KOPrefs::instance()->mJournalSummaryUser = strlist;
+ break; // don't disable
}
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
- enum {LOCATION, SUMMARYEVENT, SUMMARYTODO};
+ enum {LOCATION, SUMMARYEVENT, SUMMARYTODO,SUMMARYJOURNAL};
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() :
addItemStringList("TodoSummary User",&mTodoSummaryUser);
+ addItemStringList("JournalSummary User",&mJournalSummaryUser);
@@ -365,2 +366,3 @@ void KOPrefs::setAllDefaults()
mTodoSummaryUser = getDefaultList() ;
+ mJournalSummaryUser = getDefaultList() ;
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
QStringList mTodoSummaryUser;
+ QStringList mJournalSummaryUser;