Commit Graph

7840 Commits

Author SHA1 Message Date
John Scipione
a9f45419e6 ColumnListView: Add default case to switch 2014-12-02 19:23:53 -05:00
John Scipione
73b596224c ColumnListView: preserve view high color 2014-12-02 19:23:52 -05:00
John Scipione
86ebf4c755 ColumnListView: check for NULL column 2014-12-02 19:23:52 -05:00
John Scipione
539dc1bc53 A bunch of style fixes
No functional changes intended
2014-12-02 19:23:51 -05:00
Chirayu Desai
dc4f88b8fb libbind: Fix Coverity bug 603368: Missing break in switch
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2014-12-02 22:02:57 +01:00
Chirayu Desai
fec5692329 ColumnListView: Fix two bugs reported by Coverity
* Fix Coverity bug 991147: Copy-paste error
* Fix Coverity bug 991264: Dereference after null check

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2014-12-02 21:28:45 +01:00
Adrien Destugues
4ca1c2476e Default decorator: localize about box. 2014-12-02 15:30:08 +01:00
Adrien Destugues
3d06e082bc BOptionPopUp: move mennu setup to AttachedToWindow
* There is no need to delay this to AllAttached
* Apps may want to override the SetDivider, and doing it as late as
AllAttached can be annoying.

Fixes #10734.
2014-11-27 09:00:23 +01:00
Adrien Destugues
42272d2342 OutlineListView: yet another list/fullList mismatch.
Fixes #5817.
2014-11-26 13:48:52 +01:00
Adrien Destugues
31f5b8b5d2 BView::BeginLineArray: leave object in consistent state
We allow this method to throw bad_alloc exceptions as there is no other
way to report errors. However we left the object in a broken state
(maxCount set, but array not initialized) which would crash when calling
either AddLine or EndLineArray.

Initialize the count to 0 before throwing the exception so now
EndLineArray can be called and operations resumed safely after an
allocation failure.
2014-11-26 12:14:36 +01:00
Adrien Destugues
c278afdec1 BOptionPopUp: build fix. 2014-11-26 09:48:57 +01:00
Adrien Destugues
d47ada16bc BOptionPopUp: don't offset when there is no label.
We add a 8 pixel space between the label and the menu, but we shouldn't
do that when the label is empty. This matches BMenuField behavior.

