By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 1677
Collapse All | Expand All

(-)ori/tdelibs/tdeui/tdelistview.cpp (-26 / +65 lines)
Lines 17-22 Link Here
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
   Boston, MA 02110-1301, USA.
18
   Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
#include "config.h"
21
#include "config.h"
21
22
22
#include <tqdragobject.h>
23
#include <tqdragobject.h>
Lines 72-79 Link Here
72
      autoSelectDelay(0),
73
      autoSelectDelay(0),
73
      useSmallExecuteArea(false),
74
      useSmallExecuteArea(false),
74
      dragOverItem(0),
75
      dragOverItem(0),
75
      dragDelay (TDEGlobalSettings::dndEventDelay()),
76
      dragDelay(TDEGlobalSettings::dndEventDelay()),
76
      editor (new TDEListViewLineEdit (listview)),
77
      editor(new TDEListViewLineEdit(listview)),
77
      cursorInExecuteArea(false),
78
      cursorInExecuteArea(false),
78
      itemsMovable (true),
79
      itemsMovable (true),
79
      selectedBySimpleMove(false),
80
      selectedBySimpleMove(false),
Lines 106-111 Link Here
106
  {
107
  {
107
      renameable.append(0);
108
      renameable.append(0);
108
      connect(editor, TQT_SIGNAL(done(TQListViewItem*,int)), listview, TQT_SLOT(doneEditing(TQListViewItem*,int)));
109
      connect(editor, TQT_SIGNAL(done(TQListViewItem*,int)), listview, TQT_SLOT(doneEditing(TQListViewItem*,int)));
110
      connect(editor, TQT_SIGNAL(renameNext(TQListViewItem*,int)), listview, TQT_SLOT(renameNextProxy(TQListViewItem*,int)));
111
      connect(editor, TQT_SIGNAL(renamePrev(TQListViewItem*,int)), listview, TQT_SLOT(renamePrevProxy(TQListViewItem*,int)));
109
  }
112
  }
110
113
111
  ~TDEListViewPrivate ()
114
  ~TDEListViewPrivate ()
Lines 176-188 Link Here
176
179
177
180
178
TDEListViewLineEdit::TDEListViewLineEdit(TDEListView *parent)
181
TDEListViewLineEdit::TDEListViewLineEdit(TDEListView *parent)
179
        : KLineEdit(parent->viewport()), item(0), col(0), p(parent)
182
    : KLineEdit(parent->viewport()), item(0), col(0), p(parent), m_renSett()
180
{
183
{
181
        setFrame( false );
184
  setFrame( false );
182
        hide();
185
  hide();
183
        connect( parent, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotSelectionChanged() ));
186
  connect( parent, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotSelectionChanged() ));
184
        connect( parent, TQT_SIGNAL( itemRemoved( TQListViewItem * ) ),
187
  connect( parent, TQT_SIGNAL( itemRemoved( TQListViewItem * ) ),
185
                         TQT_SLOT( slotItemRemoved( TQListViewItem * ) ));
188
                    TQT_SLOT( slotItemRemoved( TQListViewItem * ) ));
186
}
189
}
187
190
188
TDEListViewLineEdit::~TDEListViewLineEdit()
191
TDEListViewLineEdit::~TDEListViewLineEdit()
Lines 323-359 Link Here
323
#undef KeyPress
326
#undef KeyPress
324
#endif
327
#endif
325
328
326
bool TDEListViewLineEdit::event (TQEvent *pe)
329
bool TDEListViewLineEdit::event(TQEvent *pe)
327
{
330
{
328
	if (pe->type() == TQEvent::KeyPress)
331
	if (pe->type() == TQEvent::KeyPress)
329
	{
332
	{
330
		TQKeyEvent *k = (TQKeyEvent *) pe;
333
		TQKeyEvent *k = (TQKeyEvent*)pe;
331
334
    KKey kk(k);
332
	    if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) &&
335
    if (m_renSett.m_useRenameSignals &&
333
			p->tabOrderedRenaming() && p->itemsRenameable() &&
336
        (m_renSett.m_SCNext.contains(kk) || m_renSett.m_SCPrev.contains(kk)))
334
			!(k->state() & ControlButton || k->state() & AltButton))
337
    {
338
      keyPressEvent(k);
339
      return true;
340
    }
341
	  else if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab) &&
342
			       p->tabOrderedRenaming() && p->itemsRenameable() &&
343
			       !(k->state() & ControlButton || k->state() & AltButton))
