Commit graph

3292 commits

Author SHA1 Message Date
Peter Penz 6a228cdbd9 Fix rubberband-issue in combination with Shift- and Control-key
The old selection must be remembered before starting the rubberband
selection, otherwise it would not be possible anymore to deselect
items that have been selected by the rubberband itself.
2011-08-20 23:27:23 +02:00
Peter Penz 2f0ceedae0 Respect Shift- and Control-key for the rubberband selection
If the user has pressed the Shift- or Control-key during the
rubberband selection, the previous selection should not be cleared.
2011-08-20 23:12:54 +02:00
Peter Penz c9f4e1baae Simplify rubberband selection for views that have only one column
In this case the rubberband automatically uses the whole width of
the view.
2011-08-20 23:04:01 +02:00
Peter Penz 4aedb07674 Select items when using the rubberband 2011-08-20 22:53:19 +02:00
Peter Penz afcb8cd53c Respect rubberband direction when autoscrolling
The autoscrolling should not be triggered if the rubberband
direction is different from the autoscroll direction
2011-08-20 14:21:05 +02:00
Peter Penz 074acd8009 Fix possible endless recursion when using the rubberband
If the autoscrolling has been activated when using the rubberband,
it was possible that an endless recursion occured as the
autoscrolling triggered a change of the rubberband which triggered
a change of the autoscrolling etc.
2011-08-20 13:54:20 +02:00
Peter Penz dbe2152912 Provide basic rubberband functionality
This is just a rough draft: The rubberband gets visible and an
automatic scrolling is done if the autoscroll-margins have been
reached. However currently no items get selected yet. Currently
the autoscrolling has a severe bug if the scrollbars are manually
changed before or after a rubberband selection.
2011-08-18 23:14:30 +02:00
Frank Reininghaus 63e82a2b3b Add unit test for expanding folders in KFileItemModel 2011-08-15 21:06:06 +02:00
Peter Penz 1479e82315 Allow to adjust start-index when renaming a various number of items
Review: http://git.reviewboard.kde.org/r/102328/
Thanks to Chirag Anand for the patch!

CCMAIL: anand.chirag@gmail.com
2011-08-15 20:36:43 +02:00
Frank Reininghaus dd71994b6c Fix for KFileItemModel::expansionLevelsCompare
Before this commit, expanding and collapsing folders in the details
view would lead to strange results in a folder with the items "a",
"a/a/", "a/a/1", "a/a-1/", and "a/a-1/1".  The problem was that the
comparison between "a/a/1" and "a/a-1/1" went wrong: the first
character in which the paths differ is a "/" in one of the items, such
that the code that reduces this 'index' in
KFileItemModel::expansionLevelsCompare in order to find the 'common
path' did nothing because it checked that only *one* of the two items
does not have an "/" at the position 'index'.
2011-08-15 13:05:53 +02:00
Frank Reininghaus c12f0f8c61 Remove incorrect asserts
They could lead to crashes if the Details View is used and the
view is not wide enough to show all columns for the items.
2011-08-14 19:35:06 +02:00
Frank Reininghaus 2476f632de Keep the current item visible in the view 2011-08-14 17:21:18 +02:00
Frank Reininghaus a7060e6fec Enable switching rows or columns using the keyboard 2011-08-14 17:19:47 +02:00
Peter Penz 188d1a9c7d Move drawing of textbackground to KItemListWidget
As the textbounding-rectangle is now a property of KItemListWidget
also the default visual appearance is moved now from
KFileItemListWidget to KItemListWidget.
2011-08-14 16:11:57 +02:00
Peter Penz 5472115751 Rename KItemListWidget::hoverBoundingRect()
It has been split now to iconBoundingRect() and textBoundingRect().
This is required to implement the rubberband in an efficient way
and makes it more explicit what rectangle is returned.
2011-08-14 15:47:31 +02:00
Peter Penz e57bef0261 Remove "FirstRun" property
The property got obsoleted by the "Version" property.
2011-08-14 15:31:58 +02:00
Peter Penz c173de4c9b Don't limit the preview size to 2 GByte
Reviewed at: https://git.reviewboard.kde.org/r/102319/#review5683
Thanks to Jussi Judin for the patch!

