Commit Graph

238 Commits

Author SHA1 Message Date
Rene Gollent
a67852c554 Reset the cursor check state if we drag over a pose that's not a suitable DnD destination for the drag. Otherwise we'll reset the cursor back to the move state and never set to copy again unless we exit/reenter the window. Thanks to luroh for reporting.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29167 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-08 18:39:39 +00:00
Rene Gollent
81796bc0b3 Don't leak memory when aborting operations due to read-only volume.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-08 16:00:46 +00:00
Rene Gollent
c854c13348 Disallow move to trash and/or delete operations from read-only volumes. This fixes ticket #3421.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29163 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-08 14:33:22 +00:00
Rene Gollent
42fe9293f8 Tracker now alters the cursor to indicate the resulting FS op when drag and dropping files.
If the op is determined to be a copy, the copy cursor from Wonderbrush (thanks Stephan!) is
displayed. Otherwise, the default hand cursor is used to indicate move.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-08 01:05:34 +00:00
Joachim Seemer
4f3347b64b As discussed here:
https://lists.berlios.de/pipermail/haiku-commits/2009-February/014198.html
We decided on a distinction between path+filename and only the path to a file.
I changed the places a user is exposed to the issue, using the definition:
Path with filename:	"Path"
Path without filename:	"Location"


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29130 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-03 16:16:26 +00:00
Rene Gollent
8e1e99a333 Fix Create Link from context menu.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29109 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-02-01 16:25:30 +00:00
Rene Gollent
28e82de7b3 Compute the point list for the destination items. This fixes a problem reported by BGA where dropped items in large icon mode weren't being dropped onto the location of the pointer, but rather the first available grid slot.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29104 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-31 21:48:29 +00:00
Rene Gollent
dc027966d7 Unbreak build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29099 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-31 15:38:35 +00:00
Rene Gollent
b8d65a49d8 This should really fix #3393. Apparently I'm more sleep-deprived than I thought.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29096 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-31 03:21:23 +00:00
Rene Gollent
fee5fc34ff Fix another regression preventing moving around icons. Fixes ticket #3393.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29095 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-30 23:49:02 +00:00
Rene Gollent
6a392dcec4 Skip doing the preflight size calculation in cases where the requested FS operation will be instantaneous anyways.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29093 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-30 00:08:26 +00:00
Rene Gollent
994541a836 Refactor MoveSelectionTo a bit to reuse other code instead of duplicating most of it practically verbatim with different variable names.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29092 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-29 23:49:57 +00:00
Rene Gollent
12f46bebca Fix a regression introduced with my previous commit where forcing Move would not always be respected.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29091 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-29 22:21:22 +00:00
Rene Gollent
cfd0c07711 If the source and destination volumes of a drag and drop op do not match, default to copying unless the user has explicitly requested otherwise. TODO: visual indicator of which op is going to happen.
--

M    PoseView.cpp


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-29 00:05:38 +00:00
Jérôme Duval
280987e2cb Applied a tip from Stephan: pass the location to DrawString directly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-25 19:43:41 +00:00
Jérôme Duval
0cfe9ac0f7 * centers the text for the settings list item as done with BStringItem
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-25 19:12:58 +00:00
Alexandre Deckner
e5a30119a0 * There was a bug in the way the mimetypes list was constructed, it would recalculate the list on
each addition, which is o(n). It's already refreshed lazily on read, only rarely when ContainerWindow updates 
his menu.
 Now there's only one recalc when finished adding poses, 9ms for 20K files here.
Pose adding is almost linear now for the first thousand files, but it gets worse after that due to 
another known problem. Now doing 35s instead of 80s on a 20K files folder here, more to come :) 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28891 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-12 19:42:41 +00:00
Karsten Heimrich
b47e734742 * Prevent a column to shrink smaller then the default column width. This was most notable
when double clicking e.g. the Size column in a tracker window containing only folders.
  It would shrink smaller then one can resize it while dragging the resize 'handle'.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28885 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-11 18:12:12 +00:00
Karsten Heimrich
b2f91e61b7 * Prevent the B_OBSERVER_NOTICE_CHANGE to get passed on to ContainerWindow, since
this would crash Tracker in case the 'Open With' window is shown and one try's
  to set, e.g 'Show full path in title' or 'Show Navigator' etc.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-11 17:39:54 +00:00
Alexandre Deckner
51505cb08a * The pose adding thread was going too fast, opening too many files (those are closed by the window thread), and
reaching the file descriptor limit. For some still unknown reason, this was causing GetNextDirents to stop returning new 
entries. The result was that, on populated folders, Tracker wouldn't load all poses and stop at a random amount.
We now take a more conservative approach and close the files before sending, reopening them on reception.
 
