Commit graph

266 commits

Author SHA1 Message Date
Tim Ledbetter 0b1adf784f SystemMonitor: Add an action to manually refresh process statistics 2024-06-23 21:20:37 +01:00
Tim Ledbetter 4091d7fc05 SystemMonitor: Add an action to pause updates 2024-06-23 21:20:37 +01:00
Isaac 653f41336b SystemMonitor: Add dropped packets count to adapter table 2024-05-09 12:02:26 +02:00
Hugh Davenport 7fa0cf194f Applications: Add fullscreen option to Utilities 2024-01-14 15:18:43 -07:00
Tim Ledbetter b242fe20cc SystemMonitor: Make the icon column in the Processes tab non-selectable 2024-01-14 15:01:47 -07:00
Tim Ledbetter 7772637d03 SystemMonitor: Condense process statistics displayed in processes tab
Previously, some non-default process statistics were displayed in a
long human readable format in the processes tab, which could negatively
affect readability. A shorter format is now used in the processes tab,
while the process properties window retains the longer format.
2024-01-12 09:07:51 +01:00
Tim Ledbetter 800cb4eceb SystemMonitor: Don't include the Idle Task in process statistics
The Idle Task is no longer displayed in the Processes tab and is not
included in the process count in the status bar.
2024-01-10 23:28:10 +01:00
Tim Ledbetter 1c1fc67f75 SystemMonitor: Prefer range-based for loop when updating ProcessModel 2024-01-10 23:28:10 +01: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
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 b4e134cb52 Userland: Use non-fallible EventReceiver::add() where possible 2023-09-25 10:58:31 +02:00
Bastiaan van der Plaat 5d37e1c220 Userland: Remember window state of productivity / editor applications 2023-09-24 20:00:00 -06: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
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
Andreas Kling 8322b31b97 LibGUI: Remove Widget::try_set_layout<T>()
And fall back to the infallible set_layout<T>().

Work towards #20557.
2023-08-14 14:57:54 +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
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
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
Timothy Flynn c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
kleines Filmröllchen 10931dceb8 SystemMonitor: Only read process command line once
Process command line reading took up 50% (!) of all of SystemMonitor's
work. However, a process's command line per definition never changes, so
we can read it once and carry it over. Also, if we couldn't read a
process's command line once, it is close to impossible that we'll ever
be able to read it in the future. Therefore, skip reading such command
lines again as well.

This commit also converts the command line itself to use String, while
we're at it.
2023-07-06 11:07:45 +01:00
kleines Filmröllchen 7d53767ce8 SystemMonitor: Don't reopen process statistics file on every update
This file can just remain open; we seek to its start anyways.
This previously accounted for over 5% of SystemMonitor runtime.
2023-07-06 11:07:45 +01:00
Karol Kosek 5234a30731 LibGUI+Userland: Port Action status tips to String 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
Sam Atkins f33824d2e9 LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
Tim Ledbetter 2b89020b6c SystemMonitor: Make byte counts in ProcessStateWidget human-readable 2023-06-11 09:26:54 +01:00
Tim Ledbetter 8d721dc0f7 Kernel+LibCore+SystemMonitor: Make thread statistics values 64-bit
Thread statistics values which count bytes are now 64-bit. This avoids
overflow when these values go above 4GiB.
2023-06-11 09:26:54 +01:00
Karol Kosek f12dc8b7f5 SystemMonitor: Ignore unveil error about unexisting HackStudio binary
The minimal build configuration doesn't include HackStudio and
SystemMonitor refused to run after trying to unveil a not exiting file.

This change will just ignore this specific error for this specific file
as if nothing really happened.

The ability to quickly debug a process in HackStudio is not the main
feature of the application and HackStudio itself is rather heavy to be
put in the minimal configuration.

Additionally, I find it unnecessary to disable/hide the 'Debug in
HackStudio' action because build configurations are mostly for testing
purposes anyway. You will get a 'No such file or directory' error in the
console after activating the action though. :^)
2023-06-07 00:35:50 +02:00
Jelle Raaijmakers f391ccfe53 LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive
Previously, calling `.right()` on a `Gfx::Rect` would return the last
column's coordinate still inside the rectangle, or `left + width - 1`.
This is called 'endpoint inclusive' and does not make a lot of sense for
`Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would
return 4 as its right side. This same problem exists for `.bottom()`.

This changes `Gfx::Rect` to be endpoint exclusive, which gives us the
nice property that `width = right - left` and `height = bottom - top`.
It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly
the same.

All users of `Gfx::Rect` have been updated accordingly.
2023-05-23 12:35:42 +02:00
Karol Kosek 6ab660b62f SystemMonitor: Store text in UnavailableProcessWidget using String class 2023-05-22 06:12:17 +02:00
Karol Kosek 2f8f7eb899 SystemMonitor: Propagate more errors on startup 2023-05-22 06:12:17 +02:00
Karol Kosek 412630637a SystemMonitor: Convert most widgets to a failable factory
I didn't convert widgets that don't do any failable tasks currently
or are lazy-initialized.
2023-05-22 06:12:17 +02:00
Ben Wiederhake 41b45d5599 SystemMonitor: Prefer File::read_until_eof over DeprecatedFile
Because MemoryStatsWidget::refresh is run nearly directly by the
EventLoop, the only real alternative to crashing would be to cancel the
update, and keep the old data. That doesn't sound sufficiently better to
warrant being implemented.
2023-05-19 23:31:20 +02:00
Karol Kosek b7558a5ce4 LibGUI+Userland: Store column names in JsonArrayModel as String 2023-05-15 06:42:10 +02:00
Karol Kosek 945f05ed76 Userland: Port Model::column_name() to String 2023-05-15 06:42:10 +02:00
Ben Wiederhake b23a0b409d SystemMonitor: Prefer Core::File, poll ProcessStatisticsReader correctly
The signature of Core::ProcessStatisticsReader::get_all changed, and
instead of requiring a pointer to an open file, it now needs a bool to
indicate whether usernames should be polled or not. `m_proc_all` was
always converted to `false` in `RefPtr::operator bool()`, so we were
missing usernames for a long time.
2023-05-14 13:46:57 +02:00
Fabian Dellwing b01fcccbbd Userland+Base: Don't run NetworkSettings in elevated mode 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
thankyouverycool 91bafc2653 LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
Andreas Kling c756e021a7 Userland: Remove "Inspector" program and related utilities
This program has never lived up to its original idea, and has been
broken for years (property editing, etc). It's also unmaintained and
off-by-default since forever.

At this point, Inspector is more of a maintenance burden than a feature,
so this commit removes it from the system, along with the mechanism in
Core::EventLoop that enables it.

If we decide we want the feature again in the future, it can be
reimplemented better. :^)
2023-04-25 14:48:40 +02:00
Karol Kosek 969543a847 LibGUI+Userland: Make Window::*add_menu take name using new string 2023-04-19 07:59:54 +02:00
Liav A e931b2ecd9 SystemMonitor: Handle zombie processes properly
SystemMonitor had a bug in which it would crash in case there are zombie
processes left in the system.
The fix for this is to check if a process has no threads (which will
indicate that the process is a zombie and is waiting to be reaped), and
if that's the case, artificially create a thread row that is just enough
to represent the zombie process.
2023-04-10 11:25:01 -06:00
Karol Kosek ee5838084d LibCore+Userland: Add DEPRECATED infix to REGISTER_STRING_PROPERTY macro 2023-03-16 09:58:42 +01:00