Commit Graph

6360 Commits

Author SHA1 Message Date
Alex Smith
4b8a51c34c Fixed incorrect sizeof in LinkReceiver::ReadRegion.
The type of BRegion::fCount is long, and ServerLink sends/receives it
with sizeof(long), but LinkReceiver was using sizeof(int32). Due to
long being 64 bit this was resulting in a mismatch. This fixes the
drawing problems on x86_64.
2012-08-09 18:10:49 +01:00
Alex Smith
c0166cf22a Should check for ELF_CLASS, not ELFCLASS32. 2012-08-09 14:06:29 +01:00
Alex Smith
a5e96a301e Merge branch 'master' into x86_64 2012-08-09 08:24:50 +01:00
Philippe Saint-Pierre
9766084650 InfoWindow: Icon wasn't properly refreshing when changing 2012-08-09 01:28:54 -04:00
Philippe Saint-Pierre
11a36918ee PoseView::AddPosesTask - no need to open the node at this point 2012-08-09 01:28:54 -04:00
x-ist
6e1a7a15cd Fix BTextView tab calculation.
In rare cases such as described in #7955 BTextView happens to calculate the
width of a tab close to zero (e.g. 0.000031). This patch adds a fallback to the
default tab width in that case.

Signed-off-by: Ryan Leavengood <leavengood@gmail.com>
2012-08-08 22:17:38 -04:00
Rene Gollent
74e288401d 64-bit fixes. Gets Debugger fully compiling on x86-64. 2012-08-08 19:40:51 -04:00
Philippe Saint-Pierre
aafb6faf57 PoseView: crash related to PoseView containing many files
Due to a previous change in the incrementation of models in AddPosesTask,
PoseView containing large number of poses were prone to crash in ClearPoses().

Gaps in PoseList or other invalid memory area were introduced.

Thanks to x-ist for precious assistance in spotting those issues!
2012-08-08 16:36:02 -04:00
Philippe Saint-Pierre
0bc1be3252 PoseView: Fix crash in FilePanel
Again, a regression fix. Under some circumstance, fFiltering was wrongly
set. Also, the node wasn't open before checking the BRefFilter and some
filters expected that to be.
2012-08-08 14:59:29 -04:00
Philippe Saint-Pierre
5489384d45 Tracker: crash fix in FilePanel
Regression of hrev44493, file panel crashed when changing dir and
filtering being disabled (sorry!)

Also fix the widget editing when filtering is activated. Now renaming
a file/folder and causing it to 'fall off' the filter does work.
2012-08-08 13:07:53 -04:00
Philippe Saint-Pierre
7d460e3bb9 PoseList: fix an assertion failure 2012-08-08 13:07:53 -04:00
Philippe Saint-Pierre
ea8b1e14f9 OpenWithWindow: Fix crash at closing, and fix filtering
Following hrev44493, the way ShouldShowPose was used changed a bit,
to harmonize with type ahead filtering.

This updates OpenWithWindow to use a BRefFilter to do its
filtering rather than overloading ShouldShowPose.
2012-08-08 13:07:53 -04:00
Philippe Saint-Pierre
c2535dc48a Tracker: various issues regarding filtering
1. A BRefFilter-ed PoseView wouldn't keep monitoring files after its opening
thus not picking up files that happen to fit the filter thereafter (mime attr
updated, etc..)
2. A filtered PoseView wouldn't get updated when:
  a) a column was added or removed
  b) a file was renamed
  c) a file was moved
3. Harmonize the way BRefFiltering and Type-ahead filtering are working. Both
can be used together.
4. The handler for AttributeChanged() wasn't working properly if link(s) of a
changed model was/were its siblings.
5. Broken links weren't detected/updated (it nows monitor the lost target
parent directory, and wait for the target creation to show the link fixed)

This is a big change (even more considering the 'critical-ness' of the component)
Testing is MUCH welcome!

Should fix #4254, #5381, #1717 (and maybe others)
2012-08-07 18:31:54 -04:00
Hamish Morrison
59b4be8cc1 Move SoundConsumer to libmedia in the BPrivate namespace
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2012-08-07 23:38:37 +02:00
Alex Smith
a731ad19e6 ELF64 and x86_64 support in the debug kit. 2012-08-07 20:22:36 +01:00
Ryan Leavengood
e77304562d Actually sort the translator menu used in ShowImage.
There were two problems with the last commit:

* the list needed to be outside of the top-level loop.
* BList was just broken for sorting translation_format pointers.

I fixed this by moving the loop outside and converting the translation_formats
to translator_info, which has the translator_id, since that is needed to create
the menu item, and would otherwise be unavailable outside the loop.

I tried to get this working with BList, but the sorting was completely broken,
and converting to BObjectList made the code much, much better and worked great.
Screw BList and casting, hurray templated BObjectList.

Really fixes #6782.
2012-08-07 00:41:41 -04:00
Alex Smith
c802257bbb Merge branch 'master' into x86_64 2012-08-06 12:34:03 +01:00
Ryan Leavengood
adfe152ee2 Sort the translation formats in AddTranslationItems by name.
This is used by ShowImage and CodyCam to create a list of image formats which a
file can be saved as. Tracker sorts the image MIME types used in the Find
window by name, so this makes these Save As menus match that (minus the icons
which I think are superfluous.)

Fixes #6782.