335
		{
344
		{
336
			selectNextCell(item, col,
345
			selectNextCell(item, col, (k->key() == Key_Tab && !(k->state() & ShiftButton)));
337
				(k->key() == Key_Tab && !(k->state() & ShiftButton)));
338
			return true;
346
			return true;
339
	    }
347
	  }
340
	}
348
	}
341
342
	return KLineEdit::event(pe);
349
	return KLineEdit::event(pe);
343
}
350
}
344
351
345
void TDEListViewLineEdit::keyPressEvent(TQKeyEvent *e)
352
void TDEListViewLineEdit::keyPressEvent(TQKeyEvent *e)
346
{
353
{
347
	if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter )
354
  KKey kk(e);
355
  if (m_renSett.m_useRenameSignals &&
356
      (m_renSett.m_SCNext.contains(kk) || m_renSett.m_SCPrev.contains(kk)))
357
  {
358
    TQListViewItem *i=item;
359
    int c=col;
360
    terminate(true);
361
    KLineEdit::keyPressEvent(e);
362
    if (m_renSett.m_SCNext.contains(kk))
363
    {
364
      emit renameNext(i,c);
365
    }
366
    else
367
    {
368
      emit renamePrev(i,c);
369
    }
370
  }
371
  else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)
348
		terminate(true);
372
		terminate(true);
349
	else if(e->key() == Qt::Key_Escape)
373
	else if(e->key() == Qt::Key_Escape)
350
		terminate(false);
374
		terminate(false);
351
        else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Up)
375
  else if (e->key() == Qt::Key_Down || e->key() == Qt::Key_Up)
352
        {
376
  {
353
		terminate(true);
377
		terminate(true);
354
                KLineEdit::keyPressEvent(e);
378
    KLineEdit::keyPressEvent(e);
355
        }
379
  }
356
	else
380
  else
357
		KLineEdit::keyPressEvent(e);
381
		KLineEdit::keyPressEvent(e);
358
}
382
}
359
383
Lines 425-432 Link Here
425
449
426
450
427
TDEListView::TDEListView( TQWidget *parent, const char *name )
451
TDEListView::TDEListView( TQWidget *parent, const char *name )
428
  : TQListView( parent, name ),
452
  : TQListView(parent, name), d(new TDEListViewPrivate(this))
429
        d (new TDEListViewPrivate (this))
430
{
453
{
431
  setDragAutoScroll(true);
454
  setDragAutoScroll(true);
432
455
Lines 1416-1421 Link Here
1416
  emit itemRenamed(item);
1439
  emit itemRenamed(item);
1417
}
1440
}
1418
1441
1442
void TDEListView::renameNextProxy(TQListViewItem *item, int col)
1443
{
1444
  emit renameNext(item, col);
1445
}
1446
1447
void TDEListView::renamePrevProxy(TQListViewItem *item, int col)
1448
{
1449
  emit renamePrev(item, col);
1450
}
1451
1452
1419
bool TDEListView::acceptDrag(TQDropEvent* e) const
1453
bool TDEListView::acceptDrag(TQDropEvent* e) const
1420
{
1454
{
1421
  return acceptDrops() && itemsMovable() && (e->source()==viewport());
1455
  return acceptDrops() && itemsMovable() && (e->source()==viewport());
Lines 2424-2429 Link Here
2424
    return d->useSmallExecuteArea;
2458
    return d->useSmallExecuteArea;
2425
}
2459
}
2426
2460
2461
void TDEListView::setRenameSettings(const TDEListViewRenameSettings &renSett)
2462
{
2463
  d->editor->setRenameSettings(renSett);
2464
}
2465
2427
void TDEListView::virtual_hook( int, void* )
2466
void TDEListView::virtual_hook( int, void* )
2428
{ /*BASE::virtual_hook( id, data );*/ }
2467
{ /*BASE::virtual_hook( id, data );*/ }
2429
2468
(-)ori/tdelibs/tdeui/tdelistview.h (-4 / +72 lines)
Lines 17-34 Link Here
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
   Boston, MA 02110-1301, USA.
