Commit Graph

2009 Commits

Author SHA1 Message Date
thankyouverycool
a593b83189 LibGfx+Applications: Add human readable name helper for fonts
This returns a more comprehensible name than raw weight and slope
metrics and is intended for use in UIs. Now displays human readable
font names in FontSettings, TerminalSettings and CharacterMap.
2022-02-01 10:06:26 +01:00
Timothy Flynn
6efbafa6e0 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2022-01-31 18:23:22 +00:00
Jelle Raaijmakers
48eecaad64 LibGUI: Remove Window background color
The `m_background_color` field was not used anywhere. Both `Terminal`
and the `ColorPicker` widget invoked `set_background_color()` to no
avail.
2022-01-31 00:38:15 +01:00
Dylan Katz
caecb6ba72 DisplaySettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
362df5b6dd MailSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
3ee32b6dbf MouseSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
90b371ef47 KeyboardSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
ca912a87f1 BrowserSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Ali Mohammad Pur
e72521f286 LibCoredump: Copy out the FooInfo structs to an aligned address
We were handing out unaligned pointers to these, which made UBSAN super
mad, copy them out to avoid that.
2022-01-28 22:51:27 +00:00
Ali Mohammad Pur
6d64b13a1b LibDebug+Everywhere: Avoid void* -> FlatPtr -> void* dance
And limit the `void*` to the functions that interface the system (i.e.
ptrace wrappers).
This generally makes the code less riddled with casts.
2022-01-28 22:51:27 +00:00
kleines Filmröllchen
145eeb57ab Userland: Remove a bunch of unnecessary Vector imports
How silly :^)
2022-01-28 23:40:25 +01:00
kleines Filmröllchen
cab6384966 HexEditor: Use Array in FindDialog's options 2022-01-28 23:40:25 +01:00
Timothy Flynn
bd5662d6f2 CharacterMap: Move display name strings into the search results object
Now that we're passing the display name directly to the search results
structure, let's move() the string instead of copying it.
2022-01-28 15:26:58 +00:00
Timothy Flynn
54d89401df CharacterMap: Change the search widget to display results in a TableView
Code points that have a bidirectional attribute of right-to-left (e.g.
some Arabic and Hebrew code points) were causing the code point to
render at the end of the search result, rather than the beginning. To
keep the results consistent, split the search results into two columns:
the first for the code point, the second for its name.
2022-01-28 15:26:58 +00:00
Timothy Flynn
55d28a738e Revert "FileManager: Display times in the user's local time zone"
This reverts commit 080b054695.
2022-01-28 15:13:35 +00:00
Timothy Flynn
8599ee3049 Revert "Userland: Invoke tzset in apps that care about time zones"
This reverts most of commit ede5c9548e.
The one change not reverted is ClockWidget.h, so that the taskbar clock
can continue to notice time zone changes.
2022-01-28 15:13:35 +00:00
Timothy Flynn
080b054695 FileManager: Display times in the user's local time zone 2022-01-28 12:25:20 +00:00
Timothy Flynn
da2eb63652 BrowserSettings: Use standard text placement for check box text 2022-01-28 13:20:19 +01:00
Timothy Flynn
0a3b1f6bc8 MailSettings: Use standard text placement for check box text 2022-01-28 13:20:19 +01:00
Timothy Flynn
cfd1755910 MouseSettings: Use standard text placement for check box text 2022-01-28 13:20:19 +01:00
Timothy Flynn
a027ccad75 LibTimeZone+Userland: Rename current_time_zone to system_time_zone
This renames the current implementation of current_time_zone to
system_time_zone to more clearly indicate what it is. Then reimplements
current_time_zone to return whatever was set up by tzset, falling back
to UTC if something went awry, for convenience.
2022-01-25 18:39:36 +00:00
Timothy Flynn
ede5c9548e Userland: Invoke tzset in applications that care about time zones
In most applications, we invoke tzset once at startup for now. Most of
these are short lived and don't need to know about time zone changes.

The exception is the ClockWidget in the taskbar. Here, we invoke tzset
each time we update the system time. This way, any time zone changes can
take effect immediately.
2022-01-25 18:39:36 +00:00
Andreas Kling
58b5aede65 CrashReporter: Dispatch backtrace progress callbacks on the main thread
We can't fiddle with GUI widgets off the main thread, so let's use
Core::EventLoop::deferred_invoke() to dispatch the work.

The progress bar doesn't visibly update yet, but at least we're not
crashing anymore.
2022-01-25 09:13:40 +01:00
Sam Atkins
c388a879d7 AK+Userland: Make AK::decode_base64 return ErrorOr 2022-01-24 22:36:09 +01:00
Sam Atkins
f590cd1850 AK+Userland: Make AK::decode_hex() return ErrorOr
This lets us propagate the reason why it failed up to the caller. :^)
2022-01-24 22:36:09 +01:00
Sam Atkins
45cf40653a Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr
Apologies for the enormous commit, but I don't see a way to split this
up nicely. In the vast majority of cases it's a simple change. A few
extra places can use TRY instead of manual error checking though. :^)
2022-01-24 22:36:09 +01:00
Sam Atkins
2b3790100a Browser: Convert file-downloading code to Core::Stream :^) 2022-01-24 17:10:01 +01:00
Sam Atkins
20b4bfc892 Browser: Convert ad-filter loading to Core::Stream :^) 2022-01-24 17:10:01 +01:00
Sam Atkins
ad1f24ecb9 Browser: Convert search-engines file loading to Core::Stream :^)
Wrapped it in a method so we can take advantage of TRY(). I chose not to
make failure here stop the Browser process, but just to cancel loading
any more search engines.
2022-01-24 17:10:01 +01:00
Tom
6565ec59fa DisplaySettings: Show display's manufacturer and size instead of device
Rather than displaying the path of the framebuffer, try and display
the manufacturer name and the size of the display. If no EDID data is
available, fall back to showing the device path.
2022-01-23 22:45:21 +00:00
Tom
ab1075e296 DisplaySettings: Show DPI for selected resolution
This uses the EDID provided by the connected display to show the pixel
density of a selected resolution.
2022-01-23 22:45:21 +00:00
mjz19910
1ef633472b Everywhere: Convert VM::call() to JS::call() 2022-01-23 15:24:45 +00:00
kleines Filmröllchen
69c1910037 LibCore: Allow EventLoops to run on multiple threads safely
The event loop system was previously very singletony to the point that
there's only a single event loop stack per process and only one event
loop (the topmost) can run at a time. This commit simply makes the event
loop stack and related structures thread-local so that each thread has
an isolated event loop system.

Some things are kept at a global level and synchronized with the new
MutexProtected: The main event loop needs to still be obtainable from
anywhere, as it closes down the application when it exits. The ID
allocator is global as IDs should not be shared even between threads.
And for the inspector server connection, the same as for the main loop
holds.

Note that currently, the wake pipe is only created by the main thread,
so notifications don't work on other threads.

This removes the temporary mutex fix for notifiers, introduced in
0631d3fed5 .
2022-01-23 15:21:10 +01:00
Timothy Flynn
d365559839 ClockSettings: Add a GUI application to set the system time zone
This application can be expanded with other clock-related options. For
an initial iteration, it has just an option to change the time zone.
2022-01-23 12:48:26 +00:00
Timothy Flynn
bcf4ec9c61 Userland: Add promises to programs that will read /etc/timezone
This will require unveiling /etc/timezone itself for reading, as well as
the rpath pledge promise.
2022-01-23 12:48:26 +00:00
Rummskartoffel
c93dfe8097 TextEditor: Fix crash on startup when file specified cannot be opened
Due to a bug introduced in f674102, TE would attempt to access the value
of an ErrorOr that didn't hold one, hitting an assertion.
2022-01-23 00:27:41 +00:00
davidot
2d4b345bb1 Spreadsheet: Enable dynamic import of javascript modules
This has some risks as it can (attempt to) load arbitrary files on the
filesystem but for now it can only load local files which do go through
normal file operations. But let's enable it for now to see what we can
do with it.
2022-01-22 01:21:18 +00:00
Luke Wilde
631bbcd00a LibJS: Refactor interpreter to use Script and Source Text Modules
This also refactors interpreter creation to follow
InitializeHostDefinedRealm, but I couldn't fit it in the title :^)

This allows us to follow the spec much more closely rather than being
completely ad-hoc with just the parse node instead of having all the
surrounding data such as the realm of the parse node.

The interpreter creation refactor creates the global execution context
once and doesn't take it off the stack. This allows LibWeb to take the
global execution context and manually handle it, following the HTML
spec. The HTML spec calls this the "realm execution context" of the
environment settings object.

It also allows us to specify the globalThis type, as it can be
different from the global object type. For example, on the web, Window
global objects use a WindowProxy global this value to enforce the same
origin policy on operations like [[GetOwnProperty]].

Finally, it allows us to directly call Program::execute in perform_eval
and perform_shadow_realm_eval as this moves
global_declaration_instantiation into Interpreter::run
(ScriptEvaluation) as per the spec.

Note that this doesn't evalulate Source Text Modules yet or refactor
the bytecode interpreter, that's work for future us :^)

This patch was originally build by Luke for the environment settings
object change but was also needed for modules. So I (davidot) have
modified it with the new completion changes and setup for that.

Co-authored-by: davidot <davidot@serenityos.org>
2022-01-22 01:21:18 +00:00
Dylan Katz
3919a1dcc0 Browser: Load icons at start of program
Previously, Browser loaded icons from the disk every time an icon
was set. In addition to making more calls to the disk and decoding
more images, this makes error propagation impossible. This change
moves all icon loading to the start of the program.
2022-01-21 22:14:13 +01:00
Mustafa Quraish
bba32de857 SpreadSheet: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
ca2c7dced5 3DFileViewer: Use FileSystemAccessClient::try_* APIs
This commit also removed the redundant `filename` parameter from
`GLContextWidget::load_file`, since the filename is already stored
within the file itself.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
abb16683c9 ThemeEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
f674102447 TextEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
effb19f996 PDFViewer: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
1c3e93c6e0 PixelPaint: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
aae96af812 HexEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Sam Atkins
94f2508519 CrashReporter: Don't crash when investigating a HackStudio crash
Previously when opening a crash report for HackStudio, the
`unveil("/bin/HackStudio", "rx")` call was failing because of the
earlier `unveil(executable_path.characters(), "r")` call requesting only
"r" permissions for it. This patch handles this specific case, so you
can crash HackStudio to your heart's content. :^)