If the use of BList is no longer recommended, I welcome better suggestions
for sorting which will work in both GCC2 and GCC4. But this works ;)
2012-08-06 02:08:37 -04:00
Ryan Leavengood
57c5b09e1a Use be_control_look != NULL everywhere in the Interface Kit.
Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.
2012-08-05 18:07:23 -04:00
Humdinger
aed3510485 Close alerts with ESCAPE key.
Added SetFlags(B_CLOSE_ON_ESCAPE) or SetShortcut(index, B_ESCAPE) to BAlerts
depending if the result gets used later in the code, or if it's a one-button
BAlert.
2012-08-05 19:32:46 +02:00
Alex Smith
adf8818ec0 Compilation fixes for Terminal, add to image.
It runs, but has shown up various bugs: app_server crashes, kernel
panics, rendering problems. Working on fixing these now.
2012-08-05 10:24:22 +01:00
Alex Smith
3fed1a15f5 Get app_server working on x86_64.
With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.
2012-08-05 08:46:30 +01:00
Alex Smith
049d149cf7 Handle 64-bit types correctly. 2012-08-04 18:58:26 +01:00
Alex Smith
54393c0379 Merge branch 'master' into x86_64 2012-08-04 09:59:17 +01:00
Ryan Leavengood
bab4f5ad7d Use the parent menu's font when truncating labels.
Fixes the other bug uncovered by #8829, but my other fix was valid too.
2012-08-04 00:24:56 -04:00
Ryan Leavengood
4ffc27fcc1 Fix incorrectly truncated menu labels.
An off-by-one error (> instead of >= really) was causing truncation when it
wasn't needed. But for some reason this only showed up when the main font size
was increased. I may or may not look into that, but this fixes the issue.

Maybe one of the faster bug logged to bug fixed times in Haiku history? ;)
2012-08-03 23:56:00 -04:00
John Scipione
593808d96a Return authors name's to DeskCalc headers.
No functional change.

* Surround email addresses in angle brackets.
* Add myself to ExpressionParser.cpp and .h
* Remove myself from ExpressionTextView.cpp and .h
* Alphatetize authors by last name.

Thanks Ingo and Axel.
2012-08-03 11:16:23 -04:00
Ryan Leavengood
0eed2a7c98 Fix flickering menus, especially menu bars.
Figured out by Stephan originally and only hacked in WebPositive, I knew
something about WebPositive was different because it did not flicker when
everything else did.

Since we fully draw the menus there is no need to have app_server fill in the
background with the view color. That is what was causing the flickering.

Should fix #484, #532 and #4335. Thanks diver for confirming the patch against
those tickets.
2012-08-02 23:25:29 -04:00
John Scipione
57e436840b Revert "Remove the ellipses for About App in the replicant menu."
Apparently ellipses are used for all dialog boxes on Haiku.
Sorry for the noise.

Thanks AnEvilYak

This reverts commit 147ef3a9e8.
2012-08-01 07:54:39 -04:00
John Scipione
147ef3a9e8 Remove the ellipses for About App in the replicant menu.
The ellipsis character (...) after a menu item means that
the command needs more information from the user before
the operation executes.

The ellipsis character doesn’t simply mean that a dialog
box or window will appear.

The window appearing completes the command and doesn’t
require additional input from the user before it executes.
2012-08-01 07:46:44 -04:00
Alex Smith
e6b3188fcb Merge branch 'master' into x86_64 2012-08-01 10:44:38 +01:00
Alex Smith
f7010474bb Changed resource alignment behaviour for ELF64 binaries.
The current behaviour of aligning to the maximum value of p_align seen
is problematic for x86_64, as the default segment alignment is 2MB.
This causes all x86_64 binaries to be padded to at least 2MB when
resources are added to them. There is no need to align to p_align in
the file itself (it's only an in-memory requirement), therefore
instead just align up to an 8-byte boundary. The current behaviour is
retained for ELF32, so this won't cause any compatibility problems
(there are no existing ELF64 BeOS/Haiku binaries to worry about).
2012-08-01 10:35:34 +01:00
Alex Smith
d4ec857af3 Merge branch 'master' into x86_64 2012-07-31 12:10:24 +01:00
John Scipione
8ffd0477dd Implement degree mode in DeskCalc.
Default is radian mode,  You set the option in the right click menu
like the other options.

Note: degree mode does not affect hyperbolic trigonometric functions.
This is how Mac Calculator, Windows Calculator, and Google Calculator
work.
2012-07-30 22:35:57 -04:00
Alex Smith
9be774b553 Compilation and 64-bit fixes to libbe.so sources.
Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.
2012-07-30 21:27:21 +01:00
Alex Smith
e27109c167 Merge branch 'master' into x86_64 2012-07-30 08:24:31 +01:00
Alex Smith
6e2f6d1ace Changed cookie type for get_next_area_info() to ssize_t.
The cookie is used to store the base address of the area that was just
visited. On 64-bit systems, int32 is not sufficient. Therefore, changed
to ssize_t which retains compatibility on x86 while expanding to a
sufficient size on x86_64.
2012-07-29 09:31:14 +01:00
Ryan Leavengood
6a03786cc9 Draw menus using the user chosen colors. 2012-07-28 23:02:17 -04:00
Ryan Leavengood
688e878807 Don't check for double click if it was a right mouse click.
Fixes #8714.
2012-07-28 19:58:28 -04:00
John Scipione
e51854a127 Add 96x96 and 128x128 icon sizes to tracker including scaling of BeOS icons using scale3x and scale4x algorithms. 2012-07-28 14:07:43 -04:00
John Scipione
ea001e585a Round 2 of style changes to Tracker
* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes
2012-07-28 14:02:35 -04:00
John Scipione
a51764c53e WIP: Yet more style fixes, mostly 80 char violations. 2012-07-28 14:02:34 -04:00
John Scipione
96a1e39a63 An error while emptying trash is not that dramatic. 2012-07-27 20:46:48 -04:00
John Scipione
caaec0198e A for loop with just an end condition is better as a while loop. 2012-07-27 20:46:48 -04:00
John Scipione
b05aa8b5b1 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
2012-07-27 20:46:47 -04:00
Philippe Saint-Pierre
b866f1fa54 Tracker: Files created from templates are now monitored
fixes #2796.
2012-07-24 14:53:57 -04:00
Philippe Saint-Pierre
4c45f003ed Tracker: Right clicking on Pose triggered Rename prompts
Right clicking on a Pose to get the contextual menu would quite often
trigger a rename action of that pose. Don't allow to rename a pose
by releasing the secondary mouse button.
2012-07-23 22:38:44 -04:00
Philippe Saint-Pierre
fb678bc3d0 Tracker: Sorting in filtered view led to crash
Fixes #6992.
2012-07-23 19:06:08 -04:00
Philippe Saint-Pierre
c082e8f2e2 Tracker: Variation between Saved and Restored widths
When restored, an overlap was wrongly detected in offsets for
failure to take into account the width of the border line.

This was causing the horizontal scrollbar to show unnecessarily.
2012-07-23 17:05:57 -04:00
Philippe Saint-Pierre
50d739dee5 Tracker: Regression fix
A crash of Tracker was triggered when accessing AddOn menu (by
shortcut or context-menu) for Pose on Desktop, because of it's
incapacity to read the mime type list (that wasn't built in
those cases).
2012-07-23 16:15:19 -04:00
Philippe Saint-Pierre
5cdd07a814 Tracker: Optimisation of AddonMenu menu construction
1. Build the list of mimetypes of files in selection only once and
reuse it for all further tests.

2. Fix a regression introduced in hrev44384 where the MimeType()
wouldn't get recognized when just changed by tracker (by that same
right click).  It would be on subsequent clicks.