18
   Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
#ifndef TDELISTVIEW_H
21
#ifndef TDELISTVIEW_H
21
#define TDELISTVIEW_H
22
#define TDELISTVIEW_H
22
23
23
#include <tqheader.h>
24
#include <tqheader.h>
24
#include <tqlistview.h>
25
#include <tqlistview.h>
25
26
#include <tdeshortcut.h>
26
#include <tqptrlist.h>
27
#include <tqptrlist.h>
27
#include <tdelibs_export.h>
28
#include <tdelibs_export.h>
28
29
29
class TQDragObject;
30
class TQDragObject;
30
class TDEConfig;
31
class TDEConfig;
31
class KLineEdit;
32
class KLineEdit;
33
34
// Used to set the 'move to next/previous item' after renaming is completed
35
class TDEListViewRenameSettings
36
{
37
  public:
38
    bool m_useRenameSignals;   // if true, emits renameNext/renamePrev signals
39
    TDEShortcut m_SCNext;      // the shortcut key for moving to the next cell
40
    TDEShortcut m_SCPrev;      // the shortcut key for moving to the previous cell
41
42
    TDEListViewRenameSettings()
43
       : m_useRenameSignals(false), m_SCNext(), m_SCPrev() {}
44
45
    TDEListViewRenameSettings(bool useRenameSignals, TDEShortcut scNext, TDEShortcut scPrev)
46
       : m_useRenameSignals(useRenameSignals), m_SCNext(scNext), m_SCPrev(scPrev) {}
47
    
48
    TDEListViewRenameSettings(const TDEListViewRenameSettings &that)
49
       : m_useRenameSignals(that.m_useRenameSignals), m_SCNext(that.m_SCNext), m_SCPrev(that.m_SCPrev) {}
50
51
    TDEListViewRenameSettings& operator=(const TDEListViewRenameSettings &that)
52
    {
53
      if (this==&that) return *this;
54
      m_useRenameSignals = that.m_useRenameSignals;
55
      m_SCNext = that.m_SCNext;
56
      m_SCPrev = that.m_SCPrev;
57
      return *this;
58
    }
59
};
60
61
32
/**
62
/**
33
 * This Widget extends the functionality of TQListView to honor the system
63
 * This Widget extends the functionality of TQListView to honor the system
34
 * wide settings for Single Click/Double Click mode, AutoSelection and
64
 * wide settings for Single Click/Double Click mode, AutoSelection and
Lines 419-424 Link Here
419
   */
449
   */
420
  bool useSmallExecuteArea() const;
450
  bool useSmallExecuteArea() const;
421
451
452
  /**
453
   * Allows to set the rename settings for the TDEListViewLineEdit editor.
454
   * It is possible to select whether to move or not the item selection when the rename
455
   * operation is completed and which shortcuts to use to move to the next or previous item. 
456
   * @param renSett A TDEListViewRenameSettings object containing the specified settings.
457
   *
458
   * @since 14.0
459
   */
460
  void setRenameSettings(const TDEListViewRenameSettings &renSett);
461
462
422
signals:
463
signals:
423
464
424
  /**
465
  /**
Lines 571-581 Link Here
571
   * @param i is the item for which the menu should be shown. May be 0L.
612
   * @param i is the item for which the menu should be shown. May be 0L.
572
   * @param p is the point at which the menu should be shown.
613
   * @param p is the point at which the menu should be shown.
573
   */
614
   */
574
  void contextMenu (TDEListView* l, TQListViewItem* i, const TQPoint& p);
615
  void contextMenu(TDEListView* l, TQListViewItem* i, const TQPoint& p);
575
616
576
  void itemAdded(TQListViewItem *item);
617
  void itemAdded(TQListViewItem *item);
577
  void itemRemoved(TQListViewItem *item);
618
  void itemRemoved(TQListViewItem *item);
578
619
620
  /**
621
   * This signal is emitted when item renaming is completed by a TAB.
622
   * It signals the receiver that the sender would like to start renaming the next item.
623
   * This is not hardcoded in TDEListView because the next item is application depended
624
   * (for example it could be the next column or the next row or something completely different)
625
   *
626
   * @param item is the renamed item.
627
   * @param col is the renamed column.
628
   *
629
   * @since 14.0
630
   */
