Commit Graph

673 Commits

Author SHA1 Message Date
Jesse
6557a31049 Terminal: Scroll cursor into view when typing (#568)
When the user has scrolled up and begins typing, the scrollbar will
automatically return them to the current cursor position so that they
can see what they're typing.
2019-09-16 07:52:27 +02:00
Jesse
444a4e4d39 DisplayProperties: Auto-resolution and graphical fix (#566)
The program will now automatically select the user's currently
chosen resolution when it is loaded up, however it is not
"visually selected" in the `GListView`

Moved the `resolution_list` list to be on the top to keep it consistent
with the wallpaper tab.
2019-09-16 07:50:47 +02:00
Conrad Pankoff
aa95bd7037 LibGUI: Fix move() of const StringView& 2019-09-16 07:49:43 +02:00
Conrad Pankoff
6fd096999e Applications: Add "Welcome" application, inspired by Windows 98 2019-09-16 07:49:43 +02:00
Andreas Kling
4463adc0ff FileManager: Show human-readable file size info in the status bar
Fixes #553.
2019-09-15 17:50:15 +02:00
Andreas Kling
e83390387c LibGUI: Simplify GCommonActions a bit
Use the same callback signature as GAction so we can just forward it
to GAction instead of chaining callbacks.
2019-09-14 22:10:44 +02:00
Jesse Buhagiar
58ceaebd5a DisplayProperties: Wallpaper tab now has preview
As was mentioned in #556, the `DisplayProperties` Wallpaper tab
contained a lot of "extra space", in which half the tab was taken up
by the list of wallpapers. The rest of that space is now reserved for
a wallpaper preview, so the user can see the selected image before
applying it.
2019-09-14 19:27:16 +02:00
Andreas Kling
31046b18bb FileManager: Use a special clipboard data type for copied file lists
When copying a list of files to the clipboard, we now use the special
data type "file-list".

This allows us to have the paste action's enabled state reflect the
actual ability to paste something. :^)
2019-09-14 09:20:20 +02:00
Andreas Kling
9d2c4d223a TextEditor+Base: Add an icon for the "Find" action :^) 2019-09-13 23:56:37 +02:00
Andreas Kling
ff72b4d475 FileManager+Base: Add "properties" icon
Something to show for the properties action in FileManager. It still
doesn't actually do anything, but at least now it looks neat. :^)
2019-09-13 23:07:59 +02:00
Andreas Kling
11f2e7cd5c GMenu: Update apps now that you can create a nameless GMenu
We had many context menus with names, simply because you were forced
to give them names.
2019-09-13 22:14:07 +02:00
Andreas Kling
5eb2c138e2 FileManager: Update enabled state of the copy and delete actions
Based on whether something is selected or not. I added a FIXME about
the paste action, since that will require some more coordination with
the system clipboard.
2019-09-13 22:09:01 +02:00
Andreas Kling
27e1128e6e FileManager: Assign keyboard shortcuts to the various actions 2019-09-13 22:04:08 +02:00
Andreas Kling
3a02bd40f8 FileManager: Add a basic context menu with copy/paste/delete/...
I also added a dummy "Properties..." action just to fill out the menu a
little bit. :^)

Fixes #270.
2019-09-13 22:00:47 +02:00
MinusGix
ad75b61eca IRCClient: Fix unneeded conversion to String 2019-09-13 09:22:30 +02:00
Andreas Kling
27321e9c44 PaintBrush: Only send left and right mouse button events to tools
Tools don't know what to do with the middle mouse button anyway,
so it's better if we just don't pass it along.

Fixes #546.
2019-09-12 20:33:05 +02:00
Andreas Kling
d86fb8033e FileManager: Show info about currently selected items in statusbar
When there's a non-zero number of selected items, we now show the
number in the statusbar, along with the total selected file size. :^)

