Commit Graph

7811 Commits

Author SHA1 Message Date
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
Adrien Destugues
961fdd8cc3 BMessageFormat: parse the pattern at construction
* Instead of parsing the pattern everytime Format() is called, parse it
only once when the object is created.
* Adjust all callers to make use of the feature and reuse the instance
as much as possible. This also allows calling B_TRANSLATE only once
instead of everytime the formatting needs to be done. We use either a
static instance (when the message pattern is constant) or a field (when
it is not known to be constant).
* Since the BMessageFormat instances are now reused, add locking to
avoid race conditions (ICU itself is thread safe, but the format pattern
is recreated when the locale is changed)
2014-10-08 15:12:48 +02:00
Adrien Destugues
824cb460ac DateTimeFormat: handle custom 24 hours clock.
The "j" format pattern selects a 12 or 24 hours clock automatically
depending on the locale, but it doesn't work when the format is forced
in the locale preflet or through the BFormattingConventions API. So we
manually pick either K or H depending on that setting.
2014-10-08 11:36:52 +02:00
Adrien Destugues
892f3b8b9a DateTimeFormat: use the proper format for timezone.
V used to mean the same as z, but was repurposed to someone else. So
actually use z which is what we want.

Fixes #11325.
2014-10-07 22:02:27 +02:00
Adrien Destugues
97d07c8af2 Add API for parsing dates. 2014-10-07 17:40:18 +02:00
Adrien Destugues
090a0d7686 Add an API to get month names. 2014-10-07 16:08:22 +02:00
Adrien Destugues
4a3a474224 Reimplement BDateTimeFormat using ICU support
* Avoid hardcoding the format to "date, time"
* Allows using DateTimePatternGenerator to create custom formats from a
set of fields.
2014-10-07 13:06:40 +02:00
Adrien Destugues
53382a8aa7 Start making use of BMessageFormat. 2014-10-07 10:05:40 +02:00
Adrien Destugues
0da7796e6c Add BMessageFormat class.
This can be used to format complex messages properly. It moves the
complexity of handling plural forms, gender, and anything else needed
into the localizable string, rather than hardcoding it in the code.

This moves the difficulty of handling these things properly to people
doing translations, rather than relying on developers to do it.