Also, we were unveiling the executable path twice, once manually and
once implicitly as part of the coredump's libraries, so we now check for
the latter and avoid it.

Thanks to Daniel for noticing what was right in front of me and I didn't
see!

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2022-01-20 10:38:10 +01:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Undefine
9a28ef7aa9 SystemMonitor: Show unknown in PCI devices
In case when the PCI class, device or vendor is unknown, show
that it is unknown instead of just putting the ID
2022-01-19 21:47:40 -08:00
Timothy Flynn
d51d5f9591 FontEditor: Retrieve code point abbreviations from LibUnicode
Rather than using a hard-coded list from AK::UnicodeUtils, LibUnicode
contains the up-to-date official names and contains abbreviations for
more control code points.
2022-01-18 15:13:25 +00:00
Brian Gianforcaro
974e36e7a9 TextEditor: Hookup git commit message detection and highlighting 2022-01-18 09:01:16 +01:00
Jesse Buhagiar
865e7bbe5e LibGL+LibSoftGPU+3DFileViewer: Implement Specular highlighting :^) 2022-01-18 01:48:51 +02:00
thankyouverycool
c094bb60bc FontEditor: Set GlyphEditor glyph on initialization
Fixes GlyphEditor appearing blank on start and subsequent
re-initializations.
2022-01-16 21:36:39 +01:00
thankyouverycool
8f60ea4470 FontEditor: Disambiguate save function from save-as action 2022-01-16 21:36:39 +01:00
thankyouverycool
c2b7bbbb2c FontEditor: Update GlyphEditor and width widgets on paste and delete
Fixes unsynced state between widgets after paste and delete actions.
2022-01-16 21:36:39 +01:00
thankyouverycool
7d7f683715 FontEditor: Correct GroupBox height
Font Metadata's GroupBox height was off by an _unsightly_ 2 pixels.
Now we make heights explicit for all child widgets and let shrink_to_fit
automatically calculate things.
2022-01-16 21:36:39 +01:00
thankyouverycool
24bd2a427c FontEditor: Calculate GlyphEditor toolbar widths more precisely
Fixes pixel imperfect toolbar widths when editing small fonts.
2022-01-16 21:36:39 +01:00
thankyouverycool
2e849250eb FontEditor: Remove unnecessary call during GlyphEditor init
GlyphEditor's relative rect is automatically set during layout.
2022-01-16 21:36:39 +01:00
thankyouverycool
ff42ad88ee FontEditor: Remove .gitignore artifact from old build system 2022-01-16 21:36:39 +01:00
Marcus Nilsson
8b39ec7c18 SystemMonitor: Don't display empty CPU graphs when number of CPUs < 4
When we have less than 4 CPUs we don't need to display a whole row of
CPU graphs.
2022-01-16 15:04:40 +01:00
Sam Atkins
53cd87cc1d CharacterMap+Base: Give Character Map an icon 2022-01-16 11:17:03 +01:00
Sam Atkins
83a9661c04 CharacterMap+Base: Add man page for Character Map :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
2a7c638cd9 CharacterMap: Add a find-by-name window
This works the same way as the command-line usage, searching against the
display name as provided by LibUnicode.

I've modified the search loop to cover every possible unicode
code-point, since my previous logic was flawed. Code-points are not
dense, there are gaps, so simply iterating up to the count of them will
skip ones with higher values. Surprisingly, iterating all 1,114,112 of
them still runs in a third of a second. Computers are fast!
2022-01-16 11:17:03 +01:00
Sam Atkins
2bf7abcb28 CharacterMap: Add previous, next, and go-to glyph buttons
These work the same as in FontEditor, where I shamelessly stole them
from. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
e975db23c0 LibGUI+FontEditor: Move seek-prev/next-glyph logic into GlyphMapWidget 2022-01-16 11:17:03 +01:00
Sam Atkins
9ca8428238 CharacterMap: Add output box for copying arbitrary character sequences
This adds a TextBox along the bottom of the window. Double-clicking on a
character will append it to this box, which you can edit as any other
TextBox, or click the copy button to copy the output to the clipboard.
2022-01-16 11:17:03 +01:00
Sam Atkins
2327ea8970 CharacterMap: Add new Character Map application :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
21a24c36a8 LibGUI: Make GlyphMapWidget work with vector fonts
This basically just meant replacing the `m_font` field with the one
inherited from Widget.
2022-01-16 11:17:03 +01:00
Sam Atkins
8175cd0a28 LibGUI+FontEditor: Move GlyphMapWidget to LibGUI
This will allow us to use this in other apps, such as the upcoming
Character Map. :^)
2022-01-16 11:17:03 +01:00
Olivier De Cannière
d3dfb957a6 PixelPaint: Add delete selection behavior
The delete key can now be used to erase the pixels on the active layer
contained within the selection rectangle.

Closes #11861
2022-01-15 23:38:00 +01:00
creator1creeper1
19d9d5bfe1 Everywhere: Mark Vector of mutable references as mutable
The point of a reference type is to behave just like the referred-to
type. So, a Foo& should behave just like a Foo.

In these cases, we had a const Vector. If it was a const Vector of Foo,
iterating over the Vector would only permit taking const references to
the individual Foos.

However, we had a const Vector of Foo&. The behavior should not
change. We should still only be permitted to take const references to
the individual Foos. Otherwise, we would be allowed to mutate the
individual Foos, which would mutate the elements of the const Vector.
This wouldn't modify the stored pointers, but it would modify the
objects that the references refer to. Since references should be
transparent, this should not be legal.

So it should be impossible to get mutable references into a const
Vector. Since we need mutable references in these cases to call the
mutating member functions, we need to mark the Vector as mutable as
well.
2022-01-16 00:38:21 +03:30
Mateusz Krajewski
ae71d2b70e PixelPaint: Restrict "crop to selection" to image boundaries 2022-01-15 21:55:41 +01:00
Rummskartoffel
a610d9a3d1 Assistant: Fix crash in FileProvider background thread upon exit
If the Threading::BackgroundAction for filesystem indexing in
FileProvider hadn't finished by the time the main thread exited, it
would still try to access the FileProvider object that lived in the main
thread, thereby causing a segfault and crashing. This commit prevents
FileProvider from being destroyed while the background thread is still
running by giving the background thread a strong reference to its
FileProvider.
2022-01-15 21:45:03 +01:00
Rummskartoffel
ada1d4906e Assistant: Make Provider ref-counted 2022-01-15 21:45:03 +01:00
Glenford Williams
c55dfabdd5 Spreadsheet: Use FileSystemAccessClient for the reading of files 2022-01-15 22:20:15 +03:30
Brian Gianforcaro
ef2fd31288 Terminal: Add config listeners for controlling scrollbar visibility 2022-01-15 11:03:23 +01:00
Brian Gianforcaro
ab4035e227 TerminalSettings: Expose a CheckBox controlling scrollbar visibility 2022-01-15 11:03:23 +01:00
sin-ack
2e1bbcb0fa LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer
This change unfortunately cannot be atomically made without a single
commit changing everything.

Most of the important changes are in LibIPC/Connection.cpp,
LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp.

The notable changes are:
- IPCCompiler now generates the decode and decode_message functions such
  that they take a Core::Stream::LocalSocket instead of the socket fd.
- IPC::Decoder now uses the receive_fd method of LocalSocket instead of
  doing system calls directly on the fd.
- IPC::ConnectionBase and related classes now use the Stream API
  functions.
- IPC::ServerConnection no longer constructs the socket itself; instead,
  a convenience macro, IPC_CLIENT_CONNECTION, is used in place of
  C_OBJECT and will generate a static try_create factory function for
  the ServerConnection subclass. The subclass is now responsible for
  passing the socket constructed in this function to its
  ServerConnection base; the socket is passed as the first argument to
  the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before
  any other arguments.
- The functionality regarding taking over sockets from SystemServer has
  been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket
  implementation of this functionality hasn't been deleted due to my
  intention of removing this class in the near future and to reduce
  noise on this (already quite noisy) PR.
2022-01-15 13:29:48 +03:30
Colin
dc89ac1463 PixelPaint: Update SelectedColorWidget::m_color consistently 2022-01-14 21:33:32 +01:00
kleines Filmröllchen
be6418cc50 Everywhere: Use my new serenityos.org e-mail :^) 2022-01-14 11:54:09 +01:00
Idan Horowitz
d55c130df5 SystemMonitor: Split multi-core CPU usage graphs into multiple rows
This looks much nicer than the current cramped single-row solution.
2022-01-14 01:02:50 +01:00
Mustafa Quraish
7974fee800 PixelPaint: Inherit from AbstractZoomPanWidget 2022-01-14 01:02:34 +01:00
Mustafa Quraish
b21d128075 ImageViewer: Inherit from AbstractZoomPanWidget 2022-01-14 01:02:34 +01:00
sin-ack
aedb013ee3 LibIMAP+Userland: Convert LibIMAP::Client to the Serenity Stream APIs
You now cannot get an unconnected LibIMAP::Client, but you can still
close it. This makes for a nicer API where we don't have a Client object
in a limbo state between being constructed and being connected.

This code still isn't as nice as it should be, as TLS::TLSv12 is still
not a Core::Stream::Socket subclass, which would allow for consolidating
most of the TLS/non-TLS code into a single implementation.
2022-01-13 15:16:12 +03:30
sin-ack
dbd25916a3 LibCore+Userland+Tests: Convert Stream APIs to construct on heap
As per previous discussion, it was decided that the Stream classes
should be constructed on the heap.

While I don't personally agree with this change, it does have the
benefit of avoiding Function object reconstructions due to the lambda
passed to Notifier pointing to a stale object reference. This also has
the benefit of not having to "box" objects for virtual usage, as the
objects come pre-boxed.

