Commit graph

138 commits

Author SHA1 Message Date
Dan Klishch d8119c4b4a LibLocale: Statically link LibLocaleData into LibLocale 2024-04-21 13:34:04 -06:00
Shannon Booth e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
kleines Filmröllchen adc845e0cb Userland: Port to automatic GML initializer where possible 2024-01-29 05:21:48 -07:00
Hugh Davenport 13c66ebf12 DevTools: Add fullscreen option
All except SQLStudio, as that causes a crash
2024-01-14 15:18:43 -07:00
Ali Mohammad Pur 5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
kleines Filmröllchen 062e0db46c LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
2023-09-27 03:22:56 +02:00
Tim Ledbetter 3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Tim Ledbetter a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Tim Ledbetter 0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Tim Ledbetter ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Sam Atkins aae7905369 Applications: Use native style sheet for WebViews where appropriate 2023-08-25 20:30:20 +01:00
thankyouverycool 57f3b18109 LibGUI+Userland: Remove Toolbar::try_add_{action,separator}()
These calls largely occur during initialization before there's
unsaved state worth preserving
2023-08-15 15:56:34 +02:00
Andreas Kling bd61e75e0b LibGUI: Remove Window::try_add_menu()
And fall back to the infallible add_menu().
2023-08-14 14:57:54 +02:00
Andreas Kling f2faf2767f LibGUI: Remove Menu::try_add_action()
And fall back to the infallible add_action().
2023-08-14 14:57:54 +02:00
Andreas Kling 1525fa3b8f LibGUI: Remove Menu::try_add_separator()
And fall back to the infallible add_separator().
2023-08-14 14:57:54 +02:00
kleines Filmröllchen 8ec9b26bba Help: Use new GML code generator 2023-08-11 21:33:48 +02:00
kleines Filmröllchen 1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +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
Andreas Kling 34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
Karol Kosek 65a927d16e Help: Clear statusbar when leaving link 2023-06-15 13:53:22 +01:00
Karol Kosek 2029750519 LibGUI+Userland: Port StatusBar::text() and set_text functions to String 2023-06-15 13:53:22 +01:00
Hendiadyoin1 a45682dcdc Applications: Stop lying about string types 2023-06-13 01:49:02 +02:00
Tim Ledbetter 8bb6a820e2 Help: Sort search results by score
This makes pages with matching titles appear at the top of the search
results.
2023-05-29 10:47:48 -06:00
Tim Ledbetter 556c4ac358 LibGUI: Allow FilteringProxyModel to optionally sort results by score
When the `FilteringOptions::SortByScore` flag is set, filtered indices
are sorted by match score in descending order, meaning the most
relevant results should appear first.

The default behavior of FilteringProxyModel is unchanged.
2023-05-29 10:47:48 -06:00
Tim Ledbetter a042c4e93d Help: Perform a fuzzy match on the page title when searching
This allows for slight misspellings to still return a result.
2023-05-29 10:47:48 -06:00
James Liu f248f566b8 Help: Fix link to Contents page 2023-05-10 09:13:07 +01:00
Lucas CHOLLET 1a97382305 LibGUI: Make Application's construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.

This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.

From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
2023-05-05 16:41:21 +01:00
Tim Ledbetter 2618639bdb Help: Ensure window title is updated when a subsection is selected 2023-04-25 02:16:48 -06:00
Karol Kosek 969543a847 LibGUI+Userland: Make Window::*add_menu take name using new string 2023-04-19 07:59:54 +02:00
MacDue 35612c6a7f AK+Everywhere: Change URL::path() to serialize_path()
This now defaults to serializing the path with percent decoded segments
(which is what all callers expect), but has an option not to. This fixes
`file://` URLs with spaces in their paths.

