-rw-r--r-- | korganizer/journalentry.cpp | 16 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 3 |
2 files changed, 16 insertions, 3 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 7f6f221..5269af7 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -124,24 +124,28 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : | |||
124 | mTitle->setMaximumWidth( maxwid/2 +20 ); | 124 | mTitle->setMaximumWidth( maxwid/2 +20 ); |
125 | mCalendarBox->setMaximumWidth( maxwid/2 -20); | 125 | mCalendarBox->setMaximumWidth( maxwid/2 -20); |
126 | } else { | 126 | } else { |
127 | mTitle->setMaximumWidth( (maxwid/4)*3); | 127 | mTitle->setMaximumWidth( (maxwid/4)*3); |
128 | mCalendarBox->setMaximumWidth( maxwid/2 ); | 128 | mCalendarBox->setMaximumWidth( maxwid/2 ); |
129 | } | 129 | } |
130 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); | 130 | //mCalendarBox->setMaximumWidth( maxwid/2 -20 ); |
131 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); | 131 | mEditor->setWordWrap( KTextEdit::WidgetWidth ); |
132 | QBoxLayout *topLayout = new QVBoxLayout(this); | 132 | QBoxLayout *topLayout = new QVBoxLayout(this); |
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() ) ); |
139 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | 143 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
140 | mTitle->lineEdit ()->setText(""); | 144 | mTitle->lineEdit ()->setText(""); |
141 | } | 145 | } |
142 | 146 | ||
143 | JournalEntry::~JournalEntry() | 147 | JournalEntry::~JournalEntry() |
144 | { | 148 | { |
145 | //qDebug("JournalEntry::~JournalEntry() "); | 149 | //qDebug("JournalEntry::~JournalEntry() "); |
146 | } | 150 | } |
147 | void JournalEntry::resizeEvent(QResizeEvent* e ) | 151 | void JournalEntry::resizeEvent(QResizeEvent* e ) |
@@ -302,30 +306,38 @@ Journal *JournalEntry::journal() const | |||
302 | 306 | ||
303 | void JournalEntry::clear() | 307 | void JournalEntry::clear() |
304 | { | 308 | { |
305 | mJournal = 0; | 309 | mJournal = 0; |
306 | mEditor->setText(""); | 310 | mEditor->setText(""); |
307 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | 311 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
308 | mTitle->lineEdit ()->setText(""); | 312 | mTitle->lineEdit ()->setText(""); |
309 | } | 313 | } |
310 | 314 | ||
311 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) | 315 | bool 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; |
323 | } | 335 | } |
324 | } | 336 | } |
325 | 337 | ||
326 | return QFrame::eventFilter( o, e ); // standard event processing | 338 | return QFrame::eventFilter( o, e ); // standard event processing |
327 | } | 339 | } |
328 | 340 | ||
329 | void JournalEntry::writeJournal() | 341 | void JournalEntry::writeJournal() |
330 | { | 342 | { |
331 | if ( !visibleMode ) return; | 343 | if ( !visibleMode ) return; |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 4fc1194..b378330 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -1284,25 +1284,26 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
1284 | } | 1284 | } |
1285 | } | 1285 | } |
1286 | e->accept(); | 1286 | e->accept(); |
1287 | } | 1287 | } |
1288 | break; | 1288 | break; |
1289 | default: | 1289 | default: |
1290 | e->ignore(); | 1290 | e->ignore(); |
1291 | } | 1291 | } |
1292 | } | 1292 | } |
1293 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1293 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1294 | : KListView( lv, "kolistlistview", false ) | 1294 | : KListView( lv, "kolistlistview", false ) |
1295 | { | 1295 | { |
1296 | mYMousePos = 0; | 1296 | mYMousePos = 0; |
1297 | setAllColumnsShowFocus( true ); | ||
1297 | mPopupTimer = new QTimer(this); | 1298 | mPopupTimer = new QTimer(this); |
1298 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); | 1299 | connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); |
1299 | #ifndef DESKTOP_VERSION | 1300 | #ifndef DESKTOP_VERSION |
1300 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1301 | //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1301 | #endif | 1302 | #endif |
1302 | setSelectionMode( QListView::Multi ); | 1303 | setSelectionMode( QListView::Multi ); |
1303 | setMultiSelection( true); | 1304 | setMultiSelection( true); |
1304 | } | 1305 | } |
1305 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) | 1306 | bool KOListViewListView::hasMultiSelection(QListViewItem* item) |
1306 | { | 1307 | { |
1307 | QListViewItem *qitem = firstChild (); | 1308 | QListViewItem *qitem = firstChild (); |
1308 | while ( qitem ) { | 1309 | while ( qitem ) { |