1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00
Commit graph

1971 commits

Author SHA1 Message Date
Lenny Maiorani
e6f907a155 AK: Simplify constructors and conversions from nullptr_t
Problem:
- Many constructors are defined as `{}` rather than using the ` =
  default` compiler-provided constructor.
- Some types provide an implicit conversion operator from `nullptr_t`
  instead of requiring the caller to default construct. This violates
  the C++ Core Guidelines suggestion to declare single-argument
  constructors explicit
  (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit).

Solution:
- Change default constructors to use the compiler-provided default
  constructor.
- Remove implicit conversion operators from `nullptr_t` and change
  usage to enforce type consistency without conversion.
2021-01-12 09:11:45 +01:00
Nick Vella
eeffdb9725 FileManager: Show location bar on breadcrumb bar double-click. 2021-01-12 08:58:49 +01:00
Andreas Kling
f03800cee3 Kernel: Add dedicated "ptrace" pledge promise
The vast majority of programs don't ever need to use sys$ptrace(),
and it seems like a high-value system call to prevent a compromised
process from using.

This patch moves sys$ptrace() from the "proc" promise to its own,
new "ptrace" promise and updates the affected apps.
2021-01-11 22:32:59 +01:00
AnotherTest
510030971b LibLine: Handle history across multiple concurrent sessions better
- Store history entries as (timestamp)::(entry)\n\n
- Merge the entries together when saving to avoid loss of history
  entries

To ideally make having two concurrently open shells
(or `js` repls or whatever) not overwrite each others' history entries.
2021-01-11 21:09:36 +01:00
Lenny Maiorani
1b2364846f SinglyLinkedList: Implement find in terms of AK::find
Problem:
- The implementation of `find` is coupled to the implementation of
  `SinglyLinkedList`.

Solution:
- Decouple the implementation of `find` from the class by using a
  generic `find` algorithm.
2021-01-11 19:45:05 +01:00
Lenny Maiorani
f99d1d3bd7 Vector: Implement find, find_if, find_first_matching in terms of AK::find*
Problem:
- The implementation of `find` is coupled to the implementation of `Vector`.
- `Vector::find` takes the predicate by value which might be expensive.

Solution:
- Decouple the implementation of `find` from `Vector` by using a
  generic `find` algorithm.
- Change the name of `find` with a predicate to `find_if` so that a
  binding reference can be used and the predicate can be forwarded to
  avoid copies.
- Change all the `find(pred)` call sites to use `find_if`.
2021-01-11 19:45:05 +01:00
Andreas Kling
2f3b901f7f AK: Make MappedFile heap-allocated and ref-counted
Let's adapt this class a bit better to how it's actually being used.

Instead of having valid/invalid states and storing an error in case
it's invalid, a MappedFile is now always valid, and the factory
function that creates it will return an OSError if mapping fails.
2021-01-10 16:49:13 +01:00
asynts
019c9eb749 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-09 21:11:09 +01:00
Andreas Kling
6a19542715 LibVT+Terminal: Resize terminal when font changes
When the font is changed in the Terminal application, we now resize the
terminal window to accomodate the new font.
2021-01-09 14:03:06 +01:00
TheMorc
30ef10a5b9 SpaceAnalyzer: use "Proper Noun" name style 2021-01-09 13:59:23 +01:00
TheMorc
124518a14a SystemMonitor: Add args parsing for opening a specific tab
This allows SystemMonitor to parse -t or -open-tab argument
to open a specific tab. (ex. network, interrupts etc.)
2021-01-09 13:27:23 +01:00
Andreas Kling
12d0d12a78 FileManager+LibGUI: Make the breadcrumb bar accept text/uri-list drags 2021-01-09 12:02:07 +01:00
Itamar
dcdb68a013 Debugger: Support shared libraries
This makes our cli debugger, 'sdb', conform to the updated DebugSession
API and support shared libraries.
2021-01-09 10:55:46 +01:00
Emanuele Torre
5735fb47f3 FileManager: Remove extra semicolon added by mistake. 2021-01-08 22:10:25 +01:00
Andreas Kling
3b3233aaf0 FileManager: Allow drag&drop onto breadcrumb bar directories :^)
You can now drop dragged items onto directories in the breadcrumb bar
and we'll copy them to that directory for you. Pretty cool!
2021-01-08 19:51:44 +01:00
Mart G
e575d3fd3d Utilities: Add a disk space usage analyzation program.
SpaceAnalyzer: Partially address code review changes.