The name has been changed to serialize_path() path to make it more clear
that this method will generate a new string each call (except for the
cannot_be_a_base_url() case). A few callers have then been updated to
avoid repeatedly calling this function.
2023-04-15 06:37:04 +02:00
Andreas Kling 26a4e4d23d Help: Don't abort opening help:// URLs when error *didn't* occur
Fixes #14158
2023-03-22 13:07:57 +01:00
Mathis Wiehl f276e70ac9 Help: Don't defer tree view selection updates
It is unsafe to defer this selection update, because ::open_url itself
is called when users make selection updates, creating a race.

This fixes and infinite selection change loop one could easily reproduce
by holding an up or down arrow key in the tree view while clicking on a
tree view item a couple of times.
2023-03-07 09:50:50 +01:00
Linus Groh 09d40bfbb2 Everywhere: Use _{short_,}string to create Strings from literals 2023-02-25 20:51:49 +01:00
Andreas Kling 33e87d1627 Userland: Fix remaining smart pointer const-correctness issues 2023-02-21 00:54:04 +01:00
Tim Schumacher d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Tim Schumacher 82a152b696 LibGfx: Remove try_ prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Liav A e241b47fee Userland: Remove a bunch of unveil calls on /sys/kernel/processes
These are not needed anymore since the introduction of the new
get_root_session_id syscall.
2023-01-13 13:41:30 +01:00
Tim Ledbetter 61074b6b5c Help: Update browse view when opening a new help page
The browse view now always tracks the currently open help page.
2023-01-09 09:55:02 +01:00
Sam Atkins f0395a2042 LibGUI+Userland: Rename try_load_from_gml() -> load_from_gml() :^)
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07 14:39:30 +01:00
Sam Atkins 54b1326165 Userland: Replace all uses of load_from_gml with try_load_from_gml
MOAR FIXMES! ;^)
2023-01-07 14:39:30 +01:00
Sam Atkins 0c24522635 LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
Rip that bandaid off!

This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
  the only one.

The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06 13:36:02 -07:00
kleines Filmröllchen 2d08e53493 Help: Detect clicked page correctly
index_from_path is the only remaining model index handling function that
wasn't aware of subsections. After this change, clicked pages are
resolved to a model index correctly, eliminating the weird
subsection-expansion bugs from before.
2023-01-02 06:15:13 -07:00
kleines Filmröllchen 3cecd612ba Help: Don't expand the whole tree of the selected node's parent
This now expands nodes unnecessarily with nested sections.
2023-01-02 06:15:13 -07:00
kleines Filmröllchen 201c9d7c77 Help+LibManual: Open sibling page for subsections
Clicking on a subsection now displays the sibling page, which is
intended to be the main page for that section.
2023-01-02 06:15:13 -07:00
kleines Filmröllchen 2aa374eba1 Help+LibManual: Move URL handling to LibManual 2023-01-02 06:15:13 -07:00
kleines Filmröllchen aa5e574872 Help+LibManual: Make the children accessor fallible
This is convenient for the section node which might compute children
on the fly.
2023-01-02 06:15:13 -07:00
kleines Filmröllchen 437d3ca0ea Help: Use array size instead of sizeof to determine number of sections
This was a relict when the sections were still a help-internal array.
2023-01-02 06:15:13 -07:00
kleines Filmröllchen 1ec0548158 Help: Only toggle open/close for SectionNodes
The responsible code was actually casting everything to a SectionNode
pointer, violating type safety all over the place and leading to
frequent crashes. I'm surprised this was not exhibited before; I guess
my recent changes made this bug surface.
2023-01-02 06:15:13 -07:00
Maciej 8c082869d0 Help: Move-capture help page path
Previously it was reference-captured, causing crash because of stack
use after return.
2022-12-14 15:06:38 +00:00
kleines Filmröllchen 5a346c4297 Help+LibManual: Without arguments, open index page instead of crashing
This is the old behavior before the recent LibManual refactor. It also
moves the definition of the index page into LibManual for better reuse.
2022-12-12 00:37:29 -07:00