summaryrefslogtreecommitdiffabout
path: root/korganizer/journalentry.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/journalentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp53
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
@@ -44,2 +44,3 @@
#include "koprefs.h"
+#include <klineedit.h>
@@ -65,12 +66,3 @@ 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 );
-
@@ -79,9 +71,8 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
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);
@@ -113,4 +104,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
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() ) );
@@ -120,3 +111,3 @@ JournalEntry::~JournalEntry()
{
- qDebug("JournalEntry::~JournalEntry() ");
+ //qDebug("JournalEntry::~JournalEntry() ");
}
@@ -181,8 +172,4 @@ void JournalEntry::setDate(const QDate &date)
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 +")");
}
@@ -191,2 +178,3 @@ void JournalEntry::toggleShowJournal()
{
+ flushEntry();
if ( showOnlyMode )
@@ -196,3 +184,7 @@ void JournalEntry::toggleShowJournal()
}
-
+void JournalEntry::setShowOnly()
+{
+ showOnlyMode = true;
+ mEditor->setFocus();
+}
void JournalEntry::setJournal(Journal *journal)
@@ -202,11 +194,9 @@ 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;
@@ -276,4 +266,3 @@ void JournalEntry::writeJournal()
mJournal->setDescription(mEditor->text());
- //qDebug("tttt%s ", mEditor->text().latin1());
-
+ mJournal->setSummary(mTitle->text());
mDirty = false;