Commit graph

3484 commits

Author SHA1 Message Date
Andreas Kling
99ac34eeae Ladybird+LibWebView+Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling
4eb43cc107 Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Jelle Raaijmakers
14091f32c6 Browser: Synchronize database statements used for cookies
Since SQLServer is inherently asynchronous, database statements can run
in parallel. Our `CookieJar` did not require synchronous actions on the
database for its cookies, resulting in cookies not being set
immediately. This resulted in a bug that could be exposed by setting
`document.cookie` and immediately querying its value, revealing that the
cookie was not yet persisted.

Solve this by requiring all database statements to be executed
synchronously. Ideally SQLServer has a mechanism to determine interquery
dependencies and blocks until dependent queries are fully executed, but
until we have that, this works around that limitation.
2023-08-08 06:25:11 -04:00
Andreas Kling
18c54d8d40 LibJS: Make Cell::initialize() return void
Stop worrying about tiny OOMs.

Work towards #20405
2023-08-08 07:39:11 +02:00
Lucas CHOLLET
3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Lucas CHOLLET
a5edc9cdfc Userland: Prefer _short_string over String::from_utf8_short_string
This user-defined literal is a strictly equivalent but shorter alias to
`String::from_utf8_short_string`.
2023-08-08 07:37:21 +02:00
Monroe Clinton
1b5b1e4153 Calendar: Implement saving, loading, and displaying of calendars
The user can now save, load, and view calendars. A calendar is made up
of an array of events which are saved in a JSON file. In the future we
should implement the iCalendar standard instead of using a custom
format.
2023-08-07 13:14:58 -06:00
Andreas Kling
34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
Andreas Kling
ddbe6bd7b4 Userland: Rename Core::Object to Core::EventReceiver
This is a more precise description of what this class actually does.
2023-08-06 20:39:51 +02:00
Zaggy1024
ba236e3f21 PixelPaint: Don't const_cast to update the editor on filter application 2023-08-06 11:56:21 +02:00
Hediadyoin1
50bf303edd LibJS: Capture UnrealizedSourceRanges in ExecutionContext, not ASTNodes
This loosens the connection to the AST interpreter and will allow us to
generate SourceRanges for the Bytecode interpreter in the future as well

Moves UnrealizedSourceRanges from TracebackFrame to the JS namespace for
this
2023-08-05 06:39:06 +02:00
0GreenClover0
259228d8d2 Spreadsheet: Set Help window mode to Modeless in the constructor
And don't try to do it every time the Help button is clicked.
This fixes a crash when clicking the Help button twice (setting window
mode on an already visible window is not supported).

This also fixes a situation where when opening the Help window with an
action, we didn't set its mode to "Modeless".
2023-08-05 02:14:51 +03:30
Karol Kosek
49df2e1e3a Ladybird+Browser: Update zoom text on menu after clicking zoom button 2023-08-04 15:16:48 +02:00
Fabian Neundorf
413e212ea8 Piano: Cache buffers in Track and WaveWidget
The Track itself caches the Samples after each processing step which
allows it to be queried without the need to process it every time.

This result is queried by the WaveWidget which then caches the result to
prevent unnecessary heap allocations every paint event.
2023-08-04 12:56:27 +02:00
Fabian Neundorf
885e35e92c Piano: Use Sample struct from LibDSP
Removes the Sample struct inside Piano and replaces it with the struct
from LibDSP.

