History log of /haiku/src/kits/tracker/DesktopPoseView.cpp
Revision Date Author Comments
# e7803cf1 26-Jan-2015 Augustin Cavalier <waddlesplash@gmail.com>

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).


# 2f60dea5 29-Jul-2014 John Scipione <jscipione@gmail.com>

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.


# 29c145bc 18-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Check LockLooper() return value.

Fixes CID602468 and CID602469

Thanks waddlesplash for pointing this out.


# d7e68211 04-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: miscellaneous style fixes


# 238d9b2e 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: DesktopPoseView style fixes


# 1c29b26e 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add virtual directory feature to Tracker

Similar to stored queries, files of the virtual directory type behave
like directories -- i.e. they open in a list-mode Tracker window and
show up as an item with submenu in navigation menus. The file itself is
a plain text file in driver settings format. It can have an arbitrary
number of "directory" entries, which specify the paths of (actual)
directories for which the virtual directory provides a merged view. The
view will not show duplicate entries. For non-directory entries the
first one encountered (according to the order the directory paths are
specified in the file) will be shown. A subdirectory entry will again
behave like a virtual directory.

The support in Tracker isn't perfect yet. I'm afraid major refactoring
would be necessary to get it there.

The virtual directory file type uses a differently colored version of
the folder icon. Alternatives welcome.


# db416834 02-Jan-2013 Matt Madia <mattmadia@gmail.com>

Automatic whitespace cleanup. No functional change.


# ea001e58 28-Jul-2012 John Scipione <jscipione@gmail.com>

Round 2 of style changes to Tracker

* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes


# a51764c5 27-Jul-2012 John Scipione <jscipione@gmail.com>

WIP: Yet more style fixes, mostly 80 char violations.


# b05aa8b5 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# ef9c0b6a 31-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More cleanups:
- remove some more leftover desktop integration-related code.
- remove special case that would hide the Desktop folder in file panels.
- fixed BFilePanel to correctly filter out the trash from the volume root
and show it on the desktop like everywhere else.
- renamed CountView::Add/RemoveFilter so they don't hide
BHandler::Add/RemoveFilter (gcc4 warning).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35368 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a65ec153 15-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix style violations (thanks Axel!).
Update filesystem name in find_directory as our fat filesystem is not named "dos".



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35093 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01dffd8e 14-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More Tracker refactoring:
* relocated Trash dirs to volume roots by modifying find_directory() to report the trash location as volume/Trash.
* FSUtils no longer creates /home/Desktop on every volume.
* TrashWatcher now keeps icons in sync on all volumes.
* Simplified FSGetDeskDir since it no longer has to worry about getting the desk directory on any volume other than the root.
* Relocated trash context menu logic to BContainerWindow so it can also be used at the volume roots.
* DesktopPoseView now creates a virtual Trash pose representing the trash contents as before.
* Corrected typo: Model::WriteAttrKillForegin() -> Model::WriteAttrKillForeign().

Closes ticket #5245.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35085 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 671dd808 12-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Various cleanups:
* Removed dead/obsolete Integrate Non-boot Desktops code.
* Modified PoseView to ignore the fInvisible attribute of BPoseInfo for now.
This has the net effect that the Desktop folder and /boot/var are no longer
hidden from the user. To go with this change, Tracker no longer forcibly
writes that hidden setting to those folders on access. This feature might
be useful again in the future (especially in conjunction with relocating
the Trash folder somewhere such as the disk root), but is currently somewhat
problematic because those dual-booting with BeOS will still have a Tracker
that force writes those attributes which would bring us back to square one
with respect to showing the Desktop folder when we start respecting the
attribute again. Suggestions welcome. Haiku-only users can remove the
_trk/pinfo_le attribute on those folders to remove the invisibility
in any case.
* TrackerSettings: Removed obsolete desktop integration settings. Also
modified TrackerSettings parser to skip unrecognized settings instead
of aborting the settings file parsing process entirely.