Fixes #271.
2019-09-12 18:59:13 +02:00
Andreas Kling
1632f6b2dd FileManager: Add C_OBJECT macro to DirectoryView 2019-09-12 18:26:26 +02:00
Max Thrun
ae060d7450 SoundPlayer: Scale y coordinate to prevent drawing outside clip rect
Previously if sample.left amplitude was more than 0.5 we would draw
outside the painters clip rect.
2019-09-11 10:20:08 +02:00
Aaron Malpas
026a8be4e5 File Manager: Implement copy-paste
The files to copy are remembered with the clipboard, which stores a 
command (e.g. "copy") and files to be copied on different lines.
2019-09-10 19:28:41 +02:00
Aaron Malpas
7841aadb41 FileManager: Create FileUtils
This could later be replaced with library-provided utility functions
when/if they exist.
2019-09-10 19:28:41 +02:00
Aaron Malpas
b894803a30 FileManager: Add on_selection event for DirectoryView
There needs to be a way to know when a user has selected a file. 
file_system_model->on_selection_changed only fires on directory 
change.
2019-09-10 19:28:41 +02:00
Andreas Kling
fb275c9442 FileManager: Make the tree view follow the path changes correctly
The left-side tree view was not following along when switching paths
via the right-side views. Hook this back up.
2019-09-08 09:08:50 +02:00
Andreas Kling
6dec328af7 LibGUI+FileManager: Add GAbstractView::on_selection_change hook
This hook will be called whenever the view's selection changes somehow.
Use this in the FileManager to keep the left and right views in sync.
2019-09-07 21:35:04 +02:00
Andreas Kling
9d97781e37 FileManager: Port to using GModelSelection 2019-09-07 20:41:14 +02:00
Andreas Kling
f8c0168adc IRCClient: Fix window selection after GModelSelection changes 2019-09-07 20:01:37 +02:00
Andreas Kling
9c1fa0bd51 SystemMonitor: Fix PID selection after GModelSelection changes 2019-09-07 19:59:03 +02:00
Andreas Kling
a635619cc0 GTabWidget: Rename get_active_tab() => active_tab_index() 2019-09-07 16:57:26 +02:00
Andreas Kling
568936775f DisplayProperties: Fix build after AKString.h => String.h change 2019-09-07 16:57:03 +02:00
Jesse Buhagiar
ecbc0322c1 Applications: Create a display properties manager
An interactive application to modify the current display settings, such as
the current wallpaper as well as the screen resolution. Currently we're
adding the resolutions ourselves, because there's currently no way to
detect was resolutions the current display adapter supports (or at least
I can't see one... Maybe VBE does and I'm stupid). It even comes with
a very nice template'd `ItemList` that can support a vector of any type,
which makes life much simpler.
2019-09-07 16:51:15 +02:00
Andrew Weller
16aba5100d TextEditor: Implement File/New Action
The user is asked if they want to save a dirty file before they create
a new one.
2019-09-06 18:38:26 +02:00
Andreas Kling
73fdbba59c AK: Rename <AK/AKString.h> to <AK/String.h>
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.

Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Sergey Bugaev
6d3f52c4a4 Terminal: Add some basic emoji support
This is not as perfect as it is elsewhere in the system, as we cannot
really change how terminal "thinks about" characters and bytes. What
we can do though, and what this commit does, is to *render* emojis, but
make it seem as if they take up all the space, and all the columns their
bytes would take if they were all regular characters.
2019-09-05 16:37:39 +02:00
Sergey Bugaev
22e6978c71 WindowServer+LibGUI+FontEditor: Encode special characters as UTF-8 2019-09-05 16:37:39 +02:00
rhin123
9f8a2af921 Terminal: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
1f666abcd2 SystemMonitor: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
2d8318a474 QuickShow: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
962b65b42f Piano: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
a538968cc2 PaintBrush: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
7df4cfe606 IRCCient: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
86c68210f0 FileManager: Added GCommonActions 2019-09-05 09:40:54 +02:00
rhin123
f468634494 TextEditorWidget: Added GCommonActions 2019-09-05 09:40:54 +02:00
Andreas Kling
5cfd67ecbb FileManager: Open ".wav" files in SoundPlayer when activated
Now you can double-click on WAV files in the FileManager. Neato! :^)
2019-09-04 20:20:36 +02:00
Andreas Kling
1188a036e9 SoundPlayer: Start working on a GUI sound player application
This can play anything that AWavLoader can load (so obviously only WAV
files at the moment.)

