Compare commits

...

10 Commits

Author SHA1 Message Date
bc5169b1f6 exit on close (i.e. never daemonize) 2024-05-18 06:18:20 +00:00
Guido Günther
71f5ffd7dc ci: Update image
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/730>
2024-05-14 08:40:16 +00:00
Guido Günther
af7388db6c ci: Simplify image updates
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/730>
2024-05-14 08:40:16 +00:00
Guido Günther
34b68ec082 mm-origin: Don't crash when Modem has no location services
When no locationservice is available the API can return `NULL` without
setting an error.

Closes: https://gitlab.gnome.org/GNOME/calls/-/issues/641
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/728>
2024-04-24 16:44:00 +02:00
Julian Sparber
0d0cd1c095 Remove Julian Sparber as maintainer 2024-04-18 10:44:11 +00:00
Anton Lazarev
b5577d0005 sip-account-widget: Remove set_password_visibility
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
2024-04-06 08:15:29 -07:00
Anton Lazarev
b2e3e8445d calls-contacts-box: Migrate to GListModel
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
2024-04-06 08:15:29 -07:00
Anton Lazarev
27e6b7a9db treewide: Remove requires glade-isms from ui definitions
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
2024-04-06 08:15:29 -07:00
Anton Lazarev
1e862ffc67 sip-account-widget: Use GtkPasswordEntry
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
2024-04-06 08:15:29 -07:00
Anton Lazarev
7cf7fc02d6 build: Specify required GTK version
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
2024-04-06 08:15:29 -07:00
24 changed files with 67 additions and 112 deletions

View File

@@ -10,7 +10,7 @@ stages:
- deploy
variables:
DEBIAN_IMAGE: $CI_REGISTRY/gnome/calls/debian:v0.0.20240113.1
DEBIAN_IMAGE: $CI_REGISTRY/gnome/calls/debian:v0.0.2024-05-14
GIT_SUBMODULE_STRATEGY: normal
build:native:

7
.gitlab-ci/Makefile Normal file
View File

@@ -0,0 +1,7 @@
VERSION=$(shell date --iso)
all:
./run-docker.sh build --base debian --version 0.0.$(VERSION)
push:
./run-docker.sh push --base debian --version 0.0.$(VERSION)

View File

@@ -17,13 +17,6 @@
<programming-language>C</programming-language>
<maintainer>
<foaf:Person>
<foaf:name>Julian Sparber</foaf:name>
<foaf:mbox rdf:resource="mailto:julian.sparber@puri.sm" />
<gnome:userid>jsparber</gnome:userid>
</foaf:Person>
</maintainer>
<maintainer>
<foaf:Person>
<foaf:name>Evangelos Ribeiro Tzaras</foaf:name>

View File

