author | zautrix <zautrix> | 2005-06-29 12:29:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 12:29:53 (UTC) |
commit | 0d4d5898a32f162dca010db329e02310a14629d5 (patch) (side-by-side diff) | |
tree | 2d6e758a8a5ec64995de79a4cd1c02c89f509190 /korganizer/journalentry.cpp | |
parent | 435e68d6ace30fb2121b718226e00be44971c617 (diff) | |
download | kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.zip kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.tar.gz kdepimpi-0d4d5898a32f162dca010db329e02310a14629d5.tar.bz2 |
j fixes
-rw-r--r-- | korganizer/journalentry.cpp | 53 |
1 files changed, 21 insertions, 32 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 0b923ad..05bfd31 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -43,4 +43,5 @@ #include <kmessagebox.h> #include "koprefs.h" +#include <klineedit.h> #include <libkcal/journal.h> @@ -64,25 +65,15 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : QHBox * vb = new QHBox ( this ); - QPushButton * newJournal = new QPushButton( vb ); QIconSet icon; - if ( QApplication::desktop()->width() < 321 ) - icon = SmallIcon("ko16old"); - else - icon = SmallIcon("ko24old"); - newJournal->setIconSet (icon ) ; - int size = newJournal->sizeHint().height(); - newJournal->setFixedSize( size, size ); - QPushButton * toggleJournal = new QPushButton( vb ); icon = SmallIcon("1updownarrow"); toggleJournal->setIconSet (icon ) ; - //int size = toggleJournal->sizeHint().height(); + int size = toggleJournal->sizeHint().height(); toggleJournal->setFixedSize( size * 2 /3 , size ); - - - + new QLabel(i18n(" Title: "),vb); + mTitle = new KLineEdit ( vb ); mTitleLabel = new QLabel(i18n("Title"),vb); - mTitleLabel->setMargin(2); + mTitleLabel->setMargin(0); mTitleLabel->setAlignment(AlignCenter); QPushButton * loadTemplate = new QPushButton( vb ); @@ -112,6 +103,6 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mEditor->installEventFilter(this); connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); + connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) ); connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); - connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) ); connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); } @@ -119,5 +110,5 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : JournalEntry::~JournalEntry() { - qDebug("JournalEntry::~JournalEntry() "); + //qDebug("JournalEntry::~JournalEntry() "); } QSize JournalEntry::sizeHint() const @@ -180,14 +171,11 @@ void JournalEntry::setDate(const QDate &date) writeJournal(); int id = mCalendar->defaultCalendar(); - if ( id == 1 ) { - mTitleLabel->setText(KGlobal::locale()->formatDate(date)); - } else { - QString calname = KOPrefs::instance()->getCalendar( id )->mName; - mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); - } + QString calname = KOPrefs::instance()->getCalendar( id )->mName; + mTitleLabel->setText( " (" + calname +")"); } void JournalEntry::toggleShowJournal() { + flushEntry(); if ( showOnlyMode ) emit showJournalOnly( 0 ); @@ -195,5 +183,9 @@ void JournalEntry::toggleShowJournal() emit showJournalOnly( mJournal ); } - +void JournalEntry::setShowOnly() +{ + showOnlyMode = true; + mEditor->setFocus(); +} void JournalEntry::setJournal(Journal *journal) { @@ -201,13 +193,11 @@ void JournalEntry::setJournal(Journal *journal) mJournal = journal; - + mTitle->setText(mJournal->summary()); mEditor->setText(mJournal->description()); int id = mJournal->calID(); - if ( id > 1 ) { - QString calname = KOPrefs::instance()->getCalendar( id )->mName; - mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); - } else { - mTitleLabel->setText(KGlobal::locale()->formatDate(mDate)); - } + + QString calname = KOPrefs::instance()->getCalendar( id )->mName; + mTitleLabel->setText( " (" + calname +")"); + mDirty = false; } @@ -275,6 +265,5 @@ void JournalEntry::writeJournal() mJournal->setDescription(mEditor->text()); - //qDebug("tttt%s ", mEditor->text().latin1()); - + mJournal->setSummary(mTitle->text()); mDirty = false; } |