Commit Graph

304 Commits

Author SHA1 Message Date
Andreas Kling
a2086ad56e LibGUI: Rename Action::long_text to Action::status_tip
This feels a bit more descriptive.
2021-04-18 10:58:22 +02:00
Linus Groh
2b0c361d04 Everywhere: Fix a bunch of typos 2021-04-18 10:30:03 +02:00
Linus Groh
0d4912826b FileManager: Pluralize empty selection statusbar message properly
"item(s)" is silly, we can be more specific. :^)
2021-04-18 00:48:07 +02:00
Andreas Kling
f07efa1640 Run: Put the window in the bottom left of the desktop
This makes a lot more sense now that it's spawned by the start button.
2021-04-17 23:27:00 +02:00
Idan Horowitz
47dba83d30 Browser: Display full UserAgent string in status bar on menu hover
This uses the new on_action_enter & on_action_leave APIs to display
the full useragent string when hovering over one of the useragent
spoof menu options.
2021-04-17 22:35:13 +02:00
Andreas Kling
e67f392576 TextEditor: Show action long texts in the status bar :^)
We now display a description of the currently hovered action in the
text editor application's status bar. This is pretty cool! :^)

This is currentl achieved via the hooks on GUI::Application. Longer
term we'll probably want to find a more flexible abstraction for this,
since not all applications will be as simple as TextEditor.
2021-04-17 20:49:53 +02:00
Leandro Pereira
602f98fe67 FileManager: Estimate transfer time
Use the total bytes transferred count to estimate the time left
for the copy operation to finish.  With the estimate label, the
two progress bars were deemed superfluous, so the only remaining
progress bar is the overall copy progress, that is updated more
frequently.  (The same progress is also shown in the task bar,
so you can minimize the window and still be informed of the
progress.)
2021-04-17 09:41:35 +02:00
Leandro Pereira
8d25290198 FileManager: Show file copying animation
Bring some mid-90s charm and show a file flying animation while copying
files.  Icons for both source and destination directories are currently
the default icons, but in the future they could be the respective icons
for the destination directory.
2021-04-17 09:41:35 +02:00
Andreas Kling
0528dc9b87 FileManager: Make DirectoryView API's take String instead of StringView 2021-04-17 01:27:30 +02:00
Hendiadyoin1
6c618eb072 HexEditor: Use debgln_if 2021-04-16 20:03:35 +02:00
Jagger De Leo
2976311536 PixelPaint: Add keyboard zoom shortcuts
You can now use Ctrl+= and Ctrl+- to zoom in and out.
2021-04-16 19:57:28 +02:00
Jagger De Leo
b48b8c372e PixelPaint: Add Zoom Reset button to new View Menubar.
If you lose your image while panning and zooming around, it is handy to
have a reset function to get back home. :^)
2021-04-16 19:57:28 +02:00
Timothy Flynn
2381b19719 Browser+LibWeb+WebContent: Parse cookies in the OOP tab
To protect the main Browser process against nefarious cookies, parse the
cookies out-of-process and then send the parsed result over IPC to the
main process. This way, if the cookie parser blows up, only that tab
will be affected.
2021-04-16 19:19:31 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
Andreas Kling
4316e817db Welcome: Fix build breakage 2021-04-15 21:00:55 +02:00
Nicholas-Baron
c4ede38542 Everything: Add -Wnon-virtual-dtor flag
This flag warns on classes which have `virtual` functions but do not
have a `virtual` destructor.

This patch adds both the flag and missing destructors. The access level
of the destructors was determined by a two rules of thumb:
1. A destructor should have a similar or lower access level to that of a
   constructor.
2. Having a `private` destructor implicitly deletes the default
   constructor, which is probably undesirable for "interface" types
   (classes with only virtual functions and no data).