It works by having a timer that wakes up every 100ms and tries to send
a sample buffer to the AudioServer. If our server-side queue is full
then we wait until the next timer iteration and try again.

We display the most recently enqueued sample buffer in a nice little
widget that just plots the samples in green-on-black. :^)
2019-09-04 20:18:41 +02:00
Andreas Kling
2441c1fde2 IRCClient: Use GAboutDialog :^) 2019-09-04 19:11:37 +02:00
Andreas Kling
75eb84c7e4 IRCClient: Size columns to-fit in the window and member views 2019-09-04 19:07:59 +02:00
Andreas Kling
e12bbc097f IRCClient: Add 16x16 icon 2019-09-04 18:56:39 +02:00
Andreas Kling
52f62c2d7e IRCClient: Tweak UI to look less padding-bloated 2019-09-04 18:54:43 +02:00
Andreas Kling
2216c7ecc6 IRCClient: Make the auto-join on connect feature actually do something 2019-09-04 17:37:11 +02:00
Andreas Kling
9cb4e5ac81 IRCClient: Don't auto-open new queries for NOTICE or CTCP messages
This seems to match what other IRC clients do, and it means we don't
get three separate "server" windows when connecting to Freenode. :^)
2019-09-03 21:47:43 +02:00
Andreas Kling
5c7ef5977d IRCClient: Handle incoming CTCP requests VERSION and PING
CTCP requests are client-to-client messages that are sent as either
PRIVMSG (for requests) or NOTICE (for responses) and wrapped in ASCII
character 0x01 on both sides.

This patch implements responding to the very common VERSION and PING
requests. We always get a VERSION request from freenode when connecting
there, for instance. :^)
2019-09-03 21:18:28 +02:00
Andreas Kling
841f1276e6 TextEditor: Use GAboutDialog :^) 2019-09-02 19:48:47 +02:00
Andreas Kling
aea6a28e9c Terminal: Use GAboutDialog :^) 2019-09-02 19:46:35 +02:00
Conrad Pankoff
1f56612c8a Terminal: Add -e (execute) command line option
This allows a user to specify a command to run after opening the terminal
program. By default it will still spawn an interactive shell.
2019-09-02 08:33:36 +02:00
Andreas Kling
cfe09784a4 TextEditor: Clear the dirty flag in newly opened documents 2019-08-29 18:54:06 +02:00
Andreas Kling
a71e411b27 Terminal: Use a gear icon for the "Settings" menu 2019-08-29 18:19:40 +02:00
Andreas Kling
72950f93a3 TextEditor: Move the Font menu inside the View menu
This will be our first user of the nested menus feature. :^)
2019-08-29 06:36:35 +02:00
Andreas Kling
b1763238d7 TextEditor: Ask the user before closing a dirty (modified) document
It's a little unfortunate that we have two separate code paths that can
lead to asking the user about this. Longer-term we should find a way to
unify these things.

Fixes #491.
2019-08-27 20:39:01 +02:00
Andreas Kling
ecbedda34c TextEditor: Add a "document dirty" flag and show it in the window title
This lets you know if the document has been modified since last save.
2019-08-27 20:18:19 +02:00
Andreas Kling
07933d0b46 TextEditor: Let's enable line wrapping by default 2019-08-27 17:05:01 +02:00
Andreas Kling
b6de723eb3 TextEditor: Move line wrapping setting to a new "View" menu 2019-08-27 17:01:52 +02:00
Andreas Kling
b0b94560c3 FileManager: Add "go home" action to the "Go" menu 2019-08-26 21:20:39 +02:00
Andreas Kling
08d7c86e90 FileManager: Move "File" menu entries to the app menu 2019-08-26 19:18:54 +02:00
Andreas Kling
cef2c04952 TextEditor: Move all "File" menu entries into the app menu instead
It felt weird to have both the app menu *and* a "File" menu.
2019-08-26 17:59:05 +02:00
Sergey Bugaev
d91efd4cd0 Piano: Port threading to LibThread 2019-08-26 11:31:14 +02:00
Sergey Bugaev
e1a6f8a27d LibThread: Introduce a new threading library
This library is meant to provide C++-style wrappers over lower
level APIs such as syscalls and pthread_* functions, as well as
utilities for easily running pieces of logic on different
threads.
2019-08-26 11:31:14 +02:00
Andreas Kling
d5f3487203 TextEditor: Select everything in the find textbox when pressing Ctrl+F
This allows you to press Ctrl+F and immediately start typing a new
search string, instead of having to remove the old one first. :^)
2019-08-25 21:46:39 +02:00
Andreas Kling
e8e8741c88 LibGUI+TextEditor: Make GButton activate its action if present
Previously even if you assigned a GAction to a GButton, you still had
to activate() the action manually by hooking the GButton::on_click
callback.
2019-08-25 21:46:39 +02:00
Andreas Kling
ded005500d TextEditor: Add actions for find next/previous (Ctrl+G, Ctrl+Shift+G) 2019-08-25 21:46:39 +02:00
Andreas Kling
d88c40568f TextEditor: Add search-related actions to the text editor context menu
Using the new GTextEditor::add_custom_context_menu_action() mechanism.