3. Rename the static map variable to better fit our coding style
and be more understandable.
2012-07-23 14:47:24 -04:00
Philippe Saint-Pierre
516cac7817 Tracker: Coding style violations fixes and typos
No functional changes, thanks Axel!
2012-07-23 08:21:43 -04:00
Philippe Saint-Pierre
674ff0df2f Tracker: Various sorting issues in Tracker
When sorting files by Modified dates, right clicking on a file was leading
to a sorting issue where files were changing positions (without reason).

1. Any changes to stats (size, modification, creation, mode) was triggering
the sorting. Now only stats fields currently used as a Sort criteria will
trigger such event.

2. The Mimeset of file was set (in case of unknown file format) once per checked
add-on when building AddOn Menu. Now it's checked once per file in selection.
(so, once per file, rather then once per file, per add-on).

3. Now rely on registrar to force the mimeset (to trigger the sniffer in case
the attribute already exist) rather than trying to duplicate the feature in Tracker.

4. When Sorting, if there is a old position known, check if it's working by looking
if you should come after the previous item, and before the following item.  Previously,
the item would be pushed at the top if the group of item all fitting the criteria
(same file size, same file kind, etc.. depending on the sorting criteria).

Fixes #8478.
2012-07-22 22:16:19 -04:00
Philippe Saint-Pierre
1236c746af Tracker: a file leaving Trash won't appear in QueryPoseView
Fixing #1592.

A feedback FSNotification()->EntryMoved->PendingNodeMonitorCache->FSNotification
was seemingly introducing some race condition, as it was working 1 time
on several tries.
2012-07-21 22:09:45 -04:00
Philippe Saint-Pierre
2d5785ba12 CID 611239: Fix resource leak 2012-07-20 21:50:13 -04:00
Rene Gollent
902a98ad83 Fix #8753.
- Store whether or not the use of the horizontal scrollbar is desired
  on the class itself. If the CLV was set to use the horizontal scrollbar,
  and then asked to lay itself out while hidden, it would incorrectly assume
  the horizontal scrollbar wasn't in use, and consequently repositioned its
  views such that the horizontal scrollbar and outline view overlapped.
2012-07-20 19:35:21 -04:00
Ingo Weinhold
af350aa218 Add private shared class ArgumentVector
The parser is based on the FS shell's ArgVector.
2012-07-20 23:32:58 +02:00
Rene Gollent
03aa456e2e Fix mouse down handling error.
- When handling a mouse click, the button was hardcoded instead of
  passing the actual button clicked by the user. Spotted by Chris
  Roberts.
2012-07-18 23:21:06 -04:00
Rene Gollent
ed15f1b8fb Fix scrollbar handling when removing rows in BCLV.
- If removing a row results in there no longer being any rows whatsoever
  visible, force a scroll back into the visible range. Fixes #8287.
2012-07-18 23:02:30 -04:00
Alex Wilson
2d4288086f Make SpaceLayoutItem compose spacing using BControlLook.
This allows for passing spacing/inset flags to BSpaceLayoutItem.
Eg. in a builder, you could AddStrut(B_USE_ITEM_SPACING)
2012-07-16 14:59:32 +12:00
John Scipione
4bb5af765f Add control mark color setting. #8054
An enhancement adding a setting to Colors under Appearance to
set the mark color of radio button and check box controls.
2012-07-15 15:09:04 -04:00
Rene Gollent
975867a4ff Fix drawing bug in BStringField.
- If a string column was exactly the correct pixel width for the strings
  contained within it, they would skip attempting to truncate the string.
  However, the truncated string was always used for final drawing, with
  the end result that the fields would be drawn blank. This would sometimes
  manifest itself in Debugger where things like ID columns wound wind up
  showing no data until one resized the column.
2012-07-13 19:38:41 -04:00
Hamish Morrison
639ac47052 BTextView should not accept disallowed chars being pasted.
* Patch from #6885: This filters out any disallowed characters from text
  being pasted or dropped in. If the resulting filtered text is zero
  characters long, it beeps. Works with styled text too.