Now the AddPoses thread is a bit too aggressive, especially on second runs, i needed to add some snoozing otherwise it 
would stall Tracker for several seconds. (testing on a 20000 files folder).
This fixes #3054 



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28872 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-11 03:08:56 +00:00
Rene Gollent
6d344473e6 Fixed broken ternary logic in GenericAttributeText::Compare() that would result in the wrong value being returned when one or both attributes being compared were undefined. A symptom of this was the crash reported in ticket #2760. Leaving that ticket open for now though as returning the wrong value to the sort shouldn't have caused a crash regardless.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28871 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-11 01:40:05 +00:00
Rene Gollent
db5b0bfcfe When drag and dropping a text file, Tracker would refuse to extract the text (and style attributes, if any) if the file in question didn't have both the text/plain filetype *and* Tracker's clipping attribute. Since I was unable to find any good reason whatsoever to check for the latter, I removed this. Fixes the reported problems where drag and dropping a file onto a BTextView would do nothing unless the clipping attribute existed as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28828 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-12-28 06:58:11 +00:00
Rene Gollent
c3341227ea If the source volume is read only, only allow a copy op since move makes no sense in this case. Ideally we should probably also modify NavMenu and the drag context menu to only present the options that make sense in a particular situation. Fixes ticket #3195.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28769 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-12-03 14:43:23 +00:00
Rene Gollent
4f7d38d331 Correctly indicate "Copying" vs "Moving" state in status window (thanks Adrian Panasiuk for pointing this out).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28762 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-12-02 23:05:06 +00:00
Axel Dörfler
d35d0f74a6 * s/fLastKeyTime is no longer a static member - this fixes that the type-ahead
buffer will be taken over to another window (if you type fast enough).
* Also the type-ahead runner no longer clobbers the static type-ahead buffer,
  so it won't delete something you typed in another window anymore (again, if
  you type fast enough :-)).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-28 20:35:28 +00:00
Axel Dörfler
b9224a2568 * Fixed typo.
* No need to duplicate other people's coding style violations: parameters
  have names in Haiku even in header files; fixed some more occurences of
  this problem (but not nearly all).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-28 20:32:35 +00:00
Rene Gollent
87f41e61ea Resolve several bugs that are probably as old as Tracker itself:
1) Move To now works as advertised in all cases - previously it
silently converted a move into a copy if the destination volume
was different, as its move code was not geared towards handling
that case properly. This also has the side effect that drag and
drop is now always a move as well unless overridden via right click
DnD. This may or may not be reverted back to the original behavior
later depending on the consensus.
2) Copying a folder onto another folder of the same name now merges
the contents instead of destroying the original. This fixes ticket
#1420. Still to do: interactive prompting to allow fine grained file
replacement and skipping in this and other multi-file cases, but 
I'll open a new enhancement ticket for that.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-26 03:40:41 +00:00
Bruno G. Albuquerque
9141571856 - Traverse links when adding well known directories.
This change will make directories like the downloads folder get its correct
special icon even if it is a link to a another directory. The destination
directory also gets the icon which makes it easy to identify special
directories even in other partitions.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28730 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-25 23:38:08 +00:00
Bruno G. Albuquerque
641305c237 - Find panel now also includes supertype attributes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28729 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-25 22:50:02 +00:00
Stephan Aßmus
3005b1d6f5 Always retrieve the "would be mount point" of the partition
in AutoMounter::InitialMountVisitor::Visit(), otherwise restoring
mount options, like read-only mounting, would never work. This
kind of mixes the options of the mount settings, since it partially
remembers the settings even if the option is not "only previously
mounted disks", but it should not hurt anyways. As a side effect,
this should also fix the mount notification sent to Tracker, as
the path should only have been correct for the "mount previous disks"
setting.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-06 11:50:38 +00:00
Stephan Aßmus
b545073f08 * Moved the global BPrivate::WidthBuffer from BTextView into BPrivate as
gWidthBuffer.
* Tracker PoseView now uses BPrivate::gWidthBuffer instead of it's own
  instance.
* TextView.h and PoseView.h are now a little cleaner.
* InterfaceDefs.cpp now deletes gWidthBuffer in _fini_interface_kit_().
* Added binary compatibility support for NetPositive in WidthBuffer.h and .cpp.
  Obviously it kind of defeats the purpose of having WidthBuffer neatly tucked
  away in the BPrivate namespace, but Haiku should run NetPositive, I guess.
  Fixes #2879.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-06 11:31:40 +00:00
Alexandre Deckner
fc7b01b188 * fix coding style
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28408 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 18:01:55 +00:00
Alexandre Deckner
e3bcc1dc09 * Combine the two calls to ScrollBy into one.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 15:59:00 +00:00
Alexandre Deckner
e984242155 * On date format change, remove the need for the synchronous call to
DrawViewCommon(), simply invalidate since the logic is simplified now,
 see below.