It automatically scales the height of the wave depending on the maximum
amplitude, as the Samples now contain floats and not integers.
2023-08-04 12:56:27 +02:00
Torstennator
5e6f5a524a PixelPaint: New submenu for masking actions
This patch moves the mask related menu actions into a submenu in order
to keep the menu more clear.
2023-08-04 12:11:13 +02:00
Torstennator
8c681a1603 PixelPaint: Add color-masking for editing masks
This patch adds the ability to refine a editing mask by a color-range
based on the pixels of the content image. This is useful for image
editing where mask restirction via luminosity might not fit or just
certain color ranges should be edited.
2023-08-04 12:11:13 +02:00
Torstennator
df4904f61d PixelPaint: Use editing masks in filter gallery
With this change the image modifications of a filter is only applied to
regions of the image where a editing mask is defined. If no editing
mask is defined the filter modifications are applied to the whole
image.
2023-08-04 12:11:13 +02:00
Torstennator
dbbf54df2c PixelPaint: Add luminosity masking for editing masks
This adds a function where editing masks can be refined by selecting
a luminosity range that is applied to the content image and mapped to
the editing mask. This function allows the editing of image regions
that match only certain luminosity values.
2023-08-04 12:11:13 +02:00
Torstennator
660d6f171c PixelPaint: Add function to visualize editing-masks
This patch adds a function to make the editing-eask visible while
beeing in mask-mode so that the user can see which parts are covered
by the masks and can therefore be modified by other tools that support
editing masks.
2023-08-04 12:11:13 +02:00
Karol Kosek
86ad896f35 Mail: Fetch mailbox contents with BODY.PEEK[] type instead of BODY[]
We don't want to mark the entire mailbox as read when checking emails,
don't we? :^)
2023-08-02 11:21:03 +01:00
Karol Kosek
eb41f0144b AK: Decode data URLs to separate class (and parse like every other URL)
Parsing 'data:' URLs took it's own route. It never set standard URL
fields like path, query or fragment (except for scheme) and instead
gave us separate methods called `data_payload()`, `data_mime_type()`,
and `data_payload_is_base64()`.

Because parsing 'data:' didn't use standard fields, running the
following JS code:

    new URL('#a', 'data:text/plain,hello').toString()

not only cleared the path as URLParser doesn't check for data from
data_payload() function (making the result be 'data:#a'), but it also
crashes the program because we forbid having an empty MIME type when we
serialize to string.

With this change, 'data:' URLs will be parsed like every other URLs.
To decode the 'data:' URL contents, one needs to call process_data_url()
on a URL, which will return a struct containing MIME type with already
decoded data! :^)
2023-08-01 14:19:05 +02:00
Shannon Booth
8751be09f9 AK: Serialize URL hosts with 'concept-host-serializer'
In order to follow spec text to achieve this, we need to change the
underlying representation of a host in AK::URL to deserialized format.
Before this, we were parsing the host and then immediately serializing
it again.

Making that change resulted in a whole bunch of fallout.

After this change, callers can access the serialized data through
this concept-host-serializer. The functional end result of this
change is that IPv6 hosts are now correctly serialized to be
surrounded with '[' and ']'.
2023-07-31 05:18:51 +02:00
Sam Atkins
7c8772ad86 FileManager: Add file properties tab for PDF documents 2023-07-30 22:16:40 +01:00
Sam Atkins
a333d9959c FileManager: Add file properties tab for ZIP archives 2023-07-30 22:16:40 +01:00
Edwin Rijkee
dfbc2839b4 DisplaySettings: Handle case where there is no DPI value
DisplaySettings uses the optional `screen_dpi` value before checking
if it is set, causing an assertion failure. This change moves the
usage into the block where it is known to be set.

One situation where this is known to occur is on real hardware when
using the MULTIBOOT_VIDEO_MODE multiboot flag to enable graphical
display output.
2023-07-27 12:53:25 -04:00
Edwin Rijkee
fedd087546 NetworkSettings: Don't assert when there are no network adapters
NetworkSettings normally filters out `loop` when populating its list of
adapters. However, when checking if there aren't any adapters it did
not take this into account. This causes it to crash later when trying
to set the selected index of an empty combo box.