CCMAIL: jjudin+kde@iki.fi
2011-08-14 15:14:05 +02:00
Frank Reininghaus 769084221f Implement DolphinView::setItemSelectionEnabled() 2011-08-14 11:34:03 +02:00
Frank Reininghaus 7b911df33e Two small selection improvements in DolphinView
1. Implement DolphinView::clearSelection().
2. Simplify DolphinView::invertSelection().
   I found, fixed, and unit-tested a bug in the selection
   manager which was uncovered by this change.
2011-08-14 11:05:19 +02:00
Frank Reininghaus 98e859b0c3 Implement basic keyboard navigation in Icons and Compact View
Things that are still missing:
1. Moving to the previous/next row with Up/Down in Icons View,
   moving to the previous/next columns in Compact View.
2. Navigation in Details View.
Note that scrolling to the current item doesn't work yet, and
that the view does not have keyboard focus initially, so one has
to click the view before keyboard navigation and seleciton works.
2011-08-13 18:24:02 +02:00
Frank Reininghaus fabf5681f5 KItemListContainer: show only the scroll bar that is needed
Up to now, KItemListContainer would show both a vertical and
horizontal scroll bar after a view mode change. This commit
fixes that by setting the maximum and the value of the scroll
bar that is not needed to 0 in
KItemListContainer::updateScrollBars().
2011-08-13 14:35:18 +02:00
Peter Penz 7230abb635 Fix typo 2011-08-13 13:14:31 +02:00
Peter Penz 917619f52a Add a TODO-proposal for a cleaner solution of the PendingThreadsMaintainer
Thanks to Andre Wöbbeking for giving me a pointer to fix this ;-)

CCMAIL: woebbeking@kde.org
2011-08-13 13:09:02 +02:00
Peter Penz c79949ed7f Fixes for "krazy" 2011-08-13 13:00:32 +02:00
Peter Penz d11de1855f Don't enable the search panel per default
Assure that the search panel also stays disabled when updating
from an older Dolphin version.

BUG: 279348
FIXED-IN: 4.7.1
2011-08-13 12:45:14 +02:00
Frank Reininghaus 58ab93541c Implement selection of items using mouse clicks. 2011-08-13 11:51:38 +02:00
Frank Reininghaus 9b83d15be4 Test signal emission on selection changes
This commit adds a unit test that changes the selection in various
ways, verifies the result and checks that the selection manager's
selectionChanged signal has been emitted correctly. The test is
data-driven, so I hope that most further testing needs can be
fulfilled by adding new test data.

Moreover, I changed selectedItems() such that the anchored
selection is only taken into account if anchor and current item
are different. The reason is that in some situation the anchor
should not be selected initially (i.e., if an already selected
item is Control-clicked). If the anchor should be selected from
the beginning, it must be selected manually.
2011-08-11 14:23:53 +02:00
Frank Reininghaus 01ff60edee Emit KitemListSelectionManager's selectionChanged signal correctly
This commit makes sure that the signal is emitted with the correct
current and previous selection after a selection change, and
that the signal is emitted exactly once in
KItemListSelectionManager::itemsInserted and
KItemListSelectionManager::itemsRemoved.
2011-08-11 12:23:21 +02:00
Frank Reininghaus a03f7dcd22 Implement beginAnchoredSelection() and endAnchoredSelection().
Unit test included.
2011-08-10 15:21:26 +02:00
Frank Reininghaus 6d6fe76dcf Make sure that key presses are handled in KItemListController
Key press events are forwarded from KItemListContainer to
KItemListController. Right now, only the 'Home' and 'End' keys
are handled (arrow keys require some more work because their action
depends on the view mode).
Note:
1. Before key presses are handled, the view has to be clicked with
   the mouse. It seems that the view does not have the keyboard
   focus initially.