* Coding style: variables renaming by korli.
2012-07-12 23:56:36 +02:00
Rene Gollent
36c85ca8df Fix add-on image unloading for shelf replicants (ticket #8708).
- The version of instantiate_object() that returns the image id from which
  the object was reinstantiated was not correctly returning it in all
  circumstances, only if it had to find/load the add-on itself. This caused
  problems for BShelf since the latter relies on that image id in order to
  determine what image to unload when replicants are removed. To remedy this,
  introduce an additional version of find_instantiation_func() that returns
  the image id in which the instantiation function was found, and make use
  of it in instantiate_object() in order to also be able to return the image
  id in that case.
2012-07-10 18:41:49 -04:00
Humdinger
851c719d02 Small text changes in alert when renaming/moving special folders.
Since the button was renamed from "Do it!" to the specific action,
an additional explanation in case of special user folders isn't
needed any more.
Split text into paragraphs for better readability.
2012-07-04 08:42:38 +02:00
Philippe Saint-Pierre
8d87f2b43a StringForRate()
Introduce a function to generate the string representation of a bitrate
(kbps, mbps, gbps, etc..)

* Factor out the code from MediaPlayer InfoWindow
* Allow different bases (/1000 or /1024)
2012-06-25 13:29:22 -04:00
Ryan Leavengood
9f5864ab09 Handle the scroll wheel changing over scrollbars.
* Extract the scrollbar change based on the mouse wheel delta into a protected
  method of BView.
* Call that method from BScrollBar's MessageReceived.

With this change it is now a bit easier to scroll horizontally around the
system by putting the mouse cursor over a horizontal scrollbar and using the
wheel.

Fixes #8631.
2012-06-24 10:50:42 -04:00
Axel Dörfler
bea2387b68 Made constants static, coding style cleanup. 2012-06-05 23:15:54 +02:00
Reznikov Sergei
72b7db341b Added resize to fit shortcuts. Partially fixes #7467.
* Adjusted initial tracker windows width to fit modified column.
* Resolved a TODO: Added get info shortcut to Open with window.

 Author:    Sergei Reznikov <diver@gelios.net>

Signed-off-by: Alexandre Deckner <alexandre.deckner@uzzl.com>
2012-05-28 16:29:43 +02:00
czeidler
875b218202 Calling the BView version of {Enable,Disable}LayoutInvalidation() seems to be more natural. 2012-05-10 10:36:42 +12:00
czeidler
31f768577e The layout checks the target view now if the layout invalidation has been disabled in the view. 2012-05-10 10:36:41 +12:00
czeidler
58f3387d56 Workaround to not trigger a relayout in DoLayout when adding the label view again. 2012-05-09 14:34:44 +12:00
Philippe Saint-Pierre
78614977b0 Tracker: Removing the Desktop Background Image don't clear a pointer
fBackgroundImage wasn't being cleared when removing the desktop
background image because the loading process wasn't ignoring
loading failures (as is the "no background for this workspace" setting).

fBackgroundImage not being NULL was causing crashes mainly in
ScreenChanged(), where it was trying to re-center a non-existant
background.  Was causing #7376 and maybe others.
2012-05-06 20:00:15 -04:00
Philippe Saint-Pierre
4dad975dda Tracker: Consider extra column margin in PoseView::Extent()
In List Mode, consider the extra margin added to the right of
the last column when computing the Extent of the PoseView. This
was causing the ResizeToFit to resize a bit too small.

Fixes #4318
2012-05-06 18:43:59 -04:00
John Scipione
c645f9bcbe Rework tooltip method in BView again.
Passing NULL or a blank string to SetToolTip(const char*) sets the
tooltip to NULL by calling SetToolTip(BToolTip*) with a NULL argument.

Calling SetToolTip(BToolTip*) with a NULL argument calls HideToolTip()
because sometimes the tool tip can change without the mouse moving,
for example because the user clicked.

Thanks Axeld and Stippi.
2012-05-04 19:55:24 -04:00
John Scipione
5ccf455f7e Fix another tooltip related bug that appears in Deskbar.
The bug is that in horizontal mode the tooltip will remain set to
the last moused over team menu item even if the mouse is no longer
over a menu item. The bug can be seen in the following screenshot:

http://26.media.tumblr.com/tumblr_m3gze8s1xi1r0f0hfo1_400.png

To fix this bug, allow you to set the tooltip text to blank or NULL
in SetToolTip(const char* text). In ShowToolTip() check to see if
the tooltip text is blank or NULL and if so, don't show the tip.
Setting the tooltip to blank or NULL effectively unsets the tooltip
on a view.
2012-05-03 20:49:18 -04:00
John Scipione
4daa7647c9 After setting the tooltip text, invalidate the layout.
This fixes a bug introduced in hrev44075 (I think) where the internal
tooltip window wouldn't resize itself after setting new tooltip text.
So if you set the tooltip to a short string then set it to a long
string the tooltip would get cut-off or if you set it to a long string
and then set it to a short string the tooltip window would be too wide.
The result can be seen in Deskbar in the following screenshot:

http://30.media.tumblr.com/tumblr_m3fg327NsV1r0f0hfo1_400.png

After invalidating the layout the internal tooltip window gets resized
correctly.
2012-05-03 01:13:16 -04:00
John Scipione
7f7f5eac6e Refactor ToolTipManager a bit.
* Change ShowTip() point parameter name to where.
* Add a parameterless ResetWindowFrame() overload that get's the current
  where and calls ResetWindowFrame(BPoint where) which does the actual
  work. FrameResized() calls this parameterless ResetWindowFrame()
  method instead of doing the work in that method. This is functionaly
  the same but allows me to call the parameterless ResetWindowFrame()
  elsewhere.
2012-05-02 23:51:49 -04:00
Alex Wilson
4ca2a44779 Make ownership-taking idempotent during unarchiving.
The previous scheme made it hard to deal with reference-counted objects,
which may be owned by many objects.
2012-05-03 08:45:29 +12:00
czeidler
a937ffd238 Make the menu window not resizable.
Right clicking the menu border showed the resize arrow and sometimes even made it possible to resize the menu.
2012-05-01 11:03:27 +12:00
Axel Dörfler
8e2140fa5e Fixed a large client side memory leak for app_server memory.
* The areas allocated for BBitmaps were never deleted, even though the
  app_server deleted its part when the memory got freed.
* This resulted in a constant memory increase if the application in question
  would operate on many changing large bitmaps, like photos.
* Since the bitmaps are reference counted, we don't actually know when to delete
  the areas, so that the app_server now notifies the client whenever that is
  possible.
* This might fix #6824.
2012-04-29 20:26:14 +02:00
czeidler
6eb2e6b47f Use the timeout in poll. 2012-04-29 16:53:40 +12:00
Axel Dörfler
2f2f3fa042 Moved stable tool tip concept into the BToolManager class.
* This removes the fVisibleToolTip member from BView, and fixes bug #5669;
  BToolTipManager::ShowTip() now gets the owner of the tool tip as an extra
  parameter.
* Removed the work-around to hide that bug.
* Improved ToolTipTest application to include more test cases like a view that
  periodically update its tool tip via SetToolTip(const char*), and one that
  sets a new tool tip every second.
* Furthermore, added a test that shows that inner views inherit the tool tip
  of their parents.
* Fixed another bug in BToolTipManager::ShowTip() that would release an
  extra reference to the tool tip currently shown.
2012-04-28 22:14:03 +02:00
Axel Dörfler
f790fa299e Added a tool tip for the detailed progress info.
* Got rid of the parentheses around the progress text.
* Automatic whitespace cleanup.
2012-04-28 22:14:02 +02:00
Axel Dörfler
254640bfcd Remove the tool tip if an empty or NULL string is set. 2012-04-28 22:14:01 +02:00
Fredrik Holmqvist
11ff194b97 Use strnlen instead of own impl, as it probably will have platform specific optimisation. 2012-04-27 22:15:48 +02:00
Humdinger
163e02d670 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-04-18 15:16:29 +02:00
John Scipione
41651bb3fd Small code simplication cleanup and add comment. 2012-04-17 23:20:37 -04:00
John Scipione
889692191d Fix Deskcalc drawing rounded corners on the desktop as a replicant, although I am not sure why I'm even bothering at this point. 2012-04-17 20:52:32 -04:00
Reznikov Sergei
ba747b26ac Fix #5586: Add missing shortcuts to FilePanel. 2012-04-17 18:27:52 +02:00
Oliver Tappe
546208a539 More catalog-related cleanup.
* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
  B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.
2012-04-16 21:31:22 +02:00
John Scipione
3244c2bcf2 Whoops, remove constraints after drawing slider bar. 2012-04-16 03:23:01 -04:00
John Scipione
a884b43bb1 Added support for buttons and menuframes with rounded corners.
* Not turned on for default buttons and menuframes right now.
* Updated Deskcalc and Keymap to use buttons with rounded corners.
* Overloaded methods with radium parameters are not virtual right
  now so as to not break vtables. Added /*virtual*/ before each
  method that should be made virtual in ControlLook.h
* Added a light line to the left border of the down arrow frame
  on menu frames as a small visual tweak.
* Replace StrokeRect() with StrokeRoundRect() when drawing the
  default button indicator. This gives them a rounded
  appearance if the button is also rounded.
* Added protected methods _DrawMenuFieldBackgroundOutside and
  _DrawMenuFieldBackgroundInside.
* Created some protected methods to get the edge, frame, and bevel
  colors from a passed in base color because it was a mess and I
  needed to calculate the colors from mutiple methods. It is much
  cleaner now.
* Added myself to ControlLook.cpp authors list. Assigned copyright
  to Haiku, Inc. Stippi also retains his copyright.
* Tons of style fixes.
  - Change all instances of `if (flags & B_FLAG)` to
    `if ((flags & B_FLAG) != 0)`
  - Reorder some methods.
  - Reorder includes.
  - Spacing.
  - Updated comments.
2012-04-16 02:10:03 -04:00
Oliver Tappe
248f2283dd Final part of cleanup in Catalog.h.
* move versions of the B_TRANSLATE_...-macros used during collecting
  of catalog keys to a specific header file, which will only be picked
  up when running collectcatkeys
* fix a couple of build problems during the preprocessing of the libbe-
  sources when extracting catalog keys, all due to private headers not
  being found
* move ZombieReplicantView.h from kits/interface to
  headers/private/interface, as this way it can be picked up when
  building the libbe catalog
2012-04-16 00:04:41 +02:00
Oliver Tappe
541ff51a6e Cleanup BCatalogAddOn.
* rename BCatalogAddOn to BCatalogData, since it doesn't represent an
  add-on, but rather the catalog data provided by an add-on
* move BCatalogData out of Catalog.{h,cpp} into its own header and
  implementation file
* drop BCatalogData::MarkForTranslation() methods, they're not needed
* drop BCatalog::GetNoAutoCollectString() methods, they're not being
  used anywhere
* cleanup the B_TRANSLATE_... macros somewhat
* add versions of the B_TRANSLATE_MARK_... macros that are meant to be
  used in void context (when the string isn't being used by the program,
  just meant to be picked up by collectcatkeys).
* adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed
* adjust users of BCatalogAddOn accordingly
2012-04-16 00:04:41 +02:00
Oliver Tappe
5ac65b7f11 More cleanup in locale kit, this time regarding namespaces.
* it's bad practice to do a 'using <namespace>' in a header, as that
  is very likely to have unintended effects, so drop those from a couple
  of private Locale headers
* adjust files all over the locale kit in order to fix the problems
  (by explicitly importing the required classes in the implementation
  files)
2012-04-16 00:04:40 +02:00
Oliver Tappe
16e5092306 Extract EditableCatalog from Catalog.{h,cpp}.
* move EditableCatalog to its own header and implementation file
* move problematic BCatalog::CatalogAddOn() to EditableCatalog
* adjust Locale tools accordingly
2012-04-16 00:04:40 +02:00
John Scipione
a2bea84d34 Override the LayoutAlignment method in BStringView.
Left align StringViews using layout API by default falling back
to the alignment settings set by SetAlignment() only if
SetExplicitAlignment() is not used.

This way StringViews are left-aligned by default, can be changed
using the Layout API, and the pre-Layout API legacy method is used
as a fallback.

See this thread for details:
http://www.freelists.org/post/haiku-development/Can-we-make-BStringViews-MaxSize-BSizeB-SIZE-UNLIMITED-B-SIZE-UNSET-by-default
2012-04-15 16:06:29 -04:00
John Scipione
3cf2d117e5 Change Time Format Options in Deskbar preferences.
Added two new methods to the Locale Kit in order to create a custom time
formats from a format string. One method is outputs into a char* array,
the other into a BString() and you can set the timezone.

These methods should be cleaned up, we only need 2, one to get
the time in a predefined style, the other to get a custom time format.
Also should probably do the same for dates and datetimes. But I'll let
this go for now.

I added myself to the Locale.cpp file. I retained the copyright instead
of assigning it to Haiku, Inc. because the file is under the OpenBeOS
license and I don't know what the concequences of copyright sharing are
for that license, unlike MIT.

These new methods are used to generate custom time formats in Deskbar.
Instead of using a set of Radio Buttons to choose between the predefined
time options I build my own by creating a format string and passing it
to the Locale Kit. The format string is generated from 3 checkboxes,
show seconds, show day of week, and show time zone. You can mix and match
between them choose any that you like. By default they are all off.

There are 3 new deskbar settings associated with these new options:
showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away.

The time format string gets cached and updated only when Update() gets called
on the TimeView class.

In order to fit all the options in (there is 1 more than before) I had to
reduce the font size of the clock to 11pt when all options are turned on in
12 hour mode. For those with no imagination it looks like this:

http://imagebin.org/208162

Renamed "Open time preferences..." menuitem to "Time preferences...".
Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time".

Other changes include refactoring the header files a bit. There were a lot
of headers included by header files uneccessarily. For instance BarWindow.h
now only includes <Window.h> and <Deskbar.h>. This change is mainly to
to speed up the compile time since it takes a while right now.

I copy the fBarView pointer from BarWindow in the BarApp constructor and then
use that throughout the file rather than getting the pointer from the window
each time by calling BarView(). BarView() is still available in the header
for other classes though.

I moved some message constants around since it was getting a bit jumbled.
Most of the messages related to settings are in PreferenceWindow.h.
fChangeState is moved to BarView.h since that is where the ChangeState()
function is and BarView.cpp uses that constant.

The time interval and format constants are in TimeView.h.

Make some methods public in their respective classes where it made sense.
The preference window methods to update dependent items are public, that
might get called from BarWindow when a message gets received at some point.

Also made ShowHideTime() and Time() public in StatusView.h. These methods
activate showing and hiding the clock and return the fTime clock object.
No reason they should be private.

I reindented the StatusView.h and PreferenceWindow.h headers to the standard
style. Question here, are the public: protected: and private: lines inside
of classes suppose to get indented 1 tab or not? I've seen both, the style
guide says no indent but 1 indent seems reasonable and looks pretty good.

Style fixes here and there. That's enough for one commit I think.
2012-04-15 00:17:54 -04:00
Oliver Tappe
eaa5e0936d Fix #8452 (app's crashing for non-existent system catalog)
* make the system catalog a BCatalog instead of a BCatalogAddOn*,
  such that using a non-existing system catalog won't crash but
  simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
  and adjust it to use BCatalog::SetTo() in order to replace the
  data used by the given catalog
* adjust all users of gSystemCatalog accordingly
2012-04-14 17:58:58 +02:00
Oliver Tappe
cc52f0df3a Make BCatalog threadsafe.
* use a locker to protect the CatalogAddOn-chain against parallel
  access
* rename BCatalog::SetCatalog() to SetTo() and make it a proper
  initializing function
* adjust implementation of BLocaleRoster accordingly
2012-04-14 17:38:58 +02:00
Oliver Tappe
250eca3254 Start cleanup of Catalog.{h,cpp}
* unify pointer style (to type* )
* always use boolean expressions in if
* introduce some spacing for better readability
* make a couple inline methods non-inline
2012-04-14 17:24:20 +02:00
Oliver Tappe
ec48d27ca3 Revert "Fix access to system catalog strings."
This reverts commit 6d2186615f.
2012-04-14 16:52:59 +02:00
John Scipione
40b6c14db7 If full time format, don't abbreviate the time zone. 2012-04-10 01:05:54 -04:00
Rene Gollent
3da13b8038 Fix typeahead cancellation in file panels.
- Add accessor to PoseView that reports whether the view is currently
  typeahead filtering.
- Use said accessor in the file panel's filter in order to detect whether
  to tell the latter to cancel filtering vs closing the panel.

Fixes #8140.
2012-04-07 20:20:39 -04:00
Oliver Tappe
635df64352 Add BLocaleRoster::GetAvailableTimeZonesWithRegionInfo()
* allow locale kit clients to get all timezones with their corresponding
  country/region ID piecemeal
2012-04-07 20:51:43 +02:00
Oliver Tappe
6d2186615f Fix access to system catalog strings.
* fix regression introduced in hrev43950:
  HashMapCatalog::GetString() didn't return the non-translated
  string in case there was no translation found, which e.g.
  caused AboutWindows to trigger a debugger message about the
  alert not having any buttons.
Thanks to diver for the hint.
2012-04-06 13:54:50 +02:00
John Scipione
3cee15aac2 Keymap changes from recent activity. No AltGr yet.
Below is a mostly complete summary of the changes in this commit.

* Set the DeadKeys for the US-International Keymap to use the Option map.
* Rename American keymap to US
* Update the US, US-International, and United-Kingdom keymaps to take
  out unneeded spaces in the option layer. Also updated the dead keys
  and some other keys on the US-International keyboard to use UTF-8
  characters rather than there ASCII equivalents when different.
* Make the Option key fall-through when there is no mapping in the Option
  table. Option is for special characters, if none, print the regular one.
  This is mostly meant for the US keymap which has an empty option map. But
  also so that you don't have to repeat the normal, shift, and caps maps in
  the option map needlessly. Although the keymaps are still not empty in
  some cases that it could be like numpad keys and space.
* Update the /bin/keymap app to use fputs() instead of printf() when there
  is no actual formatting taking place. I've gotten into trouble for doing
  this before and it is faster to not process the string unnecessarily.
* Also several 80-char limit style fixes and updated comments.
* In Keymap class Reorder the modifier keys to match the keymap files.
  Put B_CONTROL_KEY check above B_OPTION_KEY. Neither change has any effect,
  they are purely aesthetic.
* Update DumpKeymap() method to use the abbreviated modifier letters so it
  will fit in your 80-char wide terminal.
* Tiny style fix in InputServer
* 80-char limit style fix in BWindow and add a comment that the shortcut
  gets eaten in the case of Cmd+Q
* Implement IndexForModifier() in KeyboardLayout, although I am not using it.
* Take Caps Lock out of the Modifier keys window because I couldn't get
  it to work the way I wanted it to.
* Move key roles to the left column, and the key label on the left. Add column
  header labels. Thanks Rimas!
* Add validation and improve marking menu options. Add a 'Disabled' option
  to control, option, and command menus to disable the key. Make the key
  role text grey if the key roles is disabled. Validation ensures that you
  cannot repeat the same key twice in the Modifier keys window since that
  won't work. You can't define 2 sets of option keys even if you really want
  to. You can disable your control, option, and command keys if you
  want, but that is not recommended.
* Rename kUpdateModifiers to kUpdateModifierKeys message to differetiate
  it from kUpdateModifier.
* Add shift key to Modifier keys window, use the stop icon instead of the
  warning icon to indicate conflicts.
* Allow the Layout system to control the size of the Modifier keys window
  again, set the width's of the key role lables to the widest, set the width
  of the menu fields to take up the rest of the space minus room for the
  conflict views. I didn't like it that the Modifier keys window would change
  size based on what options you had selected in the menu fields. Now it
  doesn't, but, the layout system still makes it all fit.
2012-04-06 02:42:54 -04:00
Oliver Tappe
84c93bfba0 Attempt at #1586 (queries not being case-insensitive for umlauts):
* adjust corresponding query predicate to use BUnicodeChar instead
  of ctype-functions

Alas, this does not help as of now, since BUnicodeChar is missing
support for any codepoints above 0x9f ...
2012-04-04 22:54:08 +02:00
Oliver Tappe
60f75e901c Merge liblocale.so into libbe.so.
* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
  other places, too) in order to access system catalog strings. 
  This is now done via gSystemCatalog, which is provided and initialized
  by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
  that rely on it in a working state.

