Commit Graph
365 Commits
Author SHA1 Message Date
John Scipione ee20ff95a4 Tracker: Style fixes
More style fixes
2016-09-02 21:02:06 -07:00
Augustin Cavalier c1cd54a0e1 FSUtils: Add a "bool copyTimes" argument to FSCopyAttributesAndStats().
BPoseView::NewFileFromTemplate does not want to copy the times. Fixes #11702.

We have to keep a 2-argument version of this function because it looks like
some third-party applications might call it (e.g. Dockbert), and even
though it's technically private API, it's easy enough to preserve binary
compatibility.
2016-07-21 21:23:18 -04:00
Augustin Cavalier e944dacae0 Tracker: Remove special filtering case from NewFileFromTemplate.
If the pose matches the current type-ahead filter, it will be added
by the node watcher anyway, so this just created duplicate poses
which messed up internal data structures. Fixes #11122.
2016-07-21 21:12:09 -04:00
Augustin Cavalier 9bd7e4014f Tracker: Restore original PoseView/TitleView names except in BFilePanel.
Should've fixed #12635, but it doesn't. No idea why; perhaps
	request.AddSpecifier("Window", "/boot/home/Desktop");
doesn't work anymore?
2016-03-07 18:04:49 -05:00
looncraz c5b4dc4007 Tracker: Use Set*UIColor, improved font awareness.
InfoWindow now uses the font size to determine the window size and
placement of elements. Also uses system colors, including link
colors. Permissions view not font sensitive yet.

Signed-off-by: Augustin Cavalier <[email protected]>
Patch 0039 from looncraz, unmodified.
2016-01-04 07:24:41 -05:00
Markus Himmel a89ac5a653 Tracker: Add dragged poses to the drag message in the correct order
The function EachPoseAndModel iterates through poses in reverse order.
This fixes #12333.

Signed-off-by: Augustin Cavalier <[email protected]>
2015-12-17 16:25:16 -05:00
Axel Dörfler d8b517b50f Tracker: made title view height depend on font size.
* It now uses a font that's 3/4 the size of the plain font; ie. there
  shouldn't be any change with the default font size.
* Also cleaned up some weird layout code on the way.
2015-09-09 21:05:10 +02:00
Axel Dörfler bf5480299e Tracker: Made list element spacing relative to font size.
* Instead of always adding two pixels, we now multiply the size with 1.1.
2015-09-09 21:02:15 +02:00
Michael Lotz 7cef8ca2fe Tracker: Fix regression introduced in hrev49011.
If the view fails to lock because it is actually gone, we obviously
can't use it to return the container, so delete it directly in that
case.

Fixes #12072 and probably #11982 which would then be a duplicate.
2015-08-10 21:48:26 +02:00
Axel Dörfler b46999bc02 Tracker: page down/up now selects poses.
* When pressing shift it will also extend the selection to the bottom
  or the top of the page.
* It does not deselect anything yet, but Tracker's selection logic is
  pretty questionable, anyway, and it's way too complicated to
  implement this nicely as of now.
2015-07-21 21:27:38 +02:00
Janus 29355b23a7 Tracker: reduce distance between rows with big fonts 2015-06-17 11:10:18 +02:00
Janus 38b2eae6db Tracker: fix selection glitch with some fonts
* This problem was present for the fonts with total height
  greater than 19 and smaller than 20.
* Reduce distance between row with big fonts.
* Fixes #11615.
2015-06-15 04:08:14 +02:00
Augustin Cavalier 3733598912 Tracker: delete more non-Haiku code. 2015-04-26 14:01:05 -04:00
Michael Lotz 2bd0b27f5d Tracker: Fix use-after-free by ref filter of OpenWithPoseView.
Commit ea8b1e14 changed OpenWithPoseView from using ShouldShowPose for
filtering poses to a BRefFilter. The introduced ref filter used the
iterator handed to the BPoseView::AddPosesTask which took ownership
of that iterator and deleted it as soon as it was done. Since actually
adding the poses as well as further filtering is asynchronous and
happens after the AddPosesTask completes, the iterator was used after
it was already deleted.

Introduce BPoseView::ReturnDirentIterator() that is called after the
AddPosesTask is complete. The default version deletes the iterator,
the OpenWithPoseView overrides it and does nothing, it deletes the
iterator in the destructor instead.

