edit-calendar: Limit Calendar URL row to 1 line; use basename

This commit is contained in:
Hari Rana
2023-06-19 11:08:35 -04:00
parent 5f82b1054e
commit 10be0ac7ef
2 changed files with 6 additions and 1 deletions
@@ -148,6 +148,7 @@ setup_calendar (GcalEditCalendarPage *self,
/* If it's a file, set the file path */
if (is_file)
{
g_autofree gchar *basename = NULL;
g_autofree gchar *text = NULL;
g_autofree gchar *uri = NULL;
ESourceLocal *local;
@@ -155,10 +156,12 @@ setup_calendar (GcalEditCalendarPage *self,
local = e_source_get_extension (source, E_SOURCE_EXTENSION_LOCAL_BACKEND);
file = e_source_local_get_custom_file (local);
basename = g_file_get_basename (file);
uri = g_file_get_uri (file);
text = g_strdup_printf ("<a href=\"%s\">%s</a>", uri, uri);
text = g_strdup_printf ("<a href=\"%s\">%s</a>", uri, basename);
adw_action_row_set_subtitle (self->calendar_url_row, text);
gtk_widget_set_tooltip_text (GTK_WIDGET (self->calendar_url_row), basename);
}
/* If it's remote, build the uri */
@@ -175,6 +178,7 @@ setup_calendar (GcalEditCalendarPage *self,
text = g_strdup_printf ("<a href=\"%s\">%s</a>", uri, uri);
adw_action_row_set_subtitle (self->calendar_url_row, text);
gtk_widget_set_tooltip_text (GTK_WIDGET (self->calendar_url_row), uri);
}
if (is_goa)
@@ -43,6 +43,7 @@
<child>
<object class="AdwActionRow" id="calendar_url_row">
<property name="title" translatable="yes">Location</property>
<property name="subtitle-lines">1</property>
<property name="visible" bind-source="calendar_url_row" bind-property="visible" bind-flags="default" />
<style>
<class name="property"/>