Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HexEditor+LibGUI: Initial version of HexEditor, LibGUI bug fix #649

Merged
merged 2 commits into from Oct 13, 2019

Conversation

xeons
Copy link
Member

@xeons xeons commented Oct 12, 2019

Initial version of Hex Editor

I was encountering an entire system crash when the window server attempted to do something with the shortcut text on a submenu. This bug only seemed to appear when I had a lone submenu inside of a menu.

Also fixed a bug with the save dialog involving references.

@xeons xeons force-pushed the application-hex-editor branch 2 times, most recently from a42a90e to 3f1f18e Compare October 12, 2019 21:37
Copy link
Member

@awesomekling awesomekling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking very cool, lemme just nitpick a little bit.

First off, please wrap commit messages at 72 characters.

@@ -113,6 +113,11 @@ int GMenu::realize_menu()
request.menu.enabled = true;
request.menu.checkable = false;
request.menu.checked = false;

// no shortcut on submenu, make sure this is cleared out
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a useful fix, but please make it in a separate commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got this broken out now.

@@ -30,10 +30,10 @@ Optional<String> GFilePicker::get_open_filepath()

Optional<String> GFilePicker::get_save_filepath(const String& title, const String& extension)
{
GFilePicker picker(Mode::Save, String::format("%s.%s", title.characters(), extension.characters()));
auto picker = GFilePicker::construct(Mode::Save, String::format("%s.%s", title.characters(), extension.characters()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already fixed in LibGUI, please rebase on top of master. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, fixed now.

#include <LibDraw/TextAlignment.h>
#include <LibGUI/GScrollableWidget.h>

class GHexEditor : public GScrollableWidget {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The G prefix is generally used for classes in LibGUI. Since this class is outside LibGUI, you can just call it HexEditor or something like that instead.

I was encountering an entire system crash when the window server
attempted to do something with the shortcut text on a submenu. This
bug only seemed to appear when I had a lone submenu inside of a menu.
The very first release of the Hex Editor for Serenity.
@xeons xeons changed the title HexEditor+LibGUI: Initial version of HexEditor, LibGUI bug fixes HexEditor+LibGUI: Initial version of HexEditor, LibGUI bug fix Oct 12, 2019
@awesomekling
Copy link
Member

Delightful 😄

@awesomekling awesomekling merged commit 48ef1d1 into SerenityOS:master Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants