summaryrefslogtreecommitdiffabout
path: root/korganizer/journalentry.cpp
authorzautrix <zautrix>2005-11-12 22:23:02 (UTC)
committer zautrix <zautrix>2005-11-12 22:23:02 (UTC)
commit9e47202fd38512cc523c09cf8878f4c5d836e777 (patch) (unidiff)
treefa35760dc12d7176e3c2e63c22c6482601f7e59d /korganizer/journalentry.cpp
parentf1b53f2c08c2ce384f663ae6f0a818104db8c53e (diff)
downloadkdepimpi-9e47202fd38512cc523c09cf8878f4c5d836e777.zip
kdepimpi-9e47202fd38512cc523c09cf8878f4c5d836e777.tar.gz
kdepimpi-9e47202fd38512cc523c09cf8878f4c5d836e777.tar.bz2
fix
Diffstat (limited to 'korganizer/journalentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 7f6f221..5269af7 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -133,6 +133,10 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
133 topLayout->addWidget(vb); 133 topLayout->addWidget(vb);
134 topLayout->addWidget(mEditor); 134 topLayout->addWidget(mEditor);
135 mEditor->installEventFilter(this); 135 mEditor->installEventFilter(this);
136 installEventFilter(this);
137 mTitle->installEventFilter(this);
138 setFocusPolicy (QWidget::NoFocus);
139
136 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 140 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
137 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 141 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
138 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) ); 142 connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
@@ -311,12 +315,20 @@ void JournalEntry::clear()
311bool JournalEntry::eventFilter( QObject *o, QEvent *e ) 315bool JournalEntry::eventFilter( QObject *o, QEvent *e )
312{ 316{
313// kdDebug() << "JournalEntry::event received " << e->type() << endl; 317// kdDebug() << "JournalEntry::event received " << e->type() << endl;
314 318 if ( isVisible() ) {
319 mEditor->setFocusPolicy (QWidget::StrongFocus);
320 mTitle->setFocusPolicy (QWidget::StrongFocus);
321 } else {
322 mEditor->setFocusPolicy (QWidget::NoFocus);
323 mTitle->setFocusPolicy (QWidget::NoFocus);
324 }
315 if ( e->type() == QEvent::FocusOut ) { 325 if ( e->type() == QEvent::FocusOut ) {
316 writeJournal(); 326 writeJournal();
317 } 327 }
318 if ( e->type() == QEvent::KeyPress ) { 328 if ( e->type() == QEvent::KeyPress ) {
319 QKeyEvent * k = (QKeyEvent *) e; 329 QKeyEvent * k = (QKeyEvent *) e;
330 if ( !isVisible() )
331 return true;
320 if ( k->state() == Qt::ControlButton ) { 332 if ( k->state() == Qt::ControlButton ) {
321 k->ignore(); 333 k->ignore();
322 //return true; 334 //return true;