Also fix leaking the ref filter. The BPoseView does not take ownership
of the filter as it usually comes from a BFilePanel which is documented
to not take ownership.
2015-04-08 16:50:02 +02:00
Michael Lotz 0a74a00526 Tracker: Remove two outdated comments, whitespace cleanup. 2015-04-08 16:48:10 +02:00
Michael Lotz d854f235bc Tracker: Remove an old PPC STL workaround. 2015-04-08 16:42:11 +02:00
Augustin Cavalier 4e35726354 Tracker: add "hide dotfiles" option to the GUI & enable it by default.
Changing this many lines of code to add a single boolean preference
is absolutely insane. We need a new preference-tracking system, and
one that can be reused in other applications, too.

Fixes #9200.
2015-03-29 18:10:51 -04:00
John Scipione 7ef62fb6c2 Tracker: Style fixes
* Style fixes to QueryContainerWindow.h
* Style fixes to ContainerWindow
* Style fixes to Model
* Style fixes to Tracker
* Style fixes to PoseView
  - Most of the changes come from unindenting the code
2015-03-03 18:47:02 -05:00
Augustin Cavalier 8b03727a4e Revert "Tracker: Fix memory leak"
This reverts commit de7aed2b56. It turns out
that this causes crashes when trying to navigate in directories with
type-ahead filtering enabled. (possibly related to the root cause of
2015-02-28 13:22:19 -05:00
Augustin Cavalier 9e78efbb4d Tracker: delete un-needed #includes.
All of these header files are already included by the .h file that
corresponds to the .cpp file.
2015-02-28 12:54:36 -05:00
John Scipione 7d515bdbd6 Tracker: handle copying files from virtual directories
If virtual directory first resolve the symlink before copying/moving/linking the file.

Fixes #11091

R1/B1 bug squashed!
2015-02-27 18:38:39 -05:00
John Scipione 27c5746706 Tracker: Move static functions up
Rename CopySelectionListToBListAsEntryRefs to CopySelectionListToEntryRefList
to reflect that it no longer copies to a BList but instead to a BObjectList<entry_ref>
2015-02-27 18:21:52 -05:00
John Scipione 4c47562f60 Tracker: Minor style fixes to PoseView 2015-02-27 18:17:59 -05:00
John Scipione f0647531ff Tracker: link to TargetLibsupc++ 2015-02-27 16:02:25 -05:00
John Scipione 370ee87a8e Tracker: replace max_c with std::max
Remove using statements and put map include in its proper place
2015-02-27 16:02:24 -05:00
John Scipione de7aed2b56 Tracker: Fix memory leak
When items were removed from fFilteredPoseList as opposed to fPoseList, the
items were not automatically deleted and thus leaked. By setting the BObjectList
to automatically delete them on removal (by setting the deleteIfOwned paramete
to true) we avoid this leak.
2015-02-27 16:02:24 -05:00
John Scipione 8c2813c187 Tracker: Style fixes 2015-02-27 16:02:23 -05:00
John Scipione 5f26850cba Tracker: Small style fixes 2015-02-25 15:01:13 -05:00
Augustin Cavalier 2f5fe16a3e Tracker: delete #ifndef __HAIKU__ code.
Since tracker_layout has been merged, this is pretty useless now.
Should result in no change to generated assembly.
2015-02-14 18:49:25 -05:00
Augustin Cavalier e7803cf1f6 Tracker: use the Layout API wherever possible.
Sorry this commit is so big, but I couldn't figure out how to do this
incrementally without breaking things.

I wasn't able to just merge Aldeck's branch, as it was a partial refactor
of Tracker and didn't just rewrite the UI creation code to use layouts,
and the changes for PM (e.g. addon loading, virtual directories) made it
very hard to merge (it doesn't even compile after an automerge) so rather
than spending time on that, I decided it'd be better to recreate his work.

Miscellaneous notes:
 - This partially cleans up BPoseView & subclasses and BContainerWindow &
   subclasses -- none of the subclasses and child views abuse the parent's
   state, child views, or layout now.
 - BFilePanel and BDeskWindow are not on layouts, because:
   * BFilePanel docs in the Be Book instructed developers that wanted to
     modify BFilePanel's layout to just use FindView() and then move the
     views around. Obviously making it use layouts will break all BeOS
     apps that do this, and there are a lot of them (Pe, WonderBrush are
     just two examples.) I've added a note to the TODO list for R2 to create
     a layout-compatible API for this.
   * Some replicants (Workspaces, for example) rely on manipulating
     BDeskWindow's drawing state. This is incompatible with layouts, as
     at least in the case of Workspaces, it breaks a layouted version
     of BDeskWindow entirely.
 - I noticed a lot of #ifdef BEOS_VERSION ... gunk in the code. Tracker
   probably didn't build on BeOS just before this commit, and now it
   won't for sure, so I intend to go through and clean that out in the
   near future.

This commit also fixes:
 - enhancement #4996 (make Tracker's navigator use vector icons)
 - bug #3039 (resizing OpenWithWindow flashes the blue border)
 - bug #3889 (OpenWithWindow redraw errors)
 - a regression that was a side effect of "dynamic_cast<BDeskWindow*>(this)"
   always returning NULL when run in the constructor. I just added a "bool
   isDeskWindow" to BContainerWindow's constructor that is only set to true
   by BDeskWindow.
 - a copy&paste error in VirtualDirectoryPoseView that was passing "uint32
   resizeMode" as "uint32 viewMode".

Thanks to Alexandre for his original branch (it was a very useful
reference), Axel (for some miscellaneous advice & encouragement),
Adrien & Humdinger (for user interface review), and Diver (for user
interface review & testing).
2015-01-27 01:43:51 -05:00
Adrien Destugues 529cd177b5 BFilePanel: allow to change the node flavors
There doesn't seem to be anything ini the implementation that would
cause a problem, as long as you don't try to change this while the
window is already open.
2014-12-04 09:26:49 +01:00
John Scipione 2f60dea53a Tracker: Throw exception on assert failure
... in situations where a NULL pointer dereference was vital to the
functioning of the method we use a stronger assert that throws an
exception on failure. This is accomplished by a new method in
Utilities.cpp, ThrowOnAssert().

None of these conditions should ever be true, if they are it means that
the code is written improperly and would have resulted in a NULL
dereference and undefined behavior (most likely a crash) before.

Most instances of ThrowOnAssert() either replace an ASSERT followed
by a dereference or an early return that covered the error.

Also remove _ThrowOnErrorWithMessage() which wasn't being used.
2014-08-10 15:07:38 -04:00
John Scipione 9cc03189fa Tracker: Add NULL checks and ASSERTs
To prevent recoverable NULL pointer dereferences. Dereferencing a
NULL pointer is undefined behavior and should be avoided.

Unrecoverable NULL checks will be dealt with in the next commit.
2014-08-10 15:07:37 -04:00
John Scipione 54e2dd7272 Tracker: style fixes
No functional changes intended.
2014-08-10 15:06:34 -04:00
John Scipione 95ef540535 Tracker: Unchecked dynamic_cast, CID 611229 2014-08-10 15:06:30 -04:00
John Scipione a35bd7b065 Tracker: Unchecked dynamic_cast, CID 600452 2014-08-10 15:06:29 -04:00
Jérôme Duval 3aeed6607c include strings.h where appriopriate...
instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949
2014-08-08 22:40:37 +02:00
John Scipione 3188d3d0bf Tracker: Remove logically dead code
Replace with an ASSERT that srcWindow != NULL by the time we've gotten
this far.

CID 1228649 and CID 1228650
2014-07-23 13:20:08 -04:00
John Scipione a892df239f Tracker: Fix several unchecked return values
CID611191, CID611192, CID611193
2014-07-18 17:58:07 -04:00
John Scipione 5969c5d779 Tracker: Fix use after free
CID510586
2014-07-18 17:58:05 -04:00
John Scipione 1933335b06 Tracker: fix 2 uninitialized scalers
CID610119
2014-07-18 17:58:04 -04:00
John Scipione ba24adb272 Tracker: fix 2 unbounded copies
CID609045
2014-07-18 17:58:02 -04:00
John Scipione d308d1fa82 Tracker: fix unchecked dynamic_casts
CID603130, CID603131, CID603132
2014-07-18 17:58:01 -04:00
John Scipione 62de0e04be Tracker: fix unchecked return values
Check that LockLooper() succeeds

CID611190, CID611194, CID602477
2014-07-18 17:57:43 -04:00
John Scipione dc3cfca45b Tracker: fix unused pointers
CID610474, CID610475
2014-07-18 17:53:03 -04:00
John Scipione 20e3467eae Tracker: fix dereference after NULL checks
CID600503, CID600504, CID600505
2014-07-18 17:52:37 -04:00
John Scipione 0db0308b08 Tracker: style fixes to PoseView.cpp
Compare with NULL explictly
2014-07-18 17:51:25 -04:00
John Scipione d5868b5976 Tracker: style fixes to PoseView
Variable renaming for consistency and clarity
2014-07-17 14:51:09 -04:00
John Scipione d7e6821137 Tracker: miscellaneous style fixes 2014-07-17 14:23:33 -04:00
John Scipione 091db3a99d Tracker: Check if selectedPose is NULL
... before using it.
2014-06-20 21:29:19 -04:00