Fixes #478.
2019-08-25 21:46:28 +02:00
rhin123
0df7213670 Terminal: Fixed bounding issue when clearing the selection on type
We were checking the columns of the whole selection instead of the
the specfic line were modifying. Because of this, the selection
remained if the selection's column on another line was less than
the cursor.
2019-08-25 19:53:57 +02:00
Andreas Kling
97a695403b TextEditor: Add a menu action for turning line-wrapping on/off 2019-08-25 12:23:34 +02:00
rhin123
280a9a2f34 Terminal: Clear selection if we type behind/inside it 2019-08-25 10:44:31 +02:00
Andrew Weller
e75e33eb46 TextEditor: Replaced 'Find' button with 'Prev' and 'Next' buttons. 2019-08-24 21:57:42 +02:00
Andreas Kling
b1bc7a1b5d TextEditor: Don't try to load contents of files we didn't even open
If the CFile::open() call fails, we shouldn't continue with trying to
load the file.
2019-08-23 19:11:56 +02:00
Andreas Kling
d56786ccd8 TextEditor: Avoid an unnecessary whole-file copy when opening something
This was left over from before we had the StringView(const ByteBuffer&)
constructor to help us.
2019-08-23 19:05:34 +02:00
Andreas Kling
1ca6adee90 Terminal: Allow selecting words by double-clicking them
Bonus feature: also allow selecting the whitespace in-between words by
double-clicking that. :^)
2019-08-22 19:59:27 +02:00
Andreas Kling
fae379b1f0 TextEditor: Search box should find on return, close itself on escape
This patch adds basic keyboard access to the search box. We also yield
focus back gracefully to the text document when the search box is no
longer wanted.

Focus should probably move automatically when an ancestor of the
currently focused widget if made invisible..
2019-08-22 11:11:48 +02:00
Andreas Kling
96c5c9ce12 TextEditor: Hide the search bar until the user asks for it
You can get to it via Edit/Find, or by pressing Ctrl+F.
2019-08-22 11:02:03 +02:00
Andreas Kling
bb74832dd6 TextEditor: Add a search bar that allows you to search for text
If the text is not found, we show a friendly message box that says we
didn't find the text! :^)
2019-08-21 21:30:20 +02:00
Andreas Kling
c106ec4719 Terminal: Allow scrolling through terminal history with the mouse wheel
Fixes #470.
2019-08-20 20:12:31 +02:00
Andreas Kling
076827a05d GModel: Rename on_model_update(GModel&) => on_update()
Just simplifying the API of this hook a little bit.
2019-08-20 19:45:08 +02:00
Andreas Kling
f7dce05c82 LibGUI: Remove confusing GModelNotification concept
This was a bad idea and it didn't stick. Instead we should just use the
simple "on_foo" hook functions like we do for everything else. :^)
2019-08-20 19:44:02 +02:00
Andreas Kling
64f16c141d Terminal: Implement basic history scrollback
This code needs some optimization work to reduce the amount of repaints
but the history feature basically works, which is cool :^)

