1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-09-29 15:25:24 +00:00
Commit graph

579 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras
c1be092dea account-widgets: Make row activatable
This brings us closer to the intended design and let's us get rid of
some code.
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras
f102fb3fcd account-widgets: Conform to style
Closes #396
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras
46ff807f6b sip: origin: Always notify state changes when relevant to the UI
by adding functions to the public API which determine if state changes
should be shown to the user and use them (instead of duplicating similar
logic).
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras
41479eea09 account-row: Use delayed state changes for GtkSwitch
When trying to go online/offline we're always waiting for confirmation
from the stack (even if it's a timeout) so the delayed pattern is a good choice.
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras
4f4c7e877e account-row: Fix header alignments
Uncrustify must have gotten confused.
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras
46f46cf3ec settings: Break settings binding cycle
This breaks the settings binding cycle for the "autoload-plugins" and
"preferred-audio-codecs" settings which went something like this:

g_settings_bind () is used with
G_SETTINGS_BIND_DEFAULT (G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET).
It grabs the value of our setting and sets it for the bound property.
This emits the notify signal causing the same value to be set for the
setting.

In effect this caused the setting to be marked as non-default because
Calls had changed the setting without user action. This caused updated
defaults not to apply for existing installations.
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
94fa13af4c settings: Convert to the singleton pattern
We only have a single source of settings, so we should reflect that by
using a singleton. This also reduces our LoC.

This doesn't impair our ability to run tests because there we run with
GSETTINGS_BACKEND=memory
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
d28be2650b Fix header alignment
Uncrustify messed up a bit because of the it expects a semicolon for the
G_* () macros

See https://github.com/uncrustify/uncrustify/issues/3393
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
7ac862155b Uncrustify sources
Ran `find src plugins -iname '*.[c|h]' -print0 | xargs -0 uncrustify --no-backup`
with some minimal manual intervention.
2022-04-24 12:59:42 +02:00
Evangelos Ribeiro Tzaras
69106910f8 manager: Don't raise critical when origin id lookup fails
We don't store origin ids yet
because https://gitlab.gnome.org/GNOME/calls/-/merge_requests/505
is pending on
https://gitlab.gnome.org/GNOME/gom/-/merge_requests/12 and
https://gitlab.gnome.org/GNOME/gom/-/merge_requests/13
2022-04-05 09:27:07 +02:00
Evangelos Ribeiro Tzaras
134c4af9c7 record-row: Avoid raising critical
When the record has a NULL id there won't be a CallsBestMatch we can use to bind
properties.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
1593625373 manager: Remove call-add and call-remove signal
They are phased out in favour of their newly introduced ui-call-* pendants.
This was done to have a better separation of concerns and allows for some
cleanup in CallsCall.

Closes #397
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
42557bf2a1 record-store: Switch to CallsUiCallData 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
7e538d736e ui-call-data: Provide API to get the name of the origin used
This will be used as a fallback when displaying the call details (see #222).
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
d24d1c8c59 manager: Implement lookup_origin_by_id()
This function is used in the activate callback for the per protocol dial actions
to choose the correct origin to place a call from. If an origin cannot be found
it will return NULL which will lead to the fallback "app.dial" action being
invoked.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
30c4e90499 ui-call-data: Store origin id and adapt to changes 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
16b86c29b2 origin: Add id property and adapt to changes
The id property will be used to keep track of which origin was used for a call,
so that we can default to reusing the same origin when placing a call from the
history.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
64ff76e62f manager: Remove unused function declaration
If we have the origin, we can always go directly with calls_origin_dial().
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
3ebc3ed88d call: Prefer pragma once over explicit include guard 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
a85f37e853 record-store: Sort include headers 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
094d402d9b notifier: Fix logic error
After introducing the STR_IS_NULL_OR_EMPTY macro the rewrite of the logic was
inverted.

Fixes d3677ad5d1
2022-02-25 14:30:35 +01:00
Evangelos Ribeiro Tzaras
d3677ad5d1 notifier: Fix expression testing if there is a contact
Previously cui_call_get_display_name() would return the ID of the caller if no
contact was found. As this has changed recently the test for got_contact broke.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
53129e92af util: Add STR_IS_NULL_OR_EMPTY macro
Shamelessly copied from
https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/util.h#L13
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
5b171bf2c5 record-row: Handle calls with NULL id gracefully
Shuffles some code around so that the property bindings are at the end.
This allows us to return early if there is a NULL contact (as is the case
for anonymous callers).
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
cd075d9269 record-row: Use primary info instead of name property
RECHECK if bestmatch can ever have a NULL id!
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
7f40314810 best-match: Add property for primary and secondary display information
This allows to get rid of any special casing that the users of the
calls_best_match_get_name() and calls_best_match_get_id() had to do previously.

We also allow passing in NULL for *_get_primary_info ()
and *_get_secondary_info () for the anonymous caller case.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
79875cb64e ui-call-data: Handle anonymous callers gracefully 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
9ffcbe2de8 contacts-provider: Don't throw a critical when trying to lookup NULL id
Anonymous callers will show up with a NULL id, so don't emit a critical here.

Fixes 006673a9e1
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
c36b6d713a call: Allow setting NULL id
A NULL id will be reported for anonymous callers.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
73ac050cef call: Annotate properties and add introspection attributes on getters/setters
See https://gnome.pages.gitlab.gnome.org/gi-docgen/attributes.html
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
4187eec127 notifier: Codestyle 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
1e734dbbff notifier: Chain up to parents constructed() before doing anything else
Not strictly needed here, because we don't depend on the parent being
constructed but this is how it should generally be done.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
690ac121e9 best-match: Assert CALLS_IS_BEST_MATCH in private functions 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
51598700d7 best-match: Codestyle 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras
6e7984cb5d application: Reuse existing functions in app.dial action
For that we must move open_sip_uri() and open_tel_uri() up to avoid having to
add forward declarations.

Fixes #402
2022-02-18 09:20:07 +00:00
Evangelos Ribeiro Tzaras
006673a9e1 contacts-provider: Guard against lookup with NULL id
If the id is NULL g_str_hash(NULL) will be called which tries dereferencing the
pointer.

Fixes #408
2022-02-15 08:02:18 +01:00
Evangelos Ribeiro Tzaras
8bf2f2cf1d main-window: Bump copyright year in about window 2022-02-13 00:01:50 +01:00
Evangelos Ribeiro Tzaras
f50f0b8b74 call: Add call-type property
The designs for the call details show information on the type of the call:
https://gitlab.gnome.org/Teams/Design/app-mockups/blob/master/calls/calls.png
So f.e. "Cellular", "Matrix WebRTC Video Call".

These properties can potentially also be useful in choosing the mechanism to
use for the audio controls from the call display.
2022-02-09 19:35:46 +01:00
Evangelos Ribeiro Tzaras
34b447a4ca call: Get rid of get_contact() API
This function isn't used anywhere since the recent refactoring, so let's drop
this dead code.
2022-02-09 19:35:43 +01:00
Evangelos Ribeiro Tzaras
d7ba7927d7 manager: Add section documentation 2022-02-06 09:56:31 +01:00
Evangelos Ribeiro Tzaras
3fe976505c manager: Delay UI Call removal and adjust to changes
This was handled explicitly in the Call window.
By changing the logic to delay the emission of "ui-call-removed" we make sure
that the Call UI and the exported DBus object is consistent.

We also need to change the test cases to use run a GMainLoop because we now have
to wait until signal comes in.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
cde517096b dbus: Add hint property
This is a dictionary to allow for future extensibility. Currently we're only
hinting if the UI should be shown for a given call.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
3d85ef802f call-window: Take ui-active property into account
Only show the display after the "pre-ring" phase has passed.

Fixes #371
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
93cf894a8c ringer: Take ui-active property into account
Only start ringing once the UI is deemed active, i.e. the "pre-ring" phase has
passed.

Fixes #371
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
1d5c8952ad ui-call-data: Add property to delay showing call display and ringing
This "ui-active" property should be set to FALSE for new incoming calls and set
to TRUE after a short delay of 20ms. This property is used to delay showing the
call display and starting to ring.

This delay gives DBus clients like
phosh-antispam (https://gitlab.com/kop316/phosh-antispam)
some time to make a decision whether a call should be hung up or not and defer
starting to ring and showing the display only afterwards.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras
d15614a645 selector: Fix property binding
CallsCall used "name", while CuiCall uses "display-name".
2022-02-03 07:16:04 +01:00
Evangelos Ribeiro Tzaras
896af6f8af record-row: Fix passing widget instead of string as action target
When introducing the per protocol dial actions we started setting the widget
self->target as the action target instead of the target property of
self->record.

Bizzarely we only sometimes got greeted with a critical:

11:30:20.5184                 GLib[887977]:CRITICAL: g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed

Thread 1 "gnome-calls" received signal SIGTRAP, Trace/breakpoint trap.
g_logv (log_domain=0x7ffff7ea400e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../../../glib/gmessages.c:1417
1417	../../../glib/gmessages.c: No such file or directory.
(gdb) bt
    at ../../../glib/gmessages.c:2898

Fixes: 687dd7ff383476523ae0a8a38879a171cb0b9a5a
Closes #398
2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras
d452e0a702 dbus-manager: Fix wrong property being bound
Fixes cf6c563ead
2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras
aa04401b06 dbus-manager: Prefer canonical signal names 2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras
423ce4668e record-row: Remove unnecessary G_OBJECT cast 2022-02-01 23:28:50 +01:00