Commit Graph

151 Commits

Author SHA1 Message Date
Simon Danner
0787571192 Filemanager: Only enable rename if available 2022-02-19 11:35:53 +01:00
Lenny Maiorani
160bda7228 Applications: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-14 22:06:55 +00:00
James Puleo
a0e7a4b9a8 WindowServer+Userland: Pass wallpapers as Gfx::Bitmap instead of path
The WindowServer _really_ does not need to know the filesystem path to
it's wallpaper, and allows setting arbitrary wallpapers (those outside
of `/res/wallpapers`).

The GUI::Desktop will keep track of the path to the wallpaper (if any),
and save it to config if desired (to be persisted).

This avoids the need to `unveil` paths to the wallpaper, fixing #11158
2022-02-14 16:38:42 +03:30
Idan Horowitz
c8ab45e79f Userland: Run gml-format
This brings the existing GML files up to spec with the new requirements
2022-02-13 02:36:35 +02:00
Aatos Majava
c23d25d1de FileManager: Add F6 alternate shortcut to "location" action
This mirrors the behaviour in Browser.
2022-02-12 09:06:23 -05:00
kleines Filmröllchen
6ee597369d Meta+Userland: Run the GML formatter on CI and pre-commit
Now that the GML formatter is both perserving comments and also mostly
agrees to the existing GML style, it can be used to auto-format all the
GML files in the system. This commit does not only contain the scripts
for running the formatting on CI and the pre-commit hook, but also
initially formats all the existing GML files so that the hook is
successfull.
2022-02-07 18:39:50 +01:00
Jason
cdcf097aa8 FileManager: Add an animation for deleting files 2022-02-05 19:57:45 +00:00
Sam Atkins
6b0c4908df FileManager: Don't show command palette for the desktop 2022-02-03 23:28:56 +01:00
Sam Atkins
a4cb6a49ae FileManager: Disable "View as..." actions for desktop DirectoryView
This stops these actions from being activated with Ctrl+[1,2,3] or the
command palette.. Switching to table or columns view would just hide
all the icons, so let's not make those options available.
2022-02-03 23:28:56 +01: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
080b054695 FileManager: Display times in the user's local time zone 2022-01-28 12:25:20 +00: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
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
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
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
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
Sam Atkins
3ca2aee054 Applications: Cast unused smart-pointer TRY return values to void 2021-12-05 15:31:03 +01:00
Brian Gianforcaro
cf4fa936be Everywhere: Use default execpromises argument for Core::System::pledge 2021-11-28 08:04:57 +01:00
Andreas Kling
bc2ee02ce0 FileManager: Use TRY() a lot more in the main functions :^) 2021-11-24 23:07:31 +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
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
Ben Wiederhake
f22c0ffe0c LibGUI+Everywhere: Make sync requests to Clipboard server more obvious 2021-11-21 11:49:06 +00:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Andreas Kling
4a2b718ba2 LibCore: Use ErrorOr<T> for Core::File::copy_file() 2021-11-08 00:35:27 +01:00
Andreas Kling
235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
FrHun
8249ea792e LibGUI+FileManager: Clarify Widget margins name
Even though they are called content_margins,
they are actually only ever used to determine where
a Widget is supposed to be grabbable.
So all methods and members are renamed accordingly.
2021-11-03 16:13:19 +01:00
Mustafa Quraish
fdfc0d1bac FileManager: Listen for changes to Desktop wallpaper in config
Since there's no global API for being able to just assign a callback
function to config changes, I've made an inline struct in desktop
mode with the sole purpose of checking to see if the Wallpaper
entry has changed, and then updates GUI::Desktop.

It's pretty neat seeing the wallpaper change as soon as you edit the
config file :^)
2021-10-10 01:15:34 -07:00
Tetsui Ohkubo
eb326db028 FileOperation: Deduplicate destination file names on copy
When there is a file with the same name in the destination directory,
FileManager overwrites that file without any warning. With this change,
such a file will be automatically renamed to "emoji-2.txt", for example.

