summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
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
@@ -360,102 +360,103 @@ void KListViewLineEdit::terminate()
}
void KListViewLineEdit::terminate(bool commit)
{
if ( item )
{
//kdDebug() << "KListViewLineEdit::terminate " << commit << endl;
if (commit)
item->setText(col, text());
int c=col;
QListViewItem *i=item;
col=0;
item=0;
hide(); // will call focusOutEvent, that's why we set item=0 before
emit done(i,c);
}
}
void KListViewLineEdit::focusOutEvent(QFocusEvent *ev)
{
QFocusEvent * focusEv = static_cast<QFocusEvent*>(ev);
// Don't let a RMB close the editor
if (focusEv->reason() != QFocusEvent::Popup && focusEv->reason() != QFocusEvent::ActiveWindow)
terminate(true);
}
void KListViewLineEdit::paintEvent( QPaintEvent *e )
{
KLineEdit::paintEvent( e );
if ( !frame() ) {
QPainter p( this );
p.setClipRegion( e->region() );
p.drawRect( rect() );
}
}
// selection changed -> terminate. As our "item" can be already deleted,
// we can't call terminate(false), because that would emit done() with
// a dangling pointer to "item".
void KListViewLineEdit::slotSelectionChanged()
{
item = 0;
col = 0;
hide();
}
*/
-KListView::KListView( QWidget *parent, const char *name )
+KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse )
: QListView( parent, name ),
d (new KListViewPrivate (this))
{
#ifndef DESKTOP_VERSION
- QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
+ if ( emulateRightMouse )
+ QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
#endif
//US setDragAutoScroll(true);
connect( this, SIGNAL( onViewport() ),
this, SLOT( slotOnViewport() ) );
connect( this, SIGNAL( onItem( QListViewItem * ) ),
this, SLOT( slotOnItem( QListViewItem * ) ) );
connect (this, SIGNAL(contentsMoving(int,int)),
this, SLOT(cleanDropVisualizer()));
connect (this, SIGNAL(contentsMoving(int,int)),
this, SLOT(cleanItemHighlighter()));
/*US
slotSettingsChanged(KApplication::SETTINGS_MOUSE);
if (kapp)
{
connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );
kapp->addKipcEventMask( KIPC::SettingsChanged );
}
*/
slotSettingsChanged(1); //US do this to initialize the connections
connect(&d->autoSelect, SIGNAL( timeout() ),
this, SLOT( slotAutoSelect() ) );
connect(&d->dragExpand, SIGNAL( timeout() ),
this, SLOT( slotDragExpand() ) );
// context menu handling
if (d->showContextMenusOnPress)
{
connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)),
this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int)));
}
else
{
connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)),
this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int)));
}
connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)),
this, SLOT (emitContextMenu (KListView*, QListViewItem*)));
//qDebug("KListView::KListView make alternate color configurable");
//US d->alternateBackground = KGlobalSettings::alternateBackgroundColor();
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
@@ -78,97 +78,97 @@ public:
* Possible selection modes.
*
* The first four correspond directly to QListView::SelectionMode, while
* the FileManager selection mode is defined as follows:
* @li home: move to the first
* @li end: move to the last
* @li PgUp/PgDn: move one page up/down
* @li up/down: move one item up/down
* @li insert: toggle selection of current and move to the next
* @li space: toggle selection of the current
* @li CTRL+up: move to the previous item and toggle selection of this one
* @li CTRL+down: toggle selection of the current item and move to the next
* @li CTRL+end: toggle selection from (including) the current
* item to (including) the last item
* @li CTRL+home: toggle selection from (including) the current
* item to the (including) the first item
* @li CTRL+PgDn: toggle selection from (including) the current
* item to (excluding) the item one page down
* @li CTRL+PgUp: toggle selection from (excluding) the current
* item to (including) the item one page up
*
* The combinations work the same with SHIFT instead of CTRL, except
* that if you start selecting something using SHIFT everything selected
* before will be deselected first.
*
* Additionally the current item is always selected automatically when
* navigating using the keyboard, except other items were selected explicitely.
*
* This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected
*/
enum SelectionModeExt {
Single = QListView::Single,
Multi = QListView::Multi,
Extended = QListView::Extended,
NoSelection = QListView::NoSelection,
FileManager
};
void repaintContents( bool erase = true )
{
QScrollView::repaintContents( contentsX(), contentsY(),
visibleWidth(), visibleHeight(), erase );
};
/**
* Constructor.
*
* The parameters @p parent and @p name are handled by
* @ref QListView, as usual.
*/
- KListView (QWidget *parent = 0, const char *name = 0);
+ KListView (QWidget *parent = 0, const char *name = 0, bool emulateRightMouse = true );
/**
* Destructor.
*/
virtual ~KListView();
/**
* Reimplemented for internal reasons.
* Further reimplementations should call this function or else
* some features may not work correctly.
*
* The API is unaffected.
*/
virtual void setAcceptDrops (bool);
/**
* This function determines whether the given coordinates are within the
* execute area. The execute area is the part of a @ref QListViewItem where mouse
* clicks or double clicks respectively generate a @ref #executed() signal.
* Depending on @ref QListView::allColumnsShowFocus() this is either the
* whole item or only the first column.
* @return true if point is inside execute area of an item, false in all
* other cases including the case that it is over the viewport.
*/
virtual bool isExecuteArea( const QPoint& point );
/**
* Same thing, but from an x coordinate only. This only checks if x is in
* the first column (if all columns don't show focus), without testing if
* the y coordinate is over an item or not.
*/
bool isExecuteArea( int x );
/**
* @return a list containing the currently selected items.
*/
QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?)
/**
* Arbitrarily move @p item to @p parent, positioned immediately after item @p after.
*/
void moveItem(QListViewItem *item, QListViewItem *parent, QListViewItem *after);
/**
* @return the last item (not child!) of this listview.
*
* @see lastChild()
*/