Commit graph

63 commits

Author SHA1 Message Date
Sam Atkins 8e9fb3766d FileManager: Add "Open in New Window" context menu action 2021-06-25 19:19:57 +02:00
Gunnar Beutner 631d36fd98 Everywhere: Add component declarations
This adds component declarations so that users can select to not build
certain parts of the OS.
2021-06-17 11:03:51 +02:00
Jelle Raaijmakers c247d7a662 Utilities: Change unzip -o option to -d
Other `unzip` implementations universally use `-d` to indicate the
output directory, so let's follow this convention.
2021-06-13 17:05:48 +01:00
Marcus Nilsson d5fa0ea60f FileManager: Save maximized window state on exit
When exiting FileManager in maximized state, save it and start in
maximized state on next launch.
2021-06-09 22:58:10 +02:00
Ali Mohammad Pur 51c2c69357 AK+Everywhere: Disallow constructing Functions from incompatible types
Previously, AK::Function would accept _any_ callable type, and try to
call it when called, first with the given set of arguments, then with
zero arguments, and if all of those failed, it would simply not call the
function and **return a value-constructed Out type**.
This lead to many, many, many hard to debug situations when someone
forgot a `const` in their lambda argument types, and many cases of
people taking zero arguments in their lambdas to ignore them.
This commit reworks the Function interface to not include any such
surprising behaviour, if your function instance is not callable with
the declared argument set of the Function, it can simply not be
assigned to that Function instance, end of story.
2021-06-06 00:27:30 +04:30
Jelle Raaijmakers 2c772d1848 LibGUI/AbstractView: Remove on_selection
Since the introduction of multi-select, we have had both `on_selection`
and `on_selection_change`, the latter of which was only invoked when a
change in selection came in through the model.

This removes `AbstractView::on_selection` and replaces it usage with
the more explicit `on_selection_change` everywhere.
2021-05-26 17:39:13 +04:30
Max Wipfli 229414b002 Applications: Use titlecase and distinct underlined characters in menus
This changes (context) menus across the system to conform to titlecase
capitalization and to not underline the same character twice (for
accessing actions with Alt).
2021-05-21 18:41:28 +01:00
Linus Groh 95a11d5737 FileManager: Change shortcut of Display Settings desktop option
'D' is already used by 'New Directory', let's use 'S'.

Fixes #7350.
2021-05-21 17:56:10 +01:00
Andreas Kling 31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00
Jelle Raaijmakers 55c3a5969c FileManager: Set minimum folder pane width 2021-05-13 00:43:41 +01:00
Andreas Kling a6a57830d0 FileManager: Reorganize main toolbar a little bit
Re-group things so they match the menus better.
2021-05-12 21:37:37 +02:00
Andreas Kling bed2356b11 FileManager: Reorganize menus a little bit
Move the common editing actions (cut/copy/paste/select-all) into a new
"Edit" menu. And move the "Open Terminal Here" action to the "Go" menu.
2021-05-12 21:32:54 +02:00
Ali Mohammad Pur a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Andreas Kling 4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Andreas Kling 3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling 7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
TheGeopard 2b78d90d04 FileManager: Unzip from context Menu
This adds a new context menu entry allowing you to extract ZIP archives
by invoking /bin/unzip
2021-04-25 18:40:42 +02:00
Andreas Kling b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Tobias Christiansen a8915ecd61 FileManager+FileOperation: Report Errors when doing an file operation
Report back errors from the FileOperation to the FileManager and
display them in the MessageBox
2021-04-20 12:02:01 +02:00
Tobias Christiansen 7d60164d93 FileManager: Don't crash on error in FileOperation
did_error() caused the program to crash since the DialogBox tried to
run its own Notifier with the same - now invalid because closed - fd.

In addition to setting the member that is the Notifier to nullptr we
also tell the Notifier that it is not enabled anymore.
2021-04-20 12:02:01 +02:00
Andreas Kling e98091ad15 FileManager: Show action status tips in the status bar :^) 2021-04-18 16:44:00 +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
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
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
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
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
Andreas Kling c6c0ec9403 FileManager: Add Alt shortcuts to menu actions 2021-04-09 17:08:49 +02:00
Andreas Kling ec1a72b759 FileManager: Set the default menu item in desktop context menus
This makes the "Run TextEditor" action show up in bold text as expected
when opening the context menu for TextEditor on the desktop. :^)
2021-04-06 17:55:47 +02:00
Andreas Kling 0652c2e4cc FileManager: Add Alt shortcuts for top-level menus 2021-04-05 23:15:43 +02:00
Andreas Kling 52de9b1753 LibGUI: Do AbstractView::set_column_hidden() => set_column_visible()
This API felt backwards, so let's change it.
2021-04-05 11:57:47 +02:00
Andreas Kling eff7ea5b84 LibGUI: Add GUI::CommonActions::make_properties_action()
Many apps want a "Properties" action with the same icon and shortcut.
2021-04-04 22:43:43 +02:00
Federico Guerinoni 49a062f81d LibGUI: Show human readable size in filemanager
The size is visible only in TableView mode of the filemanager.
2021-03-26 22:59:09 +01:00
Andreas Kling 78b12e1521 Userland: Turn all application menus into window menus :^) 2021-03-25 22:14:09 +01:00
David Isaksson 3f9ac88c6e PropertiesWindow: Show the file size in a human readable format 2021-03-25 10:59:11 +01:00
Vyacheslav Pukhanov 4b99dbe644 FileManager: Accept TreeView drop event 2021-03-11 18:54:52 +01:00
Linus Groh a0362d827c FileManager: Disable view change actions when directory is unreadable
Closes #3556.
2021-03-07 16:19:36 +01:00
speles 0071742a5a FileManager: Use ArgsParser, handle more options
This adds 2 more flags, that help with the "select on start" invocation.
-s - makes us open the parent directory of the entry, and select it.
-r - makes FileManager to skip real path resolution for cases when we
     want to select the symlink in parent directory.

Also, if the file path is passed as argument, not it will open parent
with the file selected.
2021-03-07 11:00:36 +01:00
speles 6e16a5cdfa Applications: Open folder with pre-selected file where appropriate :^) 2021-03-07 11:00:36 +01:00
Zac 6d68ae45b4 FileManager: Add launch handler actions to desktop context menu
Extracted a method from the code in the File Manager application which
added actions for activating launch handlers found for the selected
file from the context menu. Applied this method to desktop files
and shortcuts.

Note: made some launch handler related methods in the DirectoryView
static or const which allows passing const DirectoryView& to certain
methods.
2021-03-03 21:53:01 +01:00
speles 0b5ca28475 FileManager: Focus on file when opening file's location from Properties 2021-03-01 11:16:18 +01:00
speles e964d238b8 FileManager+LaunchServer: Add launching FileManager with focus on file 2021-03-01 11:16:18 +01:00
Linus Groh e265054c12 Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes
This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
2021-02-26 16:59:56 +01:00
Morc - Richard Gráčik edf9d07d3f FileManager: change icon for Show in File Manager
A small detail to match with the new File Manager icon in context menu. :^)
2021-02-25 08:50:25 +01:00
thankyouverycool 42717b5b79 Base: Add new icons for fonts and File Manager 2021-02-25 08:08:26 +01:00
Andreas Kling 5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00