TODO: the documentation hasn't been updated.
2012-04-04 22:44:42 +02:00
JackBurton
577265d14f Avoid calling BMenu::HitTestItems() if the cursor is over a submenu. 2012-03-31 13:30:21 +02:00
luckypower
5dca884fa5 Fix #8257: Locale not showing 24h/12h mode.
* apply patch from 'luckypower', that fixes the problem
  in BFormattingConventions - thanks!

Signed-off-by: Oliver Tappe <zooey@hirschkaefer.de>
2012-03-28 22:39:49 +02:00
JackBurton
aae7ed37e0 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-03-21 15:18:58 +01:00
John Scipione
12c10314f9 Remove MimeType docs from MimeType.cpp and cleanup style issues in that file. Create a MimeType.dox file and add the docs there. 2012-03-18 00:09:53 -04:00
JackBurton
131811f6b4 Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-03-16 21:06:38 +01:00
John Scipione
84bfb380c3 Update the behavior of uninitialized and NULL BMimeType objects.
* Two uninitialized BMimeType objects are considered to be equal,
  this is a purposeful break from BeOS R5.

* An uninitialized BMimeType object is considered to be equal to a
  BMimeType object initialized to NULL. This is a purposeful break from
  BeOS R5.

* Update the doxygen documentation comments to reflect this change which
  will hopefully make there way into the Haiku Book at some point.