Also, currently there is a check in FileManager that makes copy and
paste of a file in the same directory no-op. This change removes that
check, because it is no longer a problem.
2021-09-13 18:08:34 +04:30
Sam Atkins
e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Musab Kılıç
432839c2e9 FileManager: Kindly ask the user if they want to delete a file 2021-09-02 23:52:29 +02:00
Andreas Kling
a5992a4ef8 FileManager: Tweak layout spacing in file properties window
There wasn't enough vertical spacing between the TabWidget and the three
(Ok/Cancel/Apply) buttons at the bottom.
2021-08-31 02:43:50 +02:00
Andreas Kling
6cb536daa8 FileManager: Hide the Inode and Symlink Target columns in TableView
These are not generally interesting, so let's hide them by default.
The user can re-enable them if they want.
2021-08-31 01:35:09 +02:00
Andreas Kling
887ab3cc9a LibGUI: Rename FileSystemModel's "Owner" column to "User"
A file is owned by a User+Group, not an Owner+Group.
2021-08-31 01:35:08 +02:00
Karol Kosek
1700b6d113 FileManager: Remove tree_view_directory_context_menu
It isn't used anywhere and the tree view shows only directories
(and that is covered by the tree_view_directory_context_menu).
2021-08-31 00:46:43 +02:00
Karol Kosek
7d6308523a FileManager: Add 'Open in Terminal' action for selected dirs on desktop
This is to be more similar to the context menu from the windowed
instance of File Manager.
2021-08-31 00:46:43 +02:00
Karol Kosek
dd75ed0c5e FileManager: Add default 'Open' action in context menu for directories
This makes the directory context menu more similar to the file context
menu.
2021-08-31 00:46:43 +02:00
Karol Kosek
7cf5904124 FileManager: Place mkdir and touch actions below openings in tree view
This way, the Properties action will always be everywhere on bottom.
2021-08-31 00:46:43 +02:00
Karol Kosek
d184e5327a FileManager: Put file launch actions first
The default action (shown in bold) indicates what would you get
by double-clicking on file.  Since it's a default option, I think it
deserves to be on top (together with alternative launch options). :^)

Also they're not task actions like "Extract .zip here" or "Add to
bookmarks".
2021-08-31 00:46:43 +02:00
Andreas Kling
7b62113db7 FileManager: Report errors from chdir(), if any 2021-08-26 23:41:38 +02:00
Andreas Kling
696dbc889f FileManager: Make DirectoryView listen for configuration changes
DirectoryView now inherits from Config::Listener and will update its
view mode immediately if changed from elsewhere.

This is pretty neat. :^)
2021-08-26 23:41:38 +02:00
Andreas Kling
c8c58626e9 FileManager: Move "View as ViewType" actions into DirectoryView
Let DirectoryView manage these actions itself. This matches what we
already do for a bunch of other actions, and prepares for the next
patch which will add Config::Listener to the mix.
2021-08-26 23:41:38 +02:00
TheFightingCatfish
d2af27d2d0 FileManager: Change the cwd when opening a directory
The `open()` function of DirectoryView should change the current working
directory, so that the "Go to Location" menu item can process relative
paths correctly. Update other functions in DirectoryView to use `open()`
when opening a directory.
2021-08-26 22:02:15 +02:00
TheFightingCatfish
ce66c40160 FileManager: Remove "on activation" debug spam 2021-08-26 22:02:15 +02:00
Andy Jansson
bb399c6955 FileManager: Change read_i32 call to read_bool
The FileManager/Window/Maximized flag was incorrectly read from the
ConfigServer using read_i32 instead of the intended read_bool function
call.

It is now being read with the correct type :^)
2021-08-26 12:05:51 +02:00
Andreas Kling
1a0a35f4b8 FileManager: Use Config::pledge_domains() 2021-08-26 00:54:28 +02:00
Andreas Kling
39d9373bca FileManager: Use LibConfig instead of Core::ConfigFile :^) 2021-08-26 00:54:27 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00