- Use GUI::CommonActions::make_about_action().
- Pass large arguments by const reference instead of by value.
- Mark const functions as such.
- Add newline at end of SpaceAnalyzer.af
- Use full words instead of abbreviations in variable names.
- Use application's namespace instead of 'TreeMap'.
- move() certain assignments.
- Use member declaration initialization.
- Initialize TreeNode* member of QueueEntry.
- Rewrite find_mount_for_path to return MountInfo* instead.
- Rename ITreeMap and ITreeMapNode to TreeMap and TreeMapNode.
- Replace ext suffix with rect suffix for rectangles.

SpaceAnalyzer: Further address code review and coding style.

- Remove get prefix from accessor functions.
- Layout algorithm in its own function, with callback.
- Remove nullptr comparisons.
- Store lstat errors in error_accumulator.
- Use Rect::shatter.
- Use Rect's orientation based functions.

SpaceAnalyzer: Make sort_children_by_area const qualified.
2021-01-08 17:08:48 +01:00
Andreas Kling
ba8990fb6c LibWeb: Rename Element::resolved_style() => specified_css_values()
This object represents the specified CSS values, so let's call it that.
2021-01-06 14:58:48 +01:00
Davide Carella
e2213c5665 KeyboardMapper: Added a new radio button that shows the Shift+AltGr map. 2021-01-06 09:32:08 +01:00
Andreas Kling
a6d52e0c97 LibWeb: Add a basic content filter (ad blocking!) :^)
This patch adds a global (per-process) filter list to LibWeb that is
used to filter all outgoing resource load requests.

Basically we check the URL against a list of filter patterns and if
it's a match for any one of them, we immediately fail the load.

The filter list is a simple text file:

    ~/.config/BrowserContentFilters.txt