Fixes #10755, but our localization must now be updated to make use of
the feature.
2014-10-07 08:51:23 +02:00
Adrien Destugues
37456be704 Make use of the "invalid control" look flag
* Use a red border for BTextControl when the invalid flag is set.
2014-10-06 09:08:17 +02:00
Stephan Aßmus
6f9eb8d1bb HaikuDepot: Validate input before creating account
Provide error or info alert when fields are invalid, suggest
providing an email, but allow to ignore the warning.
2014-10-04 13:31:58 +02:00
Sidhant Sharma [:TigerKid001]
5db8f48cb6 Change Success/Failure colors.
* Part of #10834
* Colors were picked from http://clrs.cc, which was suggested by John Scipione.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2014-10-02 10:58:00 +02:00
Adrien Destugues
df4a02e0fa Fix initialization of BTimeUnitFormat
* The default constructor must configure it for the default locale
* Fix uptime not showing in AboutSystem
* Add a testcase for this
2014-10-02 10:23:31 +02:00
Adrien Destugues
e3857211d3 Move DateTimeFormat and NumberFormat out of BLocale
* ... and adjust all callers
* Remove NumberFormatImpl: we rely on ICU to provide this and it can be
fully wrapped into the C++ file. The class was a stub anyway.
* "Monetary" format is included in NumberFormat for now. There may be a
more generic solution to handle monetary and BTimeUnitFormat (and other
arbitrary units)
2014-10-02 09:19:54 +02:00
Oliver Tappe
d0fe638dbd Look for private key of default geolocation service.
* Let the jamfile set HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY if the
  header that is supposed to contain it is found in src/kits/shared
  (which isn't the case for normal builds).
* In case HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY is set, include the
  corresponding header and activate Mozilla's geolocation service with
  the key defined in that header.
  
This procedure should enable buildbot to create nightly images without
exposing the private service key.
2014-10-02 00:32:48 +02:00
Oliver Tappe
3006031ac2 Move Geolocation to kits/shared and make it private. 2014-10-02 00:32:48 +02:00
Adrien Destugues
03b2550ef1 Move time formatting to BTimeformat.
* Harmonize API for all B*Format to take an output BString by reference
as the first parameter,
* Move the FormatTime methods from BLocale to BTimeFormat
* Adjust all callers for BTimeFormat, BTimeUnitFormat and
BDurationFormat.
2014-10-01 18:13:35 +02:00
Adrien Destugues
0a925409bc Adjust all BDateFormat callers again. 2014-10-01 16:35:34 +02:00
Adrien Destugues
44f11d0982 Make BDateFormat inherit from BFormat again
* Move relevant parts up into BFormat so other format classes can use
those
* Adjust BDurationFormat and BTimeUnitFormat for the changes
* Remove the "default" date format, it is better to keep only a default
locale and let applications create B*Formats from it as needed.
* Creating a B*Format without arguments to the constructor now
configures it for the default locale, which allows for easy use in
standard cases (formatting something with the current language and
format)
* Creating a B*Format is potentially an expansive operation, it is
advised to keep the instance around and reuse it whenever possible.
However it must be "refreshed" when the locale changes, for apps which
supports that, since it keeps a copy of the language and formatting
convention, rather than a pointer to the locale as it did before.
2014-10-01 16:29:12 +02:00
Adrien Destugues
13d147b12b Introduce "invalid" text controls.
* MarkAsInvalid is used to enable or disable the mark
* The B_INVALID BControlLook flag is used
* invalid BTextControls are drawn with a red border.
* You ar encouraged to let the user know more precisely what's wrong, by
showing an helpful error message next to the control or in a tooltip.
2014-10-01 12:12:16 +02:00
Jessica Hamilton
58844015bf BNotification: correct SetIcon documentation 2014-10-01 19:01:15 +13:00
Adrien Destugues
afd5ec11d2 Add setters to BDate and BCalendarView
* BDate setters don't perform any validation, use with caution.
* BCalendarView setters do perform validation checks, and will adjust
the day so it fits the requested month or year.
* Add tests for the BCalendarView setters.
2014-09-30 15:38:24 +02:00
Adrien Destugues
526d483999 Make BDateFormat mutable
* Add setters for the language and formatting conventions
* Add shortcut getter and setter for the date format
* Use those in the locale roster to make the BDateFormat actually use
the system preferred language and format.
* Applications can also use this to extract specific information from
the system format (eg. set date format to "LLLL" to extract month
names), or define specific formats more easily (eg. for parsing and
generating e-mail headers or HTTP cookies).
2014-09-30 11:49:47 +02:00
Adrien Destugues
f188c1defa BDateFormat: improve API
* Use a reference rather than a pointer for the output string, removing
the need for NULL checks (which were missing, anyway)
* Adjust callers to that change
* Add new Format variant taking a BDate argument
2014-09-30 09:47:02 +02:00
Stefano Ceccherini
611ef1414f BSoftSynth: Select the soundfont from the settings file 2014-09-28 18:23:57 +02:00
Adrien Destugues
03598119a7 libcolumnlistview: hybrid arch build, add to image
* This is a very useful control, and 3rd-party apps should be able to
use it.
* But, there are planned improvements (making a better model/view
interface) which prevents making it part of the stable API yet.
2014-09-28 11:51:03 +02:00
Adrien Destugues
1d38b7a86a Geolocation: avoid static init of BUrl
* Fixes #11290.
2014-09-27 19:20:39 +02:00
Adrien Destugues
2a5e33a980 Move date formatting from BLocale to BDateFormat
* There is a little code duplication. This will be moved to BFormat once
the time and datetime formatting is also moved out of BLocale
* The way to create a BDateFormat from a BLocale is still open for
discussion. I'm undecided between making BDateFormat a member of
BLocale, or adding a BDateFormat(const BLocale&) constructor.
* Adjust all users of the API.
2014-09-26 18:31:11 +02:00
Adrien Destugues
be37c44a19 style fix. 2014-09-26 16:16:52 +02:00
Adrien Destugues
2f36873105 UrlRequest: add empty SetTimeout for ease of use.
* Requests that support this can implement it, NetworkRequest does
* Build fix: no need to return status_t.
2014-09-26 15:51:36 +02:00