However, it means that we now hit the heap everytime we construct a
TCPSocket for instance, which might not be desirable.
2022-01-13 15:16:12 +03:30
Lady Gegga
10a52c0b32 FontEditor: Add Klingon phrase to Preview Font 2022-01-12 22:54:59 +01:00
Idan Horowitz
f9528f1882 Kernel: Rename ProcessorInfo::{m_brandstr => m_brand}
There's no need to specify the type of the member in it's name,
especially not in shorthand format.
2022-01-12 16:09:09 +02:00
Jesse Buhagiar
b397db9948 3DFileViewer: Replace lambertian lighting with GL Lighting 2022-01-12 13:36:56 +01:00
electrikmilk
34c5d33eb0 Base+Userland: Add various icons
Add new icons to menus, add existing icons that could be used in menus.
2022-01-12 10:55:20 +01:00
electrikmilk
64ae8eac0e Base+PixelPaint: Add more menu icons
Adding icons missing from Pixel Paint menus.
2022-01-12 10:55:13 +01:00
electrikmilk
10e473bf26 Base+Browser: Add Browser icons
Add some missing icons to the brower.
2022-01-12 10:54:54 +01:00
kleines Filmröllchen
98c0c5e9e6 Help+Base: Add help://man URLs for links between man pages
The URLs of the form `help://man/<section>/<page>` link to another help
page inside the help application. All previous relative page links are
replaced by this new form. This doesn't change any behavior but it looks
much nicer :^)

Note that man doesn't handle these new links, but the previous relative
links didn't work either.
2022-01-11 00:24:57 +01:00
kleines Filmröllchen
984bae9038 Help: Refactor link handling
Link handling is now split up between open_page and open_url. While
open_page can handle any sort of input and is responsible for handling
history UI, open_url deals in URLs and takes one of a few different
actions depending on the exact URL given. Currently, only file:// URLs
are handled but this will change in the next few commits.

Note that this commit breaks relative URLs on purpose. After the new
help:// URLs, they won't be needed anyways. The reasoning is that many
URLs not specifically pointing to man page directories will cause a
(non-deadly) unveil violation in `real_path_for`. This specifically
concerns the new application launch URLs that are added in the next
commit.
2022-01-11 00:24:57 +01:00
Glenford Williams
f5ff011c1b Spreadsheet: Properly pass parent window to Workbook
Change the parent of the WizardDialog to that of the Spreadsheet window.
Previously the WizardDialog was using the open file dialog as the
parent resulting in the csv import dialog
2022-01-09 20:38:55 +01:00
Marcus Nilsson
876424923a PixelPaint: Verify that we have an ImageEditor instead of returning
We should never be in a state where an action requiring an ImageEditor
is enabled if all tabs are closed.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
ae958d97b2 PixelPaint: Disable actions when no ImageEditor is open
Disable all actions when the last tab is closed and enable them when a
new ImageEditor is created.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
18e6da6d4d PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidget
Using a WeakPtr to keep a reference to the active layer caused it to
be destroyed when the last tab was closed, which made the
m_layer == layer check in set_layer() return early since it was
already null. Because of this the LayerPropertiesWidget was never
disabled.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
7ca4d045bd PixelPaint: Make PaletteWidget::set_image_editor take a ImageEditor*
After closing the last open ImageEditor, selecting a color would try to
dereference it causing a crash. Instead make set_image_editor() take a
pointer to it and set it to nullptr when closing the last tab like we
do with LayerListWidget and LayerPropertiesWidget.
2022-01-09 20:24:02 +01:00
sholm
d54a3f4520 Help: Scroll to the top of page when opening a new link
Previously the scroll position would not reset when loading a new
page. This caused various problems such as opening the page at the
previous pages scroll position and in some instances not even
showing the new page at all.
2022-01-09 20:21:02 +01:00
Mustafa Quraish
0e6576b376 PixelPaint: Move out common logic from Filters into base class
Now, each new filter only has to describe how to actually change
the bitmaps, and the common logic of pulling out the bitmap from the
layer, and marking the action as done, etc is all handled in the
`Filter` base class.

This also makes it possible to apply filters to external bitmaps,
which are not embedded in a `Layer` (which we can use to preview
filters in the future!)
2022-01-09 12:26:07 +01:00
creator1creeper1
45e68b2aa4 PixelPaint: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
6f283a8e60 Piano: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
1b42aff9b5 Welcome: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
f17bd66ecc Mail: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
a76e97df64 PDFViewer: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
77ad98ab7c Calculator: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
20a7cb3004 VideoPlayer: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
c1dc5ef9d7 KeyboardMapper: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
26eee2c02d SystemMonitor: Propagate errors using try_set_main_widget
build_process_window now uses try_set_main_widget and might return an
error. process_properties_action handles a possible error by simply
not updating the process window if an error occured while building it.
2022-01-09 00:56:11 +01:00
creator1creeper1
c60f05b28e 3DFileViewer: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
deed6388ef FontEditor: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
de82901d4c TextEditor: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
Leonardo Nicolas
9aa0cf3265 FileManager: Do not allow rename files that cannot be modified
Pressing the F2 key on files that the user doesn't have permission was
opening the file name for editing.

This patch fixes the issue disabling the file name editing when the user
doesn't have permission to do it.

To reproduce the issue:

1) Open the File Manager
2) Click on the /etc directory
3) Select any file
4) Press the F2 key
5) Update the file name
2022-01-09 00:47:48 +01:00
Mustafa Quraish
c5fb55725e PixelPaint: Only clear LayerListWidget if there are no editors left
Previously, we would clear it if there was still an editor open. This
was not obvious because it was only visible when an inactive tab was
closed, since closing an active tab would trigger an editor change
which would re-fill the layers widget.
2022-01-09 00:19:47 +01:00
Mustafa Quraish
6c60bf7537 PixelPaint: Move request_close_editor() logic inside ImageEditor
This allows us to request any specific editor to close itself. Earlier,
this could only be done for the currently active editor, so trying to
close inactive tabs would not work properly.
2022-01-09 00:19:47 +01:00
Mustafa Quraish
c2b3bab984 PixelPaint: Move save and save_as logic inside ImageEditor
Previously the save logic was hardcoded to only work for the active
editor, so closing editors in the background would not properly
handle the unsaved changes. This patch brings us closer to be able
to fix that problem.
2022-01-09 00:19:47 +01:00
Maciej
1d98499234 FontEditor: Support selection ranges
This makes editing much easier, e.g. you don't need longer to copy
hundreds of glyphs one by one.

It has some flaws, e.g. it's not integrated with undo stack,
but we need to start with something!
2022-01-09 00:18:46 +01:00
Maciej
22b3c25f10 FontEditor: Save scale to config file 2022-01-09 00:18:46 +01:00
Maciej
4d4764e0fb FontEditor: Display something for emoji glyphs
This commit makes FontEditor displaying emojis in GlyphMapWidget. They
are not editable, what is marked by red background of a glyph.

Additionally, a proper information is displayed in statusbar.

Fixes #10900.
2022-01-09 00:18:46 +01:00
Linus Groh
eb60d16549 LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>
Instead of making it a void function, checking for an exception, and
then receiving the relevant result via VM::last_value(), we can
consolidate all of this by using completions.

This allows us to remove more uses of VM::exception(), and all uses of
VM::last_value().
2022-01-08 23:43:03 +01:00
Xavier Defrang
b1a15b02f1 PixelPaint+LibGfx: Add sepia color filter 2022-01-08 12:31:11 +01:00
Jean-Paul Balabanian
a69598a670 KeyboardMapper: Add support for dynamic keyboard visualization 2022-01-08 11:50:26 +01:00
mjz19910
10ec98dd38 Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Marcus Nilsson
eb97617ff0 PDFViewer: Add actions to rotate the displayed PDF
This implements the rotate cw/ccw actions in PDFViewer.
Since the rendered pages are stored in a HashMap for caching,
the bitmap is wrapped in a struct with the current rotation.
This way the caching works as expected while zooming, and a new bitmap
is rendered when the page is rotated.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
cecbed467b LibGUI: Move rotate cw/ccw to CommonActions
The rotate clockwise/rotate counterclockwise actions can be added to
CommonActions since they are repeated in FontEditor, ImageViewer and
PixelPaint. This keeps the shortcuts and icons consistent across
applications.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
56bec4968c PDFViewer: Enable panning with middle mouse button
Enable the use of the middle mouse button for panning in PDFViewer.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
3af71c406d PDFViewer: Add zoom in/out/reset menu actions
Make PDFViewer::zoom_in() & ::zoom_out() public and add menu and toolbar
actions. Also add an action for zoom reset.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
45085122ee PDFViewer: Fix sidebar toggle logic
The open_outline_action logic was backwards resulting in it
being closed on the first click and opened on the second,
and opposite if document->outline() was true.

There was also a collision with the Ctrl+O shortcut for opening a
document, this changes it to Ctrl+S instead.

This commit also changes the wording to 'Toogle' instead of 'Open/Close'
since the text wasn't updated as expected, and lastly, add a View menu
with the action.
2022-01-06 21:25:02 +01:00
Junior Rantila
e114e2e66d ImageViewer: Show error if wallpaper could not be set 2022-01-06 18:20:07 +01:00
Junior Rantila
9a2aad9eca ImageViewer: TRY all the things 2022-01-06 18:20:07 +01:00
Junior Rantila
9a38d1de07 LibCore+ImageViewer: Add unlink() wrapper, use it 2022-01-06 18:20:07 +01:00
RasmusNylander
c00014fa54 KeyboardMapper: Port to Core::Stream
Port KeyboardMapperWidget to use the new Core::Stream instead of the old
IODevice.

If you can't beat 'em, join 'em.
2022-01-06 17:54:03 +01:00
RasmusNylander
9678ff15a8 KeyboardMapper: Propagate errors using ErrorOr and TRY
KeyboardMapperWidget's load_map_from_file, load_map_from_system, save,
and save_to_file now all return ErrorOr<void> and no longer handles
alerting the user to potential errors.

main is now responsible for handling errors originating from its calls
to these four functions; it will simply alert the user using the new
method KeyboardMapperWidget::show_error_to_user(Error), which simply
creates a MassageBox displaying the error's string_literal.