2. The view does not scroll to the new current item yet.
2011-08-10 14:30:32 +02:00
Frank Reininghaus 2e3b7e6dd3 Always use the 'Select' mode for anchored selections
In Dolphin, we don't actually use the 'Deselect' and 'Toggle'
modes for anchored selections, so we can just remove these
modes and always use 'Select' to reduce code complexity.
2011-08-10 13:53:41 +02:00
Frank Reininghaus 258a29f61f Initial support for anchored selections in the selection manager 2011-08-10 11:43:05 +02:00
Frank Reininghaus bb80d1877a Update the anchor item when items are added or removed
If items are added or removed in the model, not only the
current item, but also the anchor item, which is the
starting point for any selections via Shift+Click or
Shift+Key, needs to be updated.
BUG: 262638
FIXED-IN: 4.8.0
2011-08-10 10:38:24 +02:00
Frank Reininghaus 84aa4e75b4 Test setting the current item and anchor item 2011-08-09 19:44:49 +02:00
Peter Penz 3957884bf2 Improvements for selections, smooth scrolling, tooltips and info-panel 2011-08-09 16:22:36 +02:00
Script Kiddy 4692eb7c96 SVN_SILENT made messages (.desktop file) 2011-08-08 08:18:53 +02:00
Script Kiddy 51e4295dd3 SVN_SILENT made messages (.desktop file) 2011-08-04 10:39:16 +02:00
Frank Reininghaus 225fd7073e Underline the current item in KFileItemListView
It still looks a bit ugly, but at least we can see the current
item now :-) It is only updated by mouse clicks at the moment.
2011-08-04 09:52:45 +02:00
Frank Reininghaus e326199727 Shift-clicks and Control-clicks should not open the item 2011-08-03 00:44:36 +02:00
Frank Reininghaus 3547357862 Update current item and anchor item on mouse clicks 2011-08-03 00:44:29 +02:00
Frank Reininghaus 71ccc7e361 Inform the selection manager about model changes. 2011-08-02 23:56:46 +02:00
Peter Penz 10f0f8d558 Minor cleanups
- Cleanup whitespaces after signal-normalization patch
- Cleanup DolphinView::Mode numbering
2011-08-02 19:58:22 +02:00
Peter Penz 8ea76d0a0e Improve performance for creating previews
The overall time for creating previews is faster the more items
are passed to KIO::previewJob() in parallel instead of passing
e.g. only 100 items once and start several KIO::previewJobs
sequentially.

However in the worst case KIO::previewJob() might
block the application for several seconds if the
MIME-type of the passed KFileItems are unknown and e.g. 10000 items
are forwarded.

So KFileItemModelRolesUpdater will now take care to resolve as many
MIME-types as possible until a timeout is reached and will only pass
those items to KIO::previewJob().

For huge image folders, where the MIME-type can be determined very
fast, this means that the overall time for creating previews will
decrease without blocking the application. For "worst case" directories
where resolving the MIME-type can get very expensive this approach
assures no blocking of the user-interface although the overall time
until all previews are generated might slightly increase.
2011-08-02 19:54:39 +02:00
Frank Reininghaus 94f3320444 Fix unwanted triggering of items
An item should only be triggered after a mouse release
event if the mouse press has been done at the same position.
2011-08-02 09:25:41 +02:00
Frank Reininghaus 23f189feef Some small API docs fixes in DolphinView. 2011-08-01 21:06:38 +02:00
Kai Uwe Broulik 6e76582694 Add missing separators to the "Help" sub-menu of Dolphin's menubar replacement like all KDE apps have
BUG: 276560
2011-08-01 18:26:18 +02:00
Montel Laurent 08d655c2bc normalize signals/slots 2011-07-31 13:33:56 +02:00
Peter Penz f23e9496f3 Merged very early alpha-version of Dolphin 2.0
Dolphin 2.0 will get a new view-engine with the
following improvements:
- Better performance
- Animated transitions
- No clipped filenames due to dynamic item-sizes
- Grouping support for all view-modes
- Non-rectangular selection areas
- Simplified code for better maintenance

More details will be provided in a blog-entry during
the next days.

Please note that the code is in a very
early alpha-stage and although the most tricky parts
have been implemented already very basic things like
drag and drop or selections have not been pushed yet.
Those things are rather trivial to implement but this
still will take some time.
2011-07-30 20:13:41 +02:00
Frank Reininghaus 69e4007e5e Fix Dolphin session management regression
The commit fff7573ebb introduced a
regression concerning restoration of saved Dolphin sessions. The
main window numbers which can be passed to KMainWindow::restore()
start with 1, and not with 0.

CCBUG:275649
(cherry picked from commit b4091809be)
2011-07-17 19:31:30 +02:00
Script Kiddy 051759e823 SVN_SILENT made messages (.desktop file) 2011-07-12 10:35:32 +02:00