mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 18:57:42 +00:00
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.
This commit is contained in:
parent
c566ef2a9d
commit
7772637d03
3 changed files with 22 additions and 8 deletions
|
@ -255,7 +255,7 @@ GUI::Variant ProcessModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == GUI::ModelRole::Display) {
|
if (role == GUI::ModelRole::Display || role == DISPLAY_VERBOSE) {
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case Column::Icon:
|
case Column::Icon:
|
||||||
return icon_for(thread);
|
return icon_for(thread);
|
||||||
|
@ -306,17 +306,29 @@ GUI::Variant ProcessModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol
|
||||||
case Column::CowFaults:
|
case Column::CowFaults:
|
||||||
return thread.current_state.cow_faults;
|
return thread.current_state.cow_faults;
|
||||||
case Column::IPv4SocketReadBytes:
|
case Column::IPv4SocketReadBytes:
|
||||||
return human_readable_size_long(thread.current_state.ipv4_socket_read_bytes, UseThousandsSeparator::Yes);
|
if (role == DISPLAY_VERBOSE)
|
||||||
|
return human_readable_size_long(thread.current_state.ipv4_socket_read_bytes, UseThousandsSeparator::Yes);
|
||||||
|
return human_readable_size(thread.current_state.ipv4_socket_read_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes);
|
||||||
case Column::IPv4SocketWriteBytes:
|
case Column::IPv4SocketWriteBytes:
|
||||||
return human_readable_size_long(thread.current_state.ipv4_socket_write_bytes, UseThousandsSeparator::Yes);
|
if (role == DISPLAY_VERBOSE)
|
||||||
|
return human_readable_size_long(thread.current_state.ipv4_socket_write_bytes, UseThousandsSeparator::Yes);
|
||||||
|
return human_readable_size(thread.current_state.ipv4_socket_write_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes);
|
||||||
case Column::UnixSocketReadBytes:
|
case Column::UnixSocketReadBytes:
|
||||||
return human_readable_size_long(thread.current_state.unix_socket_read_bytes, UseThousandsSeparator::Yes);
|
if (role == DISPLAY_VERBOSE)
|
||||||
|
return human_readable_size_long(thread.current_state.unix_socket_read_bytes, UseThousandsSeparator::Yes);
|
||||||
|
return human_readable_size(thread.current_state.unix_socket_read_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes);
|
||||||
case Column::UnixSocketWriteBytes:
|
case Column::UnixSocketWriteBytes:
|
||||||
return human_readable_size_long(thread.current_state.unix_socket_write_bytes, UseThousandsSeparator::Yes);
|
if (role == DISPLAY_VERBOSE)
|
||||||
|
return human_readable_size_long(thread.current_state.unix_socket_write_bytes, UseThousandsSeparator::Yes);
|
||||||
|
return human_readable_size(thread.current_state.unix_socket_write_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes);
|
||||||
case Column::FileReadBytes:
|
case Column::FileReadBytes:
|
||||||
return human_readable_size_long(thread.current_state.file_read_bytes, UseThousandsSeparator::Yes);
|
if (role == DISPLAY_VERBOSE)
|
||||||
|
return human_readable_size_long(thread.current_state.file_read_bytes, UseThousandsSeparator::Yes);
|
||||||
|
return human_readable_size(thread.current_state.file_read_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes);
|
||||||
case Column::FileWriteBytes:
|
case Column::FileWriteBytes:
|
||||||
return human_readable_size_long(thread.current_state.file_write_bytes, UseThousandsSeparator::Yes);
|
if (role == DISPLAY_VERBOSE)
|
||||||
|
return human_readable_size_long(thread.current_state.file_write_bytes, UseThousandsSeparator::Yes);
|
||||||
|
return human_readable_size(thread.current_state.file_write_bytes, AK::HumanReadableBasedOn::Base2, UseThousandsSeparator::Yes);
|
||||||
case Column::Pledge:
|
case Column::Pledge:
|
||||||
return thread.current_state.pledge;
|
return thread.current_state.pledge;
|
||||||
case Column::Veil:
|
case Column::Veil:
|
||||||
|
|
|
@ -55,6 +55,8 @@ public:
|
||||||
__Count
|
__Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr GUI::ModelRole DISPLAY_VERBOSE = static_cast<GUI::ModelRole>(0x101);
|
||||||
|
|
||||||
static ErrorOr<String> read_command_line(pid_t pid);
|
static ErrorOr<String> read_command_line(pid_t pid);
|
||||||
|
|
||||||
static ProcessModel& the();
|
static ProcessModel& the();
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
}
|
}
|
||||||
return m_target.column_name(index.row()).release_value_but_fixme_should_propagate_errors();
|
return m_target.column_name(index.row()).release_value_but_fixme_should_propagate_errors();
|
||||||
}
|
}
|
||||||
return m_target_index.sibling_at_column(index.row()).data();
|
return m_target_index.sibling_at_column(index.row()).data(ProcessModel::DISPLAY_VERBOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == GUI::ModelRole::Font) {
|
if (role == GUI::ModelRole::Font) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue