summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2005-03-26 11:03:22 (UTC)
committer zautrix <zautrix>2005-03-26 11:03:22 (UTC)
commitef825f1805452ba2cfb30cd7a41c392d3961f01e (patch) (unidiff)
tree60e896e2867bf3d90f0719f72c50add28bcf1d04 /microkde
parent6427570041c902840fe0f557415a07bb7aa8c031 (diff)
downloadkdepimpi-ef825f1805452ba2cfb30cd7a41c392d3961f01e.zip
kdepimpi-ef825f1805452ba2cfb30cd7a41c392d3961f01e.tar.gz
kdepimpi-ef825f1805452ba2cfb30cd7a41c392d3961f01e.tar.bz2
next rry
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/klistview.cpp5
-rw-r--r--microkde/kdeui/klistview.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp
index 154cd02..31e2053 100644
--- a/microkde/kdeui/klistview.cpp
+++ b/microkde/kdeui/klistview.cpp
@@ -376,70 +376,71 @@ void KListViewLineEdit::terminate(bool commit)
376} 376}
377 377
378void KListViewLineEdit::focusOutEvent(QFocusEvent *ev) 378void KListViewLineEdit::focusOutEvent(QFocusEvent *ev)
379{ 379{
380 QFocusEvent * focusEv = static_cast<QFocusEvent*>(ev); 380 QFocusEvent * focusEv = static_cast<QFocusEvent*>(ev);
381 // Don't let a RMB close the editor 381 // Don't let a RMB close the editor
382 if (focusEv->reason() != QFocusEvent::Popup && focusEv->reason() != QFocusEvent::ActiveWindow) 382 if (focusEv->reason() != QFocusEvent::Popup && focusEv->reason() != QFocusEvent::ActiveWindow)
383 terminate(true); 383 terminate(true);
384} 384}
385 385
386void KListViewLineEdit::paintEvent( QPaintEvent *e ) 386void KListViewLineEdit::paintEvent( QPaintEvent *e )
387{ 387{
388 KLineEdit::paintEvent( e ); 388 KLineEdit::paintEvent( e );
389 389
390 if ( !frame() ) { 390 if ( !frame() ) {
391 QPainter p( this ); 391 QPainter p( this );
392 p.setClipRegion( e->region() ); 392 p.setClipRegion( e->region() );
393 p.drawRect( rect() ); 393 p.drawRect( rect() );
394 } 394 }
395} 395}
396 396
397// selection changed -> terminate. As our "item" can be already deleted, 397// selection changed -> terminate. As our "item" can be already deleted,
398// we can't call terminate(false), because that would emit done() with 398// we can't call terminate(false), because that would emit done() with
399// a dangling pointer to "item". 399// a dangling pointer to "item".
400void KListViewLineEdit::slotSelectionChanged() 400void KListViewLineEdit::slotSelectionChanged()
401{ 401{
402 item = 0; 402 item = 0;
403 col = 0; 403 col = 0;
404 hide(); 404 hide();
405} 405}
406*/ 406*/
407 407
408KListView::KListView( QWidget *parent, const char *name ) 408KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse )
409 : QListView( parent, name ), 409 : QListView( parent, name ),
410 d (new KListViewPrivate (this)) 410 d (new KListViewPrivate (this))
411{ 411{
412#ifndef DESKTOP_VERSION 412#ifndef DESKTOP_VERSION
413 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 413 if ( emulateRightMouse )
414 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
414#endif 415#endif
415//US setDragAutoScroll(true); 416//US setDragAutoScroll(true);
416 417
417 connect( this, SIGNAL( onViewport() ), 418 connect( this, SIGNAL( onViewport() ),
418 this, SLOT( slotOnViewport() ) ); 419 this, SLOT( slotOnViewport() ) );
419 connect( this, SIGNAL( onItem( QListViewItem * ) ), 420 connect( this, SIGNAL( onItem( QListViewItem * ) ),
420 this, SLOT( slotOnItem( QListViewItem * ) ) ); 421 this, SLOT( slotOnItem( QListViewItem * ) ) );
421 422
422 connect (this, SIGNAL(contentsMoving(int,int)), 423 connect (this, SIGNAL(contentsMoving(int,int)),
423 this, SLOT(cleanDropVisualizer())); 424 this, SLOT(cleanDropVisualizer()));
424 connect (this, SIGNAL(contentsMoving(int,int)), 425 connect (this, SIGNAL(contentsMoving(int,int)),
425 this, SLOT(cleanItemHighlighter())); 426 this, SLOT(cleanItemHighlighter()));
426 427
427/*US 428/*US
428 slotSettingsChanged(KApplication::SETTINGS_MOUSE); 429 slotSettingsChanged(KApplication::SETTINGS_MOUSE);
429 430
430 if (kapp) 431 if (kapp)
431 { 432 {
432 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); 433 connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );
433 kapp->addKipcEventMask( KIPC::SettingsChanged ); 434 kapp->addKipcEventMask( KIPC::SettingsChanged );
434 } 435 }
435*/ 436*/
436 slotSettingsChanged(1); //US do this to initialize the connections 437 slotSettingsChanged(1); //US do this to initialize the connections
437 438
438 439
439 connect(&d->autoSelect, SIGNAL( timeout() ), 440 connect(&d->autoSelect, SIGNAL( timeout() ),
440 this, SLOT( slotAutoSelect() ) ); 441 this, SLOT( slotAutoSelect() ) );
441 connect(&d->dragExpand, SIGNAL( timeout() ), 442 connect(&d->dragExpand, SIGNAL( timeout() ),
442 this, SLOT( slotDragExpand() ) ); 443 this, SLOT( slotDragExpand() ) );
443 444
444 // context menu handling 445 // context menu handling
445 if (d->showContextMenusOnPress) 446 if (d->showContextMenusOnPress)
diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h
index d559ce7..0058416 100644
--- a/microkde/kdeui/klistview.h
+++ b/microkde/kdeui/klistview.h
@@ -94,65 +94,65 @@ public:
94 * @li CTRL+PgDn: toggle selection from (including) the current 94 * @li CTRL+PgDn: toggle selection from (including) the current
95 * item to (excluding) the item one page down 95 * item to (excluding) the item one page down
96 * @li CTRL+PgUp: toggle selection from (excluding) the current 96 * @li CTRL+PgUp: toggle selection from (excluding) the current
97 * item to (including) the item one page up 97 * item to (including) the item one page up
98 * 98 *
99 * The combinations work the same with SHIFT instead of CTRL, except 99 * The combinations work the same with SHIFT instead of CTRL, except
100 * that if you start selecting something using SHIFT everything selected 100 * that if you start selecting something using SHIFT everything selected
101 * before will be deselected first. 101 * before will be deselected first.
102 * 102 *
103 * Additionally the current item is always selected automatically when 103 * Additionally the current item is always selected automatically when
104 * navigating using the keyboard, except other items were selected explicitely. 104 * navigating using the keyboard, except other items were selected explicitely.
105 * 105 *
106 * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected 106 * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected
107 */ 107 */
108 enum SelectionModeExt { 108 enum SelectionModeExt {
109 Single = QListView::Single, 109 Single = QListView::Single,
110 Multi = QListView::Multi, 110 Multi = QListView::Multi,
111 Extended = QListView::Extended, 111 Extended = QListView::Extended,
112 NoSelection = QListView::NoSelection, 112 NoSelection = QListView::NoSelection,
113 FileManager 113 FileManager
114 }; 114 };
115 void repaintContents( bool erase = true ) 115 void repaintContents( bool erase = true )
116 { 116 {
117 QScrollView::repaintContents( contentsX(), contentsY(), 117 QScrollView::repaintContents( contentsX(), contentsY(),
118 visibleWidth(), visibleHeight(), erase ); 118 visibleWidth(), visibleHeight(), erase );
119 }; 119 };
120 /** 120 /**
121 * Constructor. 121 * Constructor.
122 * 122 *
123 * The parameters @p parent and @p name are handled by 123 * The parameters @p parent and @p name are handled by
124 * @ref QListView, as usual. 124 * @ref QListView, as usual.
125 */ 125 */
126 KListView (QWidget *parent = 0, const char *name = 0); 126 KListView (QWidget *parent = 0, const char *name = 0, bool emulateRightMouse = true );
127 127
128 /** 128 /**
129 * Destructor. 129 * Destructor.
130 */ 130 */
131 virtual ~KListView(); 131 virtual ~KListView();
132 132
133 /** 133 /**
134 * Reimplemented for internal reasons. 134 * Reimplemented for internal reasons.
135 * Further reimplementations should call this function or else 135 * Further reimplementations should call this function or else
136 * some features may not work correctly. 136 * some features may not work correctly.
137 * 137 *
138 * The API is unaffected. 138 * The API is unaffected.
139 */ 139 */
140 virtual void setAcceptDrops (bool); 140 virtual void setAcceptDrops (bool);
141 141
142 /** 142 /**
143 * This function determines whether the given coordinates are within the 143 * This function determines whether the given coordinates are within the
144 * execute area. The execute area is the part of a @ref QListViewItem where mouse 144 * execute area. The execute area is the part of a @ref QListViewItem where mouse
145 * clicks or double clicks respectively generate a @ref #executed() signal. 145 * clicks or double clicks respectively generate a @ref #executed() signal.
146 * Depending on @ref QListView::allColumnsShowFocus() this is either the 146 * Depending on @ref QListView::allColumnsShowFocus() this is either the
147 * whole item or only the first column. 147 * whole item or only the first column.
148 * @return true if point is inside execute area of an item, false in all 148 * @return true if point is inside execute area of an item, false in all
149 * other cases including the case that it is over the viewport. 149 * other cases including the case that it is over the viewport.
150 */ 150 */
151 virtual bool isExecuteArea( const QPoint& point ); 151 virtual bool isExecuteArea( const QPoint& point );
152 152
153 /** 153 /**
154 * Same thing, but from an x coordinate only. This only checks if x is in 154 * Same thing, but from an x coordinate only. This only checks if x is in
155 * the first column (if all columns don't show focus), without testing if 155 * the first column (if all columns don't show focus), without testing if
156 * the y coordinate is over an item or not. 156 * the y coordinate is over an item or not.
157 */ 157 */
158 bool isExecuteArea( int x ); 158 bool isExecuteArea( int x );