Commit Graph

180 Commits

Author SHA1 Message Date
ominusliticus
ae16cfff0f HackStudio: Remove release_values_but_fixme_should_propogate_errorss
There were a total of 20 fixmes that were removed. This required me to
create a `initialize_all()` function for the HackStudioWidget class
that could actually propagate the errors forward to the Serenity::Main
function for the HackStudio application.

All the fixmes dealt with loading icons for the various actions
possible.
This should not be a failure that keeps HackStudio from running, but
currently, if the icons cannot be loaded HackStudio fails to open.
2022-12-26 04:57:02 +03:30
Aayush
bc1293925a Hackstudio: Use `GUI::TextEditor' actions for cut/copy/paste buttons
This fixes a bug where hackstudio's language server will crash upon
clicking the 'cut' button when no text is selected.  This was because
the actions were not disabled on empty selection.

We now disable the actions depending on if there is empty selection
inside current tab. We update the cut/copy/paste buttons' actions when
changing tabs.
2022-12-25 15:40:46 +01:00
Karol Kosek
b67762a7f3 HackStudio: Make a new ProjectBuilder object when opening a project
We couldn't compile a project after creating it, because the project
builder was still holding a reference to the previous freed project.

Fixes: #15715
2022-12-23 23:27:45 +01:00
Karol Kosek
98fa3736ed HackStudio: Open projects after the action tab was created
This change also removes the path argument from the GitWidget
constructor because otherwise, the app wouldn't work now, as it doesn't
yet know the project path.

But it'll be set right away in open_project(), so nothing's lost. :^)
2022-12-23 23:27:45 +01:00
Tim Schumacher
9805f73704 LibCore: Remove the force parameter from File::remove
About half of the usages were not using `force` anyways, and the other
half presumably just got confused about what "force" really means in
this context (which is "ignore nonexistent files").

The only 'legitimate' user, which is `rm`, instead now handles this
completely internally instead.
2022-12-23 10:38:14 -05:00
Tim Schumacher
355e761a02 LibCore: Let File::remove return a normal ErrorOr
Having the file path in there is nice, but it makes us incompatible with
comfortable error propagation in everything that isn't File::remove.
2022-12-23 10:38:14 -05:00
Karol Kosek
ba60b01026 HackStudio: Fix typo in one error message
A regression from 4784ad66b2. oops.
2022-12-21 19:05:13 +00:00
Karol Kosek
4784ad66b2 HackStudio: Port to Core::Stream::File :^) 2022-12-20 10:58:54 +01:00
Baitinq
4c732abed5 HackStudio: Add a factory function for DebugInfoWidget
Thanks to this patch we now do error propagation in the DebugInfoWidget
creation and as a result we get rid of 4 FIXMEs :)
2022-12-16 09:58:51 +01:00
Baitinq
55a903911b HackStudio: Add a factory function for HackStudioWidget
This will allow us to handle errors while creating the HackStudioWidget.

(tip: check next commit :^)
2022-12-16 09:58:51 +01:00
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Filiph Sandström
4a766245fa HackStudio: Replace blank file when opening a new one
Before this we just added a new tab and left the `(Untitled)` tab in the
background. Now we instead check that it hasn't been modified and that
it's empty; if both these conditions are true we replace the blank
editor with the newly opened one.
2022-11-30 12:36:54 +00:00
thankyouverycool
ed196fc265 HackStudio: Remove FindWidget
HackStudio editors now have built-in incremental search
2022-11-29 15:39:13 +00:00
demostanis
34acae90c7 Userland: Let applications make use of make_command_palette_action() 2022-10-25 10:21:18 +01:00
Timothy Slater
eb9db167da HackStudio: Set proper action scope for editor shortcuts
This fixes issue #14429. The editor actions were not given a parent as
scope so defaulted to global. Because HackStudio can have multiple
editors and even multiple editor tab widgets, I chose the
VerticalSplitter that all editor tab widgets get added to as the parent.
With a Widget set as the parent, the action gets WidgetLocal scope and
allows the embedded terminals to receive shortcuts.

Thanks to Andreas for doing a quick look at this and pointing in the
right direction during an Office Hours stream :)
2022-10-11 11:12:41 +02:00
Marco Cutecchia
41744a4a87 HackStudio: Prevent closing the last editor group
Previously if the user closed the last open tab in the last TabWidget
then the open file action would stop working until they explicitly
went to the View menu and added a new editor group.

Before this commit there was an attempt at preventing the user to
close the last open tab by hiding its close button, this didn't
account for the many other ways one could close it though.
2022-10-06 11:53:23 +01:00
Marco Cutecchia
f81b494182 HackStudio: Remove the 'Open in a new tab' action
This has become the default with the previous changes so it
doesn't make sense anymore
2022-10-06 11:53:23 +01:00
Marco Cutecchia
d8b54b7dd0 HackStudio: Open files in dedicated tabs
Previously when trying to open a file from the tree view the file
would open in the currently selected tab, substituting the file
we were previously reading.
This change makes it so that clicking on a file from the tree view
opens it in a new tab, or selects the tab containing that file if
it's already open in the selected editor group.
2022-10-06 11:53:23 +01:00
networkException
4230dbbb21 AK+Everywhere: Replace "protocol" with "scheme" url helpers
URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-29 09:39:04 +01:00
Brian Gianforcaro
d0a1775369 Everywhere: Fix a variety of typos
Spelling fixes found by `codespell`.
2022-09-14 04:46:49 +00:00
Skye Sprung
4370e8f80a HackStudio: Warn of unsaved changes before making a new project
Before, the warning dialog would be opened after the NewProjectDialog,
leading to focus-fighting by the two windows. This fixes that and makes
the action more consistent with the standard serenity way of handling
unsaved changes by asking before the NewProjectDialog is brought up.
The way this is achieved avoids having to rewrite open_project as well.
2022-08-31 15:21:03 +01:00
thankyouverycool
cce9172cd4 Applications+DevTools: Remove fixed sizes from Splitters
And adjust some GML properties. Since a808cfa, splitters grow
opportunistically. Setting them to fixed sizes now quite literally
fixes them in place. Fixes immovable splitters missed in the
aforementioned commit.
2022-08-30 16:28:44 +01:00
Junior Rantila
9c42a75381 HackStudio: Add fullscreen shortcut 2022-08-10 08:42:53 +01:00
sin-ack
c8585b77d2 Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).

No functional changes.
2022-07-12 23:11:35 +02:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
ferhatgec
b56282d4b2 DevTools/HackStudio: Fix 'enabled' property of 'build' and 'run' buttons 2022-07-12 11:56:23 +01:00
Yuval
bd74db157a HackStudio: Add the "Copy Full Path" TreeView context menu option
This commit adds support for the option described above.
The option can be seen after a right click on a TreeView item,
and it puts the item's full path in the clipboard.
2022-07-08 11:20:05 +01:00
Yuval
4ef0433be1 HackStudio: Add the "Copy Relative Path" TreeView context menu option
This commit adds support for the option described above.
The option can be seen after a right click on a TreeView item,
and it puts the item's relative path in the clipboard (relative
to the project's root directory).
2022-07-08 11:20:05 +01:00
Lennon Donaghy
c1b0931d2e HackStudio: Properly clear previous editor tabs when closing project
Before this commit the close tab button, which is meant to only
show when more than one tab is open, would be present on the tab
of a new project opened after the first project.

This was due to m_all_editor_tab_widgets not being cleared when closing
the first project. This is now cleared when close_current_project() is
called.
2022-06-30 14:38:09 +01:00
Lennon Donaghy
d2aafe58c9 HackStudio: Leave one editor tab open on closing project 2022-06-30 14:38:09 +01:00
FrHun
8dd08d47f1 Applications: Remove usages of deprecated implicit conversions
These deprecated conversions are currently in place to make the system
compile, but they are to be removed soon. This prepares that.
2022-06-28 17:52:42 +01:00
hhsdev
3f230a638d HackStudio: Add "Open in New Tab" context menu entry
This action creates a new editor tab and opens the selected file in the
newly created tab.
2022-06-16 12:55:14 +01:00
Sam Atkins
cdffe556c8 LibGUI+Userland: Make Dialog::ExecResult an enum class 2022-05-13 16:27:43 +02:00
timre13
14751a4122 HackStudio: Update window close button on document change 2022-04-27 00:49:54 -07:00
Marco Cutecchia
ccc3da4ee1 HackStudio: Remember if the user wants to see dotfiles between sessions 2022-04-15 00:15:04 +02:00
Marco Cutecchia
a7ba8677cd HackStudio: Add a "Project Configuration" button in the Edit menu 2022-04-15 00:15:04 +02:00
Simon Wanner
206d6ece55 LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Itamar
d9d299f884 HackStudio: Add FindWidget
The find widget appears on Ctrl+F.

It uses the GUI::TextEditor search API to search for text, which also
takes care of highlighting the search results.
2022-03-29 17:45:36 +02:00
ry-sev
23643cf21b HackStudio: Move editors inside tab widgets
This will move the editors inside a tab widget and the user
will be able to add new editors as tabs as well as add new
tab widgets. The user will be able to easily switch between
editors as well as the tab widgets.
2022-03-16 14:36:46 +01:00
Lucas CHOLLET
6f29ccaa5a HackStudio: Remove Terminal widget when the bound shell process dies
This feature allows the terminal widget to be automatically closed when
typing `exit` inside the shell.
2022-03-14 23:43:36 +01:00
electrikmilk
ad71008d6f HackStudio: Add more files to new file menu
Add Python, Java, C, PHP, Wasm, INI, JSON, and Markdown files to new
file menu.
2022-03-08 22:42:40 +01:00
electrikmilk
cd4b732acd HackStudio: Add missing key triggers
Add key triggers that are missing, primarily from the 'New..' menu.
2022-03-08 22:42:40 +01:00
electrikmilk
7fe0e7b46b HackStudio: Move 'New' Menu to 'File'
Currently we have a 'Project' menu with a 'New' menu in it, this tries
to organize things by just having one 'New...' sub-menu in the 'File'
menu that creates new files, projects and directories.

To solve conflicts, move 'Semantic Highlighting' to the 'View' menu.

As a result of both of these changes, remove 'Project' menu.
2022-03-08 22:42:40 +01:00
Lucas CHOLLET
9a83d34543 HackStudio: Propagate error from TerminalWrapper
Use the ErrorOr pattern with the Core::System wrappers to propagate more
errors from the TerminalWrapper.

The run_command method, when called with WaitForExit::Yes now returns an
error on command failure.
2022-03-02 18:08:05 +01:00
xSlendiX
f0ac1bcaf8 HackStudio: Add icon to "Open Recent"
This commit adds the newly added "open-recent" icon to HackStudio.
2022-03-01 21:20:11 +00:00
thankyouverycool
77c4b20157 HackStudio: Segment the status bar and setup override text 2022-02-24 19:09:41 +01:00
thankyouverycool
653f01616c LibGUI+Apps: Adjust Splitter spacings
Different thread highlights between widgets lead to different
visual weights between splitters, even when they have the same
width or height. This means some splitters look best at odd
sizes while others even. This sets the default spacing to the
most commonly used, depending on orientation, and adjusts
spacing for a few apps based on the new paint rect.

The most consistent look across apps requires some manual
tweaking occassionally. Knurlheads, use your discretion!
2022-02-23 18:56:22 +02:00
thankyouverycool
fe864af0dc LibGUI+Apps: Prevent Splitter children from being unresizable
Splitters could be resized in such an order that all their remaining
children were fixed size, leading to unfillable gaps on resize events.

HackStudio and TextEditor already had logic to handle this edge case,
so this patch factors it into a general solution for all Splitters.
At least one widget is now guaranteed to be resizeable after a child
is removed.
2022-02-23 18:56:22 +02:00