@@ -32,6 +32,11 @@ project(
]
)
gtk_version = '4.8'
gtk_version_arr = gtk_version.split('.')
gtk_major = gtk_version_arr[0]
gtk_minor = gtk_version_arr[1]
calls_id = 'org.gnome.Calls'
calls_homepage = 'https://gitlab.gnome.org/GNOME/calls'
calls_name = meson.project_name()
@@ -111,6 +116,8 @@ test_c_args = [
'-Wunused-variable',
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_64',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_70',
'-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_@0@_@1@'.format(gtk_major, gtk_minor),
'-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_@0@_@1@'.format(gtk_major, gtk_minor),
# see https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/332
'-DEDS_DISABLE_DEPRECATED',
# in preparation for the switch to Gtk4 we should make sure not to use deprecated symbols

View File

@@ -44,7 +44,7 @@ i18n_plugin = i18n.merge_file(
dummy_deps = [
dependency('gobject-2.0'),
dependency('gtk4'),
dependency('gtk4', version: '>= @0@'.format(gtk_version)),
dependency('libpeas-1.0'),
]

View File

@@ -652,6 +652,7 @@ on_modem_location_get_3gpp_finish (GObject *source_object, GAsyncResult *res, gp
location_3gpp = mm_modem_location_get_3gpp_finish (location, res, &err);
if (!location_3gpp) {
if (err)
g_warning ("Failed to get 3gpp location service: %s", err->message);
return;
}

View File

@@ -42,7 +42,7 @@ i18n_plugin = i18n.merge_file(
mm_deps = [
dependency('gobject-2.0'),
dependency('gtk4'),
dependency('gtk4', version: '>= @0@'.format(gtk_version)),
dependency('ModemManager'),
dependency('mm-glib', version: '>= 1.12.0'),
dependency('libpeas-1.0'),

View File

@@ -43,7 +43,7 @@ i18n_plugin = i18n.merge_file(
ofono_deps = [
dependency('gobject-2.0'),
dependency('gtk4'),
dependency('gtk4', version: '>= @0@'.format(gtk_version)),
dependency('libpeas-1.0'),
]

View File

@@ -179,40 +179,6 @@ on_user_changed (CallsSipAccountWidget *self)
}
static void
set_password_visibility (CallsSipAccountWidget *self, gboolean visible)
{
const char *icon_name;
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
g_assert (GTK_IS_ENTRY (self->password));
icon_name = visible ?
"view-conceal-symbolic" :
"view-reveal-symbolic";
gtk_entry_set_visibility (self->password, visible);
gtk_entry_set_icon_from_icon_name (self->password, GTK_ENTRY_ICON_SECONDARY,
icon_name);
}
static void
on_password_visibility_changed (CallsSipAccountWidget *self,
GtkEntryIconPosition icon_pos,
GdkEvent *event,
GtkEntry *entry)
{
gboolean visible;
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
g_assert (GTK_IS_ENTRY (entry));
g_assert (icon_pos == GTK_ENTRY_ICON_SECONDARY);
visible = !gtk_entry_get_visibility (entry);
set_password_visibility (self, visible);
}
/*
* Stop "insert-text" signal emission if any undesired port
* value occurs
@@ -460,7 +426,6 @@ edit_form (CallsSipAccountWidget *self,
gtk_editable_set_text (GTK_EDITABLE (self->display_name), display_name ?: "");
gtk_editable_set_text (GTK_EDITABLE (self->user), user);
gtk_editable_set_text (GTK_EDITABLE (self->password), password);
set_password_visibility (self, FALSE);
gtk_editable_set_text (GTK_EDITABLE (self->port), port_str);
adw_combo_row_set_selected (self->protocol, protocol_index);
adw_combo_row_set_selected (self->media_encryption, encryption_index);
@@ -647,7 +612,6 @@ calls_sip_account_widget_class_init (CallsSipAccountWidgetClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_delete_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_apply_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_user_changed);
gtk_widget_class_bind_template_callback (widget_class, on_password_visibility_changed);
gtk_widget_class_bind_template_callback (widget_class, on_port_entry_insert_text);
gtk_widget_class_bind_template_callback (widget_class, on_port_entry_after_insert_text);
}

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="CallsSipAccountWidget" parent="AdwBin">
<child>
<object class="AdwToolbarView" id="child">
@@ -99,14 +97,10 @@
<object class="AdwActionRow">
<property name="title" translatable="yes">Password</property>
<child>
<object class="GtkEntry" id="password">
<object class="GtkPasswordEntry" id="password">
<property name="valign">center</property>
<property name="input-purpose">password</property>
<property name="visibility">False</property>
<property name="primary_icon_sensitive">False</property>
<property name="secondary_icon_name">view-reveal-symbolic</property>
<property name="show-peek-icon">True</property>
<signal name="changed" handler="on_user_changed" swapped="yes"/>
<signal name="icon-press" handler="on_password_visibility_changed" swapped="yes"/>
</object>
</child>
</object>

View File

@@ -596,11 +596,16 @@ notify_window_visible_cb (GtkWidget *window,
CallsManager *manager = calls_manager_get_default ();
g_return_if_fail (CALLS_IS_APPLICATION (application));
g_return_if_fail (CALLS_IS_CALL_WINDOW (window));
gboolean calls_visible = gtk_widget_is_visible (application->call_window);
gboolean main_visible = gtk_widget_is_visible (application->main_window);
/* The UI is being closed, hang up active calls */
if (!gtk_widget_is_visible (window))
if (!calls_visible)
calls_manager_hang_up_all_calls (manager);
/* No windows (of interest) are open -> exit */
if (!main_visible && !calls_visible)
app_shutdown (application);
}
@@ -666,6 +671,12 @@ start_proper (CallsApplication *self)
G_CALLBACK (notify_window_visible_cb),
self,
G_CONNECT_AFTER);
g_signal_connect_object (self->main_window,
"notify::visible",
G_CALLBACK (notify_window_visible_cb),
self,
G_CONNECT_AFTER);
}

View File

@@ -41,7 +41,10 @@ struct _CallsContactsBox {
GtkWidget *contacts_listbox;
GtkWidget *placeholder_empty;
GListStore *contacts_list;
GtkCustomSorter *contacts_sorter;
FolksSimpleQuery *search_query;
GtkCustomFilter *search_filter;
};
G_DEFINE_TYPE (CallsContactsBox, calls_contacts_box, ADW_TYPE_BIN);
@@ -56,15 +59,13 @@ search_changed_cb (CallsContactsBox *self,
folks_simple_query_set_query_string (self->search_query, search_text);
gtk_list_box_invalidate_filter (GTK_LIST_BOX (self->contacts_listbox));
gtk_filter_changed (GTK_FILTER (self->search_filter), GTK_FILTER_CHANGE_DIFFERENT);
}
static gboolean
contacts_filter_func (CallsContactsRow *row,
contacts_filter_func (FolksIndividual *item,
CallsContactsBox *self)
{
FolksIndividual *item = calls_contacts_row_get_item (row);
return folks_query_is_match (FOLKS_QUERY (self->search_query), item) > 0;
}
@@ -104,18 +105,14 @@ on_favourite_changed (CallsContactsBox *self)
{
g_assert (CALLS_IS_CONTACTS_BOX (self));
gtk_list_box_invalidate_sort (GTK_LIST_BOX (self->contacts_listbox));
gtk_sorter_changed (GTK_SORTER (self->contacts_sorter), GTK_SORTER_CHANGE_DIFFERENT);
}
static void
contacts_provider_added (CallsContactsBox *self,
FolksIndividual *individual)
{
GtkWidget *row;
row = calls_contacts_row_new (individual);
gtk_list_box_append (GTK_LIST_BOX (self->contacts_listbox), row);
g_list_store_append (G_LIST_STORE (self->contacts_list), individual);
g_signal_connect_object (individual,
"notify::is-favourite",
@@ -128,32 +125,24 @@ static void
contacts_provider_removed (CallsContactsBox *self,
FolksIndividual *individual)
{
int i = 0;
GtkListBoxRow *row = gtk_list_box_get_row_at_index(GTK_LIST_BOX (self->contacts_listbox), i);
while (row != NULL) {
if (calls_contacts_row_get_item (CALLS_CONTACTS_ROW (row)) == individual)
gtk_list_box_remove (GTK_LIST_BOX (self->contacts_listbox), GTK_WIDGET (row));
i += 1;
row = gtk_list_box_get_row_at_index(GTK_LIST_BOX (self->contacts_listbox), i);
guint position;
while (g_list_store_find (G_LIST_STORE (self->contacts_list), individual, &position)) {
g_list_store_remove(G_LIST_STORE (self->contacts_list), position);
}
}
static gint
contacts_sort_func (CallsContactsRow *a,
CallsContactsRow *b,
contacts_sort_func (FolksIndividual *a,
FolksIndividual *b,
gpointer unused)
{
FolksIndividual *individual_a = calls_contacts_row_get_item (a);
FolksIndividual *individual_b = calls_contacts_row_get_item (b);
const char *name_a = folks_individual_get_display_name (individual_a);
const char *name_b = folks_individual_get_display_name (individual_b);
const char *name_a = folks_individual_get_display_name (a);
const char *name_b = folks_individual_get_display_name (b);
gboolean fav_a;
gboolean fav_b;
g_object_get (G_OBJECT (individual_a), "is-favourite", &fav_a, NULL);
g_object_get (G_OBJECT (individual_b), "is-favourite", &fav_b, NULL);
g_object_get (G_OBJECT (a), "is-favourite", &fav_a, NULL);
g_object_get (G_OBJECT (b), "is-favourite", &fav_b, NULL);
if (fav_a == fav_b)
return g_strcmp0 (name_a, name_b);
@@ -194,6 +183,8 @@ static void
calls_contacts_box_init (CallsContactsBox *self)
{
CallsContactsProvider *contacts_provider;
GtkSortListModel *sorted_contacts;
GtkFilterListModel *filtered_contacts;
g_autoptr (GeeCollection) individuals = NULL;
gchar* query_fields[] = { "alias",
@@ -204,23 +195,26 @@ calls_contacts_box_init (CallsContactsBox *self)
gtk_widget_init_template (GTK_WIDGET (self));
self->contacts_list = g_list_store_new(FOLKS_TYPE_INDIVIDUAL);
self->contacts_sorter = gtk_custom_sorter_new ((GCompareDataFunc) contacts_sort_func, NULL, NULL);
sorted_contacts = gtk_sort_list_model_new (G_LIST_MODEL (g_object_ref (self->contacts_list)), GTK_SORTER (g_object_ref (self->contacts_sorter)));
self->search_query = folks_simple_query_new ("", query_fields, G_N_ELEMENTS (query_fields));
self->search_filter = gtk_custom_filter_new ((GtkCustomFilterFunc) contacts_filter_func, self, NULL);
filtered_contacts = gtk_filter_list_model_new (G_LIST_MODEL (sorted_contacts), GTK_FILTER (g_object_ref (self->search_filter)));
gtk_list_box_bind_model (GTK_LIST_BOX (self->contacts_listbox),
G_LIST_MODEL (filtered_contacts),
(GtkListBoxCreateWidgetFunc) calls_contacts_row_new,
NULL,
NULL);
gtk_list_box_set_header_func (GTK_LIST_BOX (self->contacts_listbox),
(GtkListBoxUpdateHeaderFunc) header_cb,
NULL,
NULL);
gtk_list_box_set_sort_func (GTK_LIST_BOX (self->contacts_listbox),
(GtkListBoxSortFunc) contacts_sort_func,
NULL,
NULL);
gtk_list_box_set_filter_func (GTK_LIST_BOX (self->contacts_listbox),
(GtkListBoxFilterFunc) contacts_filter_func,
self,
NULL);
g_signal_connect_swapped (self->placeholder_empty, "map", G_CALLBACK (adjust_style), self);
g_signal_connect_swapped (self->placeholder_empty, "unmap", G_CALLBACK (adjust_style), self);

View File

@@ -30,7 +30,7 @@ src_include = include_directories('.')
calls_includes = [ top_include, src_include ]
calls_deps = [ dependency('gobject-2.0', version: '>= 2.58'),
dependency('gtk4'),
dependency('gtk4', version: '>= @0@'.format(gtk_version)),
dependency('libadwaita-1', version: '>= 1.2'),
dependency('libfeedback-0.0'),
dependency('libpeas-1.0'),

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="CallsAccountOverview" parent="AdwWindow">
<property name="default-width">380</property>
<property name="default-height">660</property>

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="CallsAccountRow" parent="AdwActionRow">
<property name="title">Title</property>
<property name="subtitle">Subtitle</property>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="CallsCallRecordRow" parent="GtkListBoxRow">
<property name="activatable">False</property>
<property name="selectable">False</property>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="CallsCallSelectorItem" parent="AdwBin">
<child>
<object class="GtkFrame">

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="CallsCallWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Calls</property>
<property name="hide-on-close">True</property>

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="0.0"/>
<template class="CallsContactsBox" parent="AdwBin">
<child>
<object class="AdwToolbarView" id="child">

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="CallsContactsRow" parent="GtkListBoxRow">
<property name="activatable">False</property>
<property name="selectable">False</property>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="CallsHistoryBox" parent="AdwBin">
<child>
<object class="GtkStack" id="stack">

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="CallsMainWindow" parent="AdwApplicationWindow">
<property name="title" translatable="yes">Calls</property>
<property name="show_menubar">False</property>

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="CallsNewCallBox" parent="AdwBin">
<child>
<object class="GtkBox" id="child">

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="CallsNewCallHeaderBar" parent="GtkHeaderBar">
<property name="title" translatable="yes">New Call</property>
<child type="start">