This makes the whole program slight more clean feeling :^).
2022-01-06 17:54:03 +01:00
RasmusNylander
017135b44e KeyboardMapper: Port to LibMain 2022-01-06 17:54:03 +01:00
RasmusNylander
64684cbd5d KeyboardMapper: Fix discrepancy between cursor and button clickability
KeyButton now only responds to clicks on the key-cap's face. This
corresponds to when the cursor switches from the default arrow to a
hand.
2022-01-06 17:54:03 +01:00
RasmusNylander
35afd32a51 KeyboardMapper: Fix displaying null characters
Fixes a bug where KeyButtons would display null characters. A single
null character should be handled as an empty string.
2022-01-06 17:54:03 +01:00
RasmusNylander
41b0795f99 KeyboardMapper: Name formerly inlined variables
Renames some variables in KeyButton.cpp to increase clarity and grants
some slightly opaque inline variables names.
2022-01-06 17:54:03 +01:00
RasmusNylander
c4b2efd95e KeyboardMapper: Show multiple pressed keys at once
When depressing a key, KeyboardMapperWidget::keydown_event() will now
update only the pressed state of the button associated with the specific
key, instead of also setting the pressed state of the all the buttons to
false.

This makes it possible to highlight multiple pressed keys at once and
makes the code more consistent; the implementation of keyup_event
implied that this was a feature of the program.
2022-01-06 17:54:03 +01:00
RasmusNylander
a1531dba91 KeyboardMapper: Extract method map_from_name
Extract the mapping of a name to a character map into its own method.
This only slightly reduces the number of lines, going from 24 to 17
lines, but makes the code somewhat more readable and reduces repetition.
2022-01-06 17:54:03 +01:00
RasmusNylander
b2a6c9e5ea KeyboardMapper: Extract creation of map-selection buttons
Extract the creation of map-selection radio buttons from create_frame
into the new private method add_map_radio_button(map_name, button_text)
turning 24 lines into 4 + 6 lines. This makes create_frame a little
easier to read. :^)
2022-01-06 17:54:03 +01:00
Tobias Christiansen
923979ca93 PixelPaint: Unveil FileIconProvider.ini
This is used by the Filter Gallery and previously complained in the
debug log that it was not unveiled.
2022-01-06 15:13:05 +01:00
Lucas CHOLLET
75d1840cfc FileManager: Show Dotfiles when passing a Dotfile as an argument
Before this patch, FileManager was failing to open the directory and
open `/` instead.
2022-01-05 15:20:54 -08:00
Lucas CHOLLET
693ae73606 FileManager: Use String const& instead of String
Change ErrorOr<int> run_in_windowed_mode(String, String)
to ErrorOr<int> run_in_windowed_mode(String const&, String const&)
2022-01-05 15:20:54 -08:00
Mustafa Quraish
7c69830169 PixelPaint: Add new icon for New Image from Clipboard
This is just a slight variation of `/res/icons/16x16/paste.png`, I've
removed the lines on the paper to make it look consistent with the
"New Image" icon, which is an empty piece of paper.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
e2c73a114d PixelPaint: Use 'save' action in toolbar instead of 'save as'
I think this is likely the more common operation and makes more sense
in the toolbar. It calls the 'save as' action internally anyway if there
is no associated file.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
c03f271bbf PixelPaint: Ask about unsaved changes for all tabs on close
Now, when trying to close the application, there is a separate prompt
for each open tab with unsaved changes. Each tab is closed after it is
handled appropriately (assuming the user didn't Cancel), this makes it
so that the message box is always asking about the currently active tab,
allowing the user to see that the image contains.

If at any point the user presses "Cancel", all remaining tabs are kept
open.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
915211252d PixelPaint: Mark editor as unmodified when creating a default image
This is similar to opening an empty text file in TextEditor, the user
is only asked to saved changes if they have made any changes to it.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
fc5c327751 PixelPaint: Mark editor as unmodified when opening an image
Previously a newly opened (and unedited) project was considered
modified, even though there was no need to actually re-save the
contents.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
8c4579bced PixelPaint: Only prompt for unsaved changes if there any
Previously MainWidget::request_close() would always put up the
message box asking to save unsaved changes, even if there aren't any.
This patch makes it so that the message box is only shown if the
undo stack is in a modified state.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
2440d2c2fe PixelPaint: Move title and path from Image to ImageEditor
As noted in the latest hacking video, it doesn't seem to make much
sense to store the title and path in the image itself. These fields
have now been moved to the actual ImageEditor itself.

This allows some nice simplicfications, including getting rid of the
`image_did_change_title` hook of ImageClient (which was just a way to
report back to the editor that the title had changed).
2022-01-05 12:08:20 +01:00
Andreas Kling
219339d2a5 FontEditor: Use GUI::MessageBox::ask_about_unsaved_changes() 2022-01-04 21:49:44 +01:00
Andreas Kling
1a54ac262a PixelPaint: Make ImageEditor::m_undo_stack a regular value member 2022-01-04 21:49:44 +01:00
Andreas Kling
490d385d01 PixelPaint: Use GUI::MessageBox::ask_about_unsaved_changes()
To make the last-saved-at timestamp show up correctly, we also now mark
the editor's undo stack as unmodified on save.
2022-01-04 21:49:44 +01:00
Andreas Kling
82b071943d PixelPaint: Add "save" action
Let's have this as a complement to the "save as" action :^)
2022-01-04 21:49:44 +01:00
Andreas Kling
5c68e91dd7 TextEditor: Use early return style in "save" action callback 2022-01-04 21:49:44 +01:00
Andreas Kling
7178c39a78 TextEditor: Show time-since-last-save in "unsaved changes" dialogs :^) 2022-01-04 21:49:44 +01:00
Andreas Kling
c08872f5da TextEditor: Use GUI::MessageBox::ask_about_unsaved_changes() 2022-01-04 21:49:44 +01:00
Tobias Christiansen
f92172c7c3 PixelPaint: Add a Bloom filter
A bloom filter creates fringes around bright areas in the image
mimicking the behavior of real-world cameras.
It gets its own category "Artistic" in the Filter Gallery since its not
one filter per se but a combination of multiple.

The filter works as follows:
- Get only the light areas (above a threshold) of the image
- Blur that image
- Compose onto the original image
2022-01-04 21:41:14 +02:00
Tobias Christiansen
9d45e5ac8f PixelPaint: Add the FastBoxBlurFilter with configurable parameters :^)
The FastBoxBlurFilter has been living in LibGfx for a while and now
it's accessible in PixelPaint. The parameters for the filter are exposed
via the new Filter Gallery.
2022-01-04 21:41:14 +02:00
Rummskartoffel
902b8f1583 Calendar: Port to LibMain and TRY all the things 2022-01-04 20:46:17 +02:00
Tobias Christiansen
fd90e10600 PixelPaint: Fix crash on applying with no filter selected
The wrong conception that done() would stop the program flow right there
lead to the lambda not properly aborting when no filter was selected.

The ExecAborted would be processed and then the nullptr that was
m_selected_filter would be happily dereferenced.

This patch fixes that.
2022-01-04 18:36:27 +02:00
Tobias Christiansen
d42abb3c7b PixelPaint: Use the wrapped filters for the Filter Gallery
Now, the filters can supply the Filter Gallery with a GUI::Widget such
that the user can interact with the filter. The Filter Gallery in turn
only calls apply() on the filter once it should be run.

This decouples the PixelPaint filters a lot from the ones supported by
LibGfx and paves the way to filters with settings.

For now there still are just the plain LibGfx filters so this change
feels like introducing a lot of boilerplate, but in the future there
will be a lot more to see.
2022-01-04 14:40:00 +01:00
Tobias Christiansen
0deadcdb28 PixelPaint: Create wrappers for all supported filters 2022-01-04 14:40:00 +01:00
Tobias Christiansen
5cf0357be1 PixelPaint: Create Filter base class
All the filters will need a wrapper around them, and this is going to be
their base class
2022-01-04 14:40:00 +01:00
Tobias Christiansen
ea19f6dd4a PixelPaint: Extend Filter Gallery dialog to accommodate settings
For now, the space is empty, but it's there.
2022-01-04 14:40:00 +01:00
Andrew Kaster
5cbc734081 SystemMonitor: Remove unused functions and enable warning globally
These two helpers were the only unused functions clang could detect in
the entire codebase. Now that's commitment to no dead code :^)
2022-01-04 07:51:31 +00:00
Andrew Kaster
f8ea9cd64e Userland: Resolve unused-but-set-varaible warnings
These are almost always bugs, so enable globally.

Remove unused counter variables in SystemMonitor and disk_benchmark.
2022-01-04 07:51:31 +00:00
Andrew Kaster
a103a85ae6 Userland: Locally suppress -Wc99-designator and re-enable globally
There's only two places where we're using the C99 feature of array
designated initalizers. This feature seemingly wasn't included with
C++20 designated initalizers for classes and structs. The only two
places we were using this feature are suitably old and isolated that
it makes sense to just suppress the warning at the usage sites while
discouraging future array designated intializers in new code.
2022-01-04 07:51:31 +00:00
Andrew Kaster
c8cfd6661a Userland: Resolve -Woverloaded-virtual in LibGUI and SoundPlayer
Enable the warning project-wide. It catches when a non-virtual method
creates an overload set with a virtual method. This might cause
surprising overload resolution depending on how the method is invoked.
2022-01-04 07:51:31 +00:00
Maciej
28ea412251 PixelPaint: Make paste action create new image if no editor is opened
This matches GIMP behaviour.
2022-01-04 07:29:50 +00:00
Maciej
41d02bd5e6 PixelPaint: Add a way to quickly create an image from clipboard
Ctrl+Shift+V, like in GIMP.
2022-01-04 07:29:50 +00:00
Linus Groh
85f0fc2b83 LibJS: Return Optional<T> from Completion::{value,target}(), not T
In the end this is a nicer API than having separate has_{value,target}()
and having to check those first, and then making another Optional from
the unwrapped value:

    completion.has_value() ? completion.value() : Optional<Value> {}
    //                       ^^^^^^^^^^^^^^^^^^
    //         Implicit creation of non-empty Optional<Value>

This way we need to unwrap the optional ourselves, but can easily pass
it to something else as well.

This is in anticipation of the AST using completions :^)
2022-01-03 21:50:50 +01:00
martinfalisse
b39aede8fe Spreadsheet: Background fill color after reaching vertical end
When selecting a cell in the spreadsheet that was added
automatically as per the InfinitelyScrollableTableView
implementation, the background color is now filled correctly.