* Reworked the way TimeAttributeText was updated when date format is 
changed. Got rid of the recalculatText flag propagation, it was broken 
since forever anyway (was here on r5 max4.1): It was only updating 
visible poses and wasn't robust in certain cases. Besides, it was 
cluttering the code on several layers upfront only for date format changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-31 15:07:06 +00:00
Axel Dörfler
34034cf61b * _UnmountAndEjectVolume() now actually ejects the media, if configured, and
possible, ie. if no other volumes are mounted on the device.
* Fixed a operator precedence bug in GetSettings() when retrieving the mounted
  volume flags.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28347 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-27 15:42:00 +00:00
Alexandre Deckner
f05f4fcb53 * Added support to show tracker preferences via scripting. This will allow accessing
tracker prefs via the preferences menu using a one line script: 'hey Tracker DO 
Preferences'. Not sure how to set the icon of the script with the build system, feel 
free to do it. See enhancement #2365


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-26 00:09:47 +00:00
Alexandre Deckner
6dee6b8c17 * Do the locking and lock check in an outer 'if', the window could be left
unlocked if the whole condition wasn't true. Thanks stippi!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28276 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 09:02:17 +00:00
Alexandre Deckner
369ad66d92 * Lock the window when saving windows states in Tracker::QuitRequested.
This was the cause of #2571 and duplicate #2888 although the bug wasn't 
 triggered anymore since r28205.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28274 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-21 23:00:13 +00:00
Michael Lotz
cde552bdcb Don't select anything in type ahead mode when no match is found anymore. This
makes sure that the best match just stays selected instead of always selecting
the topmost pose.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28234 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 23:43:18 +00:00
Michael Lotz
aa22e8db2e Changed the score calculation for type ahead in the Tracker. Previously if there
was at least one character matching at the start of any file it would have
gotten a score >= 1. This rendered the substring matching completely useless
as soon as this happened, because it would always get a score < 1 depending on
the position of the occurance. Now substring matching is the first (and without
word mode, the only) score to get. Since the score depends on the position of
the match, this doesn't change anything for exact matches at the beginning, but
it does allow for substring matches even if there is a file starting with the
same letter as the search string. Also use strcasestr() instead of strstr() to
make the search case insensitive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28233 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 20:12:09 +00:00
Alexandre Deckner
842cd2b8cc * Removed the call to Refresh() when switching to scaled icon mode as it
would scroll to (0, 0), and screw the now always-in-sync fViewState.
  After testing every possible mode transition, there seem to be no side
  effect as the comment would suggest. Stippi, do you remember why it 
  was necessary? See r18699. 
* This enabled me to do my previously added TODO's. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 16:32:10 +00:00
Alexandre Deckner
3704f31d73 * AddPosesCompleted could be called actually before all the poses were added.
The method was called after _sending_ all the messages, not after receiving
  them all. This fixes the scroll validity check in AddPosesCompleted in list
  mode (bug mentioned in my last commit).

 We can now close #2441, tracker windows should now be completely persistant
with regard to scrolling now, in all modes (spatial mode, single window 
mode in list or icon mode). \o/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28210 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 09:52:09 +00:00
Alexandre Deckner
e85ca56c7d * Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28209 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 08:57:24 +00:00
Alexandre Deckner
3d7584da5c * Rewrote the way BViewState checks if changes needs to be saved on quiting a navigation window (icon mode and
list mode) or switching dir in single window navigation. Fixes the other half of the problem in #2441. Left some 
todos.
  I discovered an other bug that can add a random offset after finishing adding poses.  


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28205 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 01:41:43 +00:00
Bruno G. Albuquerque
2cb8652f55 - The Trash context menu was using a checkmark to keep track of the last
selected item which does not make much sense. Disabled the checkmark.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28201 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 00:33:38 +00:00
Axel Dörfler
49ad25b392 * The type ahead mechanism did not work correctly in list view mode: instead
of taking the contents of the columns, it would always use the file name
  instead.
* That uncovered another bug, though: WidgetText::Text() tried to cast everything
  to StringAttributeText, but GenericAttributeText is actually used for most
  columns.
* Therefore, GenericAttributeText is now a subclass from StringAttributeText.
* Extended the type ahead to take other columns into account, and made it also
  find strings in the middle (like a filter) as a second choice.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28180 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 20:18:20 +00:00
Alexandre Deckner
e522ba55ba * In single window navigation, tracker wasn't restoring the view origin (current scrolling) properly. It was reseting the origin even after
successfully loading the saved state. Reworked the logic to make that work properly (this also needed checking if the state read succeeded). This 
fixes part of #2441. There is still an issue when sometimes the view state is not saved properly, more tomorrow! 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28158 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 01:41:45 +00:00
Alexandre Deckner
404bf9d1ab * Simply check if fTrashContextMenu->Window() is non NULL. This should be the definitive
solution :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 21:14:16 +00:00
Rene Gollent
8cca2102aa Fix build (ShowingAwarePopupMenu was not added to libtracker's build, resulting in undefined sym errors).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28144 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 15:43:05 +00:00
Alexandre Deckner
618c7ffa85 * There was indeed a problem with my previous attempt at fixing #353. This should be much
better!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28139 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 15:35:59 +00:00