631
  void renameNext(TQListViewItem* item, int col);
632
633
  /**
634
   * This signal is emitted when item renaming is completed by a Shift+TAB.
635
   * It signals the receiver that the sender would like to start renaming the previous item.
636
   * This is not hardcoded in TDEListView because the next item is application depended
637
   * (for example it could be the next column or the next row or something completely different)
638
   *
639
   * @param item is the renamed item.
640
   * @param col is the renamed column.
641
   *
642
   * @since 14.0
643
   */
644
  void renamePrev(TQListViewItem* item, int col);
645
579
public slots:
646
public slots:
580
  /**
647
  /**
581
   * Rename column @p c of @p item.
648
   * Rename column @p c of @p item.
Lines 942-951 Link Here
942
   * @internal
1009
   * @internal
943
   */
1010
   */
944
  void slotSettingsChanged(int);
1011
  void slotSettingsChanged(int);
945
946
  void slotMouseButtonClicked( int btn, TQListViewItem *item, const TQPoint &pos, int c );
1012
  void slotMouseButtonClicked( int btn, TQListViewItem *item, const TQPoint &pos, int c );
947
  void doneEditing(TQListViewItem *item, int row);
1013
  void doneEditing(TQListViewItem *item, int row);
948
1014
  void renameNextProxy(TQListViewItem *item, int col);
1015
  void renamePrevProxy(TQListViewItem *item, int col);
1016
  
949
  /**
1017
  /**
950
   * Repaint the rect where I was drawing the drop line.
1018
   * Repaint the rect where I was drawing the drop line.
951
   */
1019
   */
(-)ori/tdelibs/tdeui/tdelistviewlineedit.h (+29 lines)
Lines 15-20 Link Here
15
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
15
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
   Boston, MA 02110-1301, USA.
16
   Boston, MA 02110-1301, USA.
17
*/
17
*/
18
18
#ifndef TDELISTVIEWLINEEDIT_H
19
#ifndef TDELISTVIEWLINEEDIT_H
19
#define TDELISTVIEWLINEEDIT_H
20
#define TDELISTVIEWLINEEDIT_H
20
21
Lines 33-41 Link Here
33
	~TDEListViewLineEdit();
34
	~TDEListViewLineEdit();
34
35
35
	TQListViewItem *currentItem() const;
36
	TQListViewItem *currentItem() const;
37
  void setRenameSettings(const TDEListViewRenameSettings &renSett) { m_renSett = renSett; };
36
38
37
signals:
39
signals:
38
	void done(TQListViewItem*, int);
40
	void done(TQListViewItem*, int);
41
  
42
  /**
43
   * This signal is emitted when item renaming is completed by a TAB.
44
   * It signals the receiver that the sender would like to start renaming the next item.
45
   * This is not hardcoded in TDEListView because the next item is application depended
46
   * (for example it could be the next column or the next row or something completely different)
47
   *
48
   * @param item is the renamed item.
49
   * @param col is the renamed column.
50
   *
51
   * @since 14.0
52
   */
53
  void renameNext(TQListViewItem* item, int col);
54
55
  /**
56
   * This signal is emitted when item renaming is completed by a Shift+TAB.
57
   * It signals the receiver that the sender would like to start renaming the previous item.
58
   * This is not hardcoded in TDEListView because the next item is application depended
59
   * (for example it could be the next column or the next row or something completely different)
60
   *
61
   * @param item is the renamed item.
62
   * @param col is the renamed column.
63
   *
64
   * @since 14.0
65
   */
66
  void renamePrev(TQListViewItem* item, int col);
39
67
40
public slots:
68
public slots:
41
	void terminate();
69
	void terminate();
Lines 53-58 Link Here
53
	TQListViewItem *item;
81
	TQListViewItem *item;
54
	int col;
82
	int col;
55
	TDEListView* const p;
83
	TDEListView* const p;
84
  TDEListViewRenameSettings m_renSett;
56
85
57
protected slots:
86
protected slots:
58
	void slotSelectionChanged();
87
	void slotSelectionChanged();

Return to bug 1677