Closes ticket #2872.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35040 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 862508e7 02-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Turned on widget outline by default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34443 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c5b7a0fe 19-Aug-2009 Alexandre Deckner <alex@zappotek.com>

* Give a chance to volume/disks icons to save their position when changing the
"Show Disks/Volumes Icon" preference. Fixes #1559
* Automatic white space cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32513 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 86fb66a8 29-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed a mixup of the flags and resize mode arguments. In my previous commit,
I wrongly assumed that viewMode == view flags.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29778 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0834dd80 28-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Use B_DRAW_ON_CHILDREN for the Desktop pose view.
* Draw the selection rect in DrawAfterChildren().
* Call DrawAfterChildren() manually in Draw(), if B_DRAW_ON_CHILDREN is not set.

This change allows replicants, in case they want to be aware of being embedded
in the desktop, to use alpha blending to draw on top of the desktop pose view.
For replicants which do not care, this patch changes nothing. When views
with B_DRAW_ON_CHILDREN invalidate themselves, they will automatically trigger
an update of children that sit on top the invalidated area, at least with our
app_server. So this change works just like one would expect, ie like
compositing views. Of course it should have flickering when app_server does not
run in double buffered mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29759 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f9d400 22-Feb-2009 Jérôme Duval <korli@users.berlios.de>

set widget outline to true on DesktopPoseView creation as default. It might not be set by the BackgroundImage code if there is none.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29283 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02be5353 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12772 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7803cf1f69a81b1c77880518ba16b6708c1efdb 26-Jan-2015 Augustin Cavalier <waddlesplash@gmail.com>

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).


# 2f60dea53ae5e08baeae2c4e41c89a8d2e74aaa6 29-Jul-2014 John Scipione <jscipione@gmail.com>

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.


# 29c145bcbe26d2806ae1ba74dae8f95d39611ff6 18-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Check LockLooper() return value.

Fixes CID602468 and CID602469

Thanks waddlesplash for pointing this out.


# d7e682113776632e5c04a6558eca0c5650a164e4 04-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: miscellaneous style fixes


# 238d9b2ef03d280f35dd6a51ab133b17f86feab4 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: DesktopPoseView style fixes


# 1c29b26e7c7eb94ee125315eca5a94265f613420 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add virtual directory feature to Tracker

Similar to stored queries, files of the virtual directory type behave
like directories -- i.e. they open in a list-mode Tracker window and
show up as an item with submenu in navigation menus. The file itself is
a plain text file in driver settings format. It can have an arbitrary
number of "directory" entries, which specify the paths of (actual)
directories for which the virtual directory provides a merged view. The
view will not show duplicate entries. For non-directory entries the
first one encountered (according to the order the directory paths are
specified in the file) will be shown. A subdirectory entry will again
behave like a virtual directory.

The support in Tracker isn't perfect yet. I'm afraid major refactoring
would be necessary to get it there.

The virtual directory file type uses a differently colored version of
the folder icon. Alternatives welcome.


# db41683495bfde817554415d14ae6f9cc91e77eb 02-Jan-2013 Matt Madia <mattmadia@gmail.com>

Automatic whitespace cleanup. No functional change.


# ea001e585a588e40404945a1201821da893d2e09 28-Jul-2012 John Scipione <jscipione@gmail.com>

Round 2 of style changes to Tracker

* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes


# a51764c53eecd8ca5f6312b92d8baccda89d5b1d 27-Jul-2012 John Scipione <jscipione@gmail.com>

WIP: Yet more style fixes, mostly 80 char violations.