Fixes #431.
2019-08-19 19:15:36 +02:00
Sergey Bugaev
ccdeafdefb SystemMonitor: Add a devices tab
This tab combines info from /proc/devices with device file paths from /dev.
2019-08-18 15:59:59 +02:00
Andreas Kling
d92ba85689 Terminal: Mark window as alpha-less when starting up with 100% opacity
WindowServer was led to believe that the Terminal window had an alpha
channel that had to be respected by the compositor. This caused us to
always consider it as non-opaque when culling dirty rects in compose.
2019-08-15 15:30:11 +02:00
Andreas Kling
e0395d5ebe SystemMonitor: Paint the "used" disk space column as a progress bar
This needs to be applied consistently in the rest of this UI, but here
is a start. I can't figure out what the right look should be right now
so I'm just gonna commit it this way and we'll work it out later. :^)
2019-08-14 20:38:18 +02:00
Sergey Bugaev
f6fe56d011 SystemMonitor: Add a PCI devices tab
This is essentially a graphical version of the lspci command.
2019-08-14 14:28:45 +02:00
Sergey Bugaev
cbdda91065 ProcessManager: Rename it to SystemMonitor
This is a more appropriate name now that it does a lot
more than just manage processes ^)
2019-08-14 14:28:45 +02:00
Andreas Kling
7cc9a18c39 Terminal: Only repaint the lines that actually changed
This optimization was broken since who-knows-when. Now we once again do
our best to only repaint the lines that had the "dirty" flag set.

This dramatically reduces the amount of work done by an idle Terminal
since the cursor blinking won't redraw the whole window anymore. :^)
2019-08-13 13:57:04 +02:00
Andreas Kling
ce6463ba76 Terminal: Clip to the paint event rect
We should try to avoid painting any more than what we're asked to.
2019-08-13 13:45:58 +02:00
Andreas Kling
178788f19a Terminal: Rename Terminal => TerminalWidget
This makes it a bit less confusing which is what between TerminalWidget
and VT::Terminal.
2019-08-13 13:45:48 +02:00
Andreas Kling
4fb02c78a9 LibVT: Rename VT::BufferPosition to VT::Position and move to own file 2019-08-13 12:56:10 +02:00
Andreas Kling
b24b111298 LibVT: Factor out terminal emulation from Terminal to make it reusable
Now that we're bringing back the in-kernel virtual console, we should
move towards having a single implementation of terminal emulation.

This patch rips out the emulation code from the Terminal application
and turns it into the beginnings of LibVT.

The basic design idea is that users of VT::Terminal will implement and
provide a VT::TerminalClient subclass to handle presentation-specific
things. We'll need to iterate on this, but it's a start. :^)
2019-08-12 17:34:48 +02:00
Andreas Kling
8faeead753 ProcessManager: Hook the sort order for the file systems JSON model
..and install a GSortingProxyModel on the view. This allows you to sort
the filesystems by used space etc *numerically*. :^)
2019-08-12 11:56:30 +02:00
Andreas Kling
b07a315736 ProcessManager: Add "File systems" tab with info on mounted filesystems
This was rather nice and easy to add with the new GJsonArrayModel! :^)
2019-08-11 10:11:21 +02:00
Andreas Kling
ee83b1bcf4 LibCore: Use URL in CHttpRequest
Now there's just CHttpRequest::set_url(URL), no need to specify the
host, port and path manually anymore.

Updated ChanViewer and Downloader for the API change.
2019-08-10 19:32:03 +02:00
Andreas Kling
aaccf6ee4e ProcessManager: Use a GJsonArrayModel for the process memory maps 2019-08-10 16:08:51 +02:00
Andreas Kling
afd25679bc GJsonArrayModel: Support fields that aren't tied to a single JSON value
Change the custom data massaging callback to take a const JsonObject&.
This will allow binding together data from multiple fields into one
output in the model. :^)
2019-08-10 15:06:29 +02:00
Andreas Kling
2eead3dfc0 ProcessManager: Use a GJsonArrayModel for the process file desciptors 2019-08-10 11:07:55 +02:00