It's one filter per line and they are simple glob filters for now,
with implicit asterisks (*) at the start and end of the line.
2021-01-05 21:20:15 +01:00
Tom
de6a4d49b8 SystemMonitor: Beef up CPU and memory graphs
We now show the total CPU usage as well as the kernel portion.
For the memory graphs we show the amount of committed memory,
actually allocated memory, and the portion of the kernel heap.
2021-01-05 10:59:00 +01:00
Rok Povsic
b4a783d923 TextEditor+EditingEngine: Add support for the basics of Vim emulation 2021-01-05 00:00:36 +01:00
Rok Povsic
1c17ecdeb7 TextEditor: Change 'Find regex' shortcut to Ctrl+Shift+R
So there's not conflict with Vim Emulator's Ctrl+R redo.
2021-01-05 00:00:36 +01:00
Andreas Kling
fedf561f57 Everywhere: Use GUI::CommonActions::make_about_action() 2021-01-04 23:51:49 +01:00
Andreas Kling
f0a59ab7fb Browser: Make the about menu item look a little nicer 2021-01-04 23:34:32 +01:00
Andreas Kling
bb431b58c1 FileManager: Refer to self as "File Manager" (not "FileManager") 2021-01-04 23:23:32 +01:00
Andreas Kling
9faa8e0ce6 DisplaySettings: Refer to app as "Display Settings"
Application names are proper nouns, so let's write them with capitalized
first letters.
2021-01-04 23:22:38 +01:00
Andreas Kling
83bbbff753 FileManager: Correct use of ellipsis (...) in menu items 2021-01-04 23:06:02 +01:00
Andreas Kling
4f4e6bc61b Spreadsheet: Tweak documentation window layout slightly 2021-01-04 18:47:29 +01:00
Andreas Kling
7124e63711 Spreadsheet: Tidy up cell formatting dialog a bit
Use some of the recent features in LibGUI to simplify and tidy up the
cell formatting interface. The widget layout API's are still not good
enough to make this easy, but at least it's getting better.
2021-01-04 18:42:50 +01:00
Andreas Kling
fa88a26554 Spreadsheet: Simplify conditional formatting property tab GML 2021-01-04 18:33:03 +01:00
Andreas Kling
5db34848fe Terminal: Use shrink-to-fit in the settings window 2021-01-04 18:26:52 +01:00
Andreas Kling
ded4d576df DisplaySettings: Use shrink-to-fit to simplify GML 2021-01-04 18:23:34 +01:00
Andreas Kling
ce7b09a3c5 DisplaySettings: Set "open wallpaper" button style in GML 2021-01-04 15:28:51 +01:00
Glenford Williams
7dc52e04fe
Calculator: Port interface to GML (#4742) 2021-01-03 22:27:24 +01:00
Linus Groh
bf45a28a89 CrashReporter: Show termination signal
...in both text (using strsignal) and numeric form.
Closes #4775.
2021-01-03 22:12:42 +01:00
Tom
b5437216e2 SystemMonitor: Re-use the /proc/all file descriptor when updating
This makes it more likely to be able to get statistics when resources
are scarce.
2021-01-03 22:12:19 +01:00
Tom
cf89180c35 LibCore: Report error condition when reading process statistics failed 2021-01-03 22:12:19 +01:00
Emanuele Torre
ef782c805f TextEditor+Meta+Ports+Shell: Remove blank lines at the end of some files 2021-01-03 17:12:50 +01:00
Andreas Kling
bd57fff6d4 CrashReporter: Make the window resizable
Also hide the backtrace scrollbars when they're not needed.
2021-01-03 14:35:09 +01:00
Brendan Coles
35fe1b39a2 FontEditor: Add help documentation 2021-01-03 13:22:00 +01:00
Andreas Kling
a63330077f Browser: Tell LaunchServer we only want to show the downloads directory
Browser only uses LaunchServer for one thing: to open the user's
downloads directory after a download is finished.

Eventually I'd like to move this functionality to a separate download
manager service, but for now, let's at least lock down what Browser is
able to ask LaunchServer to do. :^)
2021-01-03 12:10:34 +01:00
Andreas Kling
43c2b66b18 Revert "Terminal: Tell LaunchServer we only need to open "Help""
This reverts commit 8bf98eb581.

Terminal uses LaunchServer to open URLs that you click on. Oopsie!
2021-01-03 11:53:57 +01:00
Andreas Kling
8bf98eb581 Terminal: Tell LaunchServer we only need to open "Help" 2021-01-03 11:43:03 +01:00
Brendan Coles
bd2a7c414c Help: Support loading help page by file path as command line argument 2021-01-03 10:48:54 +01:00
Andreas Kling
05f5d0dda3 LibGfx: Add Gfx::TextAttributes (and use it in GUI::TextDocumentSpan) 2021-01-02 20:57:43 +01:00
AnotherTest
4bc33ee3ae Spreadsheet: Drop all references to example windows when closing them
Fixes #4716.
2021-01-02 17:15:46 +01:00
AnotherTest
e080a4f74a Spreadsheet: Avoid OOB access and use-after-move in selection 2021-01-02 17:15:46 +01:00
Andreas Kling
88ce755579 Help: Add a "Home" action to the toolbar :^) 2021-01-02 17:00:25 +01:00
Andreas Kling
ae0320183a Help: Rename manual section 1 to "User programs"
Since we're putting man pages for GUI apps into this category as well,
let's call it something other than "Command-line programs" :^)
2021-01-02 16:58:13 +01:00
Andreas Kling
d51bbe1e20 Help: Add a simple index page
Let's show something a bit more welcoming than empty white when the user
launches the Help application. :^)
2021-01-02 02:41:16 +01:00