Commit Graph

197 Commits

Author SHA1 Message Date
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
Alexandre Deckner
e400b7d395 * DeskWindow wasn't checking if the context menu for the trash was already open and showing. We do it like in ContainerWindow now. Fixes #353
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28089 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 14:46:47 +00:00
Axel Dörfler
b16cba7bb5 * The Tracker now makes use of the new B_DISK_SYSTEM_SUPPORTS_WRITING flag,
and will only show the "mount me read-only?" dialog when the file system
  actually supports writing in the first place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28067 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:49:10 +00:00
Axel Dörfler
d881bedfc0 * We must not sort the cached inodes, or else we mess up the order for
CanOpenWithFilter().
* This fixes bug #2795.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-04 20:33:20 +00:00
Axel Dörfler
f28ab87b68 * Added "sortInodes" parameter to CachedEntryIteratorList constructor.
* Moved static CompareInode() to CachedEntryIterator::_CompareInodes().
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27869 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-04 20:30:29 +00:00
Karsten Heimrich
05ea853598 * fix some mem leaks
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-03 12:36:58 +00:00
Karsten Heimrich
c716766b3d * whitespace cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27857 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-03 12:35:57 +00:00
Stefano Ceccherini
2b389c6e5a don't leak the bmessenger. CID 888
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27746 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 15:51:29 +00:00
Stefano Ceccherini
85d7d4bc41 the loop was never entered. CID 93
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:36:29 +00:00
Stefano Ceccherini
84dcf4f24f CID 996. Don't leak the BString
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:23:39 +00:00
Stefano Ceccherini
2e2f53f614 don't leak extendedPoseInfo on error. CID 997
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27743 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-25 14:19:59 +00:00
Rene Gollent
90b7764dc3 Move WidthBuffer and TextGapBuffer into BPrivate and use them from there in BPoseView and BTextView. This (correctly) fixes the previous gcc4 build issues.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-21 20:47:16 +00:00
Stephan Aßmus
a682d9819f Quite a cleanup action to avoid polluting the global namespace with private
BTextView classes:

* Declared the directly used BTextView helper classes as private BTextView
  classes and changed all affected files.
* Realized that Tracker's BPoseView was (accidentally?) using what used to
  be _BWidthBuffer_. It had declared it's own class with the same name and
  same members/size in headers/private/tracker/TextViewSupport.h, but the
  implementation was nowhere to be found. I can only explain this that
  the BTextView implementation was then actually linked and used. But the big
  problem was that it was used without locking (unlike in BTextView)! When
  many Tracker windows opened during system startup or later and they happened
  to each request characters not yet in the cache, I imagine things could have
  gone bad and corrupted memory. Anyways, since I can see the usefulness of
  the cache, BPoseView uses BTextView::WidthBuffer on purpose now. And I moved
  the locking inside BTextView::WidthBuffer::StringWidth().
* Adjusted InterfaceDefs.cpp accordingly.
* TODO: Move subsequent classes into BTextView namespace as well, ie derived
  classes that BTextView doesn't directly know about. All stuff in src/kits/
   inteface/textview_support/
* Added preliminary and not yet implemented layout friendly BTextView
  constructors.
* I will try to handle the insets imposed by BTextView::fTextRect a bit
  differently when used inside the new layout management framework. For this,
  I added BTextView::SetInsets() and GetInsets(). SetInsets() doesn't do
  anything yet.

So far, everything seems to work still... ;-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27654 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-20 15:08:40 +00:00
Stefano Ceccherini
ec10ce591d delete -> delete[]. CID 151
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27522 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-15 12:15:54 +00:00
Michael Lotz
fbf8d9c8dc Remove superfluous NULL check as menu being non-NULL is asserted at the top.
Fixes CID 1075.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27505 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 18:09:35 +00:00
Michael Lotz
f679edb6e4 Don't build the context menu before checking for NULL. Fixes CID 1077, though
the Tracker sources should really be cleaned up to use nothrow and/or exception
handling more consistently.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27504 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-14 17:51:13 +00:00
Stephan Aßmus
ebcba0bec8 Free query in error code path. Fixes CID 927.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 14:04:13 +00:00
Stephan Aßmus
19a1d666b3 Improve the Read-Only mounting suggestion for additional volumes.
* Following a suggestion by BGA, even non-boot Haiku volumes will get the
  read-only popup, although with less emphasis in the wording.
* BPartition does inherit the read-only flag from it's parent device when
  not yet mounted. This is now checked and at least prevents the read-only
  popup for volumes on read-only media. If I understood everything correctly,
  there is no easy way to tell if a file system supports writing.
* Updated indentation style in the header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27343 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-06 08:02:59 +00:00
Bruno G. Albuquerque
837057611d - Better be safe than sorry. Check MIME type and super type after
constructiuon. Thanks Rene for reminding me that BMimeType actually has a
  InitCheck() method. :)




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 17:38:52 +00:00
Stephan Aßmus
3f2dd98c88 This fixes a bad feeling in my stomache:
* When mounting a non-BFS volume, suggest to the user to mount it read-only.
* Store the mount flags with each volume in the automounter settings, restore
  mount settings on next boot.
The second part is probably nice to have anyways und should prevent bad surprises,
the first part should be removed again when we have absolute confidence in all
our file system implementations as well as the kernel itself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-28 13:26:45 +00:00
Bruno G. Albuquerque
dcf3842b09 - Changed the well-known "Downloads" dir to be named "downloads" for
consistency.

All well-known directories in the home dir ("mail", "people", "config") are all
lowercase. The only exception was the "Downloads" one.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27199 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-25 16:58:47 +00:00
Axel Dörfler
d262deae17 * The MIME type menu in the find panel now shows the MIME type icons, if any.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 12:30:00 +00:00
Axel Dörfler
d125d984a6 * IconMenuItem now falls back to the icon of the super type, if a MIME type
didn't have one.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27144 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 12:06:50 +00:00
Axel Dörfler
206c62f036 * Got rid of the "count" parameter and maintenance altogether - makes the code
much simpler.
* Simplified code to compute "start", ie. the index of the first MIME type menu
  item.
* Promote MIME types to the top-level if their super type don't add any
  attributes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27143 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 12:01:27 +00:00
Axel Dörfler
090da60b27 * Renamed CreateMimeMenu() to AddMimeMenu(), as it now also adds the menu to
its parent. The item count of the parent is now actually adjusted, so that
  additional entries are found.
* AddMimeMenu() now returns the menu of an already existing MIME type. Hence,
  we don't add the supertype menu twice anymore for each type, or don't add
  the second type at all when called again.
* Cleaned up naming, consistent use of "* " vs. " *".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27142 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 11:46:50 +00:00
Axel Dörfler
15a27c4d5b * Whitespace cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27141 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 11:22:52 +00:00
Bruno G. Albuquerque
e51479d912 - Creates the supertype menu when only supertype attributes are present.
- *NOW* it works.
 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27126 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 04:10:30 +00:00
Bruno G. Albuquerque
be8c87abf6 - Added a new CreateMimeMenu() method that creates the menu with attributes
for a specific MIME type. 
- Attribute menus now display a hierarchy with type and supertype attributes.

This looks a bit ugly but mostly because not all types and supertypes have icons and descriptions. Anyone up to do a MIME database cleanup? :)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-22 03:57:57 +00:00
Alexandre Deckner
c56a21ed62 - Made multi-selection modifier semantics consistent with most OS's out there. See #1255,
please shout if you've got anything against that :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-19 10:59:10 +00:00
Axel Dörfler
06ba3f0acb * Added two new ways to retrieve an icon from a device:
- B_GET_ICON_NAME: returns the name of an icon. This will then be read from
    a predefined location on disk (not yet implemented). This would also allow
    to add specifiers like "-boot", or "-fat|bfs|ntfs|...", and have special
    icons for those.
  - B_GET_VECTOR_ICON: retrieves the vector icon of a device, if any.
* get_device_icon(BBitmap*, ...) now supports other color spaces than B_CMAP8.
* Added get_device_icon(), BPartition::GetIcon(), and BVolume::GetIcon()
  variants that can also retrieve the icon data directly (like
  BNodeInfo::GetIcon()).
* Reenabled the previous BPartition::GetIcon(), based on a patch by
  Justin O'Dell - this fixes #1391.
* Tracker's MountMenu class now uses B_RGBA32 icons, instead of B_CMAP8.
* Added vector icon to scsi_disk, and scsi_cd. The former doesn't have any
  special removable icon, though.
* Header cleanup, added/updated license, whitespace cleanup.
* Marked deprecated/obsolete driver ioctls in Drivers.h.
* Removed OpenBeOS namespace in the headers I touched that still had them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-08-17 11:27:07 +00:00
Axel Dörfler
489075a3b4 * Renamed _ForceUnmount() to _SuggestForceUnmount() to clarify what it does.
* Factored an _UnmountAndEjectVolume() method that takes a partition and mount
  path out of the method with the same name that gets a BMessage.