Previously, when navigating horizontally in a spreadsheet, after
a certain point the cells would not have the same background fill
color as the user would have experienced in the previous column
ranges (A-Z).
2022-01-03 22:30:04 +03:30
Samuel Bowman
4711d789c9 CrashReporter: Move progressbar into main window
Previously we would create a temporary progress window to show a
progressbar while the coredump is processed. Since we're only waiting
on backtraces and CPU register states, we can move the progressbar
into the main window and show everything else immediately while the
slow parts are generated in a BackgroundAction.
2022-01-03 16:19:47 +01:00
kleines Filmröllchen
c748c0726a SoundPlayer: Don't enqueue samples depending on the GUI loop
Previously, SoundPlayer would read and enqueue samples in the GUI loop
(through a Timer). Apart from general problems with doing audio on the
GUI thread, this is particularly bad as the audio would lag or drop out
when the GUI lags (e.g. window resizes and moves, changing the
visualizer). As Piano does, now SoundPlayer enqueues more audio once the
audio server signals that a buffer has finished playing. The GUI-
dependent decoding is still kept as a "backup" and to start the entire
cycle, but it's not solely depended on. A queue of buffer IDs is used to
keep track of playing buffers and how many there are. The buffer
overhead, i.e. how many buffers "too many" currently exist, is currently
set to its absolute minimum of 2.
2022-01-02 22:18:37 +01:00
kleines Filmröllchen
59601b67a0 SoundPlayer: Remove resolved FIXME
I already resolved this some time ago but apparently forgot about it :^)
2022-01-02 22:18:37 +01:00
Lucas CHOLLET
7532ef78ad Calculator: Round small number to prevent crash
Small numbers (smaller than 1e-19) can't be displayed in the calculator.
They provoke a division by zero in Keypad::set_value(), as 10^20
overflows.
2022-01-02 15:42:13 +01:00
Lucas CHOLLET
939bf3e864 Calculator: Remove KeypadValue::operator>
This method was declared but not implemented, and will probably never be
useful.
2022-01-02 15:42:13 +01:00
Lucas CHOLLET
eb8df0ae2a Calculator: Display zero with only one character
This patch prevents zero to be displayed as "0.00". The value is now
always printed with only one character.
2022-01-02 15:42:13 +01:00
Filiph Sandström
ec28af0aef DisplaySettings: Add 1440p ultrawide resolution 2022-01-02 13:27:02 +01:00
Filiph Sandström
022b4a3ed3 ThemeEditor: Add "alignment" support 2022-01-01 22:51:53 +01:00
Conor Byrne
e92b6047ad HexEditor: Port HexEditor to LibMain 2022-01-01 14:47:15 +01:00
Tobias Christiansen
3528563e3d PixelPaint: Move all filters into the Filter Gallery 2022-01-01 14:38:59 +01:00
Tobias Christiansen
f2feebc6f6 PixelPaint: Expand Filter Gallery to know how to apply filters 2022-01-01 14:38:59 +01:00
Tobias Christiansen
ddaf496aa0 PixelPaint: Make the ImageEditor known throughout the Filter Gallery 2022-01-01 14:38:59 +01:00
Tobias Christiansen
f47026b1d6 PixelPaint: Add Filter Gallery Dialog to the Filter Menu
This patch adds the bare bones of the new Filter Gallery.
For now, only the gml and the basic layout got added, a fairly boringw
indow pops up when "Filter Gallery" is called.

The code for the Model used by the TreeView is taken in large parts from
HackStudio's VariableModel.
2022-01-01 14:38:59 +01:00
Conor Byrne
2042a4d1e1 VideoPlayer: Port VideoPlayer to LibMain 2022-01-01 04:28:34 +00:00
Elyse
173a84a2ef LibGUI+SoundPlayer: Use 'decrease_slider_by_page_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() - page_step() * page_number)'.
2021-12-30 14:31:50 +01:00
Elyse
0d660b27ae LibGUI+SoundPlayer: Use 'increase_slider_by_page_steps()'
This method allow us to avoid repeating the pattern
'set_value(value() + page_step() * page_number)'.
2021-12-30 14:31:50 +01:00
Elyse
086615535f Everywhere: Use 'decrease_slider_by()' method from AbstractSlider
The same idea as 'increase_slider_by()', it helps us to avoid repeating
the pattern 'set_value(value() - delta)'.
2021-12-30 14:31:50 +01:00
Elyse
d53e1fa1fa Everywhere: Use 'increase_slider_by()' method from AbstractSlider
This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
2021-12-30 14:31:50 +01:00
Timothy Flynn
565a880ce5 Userland: Link directly against LibUnicodeData where needed
This is partially a revert of commits:
    10a8b6d411
    561b67a1ad

Rather than adding the prot_exec pledge requried to use dlopen(), we can
link directly against LibUnicodeData in applications that we know need
that library.

This might make the dlopen() dance a bit unnecessary. The same purpose
might now be fulfilled with weak symbols. That can be revisted next, but
for now, this at least removes the potential security risk of apps like
the Browser having prot_exec privileges.
2021-12-30 14:18:12 +01:00
Luke Wilde
8eb01c0b11 ImageViewer: Allow choice between nearest neighbor and bilinear scaling
Currently, ImageViewer always uses nearest neighbor scaling.
This allows the user to choose whether to use nearest neighbor
or bilinear scaling. It current defaults to nearest neighbor.
2021-12-29 17:58:32 +01:00
TheGrizzlyDev
2905642550 Magnifier: Add colorblind preview options
Add the same preview options as the theme editor so you can test the
accessibility of anything on your desktop. Both tools share the same
shortcuts.
2021-12-28 23:59:56 +01:00
Maciej
ab324c1dae ImageViewer: Change how scaling works
- Store scale as a (float) factor (not as %)
- Make scaling exponential so that matches PixelPaint and another
image viewers/editors/etc
2021-12-28 23:23:09 +01:00
Andreas Kling
ac7ce12123 Kernel: Remove the kmalloc_eternal heap :^)
This was a premature optimization from the early days of SerenityOS.
The eternal heap was a simple bump pointer allocator over a static
byte array. My original idea was to avoid heap fragmentation and improve
data locality, but both ideas were rooted in cargo culting, not data.

We would reserve 4 MiB at boot and only ended up using ~256 KiB, wasting
the rest.

This patch replaces all kmalloc_eternal() usage by regular kmalloc().
2021-12-28 21:02:38 +01:00
TheGrizzlyDev
ebaf211260 ThemeEditor: Implement a way to simulate color blindness in preview
Implement a mechanism that allows us to alter colors so that they
mimic those a colorblind person would see. From the color we can then
alter the colors for the whole preview so we can simulate everything
in the theme including icons/decorations.

This filter is also available as a Filter in LibGfx so it can be
reused in multiple other places.

The color simulation algorithm is based on this one
https://github.com/MaPePeR/jsColorblindSimulator publicly available.
2021-12-28 17:10:44 +01:00
Maciej
00d1dbb95b TextEditor: Highlight AF files as INI 2021-12-28 11:36:12 +01:00
Rummskartoffel
561b67a1ad Help: Fix crash when trying to load libunicodedata.so 2021-12-28 01:31:46 +01:00
Julian Offenhäuser
5bc7a18a04 FileManager: Add "Create Archive" action
This option will appear when you select one or more files or
directories. It will then ask the user to enter a name for the new
archive (or use the current directories' name if left empty) and
create it under that name in the currently opened directory.

Note that only .zip files are currently supported.
2021-12-28 01:14:52 +01:00
Sam Atkins
d702678d16 LibJS+WebContent+Browser+js: Implement console.group() methods
This implements:
- console.group()
- console.groupCollapsed()
- console.groupEnd()

In the Browser, we use `<details>` for the groups, which is not actually
implemented yet, so groups are always open.

In the REPL, groups are non-interactive, but still indent any output.
This looks weird since the console prompt and return values remain on
the far left, but this matches what Node does so it's probably fine. :^)
I expect `console.group()` is not used much outside of browsers.
2021-12-27 21:44:07 +01:00
Rummskartoffel
ab2c5eebec Help: Fix memory leak given ambiguous man page title on command line
Given a command line with an ambiguous man page title, such as `$ Help
uname`, Help would find and try to open all matching pages, leading to
bad behavior such as a memory leak, flickering scrollbars, and
eventually a crash due to OOM. This commit fixes the issue by making
Help only open one page on startup.
2021-12-27 12:01:31 +01:00
Andreas Kling
e815bf5d1f PDFViewer: Add a basic set of pledges 2021-12-25 10:58:30 +01:00
Sam Atkins
eefe471dce SystemMonitor: Remove unused SortingProxyModel include 2021-12-24 05:11:52 -08:00
Sam Atkins
f6633a1026 LibGUI+Userland: Make SortingProxyModel::create() return ErrorOr
Unfortunately, most of the users are inside constructors, (and two
others are inside callback lambdas) so the error can't propagate, but
that can be improved later.
2021-12-24 05:11:52 -08:00
Elyse
46b1c2d609 SoundPlayer: Add a keyboard shortcut 'M' to mute the player
This shortcut let us mute/unmute the player, but it still doesn't update
the volume slider because the actual volume widget can't display a muted
state.
2021-12-24 00:19:01 -08:00
Elyse
8f2161c0ee SoundPlayer: Add 'mute' methods to Player
These methods allow us to mute/unmute the player without needing to
modify the volume level that it has.
2021-12-24 00:19:01 -08:00
Max Trussell
c8eab80b3d SoundPlayer: Sync startup loop and show playlist settings in GUI
This fix syncs up the AudioPlayer's internal state for showing
playlist information with the AudioPlayer's GUI. Before, if the
AudioPlayer was opened with a playlist file (.m3u or .m3u8) it would
automatically show the playlist information in the GUI and set the
loop mode to playlist, but the menu options would be unchecked. In
order to hide the playlist information, the menu option would then
have to be toggled twice -- once on and again off.
2021-12-24 00:05:35 -08:00
Arne Elster
277ac48649 HexEditor: Don't unnecessarily abbreviate variable names
There's enough line space to use readable variable names.
2021-12-23 23:25:47 -08:00
Arne Elster
9f38966105 HexEditor: Make HexDocuments final
There's no reason as to why someone would inherit those, so might
aswell make them final.
2021-12-23 23:25:47 -08:00
Arne Elster
af754211fa HexEditor: Scroll back to the top when opening another file
When a file is opened and scrolled to some position and the user opens
another file, the current scroll position stays the same. That's
disorienting. Therefore, when opening another file, scroll back to the
top.
2021-12-23 23:25:47 -08:00
Arne Elster
fd66dda1d7 HexEditor: Stream input files instead of keeping them in memory
To support editing of large files it is an advantage to not load the
entire file into memory but only load whatever is needed for display at
the moment. To make it work, file access is abstracted into a socalled
HexDocument, of which there two: a memory based and a file based one.
The former can be used for newly created documents, the latter for file
based editing.

Hex documents now do track changes instead of the HexEditor. HexEditor
only sets new values. This frees HexEditor of some responsibility.
2021-12-23 23:25:47 -08:00
creator1creeper1
4b2b0a4d0e Calculator: Make double construction and conversion private
At this point, the double conversions should really only be
implementation details of the KeypadValue class. Therefore,
the constructor-from double and conversion-operator-to
double of KeypadValue are made private. Instead, the
required functionality is provided by KeypadValue itself.
The internal implementation is still done using doubles.
However, this opens us up to the possibility of having
loss-free square root, inversion and division in the future.
2021-12-22 00:43:13 -08:00
r00ster91
b6d921f682 PixelPaint: Refactor falloff computation and extend hardness range 2021-12-21 13:52:55 -08:00
creator1creeper1
cacac7927b Calculator: Construct KeypadValue precisely from the Clipboard contents
Previously, we would use lossy strtod() conversion. This was bad,
especially since we switched from internally storing Calculator
state in a double to storing it in the KeypadValue class
some time ago. This commit adds a constructor for the KeypadValue
class that is not lossy by using strtoll(). It handles numbers
with and without decimal points as well as negative numbers
correctly.
2021-12-21 13:22:12 -08:00
Timothy Flynn
10a8b6d411 Userland: Add unveil/pledge requisites for dynamic Unicode data loading
Loading libunicodedata.so will require dlopen(), which in turn requires
mmap(). The 'prot_exec' pledge is needed for this.

Further, the .so itself must be unveiled for reading. The "real" path is
unveiled (libunicodedata.so.serenity) as the symlink (libunicodedata.so)
itself cannot be unveiled.
2021-12-21 13:09:49 -08:00
Ali Mohammad Pur
f0709c7a24 LibC+AK: Implement all sorts of wprintf variants 2021-12-21 21:24:36 +03:30
Sam Atkins
85a54261b3 Help: Include page names in the search
This fixes the problem before, where searching "Shell" would list
"Shell-vars" in the results, but searching "Shell-vars" would make it
disappear.

Also removed some now-unnecessary includes.
2021-12-20 10:58:41 -08:00
Sam Atkins
8461f8c1cd Help: Add support for launching with a section and page, like man
I found it strange that `man` and `Help` did not accept the same command
line arguments since they are so similar. So... now they do. :^)