# b05aa8b5b16e5b4f420a35c37805c6387df98737 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# ef9c0b6a518a4b57ca9b02a6c59a0a984157aeff 31-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More cleanups:
- remove some more leftover desktop integration-related code.
- remove special case that would hide the Desktop folder in file panels.
- fixed BFilePanel to correctly filter out the trash from the volume root
and show it on the desktop like everywhere else.
- renamed CountView::Add/RemoveFilter so they don't hide
BHandler::Add/RemoveFilter (gcc4 warning).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35368 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a65ec1537642acc9b5fa1a3633f62ce30714b6df 15-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix style violations (thanks Axel!).
Update filesystem name in find_directory as our fat filesystem is not named "dos".



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35093 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01dffd8edd94699ac1e6f2cc4322555f2171da14 14-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More Tracker refactoring:
* relocated Trash dirs to volume roots by modifying find_directory() to report the trash location as volume/Trash.
* FSUtils no longer creates /home/Desktop on every volume.
* TrashWatcher now keeps icons in sync on all volumes.
* Simplified FSGetDeskDir since it no longer has to worry about getting the desk directory on any volume other than the root.
* Relocated trash context menu logic to BContainerWindow so it can also be used at the volume roots.
* DesktopPoseView now creates a virtual Trash pose representing the trash contents as before.
* Corrected typo: Model::WriteAttrKillForegin() -> Model::WriteAttrKillForeign().

Closes ticket #5245.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35085 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 671dd808619ef6043eca11b09a193d877181d10f 12-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Various cleanups:
* Removed dead/obsolete Integrate Non-boot Desktops code.
* Modified PoseView to ignore the fInvisible attribute of BPoseInfo for now.
This has the net effect that the Desktop folder and /boot/var are no longer
hidden from the user. To go with this change, Tracker no longer forcibly
writes that hidden setting to those folders on access. This feature might
be useful again in the future (especially in conjunction with relocating
the Trash folder somewhere such as the disk root), but is currently somewhat
problematic because those dual-booting with BeOS will still have a Tracker
that force writes those attributes which would bring us back to square one
with respect to showing the Desktop folder when we start respecting the
attribute again. Suggestions welcome. Haiku-only users can remove the
_trk/pinfo_le attribute on those folders to remove the invisibility
in any case.
* TrackerSettings: Removed obsolete desktop integration settings. Also
modified TrackerSettings parser to skip unrecognized settings instead
of aborting the settings file parsing process entirely.

Closes ticket #2872.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35040 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 862508e775a71502cf15577d428848c0af02f10d 02-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Turned on widget outline by default.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34443 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c5b7a0fe6ab34130577e3aef566d32bbe172fae5 19-Aug-2009 Alexandre Deckner <alex@zappotek.com>

* Give a chance to volume/disks icons to save their position when changing the
"Show Disks/Volumes Icon" preference. Fixes #1559
* Automatic white space cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32513 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 86fb66a8dd9d6ed843e3bc3539e3b39f2560faa6 29-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed a mixup of the flags and resize mode arguments. In my previous commit,
I wrongly assumed that viewMode == view flags.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29778 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0834dd807f88b3228ea6eb54745a5f9a194f507c 28-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Use B_DRAW_ON_CHILDREN for the Desktop pose view.
* Draw the selection rect in DrawAfterChildren().
* Call DrawAfterChildren() manually in Draw(), if B_DRAW_ON_CHILDREN is not set.

This change allows replicants, in case they want to be aware of being embedded
in the desktop, to use alpha blending to draw on top of the desktop pose view.
For replicants which do not care, this patch changes nothing. When views
with B_DRAW_ON_CHILDREN invalidate themselves, they will automatically trigger
an update of children that sit on top the invalidated area, at least with our
app_server. So this change works just like one would expect, ie like
compositing views. Of course it should have flickering when app_server does not
run in double buffered mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29759 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f9d4001014776125174d25d5c201bb3fc36bf8 22-Feb-2009 Jérôme Duval <korli@users.berlios.de>

set widget outline to true on DesktopPoseView creation as default. It might not be set by the BackgroundImage code if there is none.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29283 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02be5353fd41ea40007a382e13f007eaf6b5a3a0 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12772 a95241bf-73f2-0310-859d-f6bbb57e9c96