This patch adds GUI::Action::create_checkable() helpers that work just
like the existing create() helpers, but the actions become checkable(!)
Clients are no longer required to manage the checked state of their
actions manually, but instead they will be checked/unchecked as needed
by GUI::Action itself before the activation hook is fired.
Previously, drag and drop would only work when dragging between node
items on a DirectoryView. This commit makes it possible to drag files to
the empty area of the DirectoryView and copy files more easily between
windows.
When a drag operation is accepted, we don't check whether the source
nodes contain the destination directory. This could trigger an unwanted
recursive copy.
If the selection is empty, the model index will be invalid and the file
system model will return the root directory path by default. This causes
the file manager to jump to the root directory when the currently
selected item on the tree view is deselected.
FileManager can now be started with the --desktop argument. When it's
started in this mode, it will run as a WindowType::Desktop window and
not create any of its regular UI.
The desktop version of the file manager is currently pretty bare-bones
but we can improve it over time and share more code with the regular
file manager windows.
I think this is pretty cool! :^)
functrace traces the function calls a program makes.
It's like strace, but for userspace.
It works by using Debugging functionality to insert breakpoints
at call&ret instructions.
POSIX says, "Conforming applications should not assume that the returned
contents of the symbolic link are null-terminated."
If we do include the null terminator into the returning string, Python
believes it to actually be a part of the returned name, and gets unhappy
about that later. This suggests other systems Python runs in don't include
it, so let's do that too.
Also, make our userspace support non-null-terminated realpath().
Previously, a breakpoint was removed after it was tripped.
After a breakpoint trips, we have to undo the 'int3' patch
from the instruction in order to continue the exceution.
To make a breakpoint persist, we switch to "single step" mode,
which stops the execution after a single instruction, and then we
insert the breakpoint at the previous instruction.
There is also some code that deals with an edge case where there are
breakpoints in two consecutive instructions.
For some reaason, some magic is required to convince gcc to give us
the implementation for "__cxa_demangle"
Thanks @predmond for finding this simpler form of magic :)
PT_SETTREGS sets the regsiters of the traced thread. It can only be
used when the tracee is stopped.
Also, refactor ptrace.
The implementation was getting long and cluttered the alraedy large
Process.cpp file.
This commit moves the bulk of the implementation to Kernel/Ptrace.cpp,
and factors out peek & poke to separate methods of the Process class.
This was a missing feature in the PT_TRACEME command.
This feature allows the tracer to interact with the tracee before the
tracee has started executing its program.
It will be useful for automatically inserting a breakpoint at a
debugged program's entry point.
PT_POKE writes a single word to the tracee's address space.
Some caveats:
- If the user requests to write to an address in a read-only region, we
temporarily change the page's protections to allow it.
- If the user requests to write to a region that's backed by a
SharedInodeVMObject, we replace the vmobject with a PrivateIndoeVMObject.
This is really just a workaround to keep SystemMonitor's process table
working right wrt selection retention during resorts (while also doing
full index invalidation on things like ProfileViewer inversion.)
It's starting to feel like the model abstraction is not super great
and we'll need a better approach if we want to actually build some more
dynamic functionality into our views.
`IRCChannelMemberListModel->nick_at` returns the nick name of a channel
member at the specified index.
`IRCClient->nick_without_prefix` returns a formatted nick name without
privilege prefix.
Some IRC clients use /hop to part and re-join a channel; however this
can be confused with granting half-op (+h) channel privileges to a user.
The general convention used by other IRC clients is /cycle.
Major changes are:
The layout and mouse handling has been rewritten to always center
images in the window.
QuickShow now accepts multiple images on drag and drop. The first
image gets opened in the current window, further images are opened in
new processes.
QSWidget now loads images on its own with QSWidget::load_from_file().
An on_drop callback has been introduced for QSWidget.
Added an open menu.
Added an about box and placeholder icons to the application.
QuickShow now starts without loading the sunset-retro wallpaper.
We were allowing this dangerous kind of thing:
RefPtr<Base> base;
RefPtr<Derived> derived = base;
This patch changes the {Nonnull,}RefPtr constructors so this is no
longer possible.
To downcast one of these pointers, there is now static_ptr_cast<T>:
RefPtr<Derived> derived = static_ptr_cast<Derived>(base);
Fixing this exposed a ton of cowboy-downcasts in various places,
which we're now forced to fix. :^)
QSWidget::relayout get triggered before setting a bitmap to display
while setting the widget as the main widget of the window.
I've added a null check to the paint event too to make sure the
widget works with no bitmap set.
This allows us to construct menus in a more natural way:
auto& file_menu = menubar->add_menu("File");
file_menu.add_action(...);
Instead of the old way:
auto file_menu = GUI::Menu::construct();
file_menu->add_action(...);
menubar->add_menu(file_menu);
The new Channel application menu allow offers various commands
related to the currently visible channel, including changing
the topic, kicking a user, and leaving the channel.
With this patch, it's now possible to pass a Gfx::ShareableBitmap in an
IPC message. As long as the message itself is synchronous, the bitmap
will be adopted by the receiving end, and disowned by the sender nicely
without any accounting effort like we've had to do in the past.
Use this in NotificationServer to allow sending arbitrary bitmaps as
icons instead of paths-to-icons.
Wallpaper mode and background color change options are now available. Monitor preview
widget show new settings before apply. We have some missing preview features :(
This patchset adds a Button to the toolbar (right next to the location field)
with a star icon. The star is white if the currently visited url is not yet
bookmarked and yellow if a bookmark for the url exists.
After adding or removing a bookmark, the bookmark json file is synced to disk.
Therefore, some new pledge/unveil's have been added.
This patchset adds a bookmark bar that is backed by a json file backend.
The json file is loaded and checked for the format. According to the
format, the bookmarks bar is populated with the bookmark items.
If the bookmarks do not fit into one line, an expader button is shown
that brings up a menu containing the missing bookmark items.
There is currently no way to add or remove bookmarks. A hover over a
bookmark is also not yet showing the url in the statusbar.
If you receive a channel or query message while the app is inactive,
or while the channel/query is inactive, we now post a desktop
notification so you can learn that something is happening. :^)
This patch begins integrating LibJS into LibWeb. Document holds the
JS::Interpreter for now, and it is created on demand when you first
call Document::interpreter().
We also add a simple "alert()" function to the global object.
We also clean up some old references to the old G prefixed GUI classes
This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton)
instead of C_OBJECT_ABSTRACT(AbstractButton)
There were two issues with this code:
- The result of the readlink() call was checked incorrectly for errors.
- This code shouldn't return because otherwise it leaves the GUI buttons
uninitialized below, causing RefPtr asserts to trigger when the dialog
tries to access the buttons later on.
Now that add() returns a WidgetType&, we can't rely on the parent of a
GUI::Dialog to still keep it alive after exec() returns. This happens
because exec() will call remove_from_parent() on itself before
returning.
And so we go back to the old idiom for creating a GUI::Dialog centered
above a specific window. Just call GUI::Dialog::construct(), passing
the "parent" window as the last parameter.
Since the returned object is now owned by the callee object, we can
simply vend a ChildType&. This allows us to use "." instead of "->"
at the call site, which is quite nice. :^)
This patch adds two new API's:
- WidgetType& GUI::Window::set_main_widget<WidgetType>();
This creates a new main widget for a window, assigns it, and returns
it to you as a WidgetType&.
- LayoutType& GUI::Widget::set_layout<LayoutType>();
Same basic idea, creates a new layout, assigns it, and returns it to
you as a LayoutType&.
The selected option was stored in a captured stack variable which was
long gone by the time we looked at it, so this dialog didn't really
behave the way you'd expect. Put it in a member instead. :^)
Now it actually defaults to "a < b" comparison, instead of forcing you
to provide a trivial less-than comparator. Also you can pass in any
collection type that has .begin() and .end() and we'll sort it for you.