Commit graph

110 commits

Author SHA1 Message Date
Dan Klishch 5ed7cd6e32 Everywhere: Use east const in more places
These changes are compatible with clang-format 16 and will be mandatory
when we eventually bump clang-format version. So, since there are no
real downsides, let's commit them now.
2024-04-19 06:31:19 -04:00
Timothy Flynn 683c08744a Userland: Avoid some conversions from rvalue strings to StringView
These are all actually fine, there is no UAF here. But once e.g.
`ByteString::view() &&` is deleted, these instances won't compile.
2024-04-04 11:23:21 +02:00
Shannon Booth e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
Tim Ledbetter 2331d2bafa Userland: Propagate errors with TRY() where possible 2024-02-14 17:46:06 -05:00
Sanil 433fe3dc26 Calendar: Add ability to view events 2024-02-08 08:13:04 -07:00
Sam Atkins 44ca55aaf8 LibFileSystemAccessClient+Userland: Return file paths as ByteStrings
Where it was straightforward to do so, I've updated the users to also
use ByteStrings for their file paths, but most of them have a temporary
String::from_byte_string() call instead.
2024-01-29 23:14:39 +00:00
kleines Filmröllchen 14a99bb22d Calendar: Use new GML compiler 2024-01-19 10:50:15 +00:00
Hugh Davenport 8886324cbf Applications: Add fullscreen for Office category 2024-01-14 15:18:43 -07:00
Sam Atkins e0fd5beb36 LibGUI+Applications: Default the SpinBox min/max to the full int range
By default, a SpinBox's value should be unlimited, (or as close as we
can get to that,) and then the GML or code can impose a limit if
needed. This saves the developer from entering an arbitrary "big" max
value when they want the value to have no maximum.