Fixes part of #10734.
2014-11-26 09:29:48 +01:00
Adrien Destugues
c254f99c36 BApplication: remove AboutRequested implementation
The Be Book says this is a hook method, so the default behavior should
be to do nothing (didn't test BeOS, my install is currently broken).

Showing an alert with just the application thread name is less than
helpful anyway, and this was causing crashes.

Fixes #5554.
2014-11-24 17:36:31 +01:00
Adrien Destugues
03ad73fc87 More uses of BMessageFormat
ZipOMatic, DiskUsage, MediaConverter, MediaPlayer, ShowImage,
WebPositive, Screen preferences, Tracker, string_for_size.

Thanks to KapiX for reporting those!
2014-11-24 15:42:52 +01:00
Adrien Destugues
2824c5d3a4 Fix various typos and inconsistencies in strings
DiskProbe, DriveSetup, Icon-O-Matic, Installer, Login,
PackageInstaller, Screenshot, Translation Inspector, BootManager,
CharacterMap, CodyCam, BPrintJob

DiskUsage: removed useless translation, used only for layouting purposes

Thanks to KapiX for spotting these problems.
2014-11-24 09:42:26 +01:00
Rene Gollent
8b27b73055 BCLV: Adjust arrow key behavior.
- Left/right arrow can now be used to collapse/expand the focus
  row. Holding shift reverts to the previous behavior of scrolling
  the view.
2014-11-23 09:57:18 -05:00
Jérôme Duval
073da30265 ColumnListView: deselect the last selected row
when the shift movement goes back. This behavior feels better to me,
but opinions are welcome. Tested with HaikuDepot package listview.
Noticed that CLV uses Ctrl whereas Tracker uses Alt for single item
selection.
2014-11-17 20:18:00 +01:00
Augustin Cavalier
0a74147e1d BToolbar: Allow the toolbar's orientation to be set by its creator.
I already made this patch in Heidi's clone of BToolbar. Adding it here
allows me to drop Heidi's version altogether.

I also relicensed the header file at the permission of Stephan. The .cpp
file still lists him as author and copyright holder.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-11-10 13:21:13 +13:00
Adrien Destugues
8007a392cf BMessage: add AddFlat taking a const BFlattenable
It seems the const was forgotten in the BeOS version. But there is no
reason not to have it.
2014-11-09 13:51:29 +01:00
Adrien Destugues
fbd8b14ae7 SecureSocket: fix build without SSL. 2014-11-06 15:15:40 +01:00
Adrien Destugues
5ee2151e2c BHttpRequest: propagate SSL errors to listener
This way it's possible to handle them in applications.
2014-11-06 15:02:00 +01:00
Adrien Destugues
c86ad7f93b Add more features in BCertificate class
* Make it possible to extract more useful data from the certificate
* Also get the OpenSSL error message when a certificate can't be
validated. Send it to the verification failure callback so it can be
shown to the user.
2014-11-06 15:01:59 +01:00
Adrien Destugues
3b657701db BCertificate: fix parsing of date and name. 2014-11-06 15:01:58 +01:00
Jessica Hamilton
9f8197a872 BToolbar: move into BPrivate namespace, as it's not public yet 2014-11-06 16:44:02 +13:00
Augustin Cavalier
6d93638b37 ToolBarView: rename to BToolbar and move to libshared.
Also adjust ShowImage for this, it's the only thing that's using ToolBarView
right now.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-11-04 12:45:47 +13:00
Michael Lotz
3fe7b3f72c BString: Add ScanWithFormat convenience method. 2014-11-02 11:38:45 +01:00
Michael Lotz
a0b6efc8c0 BMessage: Check message area is owned by the current team.
When a message is passed by area, the sender is supposed to transfer
area ownership to the target team. If the area is not mapped within
the current team, accessing the area address would be invalid.

Also mark the area as read-only so accidental writes to the area would
become obvious.
2014-11-01 10:26:37 +01:00
Michael Lotz
d3344ffccf BMessage: Check the return of _CopyForWrite().
When a message is passed by area, any modification to the message must
first trigger a copy of the message content. The success of this
operation was not checked however, possibly leading to later reallocs
on non-heap memory.
2014-11-01 10:26:37 +01:00
Adrien Destugues
5d5ec05b1d B*Format: make immutable and remove locking
The language and formatting conventions can now only be set when
creating the objects. This removed the needs for locking them when
formatting to avoid some other thread changing the format while it's
being used.

Adjust tests and DeskBar TimeView to the API changes.
2014-10-27 14:08:42 +01:00
Ingo Weinhold
d228f29f6e BPackageManager: Add SetDebugLevel()
Sets the debug level of the solver.
2014-10-26 00:19:35 +02:00
Ingo Weinhold
74b582a4e5 BSolver: Add SetDebugLevel()
In LibsolvSolver set the debug level of the pool.
2014-10-26 00:19:35 +02:00
Stephan Aßmus
9002c94345 Package Kit: Always allocate local repository
Consequently always register it with the solver in Init(). This solves the
problem that it made a difference at which time Init() is called. Init() is
called at the beginning of Install() and Uninstall(), but HaikuDepot was
calling it before that for other reasons. A second call to Init() will exit
early. If local package files were added to the PackageManager instance,
the local repository was created lazily, but because Init() did not run a
second time, the local repository was not registered with the solver. Now
it already is, since it is no longer created on demand, but always.
2014-10-25 11:12:26 +02:00
Adrien Destugues
72d4735712 Register media add-ons on BMediaFormat::GetFormatFor().
* Fixes #11018.
* In this case the FormatManager format list is accessed without going
throught the AddOnManager, so we must tell the AddOnManager to register
the add-ons (as this is what populates the FormatManager format list).
* Remove now unneeded workaround in mp3_decoder_test.
2014-10-22 15:25:06 +02:00
Adrien Destugues
9bf4e99477 BUrl: IDNA ToUnicode and ToASCII conversions.
* Since DNS are normally restricted to ASCII, the use of UTF-8 in domain
names is implemented using a "punycode" encoding.
* The request to the DNS server must be sent with the ASCII
representation of the domain name, however the Unicode one should be
used for user-visible parts.
* ICU provides an implementation of the conversion, which we use here.
* Conversion is currently done in-place and modifies the BUrl object
(this is similar to UrlEncode/UrlDecode).
* Adjust existing IDN test to make use of these methods. It's passing
now.
2014-10-21 14:43:13 +02:00
Adrien Destugues
06f436b3ac Use strict mode when url-decoding file requests.
We don't want '+' to become a space here.
Fixes #11109.
2014-10-21 11:31:48 +02:00
Adrien Destugues
bb2a5b4db5 DateTimeFormat: set the locale to the pattern generator.
Unfortunately this isn't enough to fix the bug shown by the test just
added.
2014-10-20 17:24:50 +02:00
Adrien Destugues
89397bab16 MessageFormat: use language and ignore formatting conventions.
The formatting conventions shouldn't change the rules used for singular/plural.
2014-10-19 11:49:56 +02:00
Adrien Destugues
0eb5978482 BMenu: don't invalidate layout when changing marked item
* The layout does not need to change. The label may change in
SetLabelFromMarked mode, but this only affects the layout of the parent
menu.
* This would crash when programatically changing the menu marked item
while the menu is open.
2014-10-18 22:28:08 +02:00
Adrien Destugues
4f978fe4db BNetBuffer: add some error checks.
The allocation of fImpl can fail, and some methods used it without
checking. Return an error code (or NULL or 0) instead of crashing in
these cases.

Also InitCheck the fInputBuffer in BHttpRequest before trying to use it.

Fixes #11350.
2014-10-18 10:15:06 +02:00
Adrien Destugues
1c0b6a4293 SecureSocket: disable SSL versions 2 and 3
There are known vulnerabilities in those. Everyone should be using TLS
by now.
2014-10-15 16:17:09 +02:00
Adrien Destugues
64bda0cc91 Add missing error check in BMessageFormat
* Avoids a crash when an invalid format pattern is used
* Add tests exercising this with various badly formatted patterns.
2014-10-13 09:07:53 +02:00
Adrien Destugues
c8b83b1708 Make disabling BOptionPopUp actually work
* Patch by ttcoder
* Fixes #10735
2014-10-12 16:54:27 +02:00
Adrien Destugues
b7aac5d21e Fix BDragger drawing when parent doesn't draw.
BDragger use some tricks to draw as a partially transparent view, it
calls the parent Draw method, then draws a partially transparent bitmap
over the resulting drawing.

This only works if the parent does somthing in the dragger area. In case
it doesn't, first fill the dragger with the parent view color, so there
is at least "something" in those pixels.

Fixes #5906.
2014-10-12 16:42:22 +02:00
Adrien Destugues
1bf53ffcfc Remove leftover printf and fix build. 2014-10-12 16:21:22 +02:00
Adrien Destugues
bdb4ae32fd Fix unarchiving of BScrollView with layout
* We archive views using "managed" archives, and the children are not
attached in the BView(BMessage*) constructor, but later. So it's not
possible to find the target and scrollbars in the constructor of
BScrollView.
* Make BScrollView override AllUnarchived and find the target and
scrollbars again there. The code is slightly different as there is no
guarantee that the first child will be the target in that case. The
existing code in the constructor is preserved for non-managed archives.
2014-10-12 16:02:34 +02:00
Adrien Destugues
4cada3807c BDragger: add layout-aware constructor.
Somehow no one needed this yet.
2014-10-11 11:18:56 +02:00
Michael Lotz
bb9112df02 Cleanup: Remove doubled semicolon and a trailing whitespace. 2014-10-10 20:38:04 +02:00
Michael Lotz
d98a3e026c package kit: Fix corruption of last package chunk on update.
PackageFileHeapWriter::_UnwriteLastPartialChunk() used ReadData() to
extract the last partial chunk into the pending buffer. This indirectly
calls PackageFileHeapWriter::ReadAndDecompressChunk(), which assumes
data past the last full chunk to come from the pending data buffer.

Since the pending data buffer is not filled in at that point, the call
to ReadAndDecompressChunk() simply did nothing, leaving the object with
a correctly sized but completely nulled pending data buffer. The last
partial chunk of a package would therefore always get corrupted when
updating a package.

Fixes #11306 that provided a reduced test case that happened to corrupt
the only chunk of a package, nulling the .PackageInfo and therefore
making the error more obvious as subsequent parsing of the info failed.
2014-10-09 23:41:39 +02:00
Adrien Destugues
26b0a53d12 Add parsing support to BTimeFormat. 2014-10-09 13:35:23 +02:00
Adrien Destugues
e0f81db657 re-add the _BMCItem_ class for binary compatibility.
This was removed in hrev17147, because our implementation of BMenuItem
does not uses it anymore. However, we must keep it in order to properly
unarchive BMenuFields that were archived in BeOS.

One application that was crashing because of this is VNCViewer.
2014-10-08 17:45:20 +02:00