Commit graph

480 commits

Author SHA1 Message Date
Andreas Kling
442256b5f8 TextEditor: Add "Save as..." action.
Add a basic "save as" action to the TextEditor app, and make "save" fall
back to using "save as" if there's no name already set.

Fixes #282.
2019-07-24 06:32:30 +02:00
Andreas Kling
72a3f69df7 LibGUI: Get rid of GWindow::should_exit_event_loop_on_close().
This behavior and API was extremely counter-intuitive since our default
behavior was for applications to never exit after you close all of their
windows.

Now that we exit the event loop by default when the very last GWindow is
deleted, we don't have to worry about this.
2019-07-23 18:20:00 +02:00
Andreas Kling
67fe583f6a Piano: Exit the event loop on main window close. 2019-07-23 06:45:00 +02:00
Andreas Kling
0d1ad84656 PaintBrush: Exit the event loop on main window close. 2019-07-23 06:44:47 +02:00
Andreas Kling
5f0f1ce9d2 FileManager: Add a toolbar button for going to the home directory.
Fixes #308.
2019-07-21 09:19:09 +02:00
Andreas Kling
aa2224a2f0 GWidget: Add set_preferred_size(width, height) overload.
It was annoying to always write set_preferred_size({ width, height }). :^)
2019-07-20 22:39:24 +02:00
Andreas Kling
c59b053ad6 GSlider: Add support for vertical sliders.
You now have to pass an Orientation to the GSlider constructor. It's not
possible to change the orientation after construction.

Added some vertical GSliders to the WidgetGallery demo for testing. :^)
2019-07-20 19:32:12 +02:00
Andreas Kling
1c0669f010 LibDraw: Introduce (formerly known as SharedGraphics.)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.

This avoids building the code twice, and will encourage better separation
of concerns. :^)
2019-07-18 10:18:16 +02:00
Robin Burchell
a9d1a86e6e CProcessStatisticsReader: Be consistent about terminology from the kernel down 2019-07-18 07:23:26 +02:00
rhin123
9724d540b6 TextEditor: Show window icon 2019-07-17 21:14:14 +02:00
Robin Burchell
7a53096e8d LibGUI: Revert GWindowServerConnection to being a singleton
This was a mistake, of course. Nested event loops don't need (or want)
independent server connections.

We initialize the connection early in GEventLoop for e.g. users that
want to get the size of a GDesktop before the connection has been
established.

Bug noticed by Andreas, introduced by me ;-)
2019-07-17 21:03:01 +02:00
Robin Burchell
2177594c96 Port LibGUI to use CIPCClientSideConnection
As a consequence, move to use an explicit handshake() method rather than
calling virtuals from the constructor. This seemed to not bother
AClientConnection, but LibGUI crashes (rightfully) because of it.
2019-07-17 20:16:44 +02:00
Andreas Kling
a17fbd98e7 LibGUI: Add input types to GMessageBox.
Currently the two available input types are:

- GMessageBox::InputType::OK (default)
- GMessageBox::InputType::OKCancel

Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
2019-07-16 21:41:13 +02:00
Andreas Kling
f98b1f635b SystemDialog: Add a new app for showing system dialogs.
Currently this will be used by the WindowServer to show some dialogs.
This is needed since WindowServer can't use LibGUI and reimplementing
message box functionality inside WindowServer would be silly. :^)

The only dialog supported in this initial version is --shutdown
2019-07-16 21:41:13 +02:00
Robin Burchell
825ce53fd3 Piano: Create the connection after the event loop
Otherwise it will crash when registering the CNotifier.
2019-07-16 20:47:32 +02:00
rhin123
1f77fbb75c TextEditorWidget: Stop dbgprintf from printing null 2019-07-16 08:34:51 +02:00
rhin123
1bcf3968f2 TextEditor: Show window after text_widget loads 2019-07-16 08:34:51 +02:00
rhin123
82d9410226 TextEditorWidget: Added improved save feature.
Instead of saving to a temp file, the TextEditorWidget now saves
to a path returned by the improved GFilePicker.
2019-07-15 18:33:33 +02:00
Andreas Kling
954a0b8efe AK: Add a canonicalized_path() convenience function.
This is the same as calling FileSystemPath(foo).string(). The majority of
clients only care about canonicalizing a path, so let's have an easy way
to express that.
2019-07-15 06:50:32 +02:00
Andreas Kling
2a9b627ae9 Piano: Use CObject::custom_event() to simplify PianoWidget a bit. 2019-07-14 10:28:10 +02:00
Andreas Kling
1ecb7462b7 Piano: Use CEventLoop::wake() to trigger repaint from sound thread.
In order to repaint the GUI after the sound thread has produced some sweet
new waves, we post a CCustomEvent to the main thread's event loop and then
wake up that event loop via CEventLoop::wake().
2019-07-14 10:22:28 +02:00
Robin Burchell
0a1bd03f1d WindowServer: Add a custom window type for Launcher
This keeps it out of the taskbar window list.
The stacking order is a little gnarly, but it seems to work OK still.
2019-07-14 00:06:47 +02:00
Andreas Kling
559a999852 Piano: Use a fixed-width font in the UI to align things nicely. 2019-07-13 23:14:00 +02:00
Andreas Kling
9197cfc62f Piano: Add 16x16 window icon. 2019-07-13 23:12:40 +02:00
Andreas Kling
3eeb0734ba Piano: Remove some unused code. 2019-07-13 23:02:07 +02:00
Robin Burchell
ffa8cb668f AudioServer: Assorted infrastructure work
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader)
* Add CLocalSocket, and CSocket::connect() variant for local address types.
  We make some small use of this in WindowServer (as that's where we
  modelled it from), but don't get too invasive as this PR is already
  quite large, and the WS I/O is a bit carefully done