* Remove the mount point only if it's in rootfs.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26604 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-24 11:25:16 +00:00
Rene Gollent
7a1c09b66a Only try to rmdir in the case of success.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26595 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 23:09:08 +00:00
Rene Gollent
5c4fff2ef1 Tracker and DriveSetup now attempt to clean up the mount point after successfully unmounting the volume.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-23 22:55:00 +00:00
Stephan Aßmus
a86d99e0da Opening previously open windows on non-boot partitions obviously only worked if the
automounter already mounted these partitions. Since this happens asynchronously,
it sometimes worked and sometimes not. The very simply and non-hacky fix for this
problem is to send a message from the automounter to the application looper to
have it open the previous windows after the initial mount scan is done.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26549 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-21 16:01:51 +00:00
Stephan Aßmus
499c81036f * Fixed automounting all BFS disk when Tracker starts.
* Fixed mounting previously mounted partitions. fSettings was never initialized when restoring
  the settings. The code I removed earlier didn't do that either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-21 15:44:45 +00:00
Stephan Aßmus
df7697df96 Do not shoot ourselves in the foot and remove the previously mounted partitions
from the settings message just after having restored it. This should fix
restoring the previously mounted partitions, but I have not tested it yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-21 13:18:17 +00:00
Michael Lotz
741b3d9004 Use B_RGBA32 instead of B_RGB32 when getting vector icons. Should fix bug #2525.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-17 19:32:57 +00:00
Axel Dörfler
dcdf3137e1 * Unnamed volumes now get the disk size instead of "unnamed" in their mount
menu name, ie. "(unnamed Ext2 File System)" could become "(12.5 GB Ext2 File System)".
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26242 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-03 20:44:57 +00:00
Alexandre Deckner
8a588970c7 - HiliteDropTarget was broken, it used a trick to avoid unselecting already selected items but assumed every
call to HiliteDropTarget(true) and HiliteDropTarget(false) would come in pair on the same target.

 Fixes #2453 and #1793


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26131 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-25 16:46:03 +00:00
Alexandre Deckner
96f8dfaec8 - Some view mode transitions had to be handled specially: kScaleIconMode -> kScaleIconMode,
kMiniIconMode -> kScaleIconMode, kIconMode -> kScaleIconMode.

  Switching the mode to kScaleIconMode uses a special code path that resets the view origin, 
which wouldn't get a chance to be stored/restored. Other icon mode don't need to save/restore 
their origin except when going to or coming from kListMode.

This fixes #2441, although i just discovered the same problem when using SwitchDir() (single 
window navigation)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26121 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-24 11:19:12 +00:00
Alexandre Deckner
d511a89a8a - Since r21336, BView::ScrollBy was checking the values against the ScrollBar ranges but ScrollBy is often called before
updating the scroll range (ie: in ContainerWindow.cpp). IMO, the programatic ScrollBy method shouldn't depend on the 
ScrollBars ranges or state. The original fix in r21336 was apparently hiding other BScrollBar or BView bugs that have been 
fixed in the mean time.
  The content was offseted when going back to list mode after moving icons on the left/up in icon mode. This fixes Tracker bug 
#2312.

- Revert and fix changes to ContainerWindow.cpp in r18481 (cvs 1.37). The condition was broken, but it wouldn't ScrollBy() 
anyway due to the previous problem. Fixing BView made the content autoscroll even if the lefttop corner of the extent was 
already visible.

- Probably unrelated, fix changes to ContainerWindow.cpp in r18993 (cvs 1.38). PoseView()->Bounds().left/top < 0 is expected, 
if for example in icon mode you move an icon close or crossing the left side of the window and then scroll left to adjust. 
This fix ResizeToFit that wouldn't scroll the view correctly in some cases.

So we had a Tracker Bug uncovering a BView fix that was hiding another Tracker bug, everything is fixed hopefully, phew :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-20 02:39:33 +00:00
Alexandre Deckner
491a329330 - AddPoses didn't check for the ShowDiskIcon() option when deciding to AddRootPoses.
When changing to icon mode with a size other than 32 (ie: kScaleIconMode) PoseView calls Refresh() and all the poses are 
removed and loaded again (PoseView.cpp line 1995). This called AddPoses but didn't check for ShowDiskIcon(). The Disks icon 
was shown on startup though, since Tracker uses another code path when starting (caching?).

  This fixes #1833.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-12 18:22:27 +00:00