author | zautrix <zautrix> | 2005-06-29 10:36:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 10:36:31 (UTC) |
commit | b7044dfc9516d546683973985555c481d59fc677 (patch) (unidiff) | |
tree | b521090cfc8eb6c8c6a6f6f8167c83058ea1361b /korganizer/journalentry.cpp | |
parent | f226b4cd2ce06a6948811fe04d80fe3ffa44f695 (diff) | |
download | kdepimpi-b7044dfc9516d546683973985555c481d59fc677.zip kdepimpi-b7044dfc9516d546683973985555c481d59fc677.tar.gz kdepimpi-b7044dfc9516d546683973985555c481d59fc677.tar.bz2 |
journal fixxx
-rw-r--r-- | korganizer/journalentry.cpp | 61 |
1 files changed, 49 insertions, 12 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index c19a5ca..7274849 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -58,2 +58,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
58 | { | 58 | { |
59 | showOnlyMode = false; | ||
59 | mCalendar = calendar; | 60 | mCalendar = calendar; |
@@ -63,5 +64,26 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
63 | QHBox * vb = new QHBox ( this ); | 64 | QHBox * vb = new QHBox ( this ); |
65 | QPushButton * newJournal = new QPushButton( vb ); | ||
66 | QIconSet icon; | ||
67 | if ( QApplication::desktop()->width() < 321 ) | ||
68 | icon = SmallIcon("ko16old"); | ||
69 | else | ||
70 | icon = SmallIcon("ko24old"); | ||
71 | newJournal->setIconSet (icon ) ; | ||
72 | int size = newJournal->sizeHint().height(); | ||
73 | newJournal->setFixedSize( size, size ); | ||
74 | |||
75 | |||
76 | QPushButton * toggleJournal = new QPushButton( vb ); | ||
77 | icon = SmallIcon("1updownarrow"); | ||
78 | toggleJournal->setIconSet (icon ) ; | ||
79 | //int size = toggleJournal->sizeHint().height(); | ||
80 | toggleJournal->setFixedSize( size * 2 /3 , size ); | ||
81 | |||
82 | |||
83 | |||
84 | mTitleLabel = new QLabel(i18n("Title"),vb); | ||
85 | mTitleLabel->setMargin(2); | ||
86 | mTitleLabel->setAlignment(AlignCenter); | ||
64 | QPushButton * loadTemplate = new QPushButton( vb ); | 87 | QPushButton * loadTemplate = new QPushButton( vb ); |
65 | QPushButton * saveTemplate = new QPushButton( vb ); | 88 | QPushButton * saveTemplate = new QPushButton( vb ); |
66 | QIconSet icon; | ||
67 | if ( QApplication::desktop()->width() < 321 ) | 89 | if ( QApplication::desktop()->width() < 321 ) |
@@ -71,3 +93,3 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
71 | saveTemplate->setIconSet (icon ) ; | 93 | saveTemplate->setIconSet (icon ) ; |
72 | int size = saveTemplate->sizeHint().height(); | 94 | //size = saveTemplate->sizeHint().height(); |
73 | saveTemplate->setFixedSize( size, size ); | 95 | saveTemplate->setFixedSize( size, size ); |
@@ -79,7 +101,2 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
79 | loadTemplate->setFixedSize( size, size ); | 101 | loadTemplate->setFixedSize( size, size ); |
80 | |||
81 | mTitleLabel = new QLabel(i18n("Title"),vb); | ||
82 | mTitleLabel->setMargin(2); | ||
83 | mTitleLabel->setAlignment(AlignCenter); | ||
84 | |||
85 | mEditor = new KTextEdit(this); | 102 | mEditor = new KTextEdit(this); |
@@ -96,2 +113,4 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
96 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 113 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
114 | connect( newJournal, SIGNAL( clicked() ), this , SIGNAL( newJournal() ) ); | ||
115 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); | ||
97 | } | 116 | } |
@@ -153,8 +172,20 @@ void JournalEntry::setDate(const QDate &date) | |||
153 | { | 172 | { |
173 | showOnlyMode = false; | ||
174 | mDate = date; | ||
154 | writeJournal(); | 175 | writeJournal(); |
176 | int id = mCalendar->defaultCalendar(); | ||
177 | if ( id == 1 ) { | ||
178 | mTitleLabel->setText(KGlobal::locale()->formatDate(date)); | ||
179 | } else { | ||
180 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | ||
181 | mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); | ||
182 | } | ||
183 | } | ||
155 | 184 | ||
156 | mTitleLabel->setText(KGlobal::locale()->formatDate(date)); | 185 | void JournalEntry::toggleShowJournal() |
157 | 186 | { | |
158 | 187 | if ( showOnlyMode ) | |
159 | mDate = date; | 188 | emit showJournalOnly( 0 ); |
189 | else | ||
190 | emit showJournalOnly( mJournal ); | ||
160 | } | 191 | } |
@@ -168,3 +199,9 @@ void JournalEntry::setJournal(Journal *journal) | |||
168 | mEditor->setText(mJournal->description()); | 199 | mEditor->setText(mJournal->description()); |
169 | 200 | int id = mJournal->calID(); | |
201 | if ( id > 1 ) { | ||
202 | QString calname = KOPrefs::instance()->getCalendar( id )->mName; | ||
203 | mTitleLabel->setText( KGlobal::locale()->formatDate(mDate,true) + " (" + calname +")"); | ||
204 | } else { | ||
205 | mTitleLabel->setText(KGlobal::locale()->formatDate(mDate)); | ||
206 | } | ||
170 | mDirty = false; | 207 | mDirty = false; |