* In BMimeType::SetTo() replace an instance of strcpy() with strlcpy()
  CID #something probably.

* Store the result of a few more strlen() function in size_t instead of
  int to prevent overflow bugs.

* Make sure BMimeType::GetSupertype() returns either B_OK or B_BAD_VALUE.

* Undo my previous "optimization" in IsValid() to declare ch outside the
  for loop.
2012-03-15 14:44:00 -04:00
John Scipione
4b4e216449 Fix another overflow bug in BMimeType
* The static toLower() method had the same overflow bug that isValid()
  had. However, since it is a private static method, rather than fix the
  method I replaced with a call to strcasecmp() in the operator== overload.
  When this method was written strcasecmp() must not have been available.

* Declare ch outside of the the loop in IsValid() so that it only gets
  initialized once.
2012-03-14 20:10:14 -04:00
John Scipione
395167071d * Fix a bug where a string longer than INT_MAX can cause IsValid() to falsely
report a valid mimetype because strlen() returns a result than when stored
  in an int is treated as a negative number.

* Style fixes in the same method
2012-03-14 18:56:54 -04:00
JackBurton
54687869ef Merge branch 'master' of ssh://git.haiku-os.org/haiku 2012-03-11 10:16:35 +01:00
Jérôme Duval
38d688ccbe BHandler: hopefully fixes a regression introduced in hrev43777.
* BHandler scripting handles bad scripting syntax by returning the Messenger property.
* Thanks to Siarzhuk Zharski for pointing this out.
2012-03-03 20:09:30 +01:00
Rene Gollent
8f5079af02 When changing the tab height, also update the layout insets if needed.
Fixes #8374.
2012-03-03 08:32:05 -05:00
JackBurton
9289418325 Fix Indentation 2012-03-03 10:24:06 +01:00
JackBurton
417c123cc4 Fix indentation 2012-03-03 10:06:42 +01:00
Rene Gollent
4183675895 Move black/white color constant definitions to header.
Previously, there were two instances of the actual variables, named in
ControlLook.cpp and Utilities.cpp. This caused clashes on gcc4 builds, leading
to various crashes during initialization. Instead we now declare them as
static constants in the header itself as is done for various other interface
color constants elsewhere. Fixes ticket #8358.
2012-03-02 20:39:12 -05:00
Oliver Tappe
d9dc0dda43 Fix #8350: clockconfig has to use the current offset from GMT.
* instead of re-applying the fixed offset that had been set when the
  Time preflet was used last, use the stored timezone name in
  clockconfig in order to determine the current GMT-offset for that
  timezone