* Add an AClientConnection which will eventually be used to talk to
  AudioServer (and make use of it in Piano, though right now it really
  doesn't do anything except connect, using our new CLocalSocket...)
2019-07-13 22:57:24 +02:00
Andreas Kling
ec7b98f079 Piano: Take down the baseline "volume" from 3000 to 1800.
I have no idea what a good value for this would be. This seems to do better
when playing many notes at once.
2019-07-13 20:54:16 +02:00
Andreas Kling
eec9666735 Piano: Use a secondary thread to write the audio stream.
This frees up the main thread to draw the GUI. The secondary thread uses
a pipe to trick the main thread's event loop to break out of select() and
update() the PianoWidget. :^)
2019-07-13 20:20:08 +02:00
Andreas Kling
c962c54610 Piano: Start working on a desktop piano.
The idea here is to implement a simple synhesizer that allows you to play
music with your keyboard. :^)

It's a huge hack currently but we can improve upon this.
2019-07-13 17:05:16 +02:00
Andreas Kling
ecbf1b673a IRCClient: Implement "/msg <nick> ..." 2019-07-13 12:02:31 +02:00
Andreas Kling
5e6c1c6912 IRCClient: Open query window immediately when created by the user.
When handling "/query nick", we now immediately switch to the new query.
2019-07-13 11:54:01 +02:00
Andreas Kling
f79f3f6b8c IRCClient: Make the channel and query mappings case-insensitive.
This allows us to send a message to "nickserv" and receive a response from
"NickServ" without getting confused. :^)
2019-07-13 11:05:30 +02:00
Andreas Kling
9a7b638743 IRCClient: Process incoming NOTICE messages like PRIVMSG.
They should be handled slightly differently, but at least now we're doing
*something* withthem.
2019-07-13 11:04:41 +02:00
Andreas Kling
d0a2668833 TextEditor: Fix build (copy_ref() in outdated PR changes.) 2019-07-11 21:30:49 +02:00
Rhin
d7b836858e TextEditor: Move the application UI into a dedicated TextEditorWidget. (#292)
Added a main widget for the text editor as a stepping stone to add new features.
2019-07-11 20:52:33 +02:00
Andreas Kling
2dc0ea1cf9 FontEditor: Initial port to using a VisualBuilder generated UI.
Here goes the first attempt at using VisualBuilder to make an application.

There are many features missing that we are gonna have to implement,
noticeably custom widgets (for the glyph editor and glyph map widgets)
but this patch already moves most of the UI layout to a form file. :^)
2019-07-11 20:19:26 +02:00
Andreas Kling
323704c851 TextEditor: Remove use of copy_ref(). 2019-07-11 16:04:53 +02:00
Andreas Kling
a35dc10f54 ProcessManager: Remove use of copy_ref(). 2019-07-11 16:04:17 +02:00
Andreas Kling
6382c14faf IRCClient: Remove use of copy_ref(). 2019-07-11 16:03:54 +02:00
Andreas Kling
433b6678c6 FontEditor: Remove use of copy_ref(). 2019-07-11 16:02:55 +02:00
Andreas Kling
c0742e4c23 FileManager: Remove use of copy_ref(). 2019-07-11 15:59:06 +02:00
Andreas Kling
245ae479eb ProcessManager: Use CProcessStatisticsReader to get process data.
It was silly to duplicate this functionality in so many places. Now everyone
uses CProcessStatisticsReader to parse /proc/all :^)
2019-07-10 15:27:52 +02:00
Andreas Kling
7083a0104a LibGUI: Add GActionGroup, a way to group a bunch of GActions.
This can be used to make a bunch of actions mutually exclusive.
This patch only implements the exclusivity behavior for buttons.
2019-07-09 22:10:03 +02:00
Andreas Kling
2c81477f16 Terminal: Try to preserve line contents when resizing the terminal window.
This is still destructive when shrinking, but clearly better than throwing
everything away.
2019-07-08 19:02:08 +02:00
Andreas Kling
0e75aba7c3 StringView: Rename characters() to characters_without_null_termination().
This should make you think twice before trying to use the const char* from
a StringView as if it's a null-terminated string.
2019-07-08 15:38:44 +02:00
Andreas Kling
752d297321 IRCClient: Fix build. Forgot to update a function signature. 2019-07-07 22:27:48 +02:00
Andreas Kling
ea9340aeca IRCClient: Implement the "part from channel" action.
Also make sure the action is disabled while we're not in a window that
corresponds to an open channel. :^)

Fixes #277.
2019-07-07 21:58:57 +02:00
Andreas Kling
27f699ef0c AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
2019-07-03 21:20:13 +02:00
Andreas Kling
b79112e6d6 AK: Add String::number() for creating a String from a number.
Instead of manually doing String::format("%d"/"%u") everywhere, let's have
a String API for this. It's just a wrapper around format() for now, but it
could be made more efficient in the future.
2019-07-03 14:56:27 +02:00
Christopher Dumas
e9ab282cfd Launcher: Reformat config a little bit (#279) 2019-07-03 05:53:44 +02:00