summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-30 15:49:34 (UTC)
committer zautrix <zautrix>2005-01-30 15:49:34 (UTC)
commita34c528fdd8d2cdec14bae9ccb0eee54c8e4e374 (patch) (unidiff)
tree21a900be618695f6dac42b5e9df6094201a981d0
parent11736af9b5348f251b0e8a3cf90fdb960c877936 (diff)
downloadkdepimpi-a34c528fdd8d2cdec14bae9ccb0eee54c8e4e374.zip
kdepimpi-a34c528fdd8d2cdec14bae9ccb0eee54c8e4e374.tar.gz
kdepimpi-a34c528fdd8d2cdec14bae9ccb0eee54c8e4e374.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 902f3f4..2f5259f 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -194,129 +194,129 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
194 QListViewItem *i = itemAt(p); 194 QListViewItem *i = itemAt(p);
195 mMousePressed = false; 195 mMousePressed = false;
196 if (i) { 196 if (i) {
197 // if the user clicked into the root decoration of the item, don't 197 // if the user clicked into the root decoration of the item, don't
198 // try to start a drag! 198 // try to start a drag!
199 if (p.x() > header()->sectionPos(header()->mapToIndex(0)) + 199 if (p.x() > header()->sectionPos(header()->mapToIndex(0)) +
200 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 200 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
201 itemMargin() || 201 itemMargin() ||
202 p.x() < header()->sectionPos(header()->mapToIndex(0))) { 202 p.x() < header()->sectionPos(header()->mapToIndex(0))) {
203 if (e->button()==Qt::LeftButton) { 203 if (e->button()==Qt::LeftButton) {
204 mPressPos = e->pos(); 204 mPressPos = e->pos();
205 mMousePressed = true; 205 mMousePressed = true;
206 } 206 }
207 } 207 }
208 } 208 }
209#endif 209#endif
210 QListView::contentsMousePressEvent(e); 210 QListView::contentsMousePressEvent(e);
211} 211}
212 212
213void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) 213void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
214{ 214{
215 215
216#ifndef KORG_NODND 216#ifndef KORG_NODND
217 QListView::contentsMouseMoveEvent(e); 217 QListView::contentsMouseMoveEvent(e);
218 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > 218 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
219 QApplication::startDragDistance()) { 219 QApplication::startDragDistance()) {
220 mMousePressed = false; 220 mMousePressed = false;
221 QListViewItem *item = itemAt(contentsToViewport(mPressPos)); 221 QListViewItem *item = itemAt(contentsToViewport(mPressPos));
222 if (item) { 222 if (item) {
223 DndFactory factory( mCalendar ); 223 DndFactory factory( mCalendar );
224 ICalDrag *vd = factory.createDrag( 224 ICalDrag *vd = factory.createDrag(
225 ((KOTodoViewItem *)item)->todo(),viewport()); 225 ((KOTodoViewItem *)item)->todo(),viewport());
226 internalDrop = false; 226 internalDrop = false;
227 // we cannot do any senseful here, because the DnD is still broken in Qt 227 // we cannot do any senseful here, because the DnD is still broken in Qt
228 if (vd->drag()) { 228 if (vd->drag()) {
229 if ( !internalDrop ) { 229 if ( !internalDrop ) {
230 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); 230 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
231 qDebug("Dnd: External move: Delete drag source "); 231 qDebug("Dnd: External move: Delete drag source ");
232 } else 232 } else
233 qDebug("Dnd: Internal move "); 233 qDebug("Dnd: Internal move ");
234 234
235 } else { 235 } else {
236 if ( !internalDrop ) { 236 if ( !internalDrop ) {
237 qDebug("Dnd: External Copy"); 237 qDebug("Dnd: External Copy");
238 } else 238 } else
239 qDebug("DnD: Internal copy: Copy pending"); 239 qDebug("DnD: Internal copy: Copy pending");
240 } 240 }
241 } 241 }
242 } 242 }
243#endif 243#endif
244} 244}
245void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 245void KOTodoListView::keyPressEvent ( QKeyEvent * e )
246{ 246{
247 247
248 QListViewItem* cn; 248 QListViewItem* cn;
249 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 249 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
250 cn = currentItem(); 250 cn = currentItem();
251 if ( cn ) { 251 if ( cn ) {
252 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 252 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
253 if ( ci ){ 253 if ( ci ){
254 if ( e->state() == ShiftButton ) 254 if ( e->state() == ShiftButton )
255 ci->setOn( false ); 255 ci->setOn( false );
256 else 256 else
257 ci->setOn( true ); 257 ci->setOn( true );
258 cn = cn->nextSibling(); 258 cn = cn->itemBelow();
259 if ( cn ) { 259 if ( cn ) {
260 setCurrentItem ( cn ); 260 setCurrentItem ( cn );
261 ensureItemVisible ( cn ); 261 ensureItemVisible ( cn );
262 } 262 }
263 263
264 } 264 }
265 } 265 }
266 266
267 return; 267 return;
268 } 268 }
269 269
270 // qDebug("KOTodoListView::keyPressEvent "); 270 // qDebug("KOTodoListView::keyPressEvent ");
271 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 271 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
272 switch ( e->key() ) { 272 switch ( e->key() ) {
273 case Qt::Key_Down: 273 case Qt::Key_Down:
274 case Qt::Key_Up: 274 case Qt::Key_Up:
275 QListView::keyPressEvent ( e ); 275 QListView::keyPressEvent ( e );
276 break; 276 break;
277 case Qt::Key_Left: 277 case Qt::Key_Left:
278 case Qt::Key_Right: 278 case Qt::Key_Right:
279 QListView::keyPressEvent ( e ); 279 QListView::keyPressEvent ( e );
280 e->accept(); 280 e->accept();
281 return; 281 return;
282 break; 282 break;
283 default: 283 default:
284 e->ignore(); 284 e->ignore();
285 break; 285 break;
286 } 286 }
287 return; 287 return;
288 } 288 }
289 e->ignore(); 289 e->ignore();
290} 290}
291void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 291void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
292{ 292{
293 QListView::contentsMouseReleaseEvent(e); 293 QListView::contentsMouseReleaseEvent(e);
294 mMousePressed = false; 294 mMousePressed = false;
295} 295}
296 296
297void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 297void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
298{ 298{
299 if (!e) return; 299 if (!e) return;
300 300
301 QPoint vp = contentsToViewport(e->pos()); 301 QPoint vp = contentsToViewport(e->pos());
302 302
303 QListViewItem *item = itemAt(vp); 303 QListViewItem *item = itemAt(vp);
304 304
305 emit double_Clicked(item); 305 emit double_Clicked(item);
306 if (!item) return; 306 if (!item) return;
307 307
308 emit doubleClicked(item,vp,0); 308 emit doubleClicked(item,vp,0);
309} 309}
310 310
311///////////////////////////////////////////////////////////////////////////// 311/////////////////////////////////////////////////////////////////////////////
312 312
313KOQuickTodo::KOQuickTodo(QWidget *parent) : 313KOQuickTodo::KOQuickTodo(QWidget *parent) :
314 QLineEdit(parent) 314 QLineEdit(parent)
315{ 315{
316 setText(i18n("Click to add a new Todo")); 316 setText(i18n("Click to add a new Todo"));
317} 317}
318 318
319void KOQuickTodo::focusInEvent(QFocusEvent *ev) 319void KOQuickTodo::focusInEvent(QFocusEvent *ev)
320{ 320{
321 if ( text()==i18n("Click to add a new Todo") ) 321 if ( text()==i18n("Click to add a new Todo") )
322 setText(""); 322 setText("");