* clockconfig now requires liblocale.so
* drop the offset field from the settings as it is no longer used,
  clockconfig was the only client
* automatic whitespace cleanup
2012-02-26 19:07:29 +01:00
Axel Dörfler
d452ff664c Added some reserved fields to BControlLook.
* This makes future changes less troublesome, although we should also add
  some virtual slots there (probably just dozens of it, though, that's why
  I was being lazy).
* Don't pass messages by value; they are copied twice this way.
* Minor coding style corrections, automatic whitespace cleanup.
2012-02-26 14:58:52 +01:00
Jerome Duval
8adaa6c544 interface kit: added compatibility symbols for GCC4
* InvalidateLayout method for BBox, BButton, BCheckBox, BMenuField,
  BScrollView, BSlider, BStringView, BTextControl.
2012-02-26 10:36:04 +01:00
Jerome Duval
44c991efdb interface kit: added compatibility symbol for BeAE
* added  _ZN9BTextView16InvalidateLayoutEb for GCC4
2012-02-26 00:55:22 +01:00
Jerome Duval
7327891c90 interface kit: added compatibility symbols for BeAE for #8354
* _ZN5BMenu16InvalidateLayoutEb for GCC4
* InvalidateLayout__7BSliderb for GCC2
2012-02-25 18:31:07 +01:00
Jerome Duval
5c6b9eb00d Some fixes for GCC 4.6 warning: variable set but not used 2012-02-23 20:32:13 +01:00
Jerome Duval
4bbb27e3cc More 'GCC4.6 variable set but not used' fixes. 2012-02-23 20:32:12 +01:00
Philippe Saint-Pierre
d63b75faf8 Outline of labels/strings drawn to desktop
* Rather than duplicating the decision taking logic involving wheter or not to draw
the outline or glow in every replicant, update be_control_look to make it more
generic.
* The Monitoring of the background preferences is now only done in Tracker (where it
was already being done).
* Add a BControlLook::B_IGNORE_OUTLINE flag to avoid this new behaviour.
* Remove that said logic from ActivityMonitor and use be_control_look.
* Use the ignore flag in DeskCalc to avoid the outline in its case.