I've audited the use of SpinBox and added `min: 0`, and removed a `max`,
where appropriate. All existing SpinBoxes constructed in code have a
range set explicitly as far as I can tell.
2024-01-14 13:46:14 +00:00
ronak69 4aa04cdf65 Calendar: Add feature to view/edit duration of events in AddEventDialog 2024-01-12 17:13:46 -07:00
ronak69 5b72711beb Calendar: Set the end time relative to the start time in AddEventDialog 2024-01-12 17:13:46 -07:00
ronak69 5875fae9e9 Calendar: Set minimum hour to 0 and maximum hour to 23 in AddEventDialog 2024-01-12 17:13:46 -07:00
david072 a84778f6ee Calendar/AddEventDialog: Prevent inputting invalid date ranges
The calendar now verifies that the user can't input invalid date ranges,
i.e. date ranges where the end is before the start. The UI elements do
this implicitly, by adjusting the values when changing the dates in an
illegal way (e.g. when picking an end date that is before the start
date, the end date will change to the start date).
2024-01-06 10:37:53 -07:00
david072 b657fa6f95 Calendar: Ask about unsaved changes when closing the window :^)
The Calendar now asks about unsaved changes in the calendar when
attempting to close the window.
2024-01-06 10:37:53 -07:00
david072 75faa9239a Calendar/EventManager: Set m_dirty directly 2024-01-06 10:37:53 -07:00
david072 887f040d0e Calendar/EventManager: Store events as structs
Previously, the EventManager stored the calendar events as a raw
JsonArray of objects. Now, we parse the JSON into a Vector<Event>
structure and store that in the EventManager. This makes it easier to
access the events from the outside, as you now don't have to know the
JSON structure anymore.
2024-01-06 10:37:53 -07:00
david072 7df936b660 Calendar/AddEventDialog: Add a cancel button 2024-01-06 10:37:53 -07:00
david072 d0a4f6678c Calendar/AddEventDialog: Change SpinBoxes to accept 24-hour values
Since the meridiem selection was removed in the previous commit and
there currently doesn't seem to be a way to change the system time
format, I'm changing the SpinBoxes here to accept 24-hour format values
for now.
2024-01-06 10:37:53 -07:00
david072 60174cc9aa Calendar/AddEventDialog: Remove meridiem selection
This removes the meridiem selection in the AddEventDialog of the
calendar because it thus far didn't do anything.
2024-01-06 10:37:53 -07:00
david072 18b1f856e5 Calendar/AddEventDialog: Convert pointers to references
This removes some warnings ;^).
2024-01-06 10:37:53 -07:00
david072 2c68554629 Calendar/AddEventDialog: Use the DatePicker to pick dates 2024-01-06 10:37:53 -07:00
david072 039114b728 Calendar: Move MonthListModel into Calendar.h
Previously, we had two versions of MonthListModel for the AddEventDialog
and the DatePickerDialog. Now, a unified version is in the Calendar.h
file, which can be used easily by anyone. Since that model and the
MeridiemListModel weren't used anymore in the AddEventDialog, I have
also removed them from there.
2024-01-06 10:37:53 -07:00
Mr.UNIX 467faee1b8 Calendar: Add a link to the Manual in Help Menu 2023-12-26 18:37:35 +01:00
Ali Mohammad Pur 5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
lanmonster e5c9d7ce26 Calendar: Add inputs to change event end date/time 2023-10-26 11:10:23 +02:00
lanmonster a7c3d39bab Calendar: Add end date/time to events 2023-10-26 11:10:23 +02:00
lanmonster 4984faa108 Calendar: Rename m_date_time to m_start_date_time
This is in preparation to add m_end_date_time
2023-10-26 11:10:23 +02:00
lanmonster a4fcec6815 Calendar: Rename input variables
These were named foo_combo, when in reality there more spinboxes than
comboboxes. Change to foo_input to accomodate whatever type of input
they may be.
2023-10-26 11:10:23 +02:00
lanmonster edee914093 Calendar: Update day range when the month changes
Previously it was possible to create an event on Feb 31(!)
2023-10-26 11:10:23 +02:00
lanmonster 97cc5b2da4 Calendar: Use GML for AddEventDialog 2023-10-26 11:10:23 +02:00
Bastiaan van der Plaat 5d37e1c220 Userland: Remember window state of productivity / editor applications 2023-09-24 20:00:00 -06:00
Tim Ledbetter 3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Tim Ledbetter 0d7b13edac Userland: Make GUI::Window construction non-fallible 2023-09-17 16:47:28 -06:00
Tim Ledbetter ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Michal Grich 331a19efe8 Calendar: Save time of the event and display it in Calendar
This PR introduces the ability to save calendar event times
and adds functionality for displaying saved times in the calendar.
Additionally, it addresses the issue where changes to the time
value in the dropdown were not being saved.
2023-09-05 15:08:42 +01:00
thankyouverycool 57f3b18109 LibGUI+Userland: Remove Toolbar::try_add_{action,separator}()
These calls largely occur during initialization before there's
unsaved state worth preserving
2023-08-15 15:56:34 +02:00
Andreas Kling bd61e75e0b LibGUI: Remove Window::try_add_menu()
And fall back to the infallible add_menu().
2023-08-14 14:57:54 +02:00
Andreas Kling f2faf2767f LibGUI: Remove Menu::try_add_action()
And fall back to the infallible add_action().
2023-08-14 14:57:54 +02:00
Andreas Kling 1525fa3b8f LibGUI: Remove Menu::try_add_separator()
And fall back to the infallible add_separator().
2023-08-14 14:57:54 +02:00
Andreas Kling 58e482a06d LibGUI: Remove Layout::try_add_spacer()
And fall back to the infallible add_spacer().

Work towards #20557.
2023-08-14 14:57:54 +02:00
0GreenClover0 061061bd9c Calendar: Make on_month_click capture the view_month_action's RefPtr 2023-08-14 07:29:09 +02:00
0GreenClover0 340230f6bf Calendar: Promote view_type ActionGroup to CalendarWidget's member
Otherwise, it would get destroyed after exiting the create() function.
2023-08-13 22:34:14 +02:00
kleines Filmröllchen 1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +02:00
Lucas CHOLLET 3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Monroe Clinton 1b5b1e4153 Calendar: Implement saving, loading, and displaying of calendars
The user can now save, load, and view calendars. A calendar is made up
of an array of events which are saved in a JSON file. In the future we
should implement the iCalendar standard instead of using a custom
format.
2023-08-07 13:14:58 -06:00
Andreas Kling 34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
implicitfield 9a1018389c LibGUI+Calendar: Move date control logic to the calendar widget 2023-07-13 04:31:40 +03:30
Sam Atkins f33824d2e9 LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
thankyouverycool 02d94a303c Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.

Rewords a few actions and dialogs to use uniform language and
punctuation.
2023-05-23 05:59:49 +02:00
Karol Kosek 945f05ed76 Userland: Port Model::column_name() to String 2023-05-15 06:42:10 +02:00