calendar-management/edit: Always show calendar location

As per mockups.

See https://gitlab.gnome.org/Teams/Design/app-mockups/-/issues/102
This commit is contained in:
Georges Basile Stavracas Neto
2024-05-02 14:54:43 -03:00
parent b547db1170
commit 9add430c30
3 changed files with 26 additions and 3 deletions
+1
View File
@@ -9,6 +9,7 @@ src/gui/calendar-management/calendar-row.ui
src/gui/calendar-management/gcal-calendar-management-dialog.ui src/gui/calendar-management/gcal-calendar-management-dialog.ui
src/gui/calendar-management/gcal-calendars-page.c src/gui/calendar-management/gcal-calendars-page.c
src/gui/calendar-management/gcal-calendars-page.ui src/gui/calendar-management/gcal-calendars-page.ui
src/gui/calendar-management/gcal-edit-calendar-page.c
src/gui/calendar-management/gcal-edit-calendar-page.ui src/gui/calendar-management/gcal-edit-calendar-page.ui
src/gui/calendar-management/gcal-file-chooser-button.c src/gui/calendar-management/gcal-file-chooser-button.c
src/gui/calendar-management/gcal-new-calendar-page.c src/gui/calendar-management/gcal-new-calendar-page.c
@@ -26,6 +26,8 @@
#include "gcal-edit-calendar-page.h" #include "gcal-edit-calendar-page.h"
#include "gcal-utils.h" #include "gcal-utils.h"
#include <glib/gi18n.h>
struct _GcalEditCalendarPage struct _GcalEditCalendarPage
{ {
AdwNavigationPage parent; AdwNavigationPage parent;
@@ -141,8 +143,14 @@ setup_calendar (GcalEditCalendarPage *self,
get_source_parent_name_color (manager, source, &parent_name, NULL); get_source_parent_name_color (manager, source, &parent_name, NULL);
GCAL_TRACE_MSG ("Calendar '%s' is GOA: %d; is file: %d; is remote: %d",
gcal_calendar_get_name (calendar),
is_goa,
is_file,
is_remote);
gtk_widget_set_visible (GTK_WIDGET (self->account_row), is_goa); gtk_widget_set_visible (GTK_WIDGET (self->account_row), is_goa);
gtk_widget_set_visible (GTK_WIDGET (self->calendar_url_row), !is_goa && (is_file || is_remote)); gtk_widget_set_visible (GTK_WIDGET (self->calendar_url_row), !is_goa);
/* If it's a file, set the file path */ /* If it's a file, set the file path */
if (is_file) if (is_file)
@@ -177,8 +185,9 @@ setup_calendar (GcalEditCalendarPage *self,
webdav = e_source_get_extension (source, E_SOURCE_EXTENSION_WEBDAV_BACKEND); webdav = e_source_get_extension (source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
guri = e_source_webdav_dup_uri (webdav); guri = e_source_webdav_dup_uri (webdav);
uri = g_uri_to_string_partial (guri, G_URI_HIDE_PASSWORD); uri = g_uri_to_string_partial (guri, G_URI_HIDE_PASSWORD);
text = g_strdup_printf ("<a title=\"%1$s\" href=\"%1$s\">%1$s</a>", uri); text = g_strdup_printf ("<a title=\"%1$s\" href=\"%1$s\">%1$s</a>", uri);
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self->calendar_url_row), _("Calendar URL"));
adw_action_row_set_subtitle (self->calendar_url_row, text); adw_action_row_set_subtitle (self->calendar_url_row, text);
gtk_accessible_update_property (GTK_ACCESSIBLE (self->calendar_url_row), gtk_accessible_update_property (GTK_ACCESSIBLE (self->calendar_url_row),
@@ -194,6 +203,12 @@ setup_calendar (GcalEditCalendarPage *self,
adw_action_row_set_subtitle (self->account_row, name); adw_action_row_set_subtitle (self->account_row, name);
} }
if (!is_goa && !is_remote && !is_file)
{
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self->calendar_url_row), _("Location"));
adw_action_row_set_subtitle (self->calendar_url_row, _("On This Computer"));
}
gtk_color_dialog_button_set_rgba (self->calendar_color_button, gcal_calendar_get_color (calendar)); gtk_color_dialog_button_set_rgba (self->calendar_color_button, gcal_calendar_get_color (calendar));
gtk_editable_set_text (GTK_EDITABLE (self->name_entry), gcal_calendar_get_name (calendar)); gtk_editable_set_text (GTK_EDITABLE (self->name_entry), gcal_calendar_get_name (calendar));
adw_switch_row_set_active (self->calendar_visible_row, gcal_calendar_get_visible (calendar)); adw_switch_row_set_active (self->calendar_visible_row, gcal_calendar_get_visible (calendar));
@@ -23,6 +23,8 @@
<property name="content"> <property name="content">
<object class="AdwPreferencesPage"> <object class="AdwPreferencesPage">
<!-- Location (URL, file path) -->
<child> <child>
<object class="AdwPreferencesGroup"> <object class="AdwPreferencesGroup">
@@ -58,7 +60,6 @@
</object> </object>
</child> </child>
<!-- Location (URL, file path) -->
<child> <child>
<object class="AdwActionRow" id="calendar_url_row"> <object class="AdwActionRow" id="calendar_url_row">
<property name="title" translatable="yes">Location</property> <property name="title" translatable="yes">Location</property>
@@ -69,6 +70,12 @@
</object> </object>
</child> </child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<!-- Calendar name --> <!-- Calendar name -->
<child> <child>
<object class="AdwEntryRow" id="name_entry"> <object class="AdwEntryRow" id="name_entry">