Should fix #7716, #7291.
2012-02-22 19:06:22 -05:00
Axel Dörfler
f1553a0fc4 Made it pass the tests, simplified number comparison.
* Space after a number was not correctly handled (must be ignored).
* Better conceal the fact that I'm not always the brightest - the number
  comparison was pretty questionable :-)
2012-02-22 23:43:22 +01:00
Axel Dörfler
f88aa5f760 Made NaturalCompare() accept NULL strings. 2012-02-22 23:32:09 +01:00
Jérôme Duval
9d46237ba1 TabView.cpp: Use B_IF_GCC_2 to simplify things 2012-02-19 15:47:49 +01:00
Ingo Weinhold
7e2730f048 View.cpp: Use B_IF_GCC_2 to simplify things 2012-02-19 15:16:07 +01:00
Jérôme Duval
48d21c1299 added BView::_ReservedView12() symbol for GCC4
* added _ZN5BView15_ReservedView12Ev
* helps with #8336
2012-02-19 14:36:53 +01:00
Fredrik Holmqvist
3e2017d24e Some cleanup in interface kit. From unused code warnings (before I updated buildtools). 2012-02-11 18:43:19 +01:00
Fredrik Holmqvist
37ea4f77f7 Removing unused code. 2012-02-11 18:39:57 +01:00
Alexander von Gluck IV
2c3ab1bed6 kits: Fix a few missed spelling issues 2012-02-08 18:06:03 -06:00
Alexander von Gluck IV
2066acfbc5 game kit: Style and whitespace cleanup. No functional change. 2012-02-08 17:38:59 -06:00
Alexander von Gluck IV
1b6bc2675f kits: Some spelling cleanup of common mistyped words
* Little whitespace cleanup
* No functional change
2012-02-08 16:50:18 -06:00
Fredrik Modéen
e817f41e8b Fixing debug in Media Kit.
* Only fixing debug i the media kit.
* Help with ASSERT(flavorID == testFlavorID) would be nice, don't know what ASSERT do.
2012-01-29 00:06:13 +01:00
Fredrik Modéen
d456de037d Fixing an "error" in how BMediaDecoder was built.
* If reading BeBook the class should be B_NO_INIT until we have called SetTo
* When I at it, any suggestion on how a test tool for BMediaEncoder should look like?
2012-01-27 22:47:12 +01:00
Alexander von Gluck IV
47452375a7 opengl: Clear up a few header issues, no functional change
* Philippe voiced that he was the original author in the ML,
  adding Philippe to the headers to ensure credit is given.
* Adding Precision Insight copyright back *just incase*
  It's unclear if Precision Insight code was used given
  Philippe's comments in the ML, lets be safe and add it back.
  As we have Brian's permission for these changes I feel
  comfortable with it.
2012-01-26 13:19:34 -06:00
Alexander von Gluck IV
a80293e0cf opengl: Pointer, newline cleanup, no functional change
* Clean up pointer positions
* Clean up function line returns
2012-01-26 09:47:08 -06:00
Alexander von Gluck IV
a42877a6e4 opengl: Header / whitespace cleanup
* I received the ok via email from Brain Paul at mesa to
  relicense the GLDispatcher sources to MIT + him as the
  author.
* Update include ordering
* Remove HAIKU_TARGET_PLATFORM_HAIKU ifdefs for boot options
2012-01-26 09:27:31 -06:00
Alexander von Gluck IV
19affa2725 mail kit: Use errno vs return codes, gives better results. 2012-01-22 09:31:36 -06:00
Alexander von Gluck IV
fd391ef3c2 mail kit: Improve debugging of internal mail kit network code
* Return the correct error code if there is a connection error
* Be more verbose if there is a problem
  network connection problem instead of showing "Login error: "
* IMAP inbound: Show a valid error message if there is a
* Show server name resolution, fishes out IPv6 bug #8293
2012-01-22 00:12:53 -06:00
czeidler
958ac01d5f Reconnect window and recreate all views. 2012-01-22 15:30:16 +13:00