Commit Graph

16 Commits

Author SHA1 Message Date
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
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Tim Schumacher
ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
demostanis
34acae90c7 Userland: Let applications make use of make_command_palette_action() 2022-10-25 10:21:18 +01:00
ne0ndrag0n
2affe67c75 Settings: Support for launching settings apps as root 2022-10-14 11:23:06 +02:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
MacDue
7c8541b914 Userland: Use GUI::Process::spawn_or_show_error() for spawn() from a GUI 2022-05-25 23:14:22 +01:00
MacDue
3fc0350caf LibCore: Return ErrorOr<pid_t> and support arguments in Process::spawn
This makes the wrapper more like the rest in LibCore, and also
removes the annoying limitation of not supporting arguments.

There are three overloads one for String, char const *, and StringView
argument lists. As long as there are <= 10 arguments the argv list
will be allocated inline, otherwise on the heap.
2022-05-25 23:14:22 +01:00
Brian Gianforcaro
cf4fa936be Everywhere: Use default execpromises argument for Core::System::pledge 2021-11-28 08:04:57 +01:00
Brian Gianforcaro
eb896aa33e Settings: Convert to TRY + serenity_main(..) 2021-11-28 08:04:57 +01:00
Brian Gianforcaro
72e9d024b9 Settings: Fix launch of settings dialog
There was a bug report on discord where someone mentioned that
launching the keyboard settings always crashed. When looking
at the backtrace it became clear we were calling down the
`AppFile::executable()` path on uninitialized memory.

We can fix this by using the "official" API for obtaining data
from the GUI ModelIndex, instead of casting random memory to
the object type we expect it to be. :^)

Validated this fixes the issue for me locally.
2021-11-27 11:24:31 +01:00
Sam Atkins
377a984905 Settings: Make sure settings are listed in alphabetical order
DirectoryIterator, and so `Desktop::AppFile::for_each()`, doesn't
guarantee anything about the order, so we manually sort afterwards.
Which means using a manual version of NonnullRefPtrVector, since that
doesn't support `quick_sort()`.
2021-11-26 22:14:56 +01:00
sin-ack
ca2c81251a Everywhere: Replace Model::update() with Model::invalidate()
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-08-06 19:14:31 +02:00
Andreas Kling
779316d468 Userland: Use Core::Process::spawn() instead of posix_spawn() in places
This replaces a bunch of very basic uses of posix_spawn() with the new
Core::Process::spawn().
2021-08-06 01:06:42 +02:00
Andreas Kling
b6c97a259c Settings: Tweak initial window size 2021-07-26 01:58:07 +02:00
Andreas Kling
87a22a77e9 Settings: Add a very simple Settings application
This is really just a launcher app that gathers all the installed apps
in the "Settings" category and presents them in a single window.
2021-07-26 00:39:10 +02:00