This moves the check for no adapters to after filtering the list, so
that shows the error message and exits.
2023-07-27 12:10:56 -04:00
Andreas Kling
a3e97ea153 Browser+LibWebView: Run with the JavaScript bytecode VM by default
The AST interpreter is still available behind a new `--ast` flag.
2023-07-25 20:00:46 +02:00
Valtteri Koskivuori
8ed3cc5f7b Spreadsheet: Update cell colors interactively while picking
Spreadsheet cells now show a real-time preview of the currently selected
color while the user is picking in `GUI::ColorPicker`
2023-07-24 11:30:54 +03:30
Valtteri Koskivuori
0388bb019f PixelPaint: Update palette colors in real-time while picking
Palette color selections in `PaletteWidget` now update while interacting
with `GUI::ColorPicker`
2023-07-24 11:30:54 +03:30
Valtteri Koskivuori
5866a3a731 Magnifier: Update grid color in real-time
The grid color now updates while interacting with `GUI::ColorPicker`
2023-07-24 11:30:54 +03:30
Timothy Flynn
e62cb539fd Revert "FileManager: Remove duplicate log statement"
This reverts commit e0b7717a6a.
2023-07-22 12:19:53 -04:00
Michal Grich
2e9fcc17a0 SystemMonitor: Fix calculation of CPU percentage
This commit addresses an issue when 'Zombie' threads are
included in CPU % calculation. This caused negative
time_scheduled_diff, resulting in a data type overflow.
2023-07-22 08:54:23 -04:00
Sam Atkins
8ec691057f FileManager: Add "Font" tab to File Properties window
We now keep the MappedFile around when inspecting a font, so that we can
use that font to display a preview.
2023-07-20 08:02:12 +01:00
Sam Atkins
50b6ed2aa3 FileManager: Add "Image" tab to File Properties window
We don't yet expose most image metadata yet, so most of this is ICC
profile data since we do have a way to access that.
2023-07-20 08:02:12 +01:00
Sam Atkins
91b677c81e FileManager: Add "Audio" tab to File Properties window 2023-07-20 08:02:12 +01:00
Sam Atkins
8e0fa57e5b FileManager: Extract creation of PropertiesWindow General tab 2023-07-20 08:02:12 +01:00
Sam Atkins
a847bd463a FileManager: Remove unused PropertyValuePair struct 2023-07-20 08:02:12 +01:00
Sam Atkins
9cd6b97dd9 FileManager: Don't wrap long paths on Properties window
These have a fixed height, so any wrapping made them entirely illegible.
2023-07-20 08:02:12 +01:00
Sam Atkins
d00f489cdc SoundPlayer: Rename main widget to SoundPlayerWidget
This is the main widget, and is never replaced by something else, so
having "AdvancedView" in there is a bit confusing.
2023-07-19 19:37:27 +01:00
Sam Atkins
fae350be3f SoundPlayer: Use an enum for PlaylistModel columns
Also correct some const-positioning.
2023-07-19 19:37:27 +01:00
Sam Atkins
32e5593ca9 SoundPlayer: Use AK::human_readable_size() for file sizes 2023-07-19 19:37:27 +01:00
Sam Atkins
7d0f70bfa0 Userland: Use AK::human_readable_digital_time() instead of custom code
Use this handy AK function instead of reimplementing the formatting code
several times. The one minor difference is that now, hours are only
shown if the duration is at least an hour long, but that seems like an
improvement to me. :^)
2023-07-19 08:45:43 -04:00
Sam Atkins
f25adbd5ae SoundPlayer: Correct formatting of PlaylistModel duration text
The previous code would format 5400 seconds as "1:90:00", when it should
be "1:30:00".
2023-07-18 21:17:58 +01:00
Sam Atkins
e0b7717a6a FileManager: Remove duplicate log statement
Now that warnln() also outputs to the debug console, this would print
the error twice.
2023-07-16 00:59:13 +02:00
Lucas CHOLLET
c5a6f0fb4d FileManager: Exit the properties window on escape 2023-07-14 06:52:38 +02:00
Lucas CHOLLET
3e6e75bb5e FileManager: Return a StringView from PropertiesWindow::get_description 2023-07-14 06:52:38 +02:00
MacDue
4aa0ef9f98 ImageViewer: Support displaying vector graphics (at arbitrary scales)
With this, you can scale, flip, and rotate vector graphics in the image
viewer like any other image, but with no pixelation :^)

With this change, vector graphics are decoded in-process (since there's
no standard way to encode them over IPC, a new encoding would be needed
for each format, which would be pretty much just be recreating that
format).

Raster images are still decoded out of process, so the surface area for
attack is still kept to a minimum.
2023-07-14 06:51:05 +02:00
implicitfield
9a1018389c LibGUI+Calendar: Move date control logic to the calendar widget 2023-07-13 04:31:40 +03:30
Karol Kosek
d8bdf26917 MailSettings: Make TLS option checked by default
The window by default showed port 993 with TLS unchecked, which was
slightly misleading as port 993 uses implicit TLS connections and
cleartext is on port 143.

This change also makes it consistent with the Mail app, as its fallback
value is also set to true.
2023-07-12 14:20:29 -04:00