This means you can now open for example the `tar` man page in Help with
`Help tar`, or `Help 1 tar` if you want to disambiguate between pages in
different sections.

If the result is not found, it falls back to the previous behavior,
treating the input as a search query.

Initially I had this written as two optional positional arguments, but
when told to parse `[optional int] [optional string]`, and then given a
string input, ArgsParser forwards it to the [optional int], which then
fails to parse. Ideally it would pass it to the second, [optional
string] arg instead, but that looks like a fairly big change to make to
ArgsParser's internals, and risk breaking things. Maybe this ugly hack
will be an incentive to fix it. :^)
2021-12-20 10:58:41 -08:00
Sam Atkins
4c91f736c7 Help: Move update_actions() code into open_page()
These two lambdas are always called together, in this order, so why not
make them one instead?

Also converted a couple of west-consts to east-const.
2021-12-20 10:58:41 -08:00
Sam Atkins
4bf2ef2a4c Help: Always show the welcome page on launch if nothing else is there
Previously, launching Help with a query like `Help tar` left the page
blank, which looks like something has gone wrong. Instead, let's show
the usual welcome page.
2021-12-20 10:58:41 -08:00
Junior Rantila
5238308d6f Magnifier: Add timeline for easy checking of animations
This patch adds a 512 frame timeline to Magnifier and the ability to
step through it with the arrow keys.

This makes it easier to check Serenity animations frame by frame for
correctness etc.
2021-12-20 10:48:03 -08:00
Junior Rantila
105f741131 Piano: Make Key_Space shortcut to toggle playback 2021-12-20 10:39:37 -08:00
Idan Horowitz
d82c91ac2c SystemMonitor: Add back accidentally removed veil lock
Since the call to lock the veil was missing, the protections provided
by unveil() were not actually enabled.
2021-12-19 13:41:35 +01:00
Astraeus-
eb1f00a940 AnalogClock: Port to LibMain 2021-12-17 13:09:54 -08:00
Astraeus-
eec6ae0d07 About: Port to LibMain 2021-12-17 13:09:54 -08:00
RasmusNylander
fa99125571 Spreadsheet: Handle emptying of cell containing only an '='
Cell::set_data(String new_data) now checks whether the cell is a
formula-cell and the new_data is an empty string. If this is case, it
will no longer simply return and will now instead actually set the
cell's contents to an empty string.

This fixes an error whereupon committing the string "=" to a cell, it
would not be possible to directly delete the cell's contents. Instead,
it first had to be overwritten with another string, which then could be
deleted.

This could probably be done more elegantly. Right now, I believe,
writing the string "=" to a (formula-)cell already containing an
identical string will result in the cell being marked as dirty, even
though nothing actually changed.
2021-12-16 02:44:37 +03:30
Ali Mohammad Pur
5f1a34bba3 Spreadsheet: Avoid using Value.to_string_without_side_effects()
We should use .to_string() and handle the possible exceptions.
This makes the displayed cell contents so much more informative than
'[object Object]' :^)
2021-12-12 14:49:49 +03:30
Ali Mohammad Pur
235eb0b1ad Spreadsheet: Replace hacky JS VM configuration with a more correct one
Now we give each sheet its own interpreter and realm, and only make them
share the VM.
This is to prepare for the next commit, which will be refactoring a
bunch of things to propagate exceptions via ThrowCompletionOr<T>.
2021-12-12 14:49:49 +03:30
Ali Mohammad Pur
82dde46a30 Spreadsheet: Replace the help button's text with something we can render 2021-12-12 14:49:49 +03:30
Ali Mohammad Pur
91444de2cf Spreadsheet: Reimplement ranges as lazy objects instead of arrays
Doing so makes it possible to talk about theoretically infinite ranges
like "all of column A".
2021-12-12 14:49:49 +03:30
Ali Mohammad Pur
892e585e9a Spreadsheet: Don't recreate the global environment on every evaluation
The worksheet's realm does not change, and is not shared, so we can
safely leave the global environment be.
This fixes lexical scoping in the spreadsheet's runtime file.
2021-12-12 14:49:49 +03:30
Sahan Fernando
49ed168ced Userland: Use File::lines() range-based for loop where appropriate 2021-12-12 14:06:38 +03:30
Undefine
312bac1967 Mail: Ask the user if they want to see the mail settings 2021-12-11 15:09:54 -08:00
Jose Flores
65df30d00c Piano: Add track controls to the player widget
Adds the ability to add a track and cycle through the
tracks from player widget. Also displays the current track
being played or edited in a dropdown that allows
for quick track selection.
2021-12-11 23:07:21 +01:00
bugreport0
1a2ff38609 CrashReporter: Remove redundant pledge() 2021-12-11 23:06:56 +01:00
Daniel Bertalan
4a81b33c07 Everywhere: Fix -Winconsistent-missing-override warnings from Clang
This option is already enabled when building Lagom, so let's enable it
for the main build too. We will no longer be surprised by Lagom Clang
CI builds failing while everything compiles locally.

