author | zautrix <zautrix> | 2005-07-04 14:29:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-04 14:29:18 (UTC) |
commit | 7221ff029af217ae703e8217333bd9b170203181 (patch) (side-by-side diff) | |
tree | f294b7f4c0235858868c2a44f70b3014b7c53aab | |
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 | 18 | ||||
-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, 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 @@ -44,4 +44,6 @@ #include "koprefs.h" #include <klineedit.h> +#include <kdialog.h> +#include "kolocationbox.h" #include <libkcal/journal.h> @@ -71,10 +73,11 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : QHBox * vb = new QHBox ( this ); QPixmap iconp; - + vb->setMargin ( KDialog::marginHint()-1 ); QPushButton * toggleJournal = new QPushButton( vb ); iconp = SmallIcon("1updownarrow"); toggleJournal->setPixmap (iconp ) ; 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); mTitleLabel->setMargin(0); @@ -96,4 +99,5 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : saveTemplate->setFixedSize( size, size ); toggleJournal->setFixedSize( size , size ); + mTitle->setMaximumHeight( size+4); mEditor = new KTextEdit(this); #ifndef DESKTOP_VERSION @@ -108,4 +112,6 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); + mTitle->load( KOLocationBox::SUMMARYJOURNAL ); + mTitle->lineEdit ()->setText(""); } @@ -178,5 +184,5 @@ void JournalEntry::setDate(const QDate &date) void JournalEntry::toggleShowJournal() { - if (!mEditor->text().isEmpty() || !mTitle->text().isEmpty()) + if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty()) flushEntry(); if ( showOnlyMode ) @@ -196,5 +202,5 @@ void JournalEntry::setShowOnly() { showOnlyMode = true; - if ( mTitle->text().isEmpty() ) + if ( mTitle->currentText().isEmpty() ) mTitle->setFocus(); else @@ -204,12 +210,13 @@ void JournalEntry::setJournal(Journal *journal) { writeJournal(); + mTitle->load( KOLocationBox::SUMMARYJOURNAL ); mJournal = 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() ); int id = mJournal->calID(); @@ -217,5 +224,4 @@ void JournalEntry::setJournal(Journal *journal) QString calname = KOPrefs::instance()->getCalendar( id )->mName; mTitleLabel->setText( " (" + calname +")"); - } @@ -230,5 +236,6 @@ void JournalEntry::clear() mJournal = 0; mEditor->setText(""); - mTitle->setText(""); + mTitle->load( KOLocationBox::SUMMARYJOURNAL ); + mTitle->lineEdit ()->setText(""); } @@ -254,5 +261,5 @@ void JournalEntry::writeJournal() { if ( !visibleMode ) return; - if (mEditor->text().isEmpty() && mTitle->text().isEmpty()) { + if (mEditor->text().isEmpty() && mTitle->currentText().isEmpty()) { if ( mJournal ) { Journal* j = mJournal; @@ -273,8 +280,11 @@ void JournalEntry::writeJournal() mCalendar->addJournal(mJournal); } - 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 @@ -33,4 +33,5 @@ class QLabel; class KTextEdit; class KLineEdit; +class KOLocationBox; using namespace KCal; @@ -77,5 +78,5 @@ class JournalEntry : public QFrame { void keyPressEvent ( QKeyEvent * ) ; QLabel *mTitleLabel; - KLineEdit * mTitle; + KOLocationBox * mTitle; KTextEdit *mEditor; int heiHint; diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 407a5d5..fd50b05 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -84,5 +84,5 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) headerLayout->addWidget(summaryLabel,0,0); - mSummaryEdit = new KOLocationBox(TRUE,parent, 10); + mSummaryEdit = new KOLocationBox(TRUE,parent, 50); mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); @@ -106,5 +106,5 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) headerLayout->addWidget(locationLabel,1,0); - mLocationEdit = new KOLocationBox(TRUE,parent,10); + mLocationEdit = new KOLocationBox(TRUE,parent,30); mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 6fa9b23..9b0e748 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -51,12 +51,5 @@ 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 ); QPixmap icon; @@ -69,7 +62,14 @@ KOJournalView::KOJournalView(Calendar *calendar, QWidget *parent, newJournal->setFixedSize( size, size ); 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() ) ); getNewEntry(); diff --git a/korganizer/kolocationbox.cpp b/korganizer/kolocationbox.cpp index 35a8123..9d5aafc 100644 --- a/korganizer/kolocationbox.cpp +++ b/korganizer/kolocationbox.cpp @@ -35,5 +35,5 @@ 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); setDuplicatesEnabled( FALSE ); @@ -62,4 +62,7 @@ void KOLocationBox::load(int what) insertStringList( KOPrefs::instance()->mTodoSummaryUser, 0 ); break; // don't disable + case SUMMARYJOURNAL: + insertStringList( KOPrefs::instance()->mJournalSummaryUser, 0 ); + break; // don't disable } } @@ -87,4 +90,7 @@ void KOLocationBox::save(int what) KOPrefs::instance()->mTodoSummaryUser = strlist; 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 @@ -37,5 +37,5 @@ class KOLocationBox : public QComboBox virtual ~KOLocationBox(); - enum {LOCATION, SUMMARYEVENT, SUMMARYTODO}; + enum {LOCATION, SUMMARYEVENT, SUMMARYTODO,SUMMARYJOURNAL}; public slots: diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 6337ca5..bb3d720 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -132,4 +132,5 @@ KOPrefs::KOPrefs() : addItemStringList("EventSummary User",&mEventSummaryUser); addItemStringList("TodoSummary User",&mTodoSummaryUser); + addItemStringList("JournalSummary User",&mJournalSummaryUser); addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); @@ -364,4 +365,5 @@ void KOPrefs::setAllDefaults() mEventSummaryUser = getDefaultList() ; 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 @@ -316,4 +316,5 @@ class KOPrefs : public KPimPrefs QStringList mEventSummaryUser; QStringList mTodoSummaryUser; + QStringList mJournalSummaryUser; bool mUseInternalAlarmNotification; |