summaryrefslogtreecommitdiffabout
path: root/korganizer/journalentry.cpp
Unidiff
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 @@
44#include "koprefs.h" 44#include "koprefs.h"
45#include <klineedit.h>
45 46
@@ -65,12 +66,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
65 QHBox * vb = new QHBox ( this ); 66 QHBox * vb = new QHBox ( this );
66 QPushButton * newJournal = new QPushButton( vb );
67 QIconSet icon; 67 QIconSet icon;
68 if ( QApplication::desktop()->width() < 321 )
69 icon = SmallIcon("ko16old");
70 else
71 icon = SmallIcon("ko24old");
72 newJournal->setIconSet (icon ) ;
73 int size = newJournal->sizeHint().height();
74 newJournal->setFixedSize( size, size );
75
76 68
@@ -79,9 +71,8 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
79 toggleJournal->setIconSet (icon ) ; 71 toggleJournal->setIconSet (icon ) ;
80 //int size = toggleJournal->sizeHint().height(); 72 int size = toggleJournal->sizeHint().height();
81 toggleJournal->setFixedSize( size * 2 /3 , size ); 73 toggleJournal->setFixedSize( size * 2 /3 , size );
82 74 new QLabel(i18n(" Title: "),vb);
83 75 mTitle = new KLineEdit ( vb );
84
85 mTitleLabel = new QLabel(i18n("Title"),vb); 76 mTitleLabel = new QLabel(i18n("Title"),vb);
86 mTitleLabel->setMargin(2); 77 mTitleLabel->setMargin(0);
87 mTitleLabel->setAlignment(AlignCenter); 78 mTitleLabel->setAlignment(AlignCenter);
@@ -113,4 +104,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
113 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 104 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
105 connect( mTitle, SIGNAL( textChanged ( const QString & ) ), this , SLOT( setDirty() ) );
114 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 106 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
115 connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) );
116 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); 107 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
@@ -120,3 +111,3 @@ JournalEntry::~JournalEntry()
120{ 111{
121 qDebug("JournalEntry::~JournalEntry() "); 112 //qDebug("JournalEntry::~JournalEntry() ");
122} 113}
@@ -181,8 +172,4 @@ void JournalEntry::setDate(const QDate &date)
181 int id = mCalendar->defaultCalendar(); 172 int id = mCalendar->defaultCalendar();
182 if ( id == 1 ) { 173 QString calname = KOPrefs::instance()->getCalendar( id )->mName;
183 mTitleLabel->setText(KGlobal::locale()->formatDate(date)); 174 mTitleLabel->setText( " (" + calname +")");
184 } else {
185 QString calname = KOPrefs::instance()->getCalendar( id )->mName;
186 mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")");
187 }
188} 175}
@@ -191,2 +178,3 @@ void JournalEntry::toggleShowJournal()
191{ 178{
179 flushEntry();
192 if ( showOnlyMode ) 180 if ( showOnlyMode )
@@ -196,3 +184,7 @@ void JournalEntry::toggleShowJournal()
196} 184}
197 185void JournalEntry::setShowOnly()
186{
187 showOnlyMode = true;
188 mEditor->setFocus();
189}
198void JournalEntry::setJournal(Journal *journal) 190void JournalEntry::setJournal(Journal *journal)
@@ -202,11 +194,9 @@ void JournalEntry::setJournal(Journal *journal)
202 mJournal = journal; 194 mJournal = journal;
203 195 mTitle->setText(mJournal->summary());
204 mEditor->setText(mJournal->description()); 196 mEditor->setText(mJournal->description());
205 int id = mJournal->calID(); 197 int id = mJournal->calID();
206 if ( id > 1 ) { 198
207 QString calname = KOPrefs::instance()->getCalendar( id )->mName; 199 QString calname = KOPrefs::instance()->getCalendar( id )->mName;
208 mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); 200 mTitleLabel->setText( " (" + calname +")");
209 } else { 201
210 mTitleLabel->setText(KGlobal::locale()->formatDate(mDate));
211 }
212 mDirty = false; 202 mDirty = false;
@@ -276,4 +266,3 @@ void JournalEntry::writeJournal()
276 mJournal->setDescription(mEditor->text()); 266 mJournal->setDescription(mEditor->text());
277 //qDebug("tttt%s ", mEditor->text().latin1()); 267 mJournal->setSummary(mTitle->text());
278
279 mDirty = false; 268 mDirty = false;