@@ -66,10 +66,6 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, EventManager& event_man
66
66
auto & starting_minute_input = *widget->find_descendant_of_type_named <GUI::SpinBox>(" start_minute" );
67
67
starting_minute_input.set_value (m_start_date_time.minute ());
68
68
69
- auto & starting_meridiem_input = *widget->find_descendant_of_type_named <GUI::ComboBox>(" start_meridiem" );
70
- starting_meridiem_input.set_model (MeridiemListModel::create ());
71
- starting_meridiem_input.set_selected_index (0 );
72
-
73
69
auto & end_date_box = *widget->find_descendant_of_type_named <GUI::TextBox>(" end_date" );
74
70
end_date_box.set_text (MUST (m_start_date_time.to_string (" %Y-%m-%d" sv)));
75
71
@@ -88,27 +84,20 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, EventManager& event_man
88
84
auto & ending_minute_input = *widget->find_descendant_of_type_named <GUI::SpinBox>(" end_minute" );
89
85
ending_minute_input.set_value (m_end_date_time.minute ());
90
86
91
- auto & ending_meridiem_input = *widget->find_descendant_of_type_named <GUI::ComboBox>(" end_meridiem" );
92
- ending_meridiem_input.set_model (MeridiemListModel::create ());
93
- ending_meridiem_input.set_selected_index (0 );
94
-
95
87
auto & ok_button = *widget->find_descendant_of_type_named <GUI::Button>(" ok_button" );
96
88
ok_button.on_click = [&](auto ) {
97
89
add_event_to_calendar ().release_value_but_fixme_should_propagate_errors ();
98
-
99
90
done (ExecResult::OK);
100
91
};
101
92
102
93
auto update_starting_input_values = [&, this ]() {
103
94
auto hour = starting_hour_input.value ();
104
95
auto minute = starting_minute_input.value ();
105
-
106
96
m_start_date_time.set_time_only (hour, minute);
107
97
};
108
98
auto update_ending_input_values = [&, this ]() {
109
99
auto hour = ending_hour_input.value ();
110
100
auto minute = ending_minute_input.value ();
111
-
112
101
m_end_date_time.set_time_only (hour, minute);
113
102
};
114
103
starting_hour_input.on_change = [update_starting_input_values](auto ) { update_starting_input_values (); };
@@ -144,37 +133,4 @@ ErrorOr<void> AddEventDialog::add_event_to_calendar()
144
133
return {};
145
134
}
146
135
147
- int AddEventDialog::MeridiemListModel::row_count (const GUI::ModelIndex&) const
148
- {
149
- return 2 ;
150
- }
151
-
152
- ErrorOr<String> AddEventDialog::MeridiemListModel::column_name (int column) const
153
- {
154
- switch (column) {
155
- case Column::Meridiem:
156
- return " Meridiem" _string;
157
- default :
158
- VERIFY_NOT_REACHED ();
159
- }
160
- }
161
-
162
- GUI::Variant AddEventDialog::MeridiemListModel::data (const GUI::ModelIndex& index, GUI::ModelRole role) const
163
- {
164
- constexpr Array meridiem_names = {
165
- " AM" , " PM"
166
- };
167
-
168
- auto & meridiem = meridiem_names[index.row ()];
169
- if (role == GUI::ModelRole::Display) {
170
- switch (index.column ()) {
171
- case Column::Meridiem:
172
- return meridiem;
173
- default :
174
- VERIFY_NOT_REACHED ();
175
- }
176
- }
177
- return {};
178
- }
179
-
180
136
}
0 commit comments