Furthermore, the stronger `-Wsuggest-override` warning is enabled in
this commit, which enforces the use of the `override` keyword in all
classes, not just those which already have some methods marked as
`override`. This works with both GCC and Clang.
2021-12-11 13:14:15 -08:00
Sam Atkins
54bbb97ac6 Browser+LibWeb+WebContent: Add variables display to Inspector
This allows us to see which custom properties apply to a given element,
which previously wasn't shown.
2021-12-10 06:52:17 +01:00
scwfri
8d0143a380 HackStudio+TextEditor: Persist EditingEngineType across editors
Persist EditingEngine mode in HackStudio and TextEditor when opening new
files or editing splits. Previously, the EditingEngine defaulted to a
RegularEditingEngine for a new Editor, even if Vim Emulation had been
selected in the existing Editor.
2021-12-09 21:31:06 +01:00
Ben Wiederhake
13cba5f8b4 Spreadsheet: Avoid implicitly copying ByteBuffer 2021-12-08 09:46:13 -08:00
Sam Atkins
3ca2aee054 Applications: Cast unused smart-pointer TRY return values to void 2021-12-05 15:31:03 +01:00
Sam Atkins
d2024f04bd Userland: Cast unused BackgroundAction::construct() results to void
User code does not need to keep this alive, so casting to void is safe.
But maybe a bit weird.
2021-12-05 15:31:03 +01:00
Elyse
8595fd585d SoundPlayer: Port to LibMain :^) 2021-12-04 15:07:18 -08:00
Andreas Kling
96e4077c38 SystemMonitor: Port to LibMain :^)
There's a lot more work to do on this application to take full advantage
of TRY() etc. This patch just scratches the surface.
2021-12-04 14:24:04 +01:00
Andreas Kling
01228bf4ef CrashReporter: Port to LibMain and use TRY() while building the UI :^) 2021-12-04 14:24:04 +01:00
Jelle Raaijmakers
a4603fbc06 3DFileViewer: Add checkbox to disable texture 2021-12-01 10:21:13 +01:00
Andreas Kling
fc0a040e5d CrashReporter: Remove unnecessary button height overrides from GML 2021-11-30 23:34:40 +01:00
Andreas Kling
85eb0eaad0 CrashReporter+HackStudio: Let's call it "Debug in Hack Studio"
"Inspect in Hack Studio" was a bit vague.
2021-11-30 23:34:40 +01:00
Erik Biederstadt
e052d647b7 Spreadsheet: Allow sheet renaming after double clicking on the tabwidget 2021-12-01 00:44:26 +03:30
thankyouverycool
298a6b9937 LibGUI+FontEditor: Allow ComboBox on_change callback to be toggled
When calling set_selected_index() on ComboBox, allow its on_change
callback to be disabled. Fixes FontEditor window state erroneously
switching to modified when initializing between different slopes
and weights.
2021-11-30 10:51:51 +01:00
thankyouverycool
ca062d83db FontEditor: Convert to east const 2021-11-30 10:51:51 +01:00
thankyouverycool
de77e28360 FontEditor: Correct member type and initialization in UndoGlyph
Makes code_point type u32, consistent with the rest of the system,
and properly initializes it.
2021-11-30 10:51:51 +01:00
thankyouverycool
e3e3c03dca FontEditor: Remove unused Vector<String> 2021-11-30 10:51:51 +01:00
thankyouverycool
ca77aea099 FontEditor: Correct NewFontDialog layout issues
Fixes incorrect scale initialization and inconsistent margins, sets
minimum values for glyph width and height to 1, and labels page 1
more precisely as "Typeface" properties.
2021-11-30 10:51:51 +01:00
thankyouverycool
9b184fc1cb FontEditor: Clean up GlyphMapWidget header
Fixes minor organizational inconsistency and zeroes initializations
for rows and columns as the previous values haven't been meaningful
since the map was converted to a scrollable widget. No functional
changes.
2021-11-30 10:51:51 +01:00
thankyouverycool
7d73d2dfc8 FontEditor: Remove superfluous 'this' pointers 2021-11-30 10:51:51 +01:00
thankyouverycool
e29abc5395 LibGfx+FontEditor: Consolidate BitmapFont width and height limits
And make them more self-documenting. Previously these constraints
were duplicated across multiple files.
2021-11-30 10:51:51 +01:00
thankyouverycool
541f1de3a8 FontEditor: Add scaled offset members to GlyphEditor
Previously these were undescriptive globals making them a bit cryptic.
2021-11-30 10:51:51 +01:00
thankyouverycool
aa09e40eb2 FontEditor: Update status bar on initialization
Fixes incorrect glyph status immediately after loading a new font.
2021-11-30 10:51:51 +01:00
thankyouverycool
ae922c67fd FontEditor: Remove code duplication when resizing GlyphEditor
The left column now also enforces a minimum width to prevent especially
small fonts from hiding the glyph toolbars and width widgets.
2021-11-30 10:51:51 +01:00
thankyouverycool
c1744822a1 FontEditor: Account for glyph width when pasting
Fixes glyphs not expanding up to their maximum width if necessary
when pasting larger glyphs into smaller ones.
2021-11-30 10:51:51 +01:00
thankyouverycool
281805696b FontEditor: Don't allow cutting and copying absent glyphs
And update status bar on cut. Fixes placing these effectless actions
on the undo stack.
2021-11-30 10:51:51 +01:00
thankyouverycool
d2b211f14a FontEditor: Don't null check newly created NonnullRefPtr fonts 2021-11-30 10:51:51 +01:00
thankyouverycool
74938e6f42 FontEditor: Factor out redundant code for a request to close 2021-11-30 10:51:51 +01:00
thankyouverycool
1e052f5a91 FontEditor: Convert mode and transform buttons into toolbar actions
This will let us more easily organize and assign shortcuts to new
modes and transformations as they are built, and it generally looks
more polished as a uniform interface. Also adds a counterclockwise
option to the rotate action, moves Copy as Character to the edit
menu as it doesn't directly impact GlyphEditor, and makes the paint
and move modes exclusive checkables to make the editor's state more
visually obvious.
2021-11-30 10:51:51 +01:00
thankyouverycool
922e80e72b FontEditor: Simplify start-up
Previusly a cloned or newly loaded font was moved twice from main to
the constructor and then from constructor to an init routine where it
was finally used. The unmasked font is now moved only once, directly
to initialization, and redundant error checking is discarded.
2021-11-30 10:51:51 +01:00
thankyouverycool
56a8a2b493 FontEditor: Use LibUnicode to convert character case
Fixes characters beyond the Basic Latin code block not showing
their upper-case form in the preview window.
2021-11-30 10:51:51 +01:00
thankyouverycool
edf86af4f4 LibGfx+FontEditor: Add helper to determine raw glyph presence
GlyphBitmaps are considered present if they have a width greater
than zero. This adds a counterpart method for raw (unmasked) glyphs
and makes intent more explicit throughout FontEditor.
2021-11-30 10:51:51 +01:00
Jelle Raaijmakers
61e4c09514 3DFileViewer: Set correct aspect ratio in view frustum 2021-11-29 22:11:41 +00:00
Jelle Raaijmakers
dcc7d7d566 3DFileViewer: Improve FPS display
We only showed frame times down to the millisecond. Our FPS counter was
based off of that, allowing for a limited set of possible FPS values.

Convert these calculations to floating point so we get more useful FPS
and frame time values.
2021-11-29 11:44:01 +00:00
kleines Filmröllchen
96d02a3e75 LibAudio: New error propagation API in Loader and Buffer
Previously, a libc-like out-of-line error information was used in the
loader and its plugins. Now, all functions that may fail to do their job
return some sort of Result. The universally-used error type ist the new
LoaderError, which can contain information about the general error
category (such as file format, I/O, unimplemented features), an error
description, and location information, such as file index or sample
index.

Additionally, the loader plugins try to do as little work as possible in
their constructors. Right after being constructed, a user should call
initialize() and check the errors returned from there. (This is done
transparently by Loader itself.) If a constructor caused an error, the
call to initialize should check and return it immediately.

This opportunity was used to rework a lot of the internal error
propagation in both loader classes, especially FlacLoader. Therefore, a
couple of other refactorings may have sneaked in as well.

The adoption of LibAudio users is minimal. Piano's adoption is not
important, as the code will receive major refactoring in the near future
anyways. SoundPlayer's adoption is also less important, as changes to
refactor it are in the works as well. aplay's adoption is the best and
may serve as an example for other users. It also includes new buffering
behavior.

Buffer also gets some attention, making it OOM-safe and thereby also
propagating its errors to the user.
2021-11-28 13:33:51 -08:00
Marcus Nilsson
5217202737 ThemeEditor: Use LibMain
Use the new serenity_main construct and TRY in ThemeEditor.
2021-11-28 10:10:35 -08:00
Marcus Nilsson
c91eebfbaa Magnifier: Use LibMain
Use the new serenity_main construct and TRY in Magnifier.
2021-11-28 10:10:35 -08:00
Andreas Kling
60c132d7d3 LibGUI: Move GUI::SettingsWindow setup out of the constructor
In order to propagate errors that occur during UI setup, we have to move
all that logic out of widget/window subclass constructors. This is a
first attempt at doing that, for GUI::SettingsWindow.
2021-11-28 08:54:22 +01:00
Andreas Kling
acd4cc97fc KeyboardSettings: Remove some unnecessary pledge promises
This program doesn't need to create or write files directly.
2021-11-28 08:54:22 +01:00
Andreas Kling
45844f9338 LibGUI: Make GUI::SettingsWindow::add_tab() return ErrorOr
This allows us to use TRY() when creating settings UI.
2021-11-28 08:10:53 +01:00
Andreas Kling
7c19e86a50 TerminalSettings: Remove unnecessary pledges and unveils 2021-11-28 08:10:53 +01:00
Andreas Kling
6b862d5063 TerminalSettings: Port to LibMain :^) 2021-11-28 08:10:53 +01:00
Andreas Kling
8a11e986e5 MailSettings: Port to LibMain :^) 2021-11-28 08:10:53 +01:00
Andreas Kling
984cf1fe7a DisplaySettings: Port to LibMain :^) 2021-11-28 08:10:53 +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
kleines Filmröllchen
1ff48a3ca4 Terminal: Modernize terminal settings as a standalone application
The settings for Terminal are extracted into their own application,
TerminalSettings, which is reachable over the normal Settings menu as
well as the same place in the Terminal menu. The font settings are moved
into these settings as well, which are now split up into the "Terminal"
and "View" tabs. The font settings themselves receive an option to
override the selected font with the system default on the user side.
The live update behavior of all of the terminal settings is retained.

The layout of the new TerminalSettings is based around the other
Settings applications, but pixel-perfectness is missing in some places.
It's a bit fiddly and I'd like to have some better GUI::Label auto-size
behavior, but oh well :^)
2021-11-27 12:45:44 +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
Marcus Nilsson
67f349be46 PixelPaint: Keep a RefPtr to offset_text_box in EditGuideDialog
Keep a RefPtr to offset_text_box in EditGuideDialog instead of using
a local pointer. Previously the lambda in ok_button.on_click() would
outlive the local variable causing a crash.
2021-11-27 11:04:48 +01:00
Andreas Kling
1ded1ed963 Run: Port to LibMain :^) 2021-11-26 23:27:57 +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
Sam Atkins
705b7fc407 Browser: Allow custom search engine URLs that don't start http[s]:// 2021-11-26 22:14:56 +01:00
Sam Atkins
a1e1405f26 BrowserSettings: Add some icons for it :^) 2021-11-26 22:14:56 +01:00
Sam Atkins
c22b0bb8b2 Browser+Base: Delete provided Browser.ini file
Having files in Base's user `.config` folder means that every time the
Serenity image is built, all user settings in that file are thrown away.
So, let's not do that! :^)

Modified the default value for the homepage url to match what was in
Browser.ini, so there is no visible change.
2021-11-26 22:14:56 +01:00
Sam Atkins
e84b3e7110 BrowserSettings: Implement restoring default values 2021-11-26 22:14:56 +01:00
Sam Atkins
f2b8ae7d86 BrowserSettings: Add preferred-color-scheme setting 2021-11-26 22:14:56 +01:00
Sam Atkins
11466c5316 BrowserSettings: Add setting for search engine 2021-11-26 22:14:56 +01:00
Sam Atkins
e927048754 Browser: Move search engine definitions to a json file
This both makes them configurable, and means that we can read them from
other applications, such as BrowserSettings. :^)
2021-11-26 22:14:56 +01:00
Sam Atkins
1933076143 Browser+BrowserSettings: Persist the "show bookmarks bar" setting
Previously this setting was only temporary, but we now save/load it from
the config file.
2021-11-26 22:14:56 +01:00
Sam Atkins
8a284be5c7 BrowserSettings: Create a BrowserSettings application :^)
Browser has a bunch of settings, but most are non-trivial to add here.
So far, these are implemented:

- Homepage URL
- Whether to close download windows when they complete

The others will be added in subsequent commits.
2021-11-26 22:14:56 +01:00
Karol Kosek
20191b58e2 DisplaySettings: Update wallpaper config path only on success
The Window Server is ignoring incorrect files since 235f39e449, so let's
not update the config when that happens and an error message instead!
2021-11-26 11:30:55 -08:00
Karol Kosek
e56ffd11ce DisplaySettings: Always save the background color to the config
Previously, you could notice that the background color isn't being
updated when you picked a small bitmap image with the 'center' mode.
2021-11-26 11:30:55 -08:00
Ralf Donau
1c59cfa28c SystemMonitor: Remove unveiling /tmp/portal/config 2021-11-25 08:50:31 +01:00
kleines Filmröllchen
a099a77e82 SoundPlayer+LibDSP: Move the FFT implementation to LibDSP
LibDSP can greatly benefit from this nice FFT implementation, so let's
move it into the fitting library :^)

Note that this now requires linking SoundPlayer against LibDSP. That's
not an issue (LibDSP is rather small currently anyways), as we can
probably make great use of it in the future anyways.
2021-11-24 23:45:08 +00:00
Andreas Kling
4cbf7f24be Terminal: Tighten lambda captures in create_find_window() 2021-11-24 23:32:43 +01:00
Andreas Kling
1749442a1c Terminal: Use LibCore syscall wrapper for ptsname() 2021-11-24 23:25:03 +01:00
Andreas Kling
6b587714e8 Terminal: Use ErrorOr and TRY() when setting up the "find" dialog 2021-11-24 23:11:11 +01:00
Andreas Kling
0ff9df3cd6 Terminal: Use TRY() a lot more in serenity_main() 2021-11-24 23:07:31 +01:00
Andreas Kling
bc2ee02ce0 FileManager: Use TRY() a lot more in the main functions :^) 2021-11-24 23:07:31 +01:00
Maciej
700c76ba23 CrashReporter: Don't visualize whitespace in memory regions text editor
This was visible for memory regions with empty name.
2021-11-24 19:44:02 +01:00
Andreas Kling
dbab20782e LibGUI: Make FilteringProxyModel factory function return ErrorOr 2021-11-24 13:52:01 +01:00
Andreas Kling
71414821b4 Help: TRY() all the things in serenity_main() :^)
This patch makes use of all the new fallible APIs in LibGUI together
with TRY() to catch and propagate errors. The main error getting caught
is allocation failures while trying to construct the Help UI.

It's quite interesting to see how the code changes as more and more
fallible calls get branded as such by wrapping them in TRY().

There's a lot of repetitive "TRY(try_foo())" going on right now. Once
this becomes the dominant programming pattern, we can drop the "try_"
prefix everywhere. :^)
2021-11-24 13:52:01 +01:00
Andreas Kling
b6f49924be LibDesktop: Make allowlist APIs return ErrorOr<void>
This makes it very smooth to use TRY() when setting up these lists,
as you can see in the rest of this commit. :^)
2021-11-24 00:25:23 +01:00
Andreas Kling
f526325e24 ImageViewer: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
ba4fd8fa15 FontEditor: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
973cb0a49e Calculator: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
31867bed5c KeyboardSettings: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
10b5393506 MouseSettings: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
db79f1cb78 Welcome: Port to LibMain :^) 2021-11-24 00:25:22 +01:00
Andreas Kling
e7d4622ce0 Help: Port to LibMain :^) 2021-11-24 00:25:22 +01:00
Andreas Kling
6536198693 TextEditor: Port to LibMain :^)
This opens up using TRY() for syscalls and Core::Object creation.
2021-11-23 15:44:59 +01:00
Andreas Kling
58fb3ebf66 LibCore+AK: Move MappedFile from AK to LibCore
MappedFile is strictly a userspace thing, so it doesn't belong in AK
(which is supposed to be user/kernel agnostic.)
2021-11-23 11:33:36 +01:00
Andreas Kling
21a5fb0fa2 LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCore
With this change, System::foo() becomes Core::System::foo().

Since LibCore builds on other systems than SerenityOS, we now have to
make sure that wrappers work with just a standard C library underneath.
2021-11-23 11:33:36 +01:00
Mustafa Quraish
4d302e0e88 Everywhere: Use Application::construct() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Mustafa Quraish
2fbcab46bf Everywhere: Use ArgsParser::parse() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Pascal Puffke
ca7b603578 Mail: Port to LibMain 2021-11-22 23:56:22 +01:00
Pascal Puffke
41b80f3d85 Piano: Port to LibMain 2021-11-22 23:56:22 +01:00
Pascal Puffke
61408e2397 PDFViewer: Port to LibMain 2021-11-22 23:56:22 +01:00
Pascal Puffke
bec7ffaf0a PixelPaint: Port to LibMain 2021-11-22 23:56:22 +01:00
Andreas Kling
c5c54f634e FileManager: Port to LibMain :^)
This simplifies a handful of calls to pledge() and sigaction().
2021-11-22 23:52:47 +01:00
Sam Atkins
97eb662e62 Browser: Scope bookmark actions so that they don't block the delete key
This fixes #10940.

Previously, all presses of the Delete key without a modifier in Browser
were uselessly consumed by the "Delete" action in the bookmark context
menu.
2021-11-22 23:48:10 +01:00
kleines Filmröllchen
b14a64b3c8 Piano: Move to LibDSP's Classic synthesizer
Almost all synthesizer code in Piano is removed in favor of the LibDSP
reimplementation.

This causes some issues that mainly have to do with the way Piano
currently handles talking to LibDSP. Additionally, the sampler is gone
for now and will be reintroduced with future work.
2021-11-22 22:26:17 +01:00
Ben Wiederhake
afc456edd6 PixelPaint: Use better-fitting image size
This makes the default image fit perfectly into the default viewport,
which means the first fit_image_to_view call will end up with a scale of
exactly 1. This scale level has no visual artifacts, which is the more
intuitive 'default' behavior.

Fixes #10975.
2021-11-22 22:14:53 +01:00
Ben Wiederhake
177478dadf PixelPaint: Add interactive zoom ComboBox to toolbar
Before, there was nothing that tells the user the current zoom level,
which is unknown after a 'fit to image' (the initial state).
2021-11-22 22:14:53 +01:00
Ben Wiederhake
9013d0fe38 PixelPaint: Add ability to fit to either width, height, or image 2021-11-22 22:14:53 +01:00
Ben Wiederhake
be697a440f PixelPaint: Allow setting ImageEditor scale and listening for changes 2021-11-22 22:14:53 +01:00
Ben Wiederhake
7f962cd9d3 PixelPaint: Floor effective viewport size to whole integers
We don't have fractional pixels available, so don't attempt to use them.
2021-11-22 22:14:53 +01:00
Pedro Pereira
272f7c340e 3DFileViewer: Port to LibMain
Simplified one pledge() and five unveil() by using TRY().
2021-11-22 21:56:04 +01:00
Andreas Kling
05e45bfdc5 Browser: Port to LibMain :^) 2021-11-22 19:47:14 +01:00
Andreas Kling
e388782f60 Terminal: Port to LibMain :^)
This simplifies a bunch of error handling and makes the main function
quite a bit shorter.

It will become shorter yet, as we get better at propagating errors. :^)
2021-11-22 19:28:31 +01:00
Tim Schumacher
8d5fb99703 CrashReporter: Show the available memory region information 2021-11-21 17:29:08 +00:00
Ben Wiederhake
69cbaac50a FontEditor: Make glyph parsing more robust
In particular, we sanity-check the received width, height, and buffer
size, before allocating.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
f22c0ffe0c LibGUI+Everywhere: Make sync requests to Clipboard server more obvious 2021-11-21 11:49:06 +00:00
Ben Wiederhake
81128c5100 Browser: Make paste access to Clipboard atomic
This avoids data race issues and saves a synchronous request to the
ClipboardServer.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
d29f094ffa FontEditor: Make paste access to Clipboard atomic
This avoids data race issues and saves three out of four synchronous
requests to the ClipboardServer.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
b6419f2cf2 LibGUI: Make clipboard-as-bitmap parsing less data-race-y
This encourages the caller to first fetch data and type atomically, and
then parse that, instead of potentially making multiple requests.
2021-11-21 11:49:06 +00:00
Jelle Raaijmakers
55526634b6 Piano: Use default sample rate in absence of audio device 2021-11-21 09:27:00 +01:00
Itamar
dd76ba2fe1 CrashReporter: Add "Inspect in Hack Studio" button
This allows the user to open the crash coredump in Hack Studio and
inspect it in the Debug tab.
2021-11-20 21:22:24 +00:00
Itamar
d6d48ce936 CrashReporter: Unlink coredump file on exit
Previously, when the --unlink flag was passed to CrashReporter, it
unlinked the coredump file immediately after reading it.

This change makes it so the coredump file is deleted when CrashReporter
exits.
2021-11-20 21:22:24 +00:00
Sam Atkins
dc3fa1c2e5 KeyboardSettings: Add icons
A calculator isn't the ideal icon for the Num-lock section, so hopefully
someone will produce a better one later.
2021-11-20 21:05:20 +00:00
Sam Atkins
c6099eca5c KeyboardSettings: Add text area to test the currently selected keymap
Right now, this is a bit of a hack. We can't set a keymap to only apply
to the test area, so we set the system keymap instead, while also
keeping track of the "real" current keymap. Whenever the settings are
applied, we update what that "real" keymap is, and when we exit, we
revert to that keymap.

Basically, it behaves as you would expect, apart from it also affecting
other applications you are typing in while the KeyboardSettings window
is open with a different keymap selected.
2021-11-20 21:05:20 +00:00
Sam Atkins
0a2b6b64c6 KeyboardSettings: Migrate to using SettingsWindow :^) 2021-11-20 21:05:20 +00:00
Sam Atkins
4bac30f737 KeyboardSettings: Migrate layout to GML
All other Settings applications use this, so let's match them!
2021-11-20 21:05:20 +00:00
Sam Atkins
1dd5c838cf DisplaySettings: Migrate to using SettingsWindow :^) 2021-11-20 21:05:20 +00:00