summaryrefslogtreecommitdiff
path: root/Userland/Applications/Help
AgeCommit message (Collapse)Author
2022-01-11Help+Base: Add help://man URLs for links between man pageskleines Filmröllchen
The URLs of the form `help://man/<section>/<page>` link to another help page inside the help application. All previous relative page links are replaced by this new form. This doesn't change any behavior but it looks much nicer :^) Note that man doesn't handle these new links, but the previous relative links didn't work either.
2022-01-11Help: Refactor link handlingkleines Filmröllchen
Link handling is now split up between open_page and open_url. While open_page can handle any sort of input and is responsible for handling history UI, open_url deals in URLs and takes one of a few different actions depending on the exact URL given. Currently, only file:// URLs are handled but this will change in the next few commits. Note that this commit breaks relative URLs on purpose. After the new help:// URLs, they won't be needed anyways. The reasoning is that many URLs not specifically pointing to man page directories will cause a (non-deadly) unveil violation in `real_path_for`. This specifically concerns the new application launch URLs that are added in the next commit.
2022-01-09Help: Scroll to the top of page when opening a new linksholm
Previously the scroll position would not reset when loading a new page. This caused various problems such as opening the page at the previous pages scroll position and in some instances not even showing the new page at all.
2021-12-30Userland: Link directly against LibUnicodeData where neededTimothy Flynn
This is partially a revert of commits: 10a8b6d4116c6a627a6c189154af032f69b29c21 561b67a1add82538502ef2f5733f1d86718898ad Rather than adding the prot_exec pledge requried to use dlopen(), we can link directly against LibUnicodeData in applications that we know need that library. This might make the dlopen() dance a bit unnecessary. The same purpose might now be fulfilled with weak symbols. That can be revisted next, but for now, this at least removes the potential security risk of apps like the Browser having prot_exec privileges.
2021-12-28Help: Fix crash when trying to load libunicodedata.soRummskartoffel
2021-12-27Help: Fix memory leak given ambiguous man page title on command lineRummskartoffel
Given a command line with an ambiguous man page title, such as `$ Help uname`, Help would find and try to open all matching pages, leading to bad behavior such as a memory leak, flickering scrollbars, and eventually a crash due to OOM. This commit fixes the issue by making Help only open one page on startup.
2021-12-20Help: Include page names in the searchSam Atkins
This fixes the problem before, where searching "Shell" would list "Shell-vars" in the results, but searching "Shell-vars" would make it disappear. Also removed some now-unnecessary includes.
2021-12-20Help: Add support for launching with a section and page, like manSam Atkins
I found it strange that `man` and `Help` did not accept the same command line arguments since they are so similar. So... now they do. :^) This means you can now open for example the `tar` man page in Help with `Help tar`, or `Help 1 tar` if you want to disambiguate between pages in different sections. If the result is not found, it falls back to the previous behavior, treating the input as a search query. Initially I had this written as two optional positional arguments, but when told to parse `[optional int] [optional string]`, and then given a string input, ArgsParser forwards it to the [optional int], which then fails to parse. Ideally it would pass it to the second, [optional string] arg instead, but that looks like a fairly big change to make to ArgsParser's internals, and risk breaking things. Maybe this ugly hack will be an incentive to fix it. :^)
2021-12-20Help: Move `update_actions()` code into `open_page()`Sam Atkins
These two lambdas are always called together, in this order, so why not make them one instead? Also converted a couple of west-consts to east-const.
2021-12-20Help: Always show the welcome page on launch if nothing else is thereSam Atkins
Previously, launching Help with a query like `Help tar` left the page blank, which looks like something has gone wrong. Instead, let's show the usual welcome page.
2021-12-05Applications: Cast unused smart-pointer TRY return values to voidSam Atkins
2021-11-28Everywhere: Use default execpromises argument for Core::System::pledgeBrian Gianforcaro
2021-11-24LibGUI: Make FilteringProxyModel factory function return ErrorOrAndreas Kling
2021-11-24Help: TRY() all the things in serenity_main() :^)Andreas Kling
This patch makes use of all the new fallible APIs in LibGUI together with TRY() to catch and propagate errors. The main error getting caught is allocation failures while trying to construct the Help UI. It's quite interesting to see how the code changes as more and more fallible calls get branded as such by wrapping them in TRY(). There's a lot of repetitive "TRY(try_foo())" going on right now. Once this becomes the dominant programming pattern, we can drop the "try_" prefix everywhere. :^)
2021-11-24Help: Port to LibMain :^)Andreas Kling
2021-11-23LibCore+AK: Move MappedFile from AK to LibCoreAndreas Kling
MappedFile is strictly a userspace thing, so it doesn't belong in AK (which is supposed to be user/kernel agnostic.)
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-08AK: Use ErrorOr<T> for MappedFile factoriesAndreas Kling
Replace Result<T, E> with ErrorOr<T> and propagate the error to callers.
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()Andreas Kling
This was used in a lot of places, so this patch makes liberal use of ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-10-22man.serenityos.org: Add section descriptions to overview pageBen Wiederhake
2021-09-02Userland: Migrate to argument-less deferred_invokesin-ack
Only one place used this argument and it was to hold on to a strong ref for the object. Since we already do that now, there's no need to keep this argument around since this can be easily captured. This commit contains no changes.
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
2021-08-06Everywhere: Replace Model::update() with Model::invalidate()sin-ack
Most of the models were just calling did_update anyway, which is pointless since it can be unified to the base Model class. Instead, code calling update() will now call invalidate(), which functions identically and is more obvious in what it does. Additionally, a default implementation is provided, which removes the need to add empty implementations of update() for each model subclass. Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
2021-07-21Userland: Add GUI::Window::add_menu() and use it everywhereAndreas Kling
Applications previously had to create a GUI::Menubar object, add menus to it, and then call GUI::Window::set_menubar(). This patch introduces GUI::Window::add_menu() which creates the menubar automatically and adds items to it. Application code becomes slightly simpler as a result. :^)
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-07-20Help: Add check for pushing current page to historyroepfeli
2021-07-15Help: Add context menuKarol Kosek
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-16Help: When opening a page, make sure it is selected in the tree viewTimon Kruiper
This has to be called with a `deferred_invoke`, since on startup the tree view contains no data yet.
2021-06-16Help: Make sure the home page is actually shown when opening the appTimon Kruiper
Previously `open_page` was called multiple times when opening the application, once for the actual page, but also in `tree_view.on_selection_change`. At startup there is no valid selection yet, which caused an empty page to be loaded. Prevent this by early returning if the `path` is null.
2021-05-26Help: Tweak splitter spacing in main UI layoutAndreas Kling
This doesn't look perfect, but it's slightly better than unmodified.
2021-05-26LibGUI/AbstractView: Remove `on_selection`Jelle Raaijmakers
Since the introduction of multi-select, we have had both `on_selection` and `on_selection_change`, the latter of which was only invoked when a change in selection came in through the model. This removes `AbstractView::on_selection` and replaces it usage with the more explicit `on_selection_change` everywhere.
2021-05-13Userland: Tighten a *lot* of pledges! :^)Andreas Kling
Since applications using Core::EventLoop no longer need to create a socket in /tmp/rpc/, and also don't need to listen for incoming connections on this socket, we can remove a whole bunch of pledges!
2021-05-12Everywhere: Add Alt shortcuts to remaining top-level menusLinus Groh
Not sure why some menus did have one and others didn't, even in the same application - now they all do. :^) I added character shortcuts to some menu actions as well.
2021-05-07Help: Add "Help" menu and move the about action thereLinus Groh
2021-05-07Chess+Help: Remove erroneous ampersand from app nameLinus Groh
This is not applicable here, the alt shortcut is set elsewhere.
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling
2021-04-23Help: Run clang-format on main.cppLinus Groh
2021-04-23Help: Add a statusbar and use it for hovered links + action status tipsAndreas Kling
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
2021-03-25Userland: Turn all application menus into window menus :^)Andreas Kling
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-16LibGUI: Make Model::data_matches() take Variant by const-referenceAndreas Kling
2021-01-17Everywhere: Remove a bunch of now-unnecessary shared_buffer pledgesAndreas Kling
2021-01-16Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"Andreas Kling
Now that WindowServer broadcasts the system theme using an anonymous file, we need clients to pledge "recvfd" so they can receive it. Some programs keep the "shared_buffer" pledge since it's still used for a handful of things.
2021-01-15Everywhere: Pledge "sendfd" in WindowServer client programsAndreas Kling
This is needed for the new way we transfer window backing stores.
2021-01-12Applications: Move to Userland/Applications/Andreas Kling