author | zautrix <zautrix> | 2005-07-05 11:01:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-05 11:01:38 (UTC) |
commit | 68016257abe13019610cb7bb230f8d754179abfb (patch) (unidiff) | |
tree | eb89374fe7aa4ef591388a49ce6ba7eddd43a10f | |
parent | ea75d46072630883fae6ededd4af1d3c427ff59f (diff) | |
download | kdepimpi-68016257abe13019610cb7bb230f8d754179abfb.zip kdepimpi-68016257abe13019610cb7bb230f8d754179abfb.tar.gz kdepimpi-68016257abe13019610cb7bb230f8d754179abfb.tar.bz2 |
nf
-rw-r--r-- | korganizer/journalentry.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 902e96f..b8a4cf2 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -93,34 +93,34 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
93 | QPushButton * loadTemplate = new QPushButton( vb ); | 93 | QPushButton * loadTemplate = new QPushButton( vb ); |
94 | QPushButton * saveTemplate = new QPushButton( vb ); | 94 | QPushButton * saveTemplate = new QPushButton( vb ); |
95 | if ( QApplication::desktop()->width() < 321 ) | 95 | if ( QApplication::desktop()->width() < 321 ) |
96 | iconp = SmallIcon("fileexport16"); | 96 | iconp = SmallIcon("fileexport16"); |
97 | else | 97 | else |
98 | iconp = SmallIcon("fileexport"); | 98 | iconp = SmallIcon("fileexport"); |
99 | saveTemplate->setPixmap (iconp ) ; | 99 | saveTemplate->setPixmap (iconp ) ; |
100 | int size = saveTemplate->sizeHint().height(); | 100 | int size = saveTemplate->sizeHint().height(); |
101 | if ( QApplication::desktop()->width() < 321 ) | 101 | if ( QApplication::desktop()->width() < 321 ) |
102 | iconp = SmallIcon("fileimport16"); | 102 | iconp = SmallIcon("fileimport16"); |
103 | else | 103 | else |
104 | iconp = SmallIcon("fileimport"); | 104 | iconp = SmallIcon("fileimport"); |
105 | loadTemplate->setPixmap (iconp ) ; | 105 | loadTemplate->setPixmap (iconp ) ; |
106 | loadTemplate->setFixedSize( size, size ); | 106 | loadTemplate->setFixedSize( size, size ); |
107 | saveTemplate->setFixedSize( size, size ); | 107 | saveTemplate->setFixedSize( size, size ); |
108 | toggleJournal->setFixedSize( size , size ); | 108 | toggleJournal->setFixedSize( size , size ); |
109 | mTitle->setMaximumHeight( size+4); | 109 | mTitle->setFixedHeight( size+4); |
110 | mCalendarBox->setMaximumHeight( size+4); | 110 | mCalendarBox->setFixedHeight( size+4); |
111 | mEditor = new KTextEdit(this); | 111 | mEditor = new KTextEdit(this); |
112 | #ifndef DESKTOP_VERSION | 112 | #ifndef DESKTOP_VERSION |
113 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); | 113 | QPEApplication::setStylusOperation( mEditor, QPEApplication::RightOnHold ); |
114 | #endif | 114 | #endif |
115 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 115 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
116 | QBoxLayout *topLayout = new QVBoxLayout(this); | 116 | QBoxLayout *topLayout = new QVBoxLayout(this); |
117 | topLayout->addWidget(vb); | 117 | topLayout->addWidget(vb); |
118 | topLayout->addWidget(mEditor); | 118 | topLayout->addWidget(mEditor); |
119 | mEditor->installEventFilter(this); | 119 | mEditor->installEventFilter(this); |
120 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 120 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
121 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 121 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
122 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); | 122 | connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); |
123 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | 123 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
124 | mTitle->lineEdit ()->setText(""); | 124 | mTitle->lineEdit ()->setText(""); |
125 | } | 125 | } |
126 | 126 | ||
@@ -196,37 +196,32 @@ void JournalEntry::fillCalendar( int setToID ) | |||
196 | while ( kkf ) { | 196 | while ( kkf ) { |
197 | if ( (!kkf->mErrorOnLoad &&! kkf->isReadOnly) || setToID == kkf->mCalNumber ) { | 197 | if ( (!kkf->mErrorOnLoad &&! kkf->isReadOnly) || setToID == kkf->mCalNumber ) { |
198 | if ( setToID ) { | 198 | if ( setToID ) { |
199 | if ( kkf->mCalNumber == setToID ) | 199 | if ( kkf->mCalNumber == setToID ) |
200 | std = count; | 200 | std = count; |
201 | } else { | 201 | } else { |
202 | if ( kkf->isStandard ) { | 202 | if ( kkf->isStandard ) { |
203 | std = count; | 203 | std = count; |
204 | } | 204 | } |
205 | } | 205 | } |
206 | ++count; | 206 | ++count; |
207 | mCalendarBox->insertItem( kkf->mName ); | 207 | mCalendarBox->insertItem( kkf->mName ); |
208 | } | 208 | } |
209 | kkf = KOPrefs::instance()->mCalendars.next(); | 209 | kkf = KOPrefs::instance()->mCalendars.next(); |
210 | } | 210 | } |
211 | mCalendarBox->setCurrentItem( std ); | 211 | mCalendarBox->setCurrentItem( std ); |
212 | if ( KOPrefs::instance()->mCalendars.count() == 1 ) | ||
213 | mCalendarBox->hide(); | ||
214 | else { | ||
215 | mCalendarBox->show(); | ||
216 | } | ||
217 | } | 212 | } |
218 | 213 | ||
219 | void JournalEntry::toggleShowJournal() | 214 | void JournalEntry::toggleShowJournal() |
220 | { | 215 | { |
221 | if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty()) | 216 | if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty()) |
222 | flushEntry(); | 217 | flushEntry(); |
223 | if ( showOnlyMode ) | 218 | if ( showOnlyMode ) |
224 | emit showJournalOnly( 0 ); | 219 | emit showJournalOnly( 0 ); |
225 | else { | 220 | else { |
226 | // we have to protect mJournal from deleting if mJournal has empty text | 221 | // we have to protect mJournal from deleting if mJournal has empty text |
227 | visibleMode = false; // set to true via :setShowOnly() | 222 | visibleMode = false; // set to true via :setShowOnly() |
228 | emit showJournalOnly( mJournal ); | 223 | emit showJournalOnly( mJournal ); |
229 | //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) ); | 224 | //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) ); |
230 | } | 225 | } |
231 | } | 226 | } |
232 | void JournalEntry::setVisibleOn() | 227 | void JournalEntry::setVisibleOn() |