Commit graph

35 commits

Author SHA1 Message Date
Kyle Lanmon c07d18c017 NetworkSettings: Use on_change when switching adapter 2024-04-08 09:35:55 -06:00
Timothy Flynn c23060e21b Userland: Avoid some now-unneeded explicit conversions to Bytes 2024-04-04 11:23:21 +02:00
kleines Filmröllchen adc845e0cb Userland: Port to automatic GML initializer where possible 2024-01-29 05:21:48 -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
tetektoza 8118ea764f NetworkSettings: Port NetworkSettings to GML compilation 2023-12-08 01:06:09 +01:00
Ali Mohammad Pur aeee98b3a1 AK+Everywhere: Remove the null state of DeprecatedString
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>

Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
2023-10-13 18:33:21 +03:30
Tim Ledbetter a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +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
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
Karol Kosek 754a5bda7a NetworkSettings: Convert NetworkSettingsWidget to a failable factory 2023-06-10 07:19:06 +02:00
thankyouverycool 02d94a303c Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.

Rewords a few actions and dialogs to use uniform language and
punctuation.
2023-05-23 05:59:49 +02:00
Fabian Dellwing b01fcccbbd Userland+Base: Don't run NetworkSettings in elevated mode 2023-05-13 17:59:37 -06:00
Fabian Dellwing 24b1bdca27 NetworkSettings: Use helper script to write config
This change allows us to not run the app with elevated privileges.

It uses the Escalator to call a helper and passes the settings as
JsonObject to it.
2023-05-13 17:59:37 -06: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
thankyouverycool 4c9933bfb7 LibGUI: Remove Label icons and replace instances with ImageWidget
These icons are a relic of GLabel and were never implemented to
accomodate both image and text. This convenience can always be added
in the future, but no current instance assumes or needs it, so let's
replace them all with ImageWidget to show clearer intent.
2023-04-30 05:48:14 +02:00
Karol Kosek 446c600d09 LibGUI+Applications: Port SettingsWindow::add_tab() to the new string 2023-03-16 09:58:42 +01:00
Tim Schumacher 606a3982f3 LibCore: Move Stream-based file into the Core namespace 2023-02-13 00:50:07 +00: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
Sam Atkins ecbe317413 NetworkSettings: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-27 08:07:24 -05:00
Sam Atkins 1dd6b7f5b7 AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-17 19:52:52 -05: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
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
Tim Schumacher ed4c2f2f8e LibCore: Rename Stream::read_all to read_until_eof
This generally seems like a better name, especially if we somehow also
need a better name for "read the entire buffer, but not the entire file"
somewhere down the line.
2022-12-12 14:16:42 +01:00
Linus Groh 57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01: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
Maciej 38fb3257c8 NetworkSettings: Add command line option for opening a specific adapter 2022-11-02 12:00:26 +00: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
Liav A 5dfb2b18f3 Applications: Use new global variables at /sys/kernel/ directory 2022-10-25 15:33:34 -06:00
ne0ndrag0n 323c403d43 NetworkSettings+SpiceAgent: Update and add required unveil paths 2022-10-15 05:59:39 +00:00
Ali Mohammad Pur 166a905951 Userland: Properly populate GENERATED_SOURCES
We previously put the generated headers in SOURCES, which did not mark
them as GENERATED (and did not produce a proper dependency).
This commit moves all generated headers into GENERATED_SOURCES, and
removes useless header SOURCES.
2022-10-12 15:55:15 +01:00
Maciej 4c23264efd NetworkSettings: Remove warning about reboot 2022-07-14 23:26:47 +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
Maciej 7dd3c5c981 Applications: Add a new NetworkSettings application 2022-07-09 09:22:25 +01:00