In short, most of the added destructors are `protected`, unless the
compiler complained about access.
2021-04-15 20:57:13 +02:00
Andreas Kling
9f4e37e342 Applications: Rename Serendipity => Welcome
Let's stick to the theme of "the most obvious name possible"
2021-04-15 20:50:24 +02:00
Timothy Flynn
5c6aa408ed Browser: Implement spec-compliant cookie retrieval
https://tools.ietf.org/html/rfc6265#section-5.4
2021-04-15 09:46:49 +02:00
Idan Horowitz
bc9cd55da4 Browser+LibWeb: Add support for spoofing the browser user agent
This is helpful when testing certain sites like twitter.com which
display differently based on the user agent.
2021-04-14 23:06:32 +02:00
Timothy Flynn
858ba11aef Browser: Respect the HttpOnly flag when storing cookies 2021-04-14 16:07:46 +02:00
Timothy Flynn
c00760c5f9 Browser+LibWeb+WebContent: Track the source of document.cookie requests
To implement the HttpOnly attribute, the CookieJar needs to know where a
request originated from. Namely, it needs to distinguish between HTTP /
non-HTTP (i.e. JavaScript) requests. When the HttpOnly attribute is set,
requests from JavaScript are to be blocked.
2021-04-14 16:07:46 +02:00
Timothy Flynn
7193e518d1 Browser+LibWeb: Move the cookie structure into LibWeb 2021-04-14 16:07:46 +02:00
Timothy Flynn
c2d38abe6f Browser+LibWeb: Move cookie parser into LibWeb
This moves the cookie parsing steps out of CookieJar into their own file
inside LibWeb. It makes sense for the cookie structures to be in LibWeb
for a couple reasons:

1. There are some steps in the spec that will need to partially happen
   from LibWeb, such as the HttpOnly attribute.
2. Parsing the cookie string will be safer if it happens in the OOP tab
   rather than the main Browser process. Then if the parser blows up due
   to a malformed cookie, only that tab will be affected.
3. Cookies in general are a Web concept not specific to a browser.
2021-04-14 16:07:46 +02:00
Timothy Flynn
cc7c86fdf4 Browser: Remove expired cookies from the CookieJar
The spec doesn't have any exact steps here, it just notes:

     The user agent MUST evict all expired cookies from the cookie store
     if, at any time, an expired cookie exists in the cookie store.

Here, we implement "at any time" as "when a cookie is retrieved or
stored".
2021-04-13 21:59:30 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Timothy Flynn
86bdfa1edf Browser: Implement spec-compliant cookie storage
https://tools.ietf.org/html/rfc6265#section-5.3

This includes a bit of an update to how cookies are first parsed. The
storage spec requires some extra information from the parsing steps than
just the actual values that were parsed. For example, it needs to know
whether Max-Age or Expires (or both) were specified to give precedence
to Max-Age. To accommodate this, the parser now uses an intermediate
struct for storing this information. The final Cookie struct is not
created until the storage steps.

The storage itself is also updated to be keyed by a combo of the cookie
name, domain, and path.

Retrieving cookies was updated to use the spec's domain-matching
algorithm, but otherwise is not written to the spec yet. This also does
not handle evicting expired cookies yet.
2021-04-13 15:52:50 +02:00
Andreas Kling
bf1ef6533c FileManager+FileOperation: Show byte progress of current file
What I meant for the GUI progress bars to show:

- Bytes copied of the current file
- Files copied of the total set

What it actually showed:

- Bytes copied of the total bytes
- Files copied of the total set

This patch fixes it by showing byte progress of the current file
instead of byte progress of total bytes.
2021-04-13 10:12:50 +02:00
Andreas Kling
a5420ee3d0 FileManager: Use a Core::File for the FileOperation pipes
Instead of popen()/pclose(), we now open the pipes manually and wrap
them in a friendly Core::File object.
2021-04-13 10:12:50 +02:00
Andreas Kling
f54e290548 FileManager: Use FileOperation to perform drag&drop copy out-of-process
And display the progress of the copy operation in a separate window. :^)

Note that this patch only updates the drag&drop code path to use the new
mechanism. We still have to go through FileManager and make use of this
everywhere.

We also need to support additional operations, like Move, Delete, etc.

Still, this is quite cool! :^)
2021-04-13 10:12:50 +02:00
Timothy Flynn
d363ed8872 Browser: Change value of "the latest representable date" for cookies
Setting the year to NumericLimits<unsigned>::max() resulted in the
following datetime: -2-12-31 00:00:00.

Instead, set the latest datetime to the last second of the year 9999.
2021-04-12 22:37:00 +02:00
Timothy Flynn
5496d71e4a Browser: Add debug command to dump cookies
Using document.cookie only lets the test page see the name/value pair;
the value returned will not included the parsed attributes.
2021-04-12 22:37:00 +02:00
Timothy Flynn
cab2e2dded Browser: Process Expires cookie attribute 2021-04-12 22:37:00 +02:00
Linus Groh
da177c6517 LibJS: Make Errors fully spec compliant
The previous handling of the name and message properties specifically
was breaking websites that created their own error types and relied on
the error prototype working correctly - not assuming an JS::Error this
object, that is.

The way it works now, and it is supposed to work, is:

- Error.prototype.name and Error.prototype.message just have initial
  string values and are no longer getters/setters
- When constructing an error with a message, we create a regular
  property on the newly created object, so a lookup of the message
  property will either get it from the object directly or go though the
  prototype chain
- Internal m_name/m_message properties are no longer needed and removed

This makes printing errors slightly more complicated, as we can no
longer rely on the (safe) internal properties, and cannot trust a
property lookup either - get_without_side_effects() is used to solve
this, it's not perfect but something we can revisit later.

I did some refactoring along the way, there was some really old stuff in
there - accessing vm.call_frame().arguments[0] is not something we (have
to) do anymore :^)

Fixes #6245.
2021-04-12 09:38:57 +02:00
Timothy Flynn
e0f9ed01c7 Browser: Process Secure and HttpOnly cookie attributes 2021-04-12 08:57:44 +02:00
Timothy Flynn
db24186309 Browser: Process Path cookie attribute 2021-04-12 08:57:44 +02:00
Timothy Flynn
3d53af354e Browser: Process Domain cookie attribute 2021-04-12 08:57:44 +02:00
Timothy Flynn
a554676008 Browser: Process Max-Age cookie attribute
Note: the default expiry time should be the "the latest representable
date". However, DateTime::from_timestamp(NumericLimits<time_t>::max())
isn't feasible due to the for-loops in LibC's time_to_tm. So instead,
this just sets the date to the maxium year.
2021-04-12 08:57:44 +02:00
Timothy Flynn
d610aeb5da Browser: Parse cookie attribute name-value pairs
Implements the remainder of the parsing algorithm of RFC-6265 Section
5.2 to extract optional attributes. The attribute values are not
processed.
2021-04-12 08:57:44 +02:00
thankyouverycool
198c4fd7f2 Serendipity: Paint theme agnostic banner
And remove temporary welcome-banner.png. Fixes invisible text in
dark themes.
2021-04-12 08:56:06 +02:00
thankyouverycool
1de4ed8ca1 Serendipity: Don't modify tip frame palette
Fixes illegible tip text
2021-04-12 08:56:06 +02:00
Timothy Flynn
e54837add5 Browser+LibWeb: Add hooks for getting and setting cookies 2021-04-11 18:24:34 +02:00
Timothy Flynn
f0cdb2bf50 Browser: Initial cookie storage implementation
This adds storage for cookies that maye be set via 'document.cookie' in
JavaScript or the Set-Cookie HTTP header. For now, it parses only the
name-value pair from a set-cookie line, but does not parse optional
attributes.

Currently, storage is ephemeral and only survives for the lifetime of
the Browser instance.
2021-04-11 18:24:34 +02:00
Andreas Kling
e43fba0c58 SystemMonitor: Add tab with detailed state to process properties window
This is done using a wrapper model that transforms all the information
about a single process in the ProcessModel and turns it into a 2-column
table model with only that process in it.
2021-04-11 13:24:59 +02:00
Andreas Kling
a78ea2c0b2 SystemMonitor: Add a little header to the process properties window
Show a larger (32x32) version of the executable icon and the process
name + PID above the various property tabs.
2021-04-11 12:52:42 +02:00
Andreas Kling
1c52dc86ee SystemMonitor: Simplify executable icon lookup in ProcessModel 2021-04-11 12:52:42 +02:00
Andreas Kling
251018676f Everywhere: Update references from ReadMe.md => README.md 2021-04-11 10:52:25 +02:00
Gunnar Beutner
8ca5b8c065 LibC: Move S_* defines into <fcntl.h>
According to the Single UNIX Specification, Version 2 that's where
those macros should be defined. This fixes the libiconv port.

This also fixes some (but not all) build errors for the diffutils and nano ports.
2021-04-11 09:51:20 +02:00
thankyouverycool
07627b3742 FontEditor: Add 'New Font' wizard to editor
Take a comfy guided tour through new font creation.
2021-04-11 01:16:34 +02:00
thankyouverycool
cdfa2614b9 FontEditor: Move menu bar into editor and tweak several widgets
Actions are now shared between menu bar and toolbar. Adds an edit
menu to complement toolbar actions. Glyphs are now passed as ints
instead of u8s; fixes Latin Extended+ glyphs failing to update in
real time on map. Converts weight and type to more human-readable
combo box lists. Selected glyph now scrolls into view on load.
2021-04-11 01:16:34 +02:00
Andreas Kling
6f5f9e6567 Calendar: Alt shortcuts and book title capitalization in menus 2021-04-10 16:11:48 +02:00