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

609 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras a85b9cd5c3 manager: Initialize g_auto variable to NULL 2021-08-25 11:06:32 +02:00
Evangelos Ribeiro Tzaras 9c777b7db8 new-call-box: Hide empty results
Because the empty result looks weird.
2021-08-19 01:46:59 +02:00
Evangelos Ribeiro Tzaras b1c22e4310 new-call-box: Press enter to place a call
Connect to the "activate" signal and take appropriate action
for both numeric and non-numeric cases.
2021-08-19 01:44:06 +02:00
Evangelos Ribeiro Tzaras a21bc475e4 new-call-box: Reindent 2021-08-19 01:35:47 +02:00
Evangelos Ribeiro Tzaras da4c6b043a new-call-box: Add placeholder texts for text input fields 2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras 2c06497b08 new-call-box: Tweak the UI
- Fills horizontally now
- Make sure the "dial" and "backspace" button are still properly aligned
  by using HdyClamp with the keypads typical size (rougly 250)
- Remove unnecessary default values from the xml
  (f.e. "can-focus" on GtkEntry or GtkButton)
2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras 3779aa1062 new-call-box: Set numeric input property based on selected origin 2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras db848b2c9f new-call-box: Add entry for non-numeric inputs 2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras e9661ce01c new-call-box: Introduce numeric-input-only property
This property will show the keypad for numeric inputs (i.e. telephone numbers)
or an entry allowing arbitrary inputs for SIP or other protocols.
2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras c61d63383f new-call-box: Remove unnecessary GtkBox 2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras 1312b2624c new-call-box: Remove unused GtkListStore 2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras 179c844a80 calls-new-call-box: Only show origin combo box if there is a choice 2021-08-14 20:46:11 +02:00
Evangelos Ribeiro Tzaras 62711da7fc new-call-box: Simplify HdyComboRow binding 2021-08-13 02:13:27 +02:00
Evangelos Ribeiro Tzaras c7731b189a origin: Add "numeric-addresses" property
This will be useful in the dialpad to determine whether we should allow
only numeric input or not.
2021-08-13 02:13:27 +02:00
Mohammed Sadiq 8af2563859 Add and use new logger
This helps provider better logs.  With this, the user can now run
with `-v` for verbose logs, use more `-v` to be more verbose,
eg `calls -vvvvv` log shall be very verbose
2021-08-11 09:38:19 +00:00
Guido Günther a1fa33c7af notifier: Add notification category
This helps shells to adjust the kind of haptic/visual/audio
feedback for the notification.
2021-08-04 02:36:34 +00:00
Guido Günther 26f0c9cb01 calls-notifier: Set log domain 2021-08-04 02:36:34 +00:00
Mohammed Sadiq fe84a02af2 history-box: Use content style for listbox
So as to match the design and less code to maintain
2021-08-03 12:42:46 +00:00
Mohammed Sadiq 47a7d58074 application: Fix handling commandline arguments
handle_local_options() are supposed to be handled only in local instance,
and not in remote instance.
2021-07-30 00:12:50 +00:00
Evangelos Ribeiro Tzaras 9d9e989be4 secret-store: Work around bug in gnome-keyring preventing keyring unlocking
When a keyring is cold (unlocked) the schema is set as
"org.freedesktop.Secret.Generic". If we require the name to strictly match
while searching we won't ever get a match.

See https://gitlab.gnome.org/GNOME/gnome-keyring/-/issues/89 and
https://gitlab.gnome.org/GNOME/libsecret/-/issues/7 for more information

Closes #316
2021-07-21 17:30:51 +02:00
Evangelos Ribeiro Tzaras 241909c942 main-window: Fix the action name for the about dialog 2021-07-20 10:18:03 +02:00
Evangelos Ribeiro Tzaras 373465cc2c about: Update copyright 2021-07-20 10:18:03 +02:00
Evangelos Ribeiro Tzaras 1f0ad8cf7c about: Update authors 2021-07-20 10:18:03 +02:00
Evangelos Ribeiro Tzaras c5e4c80a47 Introduce CallsSecretStore to store credentials 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras 803e089cfc account-overview: Hook up available providers
Fixes #264.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras fc7156fe75 Introduce CallsAccountOverview: A UI to allow managing VoIP accounts
CallsAccountOverview allows user to view, add and edit VoIP accounts
(currently SIP only).

Each CallsAccount is represented by a CallsAccountRow.

account-row: Staying alive
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras fadeaeb6b5 main-window: Add menu button
This will be used to manage VoIP accounts (SIP), show the About dialog
and so on. We will leave this hidden for now.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras 64bb170efa account-provider: Repurpose to allow graphical credential editing 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras d5bf31bdaf manager: Temporarily hold a reference to provider being unloaded 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras 2b31a9677e manager: Emit signal when loaded providers have changed 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras cc3a562f03 manager: Add API to query loaded providers 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras a638b64402 account: Add address property 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras dd3fbf646e account: Add API to query account state 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras 82ff6d0ac5 account: Use explicit notify for account state property 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras babd013bd7 Remove CallsCredentials and adapt to changes
The provider knows best which credentials it needs and CallsCredentials
was not generic to begin with, so get rid of it.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras 2af2b316ec Various codestyle fixes 2021-07-20 10:17:17 +02:00
Adrien Plazas d4ee8b4bc9 main-window: Fix the indentation
It was purposefully left broken to ease code review.
2021-07-16 08:43:43 +00:00
Adrien Plazas f4f41d9db5 main-window: Make it a HdyApplicationWindow
This gives the window some nice rounded corners, and gives us more
freedom in how to implement the UI.

This purposefully leaves the indentation broken to ease code review, it
will be fixed in the next commit.
2021-07-16 08:43:43 +00:00
Guido Günther f45ba43720 dbus: Add more DBus properties
These are needed to allow Phosh to handle incoming calls on
the locked screen.
2021-07-12 17:36:24 +02:00
Guido Günther 8bf320e006 Drop layer-surface
This drops the layer-surface code to put calls on top of the lockscreen.
This only works with wlroots based compositors and even there makes e.g.
unlocking the screen during a phone calls impossible.
2021-07-12 17:36:24 +02:00
Guido Günther cad39e05ee dbus-manager: Fix typo in log-domain 2021-07-12 17:33:12 +02:00
Evangelos Ribeiro Tzaras 69b919d7ab DBus: Use org.gnome prefix and adapt to changes
In preparation to moving to GNOME all the IDs, DBus object paths, etc should
change.
2021-07-12 13:35:57 +00:00
Evangelos Ribeiro Tzaras b74601f7c4 schema: Use org.gnome prefix and adapt to changes
In preparation to moving to GNOME all the IDs, DBus object paths, etc should
change.
2021-07-12 13:35:57 +00:00
Evangelos Ribeiro Tzaras 6e371d2f3f resources: Use /org/gnome prefix and adapt to changes
In preparation to moving to GNOME all the IDs, DBus object paths, etc should
change.
2021-07-12 13:35:57 +00:00
Evangelos Ribeiro Tzaras 9f45e8b0a5 call-display: Ellipsize labels at the end
Fixes #283
2021-07-01 02:02:09 +02:00
Evangelos Ribeiro Tzaras c293b7029d best-match: Preliminary handling of SIP addresses
This does not perform any contact lookup, but instead introduces a benign
hack to be able to get something sensible when calling
`calls_best_match_get_name()` and avoids unnecessary warnings.
2021-07-01 02:01:32 +02:00
Evangelos Ribeiro Tzaras fd45f04886 best-match: codestyle 2021-07-01 02:00:52 +02:00
Evangelos Ribeiro Tzaras 23e7fd3a60 manager: Don't use peas_engine_prepend_search_path
as it does not really "prepend" the search path.
See https://gitlab.gnome.org/GNOME/libpeas/-/issues/19

Closes #300
2021-06-29 14:47:03 +02:00
Evangelos Ribeiro Tzaras e00b90d64e application: settings: Add autoload-plugins setting
This setting will be used to define the provider plugins to be loaded on
application startup if calls has been invoked without `--provider`
2021-06-26 08:57:53 +02:00
Evangelos Ribeiro Tzaras 4f6fb722b1 application: Allow invoking with multiple -p arguments
When calls is invoked with one or more `--provider` arguments,
the application will only load the providers specified by the command line.

If no `--provider` argument is given, the application will instead fall back
to loading providers defined in the settings (see next commit).
2021-06-26 08:57:53 +02:00
Evangelos Ribeiro Tzaras cfd3c2a7fe util: Get rid of conditional compilation in calls_find_in_store()
This is not needed anymore after bumping the required glib version to 2.64.
2021-06-25 07:34:38 +00:00
Evangelos Ribeiro Tzaras cce8318a64 notifier: Explicitly handle unknown callers
Closes #288
2021-06-18 17:13:48 +00:00
Evangelos Ribeiro Tzaras dbb829be06 debug: Add G_LOG_DOMAIN to every file using g_debug() 2021-06-18 11:12:13 +02:00
Evangelos Ribeiro Tzaras 160d3e42a8 ringer: Follow coding style for G_LOG_DOMAIN
Closes #294
2021-06-18 11:12:13 +02:00
Evangelos Ribeiro Tzaras b550160a0d util: Make position argument in calls_find_store() optional 2021-06-11 17:52:43 +02:00
Evangelos Ribeiro Tzaras ccae753194 manager: codestyle 2021-06-11 17:50:42 +02:00
Evangelos Ribeiro Tzaras ddcd91d3d9 manager: Fix whitespace 2021-06-11 17:50:22 +02:00
Evangelos Ribeiro Tzaras acc35ad224 main-window: Add default case to switch statement
As caught by compiling with `-Wswitch-default`
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras 90b598ed5b record-store: Add default case to switch statements
As caught by compiling with `-Wswitch-default`
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras f097a39e04 call-display: Add default case to switch statement
As caught by compiling with `-Wswitch-default`
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras 2847508034 Fix missing-declarations warnings all over the codebase
As caught by compiling with `-Wmissing-declarations`
by either making functions static, or declaring them in the header.
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras 96a7d901c1 Fix old-style warnings all over the codebase
As caught by compiling with `-Wold-style-definition` and `-Wstrict-prototypes`.
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras 38abbc5b18 record-store: codestyle 2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras 9877f4469b display: Fix typo 2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras 588955b59e display: codestyle 2021-06-03 19:46:45 +00:00
Guido Günther 6f93b48ef4 Expose call objects on DBus
This exports call objects on the session bus:

 $ gdbus monitor --session -d sm.puri.Calls
 …
 /sm/puri/Calls: org.freedesktop.DBus.ObjectManager.InterfacesAdded (objectpath '/sm/puri/Calls/Call/1', {'sm.puri.Calls.Call': {'Inbound': <false>, 'State': <uint32 0>, 'Id': <''>, 'Party': <''>}})
 /sm/puri/Calls/Call/1: org.freedesktop.DBus.Properties.PropertiesChanged ('sm.puri.Calls.Call', {'Id': <'0987654321'>, 'Inbound': <true>, 'State': <uint32 5>}, @as [])
 /sm/puri/Calls: org.freedesktop.DBus.ObjectManager.InterfacesRemoved (objectpath '/sm/puri/Calls/Call/1', ['sm.puri.Calls.Call'])
 $ gdbus call --session --dest sm.puri.Calls --object-path /sm/puri/Calls/Call/1 --method sm.puri.Calls.Call.Hangup

Currenty hangup and accept methods are implemented as well as exposing
the current call state.
2021-06-03 14:29:36 +00:00
Evangelos Ribeiro Tzaras 8d937bedf6 Initial DBus API 2021-06-03 14:29:36 +00:00
Evangelos Ribeiro Tzaras cb533aabb7 manager: Update country code
By connecting to the "notify::country-code" signal of our origins.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 7d3426598d application: settings: Add country code setting
This helps to unbreak country code lookup (see 5fd39121).
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 4990529c6c tests: manager: Add multiple provider tests
The test suite can be further expanded later. For now this suffices to
have some basic regression testing for multiple provider support in place.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 44f2002f86 manager: Differentiate the NO_ORIGIN state
This avoids confusion when only the SIP plugin is loaded, but no account
is being used.

For this we introduce two new functions in the abstract CallsProvider class:
`is_modem()` to indicate whether the the provider deals with PTSN telephony and
`is_operational()` which by default simply checks if there any avalaible origins
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 98d66743a1 application: Don't add a provider if one is already present
If we initially invoked `gnome-calls -p sip` and later invoke
`gnome-calls sip:user@host` we don't expect to have the default MM provider
added.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 3f3b108cea new-call-box: Honour auto-use-default-origins setting 2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras fef1531749 application: Add CallsSettings class
This makes it easy to access application wide settings.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 0b2f146053 manager: support multiple providers
This includes the following changes:
- Introduce a `providers` hash table to keep track of multiple CallProvider's
  and remove the `provider` member
- Remove `calls_manager_get_provider()` and `calls_manager_set_provider()`
  in favour of `calls_manager_add_provider()`, `calls_manager_remove_provider()`
  and `calls_manager_has_provider()`
- Introduce a `origins` GListStore to keep track of available origins.
  `origins` is updated in `items_changed_cb()` when the origins of any
  CallsProvider are updated.
- Adapt to changes with respect to `calls_manager_get_origins()`.
- Introduce `origins_by_protocol` hash table to keep track of available origins
  per protocol.
- Adjust tests
- We temporarily break country code lookup which was handled previously
  with the "default-origin" mechanism. We will add it back to the CallsSettings
  class which will provide a better application-wide mechanism.
2021-06-01 14:52:18 +02:00
Evangelos Ribeiro Tzaras 0c966fdf83 origin: Add API to query supported protocols
This will allow selecting a suitable origin when placing outgoing calls.
2021-05-28 17:02:02 +02:00
Evangelos Ribeiro Tzaras 7ad0f4cdd6 provider: Add API to query supported protocols
These are the protocols that the provider plugin may support. The origins
must be queried independently whether or not they support any given protocol.

Example: A SIP origin/account may or may not support the "tel" protocol.
2021-05-28 17:02:02 +02:00
Evangelos Ribeiro Tzaras 6d8c227b24 calls-record: Introduce the protocol property
This is in preparation for supporting multiple providers (which are handling
different protocols/URI schemes).

This commit also changes the underlying database schema.
2021-05-28 17:02:02 +02:00
Evangelos Ribeiro Tzaras 53f69b06dd call: Introduce protocol property 2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras 1e84812938 util: Add simple API to query protocol 2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras 80ec7d8a35 account-provider: Add debugging in the public functions 2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras fecdc1fff8 cleanup: Fix calls_origin_get_name() related memory leaks
Document calls_origin_get_name() correctly as transfer-full.
Additionaly fix related memory leaks.
2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras 1543802c88 provider: whitespace and indentation 2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras 2ac43f391a manager: Set peas search path only once
There is no need to redo it for every added plugin.
2021-05-20 02:52:11 +02:00
Mohammed Sadiq b1278f6140 build: Avoid building files multiple times
We don't have to build each source for every test, instead we could
create a static library link it with every test, which will be a lot
faster.
2021-05-17 20:00:04 +05:30
Evangelos Ribeiro Tzaras 14ef4f6b17 Add CallsAccountProviderInterface
This interface should by implemented by providers for which the user can add
or remove accounts.
2021-05-04 06:41:43 +02:00
Evangelos Ribeiro Tzaras 781adaddee sip: origin: Use CallsAccountState instead of SipAccountState 2021-05-04 05:57:42 +02:00
Evangelos Ribeiro Tzaras 0e5bd82568 Add CallsAccountInterface
This interface should be implemented by origins which represent an online
account. This means they must have a implement a property representing the
credentials and another representing the account state (online, offline, etc).
2021-05-04 05:57:42 +02:00
Evangelos Ribeiro Tzaras 3f72d34c49 Add CallsCredentials class and use it in CallsSipProvider
CallsCredentials is a dumb container to store account credentials.
This is done in preparation for the account management in the UI.
2021-05-04 05:57:06 +02:00
Evangelos Ribeiro Tzaras f9a324fc6f manager: add debug messages when adding or removing origins 2021-04-27 11:39:09 +02:00
Evangelos Ribeiro Tzaras 8a4d408f3f manager: remove unused CallsProvider argument from functions
Both add_origin() and remove_origin() don't really need it.
2021-04-27 11:39:09 +02:00
Evangelos Ribeiro Tzaras b71227aae5 call: doc: Indicate ownership in docstrings 2021-04-27 11:38:58 +02:00
Evangelos Ribeiro Tzaras 5ed24c4ed7 doc: Fix gtk-doc transfer annotations 2021-04-27 11:38:26 +02:00
Evangelos Ribeiro Tzaras 70f1df7e0e build: separate version from the rest of the configuration data
This should make sure that we always have 'config.h' available and
should fix issues with flatpak build as seen in #257:

`fatal error: config.h: No such file or directory`
2021-04-27 01:55:13 +02:00
Evangelos Ribeiro Tzaras d0194fe534 manager: g_assert in static functions 2021-04-25 18:12:59 +02:00
Evangelos Ribeiro Tzaras c2c3f64102 codestyle: new-call-box 2021-04-25 18:12:59 +02:00
Evangelos Ribeiro Tzaras d65284acaa codestyle: align function prototypes in calls-origin header
This makes it a easier on the eyes.
2021-04-25 18:12:59 +02:00
Evangelos Ribeiro Tzaras 868d9e36da codestyle: get rid of CALLS_SET_PTR_PROPERTY macro
One more step towards fixing #214
In `calls-ofono-call.c` the changed code also adheres to the newly introduced
coding style.
2021-04-25 18:12:59 +02:00
Evangelos Ribeiro Tzaras 042478a8eb call-record: Get rid of macros
While these macros are not too bad, they will still be removed for the sake
of consistency (no other purism project uses macros this heavily).

Fixes part of #214
2021-04-25 18:12:59 +02:00
Evangelos Ribeiro Tzaras 4d405e6dcb application: add --version flag
Closes #256
2021-04-16 19:57:03 +02:00
Evangelos Ribeiro Tzaras 9a4debe87e codestyle: application 2021-04-16 19:47:01 +02:00
Evangelos Ribeiro Tzaras 21666fc7d4 best-match: Don't set NULL phone numbers when updating country code
Also related to #255
2021-04-12 14:02:26 +02:00
Evangelos Ribeiro Tzaras a072d8c7e3 best-match: avoid using NULL phone number
Fixes #255
2021-04-12 14:02:19 +02:00
Evangelos Ribeiro Tzaras 9703b1e43e best-match: disconnect old signal handlers 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 0bd6d7f2a5 best-match: Lookup contact if country code changed
Closes #217
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 25d651c834 manager: set default origin
This is a bit of a hack to get the country code property hooked up
and will require a rework when multiple provider support is being added.
As the default origin is not being used anywhere else in the code
it's currently not a problem that we're not tracking if the default
origin is being removed.

Additionally test-manager.c needed some adjustment.
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 622827d293 best-match: Use the country code 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras e5832bbad3 application: Use the country code 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 7d69d78b70 origin: Add country-code property
And add a binding in CallsManager for the default origin
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 69b170ecfe best-match: g_return_if_fail if not GeeCollection
Closes #254
Closes #227
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras f8a57edc6d contacts-provider: fix docstring
The caller takes ownership of the returned `CallsBestMatch`, so
this should be reflected in the docstring
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras f84d3c0adf call: g_return_if_fail: type check calls_call_get_contact () 2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 32c89ca9dd contact-provider: remove trailing whitespaces 2021-04-06 14:27:26 +00:00
Guido Günther e5827adb60 calls: Fix gtk-doc transfer annotation
Broken-by: 501d2914
2021-04-06 13:01:36 +00:00
Guido Günther 01f015a21c provider: Fix gtk-doc transfer annotations
Broken-by: 9e92fb88
2021-04-06 13:01:36 +00:00
Guido Günther 443d23dd56 build: deduplicate sources
Shorten the needed sources from

 calls_sources, calls_enum_sources, calls_resources,
 wl_proto_sources, wayland_sources,

to

  calls_sources

so adding new things such as generated dbus sources doesn't have to
happen in four locations but just one.
2021-04-06 14:18:06 +02:00
Guido Günther 5933a4005d build: Move generated souces before source file list
This will be needed in the next commit
2021-04-06 12:50:31 +02:00
Evangelos Ribeiro Tzaras 9e92fb88af provider: Add API for loading and unloading provider plugins
This is also used for our tests. In order to avoid code duplication
this is being moved to calls-provider.{c,h}.
2021-04-05 06:13:44 +00:00
Mohammed Sadiq c30a41ffa9 Let calls-call be an abstract class
And adapt to changes.

A calls-mm-call IS-A calls-call (and so on)
2021-04-05 09:38:03 +05:30
Mohammed Sadiq a30e1eaa8f provider: Implement default methods
Simply return NULL when these methods are called.

If not implemented, calling these methods may result
in crash when the subclasses haven't implemented them.
2021-04-04 18:16:48 +05:30
Mohammed Sadiq faa35e90dc provider: Rename a variable
Provider is no longer an interface
2021-04-04 18:12:46 +05:30
Evangelos Ribeiro Tzaras d67e690f33 new-call-box: Connect signals only if origins non-NULL
Fixes #252
2021-04-03 06:41:54 +00:00
Mohammed Sadiq dc7c676df8 provider: Avoid private data
We only have a dummy variable here
2021-04-03 07:22:27 +05:30
Evangelos Ribeiro Tzaras 685aa1950e application: open sip uri 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras de44a17fe5 sip: use ipv4 exclusively for now
IPv6 should work, but sofia's outbound engine keep printing
errors involving the outbound engine. Working theory:
Failing ICMPv6 (pings) can make sofia think we don't have connectivity.
Note that we also don't get any answers from the SIP servers we tried so far.
2021-04-03 00:08:31 +02:00
Guido Günther 55559d91db window: Don't unhibit with 0 cookie
The upper layers do not bother whether there's an inhibitor when
calling uninhibit (and shouldn't) so don't put out out warning
when called with 0 cookie.

Closes: #249
2021-04-01 16:50:51 +00:00
Guido Günther b04d564bcf manager: Allow to add plugin dir via environent
This eases testing of plugins from the source tree:

  CALLS_PLUGIN_DIR=_build/plugins/dummy/ _build/src/gnome-calls -p dummy
2021-04-01 14:07:27 +02:00
Evangelos Ribeiro Tzaras 94345e0916 manager: hang up secondary calls 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro Tzaras 24f53cd927 manager: remove unused function 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro Tzaras 78c0fb1ed7 ringer: use quiet profile for non-primary calls 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro Tzaras 3aebfcc6d1 contact-row: remove deprecated function
Fixes #234
2021-03-09 22:45:01 +01:00
Evangelos Ribeiro Tzaras 35f45d8373 meson: bump required libhandy-1 version >1.1.90 2021-03-09 16:50:13 +01:00
Guido Günther 97c2dde0eb notifier: Fix compile warning
Fixes
  ../src/calls-notifier.c: In function ‘state_changed_cb’:
  /usr/include/glib-2.0/glib/gmacros.h:1132:17: warning: ‘notification’ may be used uninitialized in this function [-Wmaybe-uninitialized]

which wasn't problematic with the current code flow but
can easily become a problem when shuffling stuff around.
2021-03-01 10:04:02 +01:00
Mohammed Sadiq 994853910d application: Open only the first 'tel:' URI
Calls can't handle multiple calls, so there is no
point in handling all URIs.

Handle opening URI in activate(), which will be helpful
when we use local_command_line()

Also, this commit fixes presenting window on initial
launch of Calls with a “tel:” URI
2021-02-27 09:14:44 +00:00
Evangelos Ribeiro Tzaras 5b34342134 new-call-box: make sure to call origin_count_changed_cb
Otherwise the model changes happening before hooking up will be missed
(which results in the model not being bound to HdyComboRow).
2021-02-27 09:45:06 +01:00
Mohammed Sadiq eda460ac15 provider: Use GListModel to track origins
And adapt to changes

It's easier to track changes if we are using GListModel than
a GList.  Also, eventually we shall have multiple providers,
and we can use GtkFlattenListModel to merge multiple origins
without manually managing pointers ourself.

Since several widgets has APIs to handle GListModels, it will
also help us create widgets from GListModels easily.
2021-02-25 08:44:56 +05:30
Evangelos Ribeiro Tzaras d75a08b9b7 application: Fix double free
The double free was introduced in 46e4422.
This fixes #225
2021-02-16 02:59:24 +01:00
Evangelos Ribeiro Tzaras 46e4422026 application: use g_autoptr 2021-02-11 00:44:07 +01:00
Evangelos Ribeiro Tzaras 5d4b84470c code style: consistent whitespaces for g_autoptr 2021-02-11 00:43:18 +01:00
Arnaud Ferraris 5375ebbc72 call-display: switch to default audio profile only if no other call
Currently, when any call is terminated, audio profile/routing is 
switched to the default one.

This is a problem when already into a call and getting a second one: 
rejecting the new call will keep the first one going, but with the wrong 
audio profile, making it difficult (or, on the PinePhone, impossible) to 
keep talking.

This patch makes sure there is no other ongoing call before switching 
the audio mode, so that it's possible to keep the first call going even 
after rejecting the second one.
2021-02-09 09:09:57 +01:00
Evangelos Ribeiro Tzaras 71f9e636b3 display: fix null pointer dereference
removing unused GError
2021-02-08 17:39:42 +00:00
Evangelos Ribeiro Tzaras f8cd126d6f record-store: Handle old and new database locations gracefully
Because we rename the project and binaries to 'gnome-calls' we want
to make sure that the call history is preserved by doing the following:
If there is an old directory '~/.local/share/calls' try to rename it to
'gnome-calls'. Use new location if it succeeds and fall back to old location if it failed.
2021-02-04 01:19:26 +00:00
Evangelos Ribeiro Tzaras c732c74703 project: rename to gnome-calls 2021-02-04 01:19:26 +00:00
Julian Sparber e09f2e10f8 CallsCallDisplay: use HdyAvatar 2021-02-03 23:58:31 +00:00
Julian Sparber 293227ff3c CallsCallRecordRow: Cleanup contact setup 2021-02-03 23:58:31 +00:00
Julian Sparber 844d04f2d9 Remove unused CallsParty 2021-02-03 23:58:31 +00:00
Julian Sparber 889d5a0981 CallManager: drop calls_manager_get_contact_name ()
This function is replaced with calls_call_get_contact ()
2021-02-03 23:58:31 +00:00
Julian Sparber 60e2b39367 CallsCallSelectorItem: Make sure that the contact infomation is updated
This is done by binding the contact information to the UI.
2021-02-03 23:58:31 +00:00
Julian Sparber 2206c3733c CallsCallDisplay: Make sure that the contact infomation is updated
This is done by binding the contact information to the UI.
2021-02-03 23:58:31 +00:00
Julian Sparber 501d29145f CallsCall: Add method to optain matching contact 2021-02-03 23:58:31 +00:00
Julian Sparber 6d3b75262d BestMatch: add has-individual property 2021-02-03 23:58:31 +00:00
Julian Sparber f1946aff79 BestMatch: remove BestMatchView to reduce vala code 2021-02-03 23:58:31 +00:00
Julian Sparber 2a85b60f7c BestMatch: Simplify code for updating new best matching individual 2021-02-03 23:58:31 +00:00
Julian Sparber 339b71a233 BestMatch: Allways return a name
If no matching contact is found the phone number is used, and when no
phone number was given "Anonymous caller" is returned.
2021-02-03 23:58:31 +00:00
Julian Sparber d75d39dc66 BestMatch: Move SearchView creation inside the class 2021-02-03 23:58:31 +00:00
Julian Sparber 99e427a529 BestMatch: Turn avatar into a property 2021-02-03 23:58:31 +00:00
Evangelos Ribeiro Tzaras d8f2534795 call-display: fix whitespace 2021-02-03 23:58:31 +00:00
Julian Sparber 19c9893ecf Contacts: Add contacts list 2021-02-03 23:28:57 +01:00
Julian Sparber 4c7b402385 Revert "ui/main-window: Hide contacts pane"
This reverts commit 6a4dbe6b18.
2021-02-03 23:28:57 +01:00
Julian Sparber f61ae1cba1 Contacts: replace CallsContacts with CallsContactsProvider 2021-02-03 23:28:56 +01:00
Julian Sparber 4ba9feb22f ContactsProvider: Add contacts provider
The CallsContacts provider offers a GListModel that can be connected
directly to a GtkListBox for showing a contacts list.
2021-02-03 16:18:29 +00:00
Evangelos Ribeiro Tzaras 2568ea8179 application: Notify when opening URI/files fails 2021-02-01 23:14:36 +00:00
Evangelos Ribeiro Tzaras dc6b675a14 application: Use g_autoptr and g_autofree 2021-02-01 23:14:36 +00:00
Mohammed Sadiq 5684d54bbd Let calls-provider be an abstract class
And adapt to changes.

A calls-mm-provider IS-A calls-provider (and so on)
2021-01-31 23:01:13 +00:00
Julian Sparber 1c8eb87e7f remove CallsCallHolder and CallsCallData
Both classes are containers for other data and we can pass the data
directly without an additional code.
2021-01-28 15:22:59 +01:00
Arnaud Ferraris 13c7f052d0 src: meson.build: update libcallaudio dependency 2021-01-24 20:09:21 +00:00
Arnaud Ferraris cf38ff628b call-display: update libcallaudio API calls
Upstream modified the async API, make sure we use it.
2021-01-24 20:09:21 +00:00
Mohammed Sadiq 862e0b5f57 resources: Use standard icon path
GtkApplication by default appends "icons" to the app id and add that
to the icon search path.  So let's just use that instead of adding
custom one.

This commit also fixes missing icon for "Add call" button in active
call window
2021-01-23 20:17:14 +00:00
Julian Sparber dc0242eda5 application: disable dial action when making calls isn't possible
Fixes: https://source.puri.sm/Librem5/calls/-/issues/109
2021-01-23 14:32:27 +00:00
Evangelos Ribeiro Tzaras 4ebea1a27c application: chain up to parents finalize 2021-01-22 15:02:22 +01:00
Evangelos Ribeiro Tzaras d7cd299d9c new-call-box: clear entry on longpress 2021-01-20 12:35:34 +00:00
Evangelos Ribeiro Tzaras 9f295a729b record-row: hide copy number menu item
for anonymous callers
2021-01-20 11:47:33 +00:00
Evangelos Ribeiro Tzaras 78a47918be record-row: Allow copying number from context menu 2021-01-20 11:47:33 +00:00
Evangelos Ribeiro Tzaras 5eeacf3720 application: add copy-number action 2021-01-20 11:47:33 +00:00
Mohammed Sadiq 945e2083e3 application: Remove unused code
constructed() was simply creating an action group which
is never used.
2021-01-20 11:00:51 +00:00
Mohammed Sadiq 7c13d3f179 application: Simplify loading css
And fix a memory leak.
2021-01-20 10:10:50 +00:00
Evangelos Ribeiro Tzaras 5bdfb0e223 application: Hang up calls when closing the UI 2021-01-12 17:09:06 +01:00
Evangelos Ribeiro Tzaras f69c597387 manager: add has_active_call() and hang_up_all_calls() 2021-01-12 16:47:36 +01:00
Evangelos Ribeiro Tzaras 4602cca37d manager: remove trailing whitespace 2021-01-12 16:47:36 +01:00
Evangelos Ribeiro Tzaras b327aefdbb call-window: inhibit idle during active call
Closes #202
2020-12-27 09:57:34 +00:00
Daniel Abrecht 4e7a0b8151 Replace CallsOrigin getters with properties and add calls_origin_foreach_call method 2020-12-07 17:25:33 +00:00
Adrien Plazas fccb72c58c style: Fix the CSS path to the HdyKeypad buttons
In libhandy 1, the hdykeypad CSS class name got renamed into keypad, and
HdyKeypad isn't a GtkGrid anymore but it contains one.
2020-11-05 09:58:21 +01:00
Mohammed Sadiq 0f88802cda new-call-box: Handle USSD commands 2020-11-03 08:19:03 +05:30
Mohammed Sadiq 1c89bf292c main-window: Add dialog to handle USSD 2020-11-03 08:19:03 +05:30
Mohammed Sadiq 949ef90e03 manager: Hook to ussd signals from provider 2020-11-03 08:19:03 +05:30
Mohammed Sadiq 6af2e26639 util: Add API to test for USSD command 2020-11-03 08:19:03 +05:30
Mohammed Sadiq 8103c3d477 Add calls-ussd interface 2020-11-02 10:00:46 +05:30
Arnaud Ferraris 8308e1dbbf src: meson.build: remove librem5-hack option and depend on libcallaudio 2020-11-01 13:17:32 +01:00
Arnaud Ferraris 088c693374 ui: call-display: set speaker and mute buttons sensitive by default
Now that we got rid of ugly hacks, these buttons should work on all
devices. We can therefore enable them by default.
2020-11-01 13:17:06 +01:00
Arnaud Ferraris 20396ac951 application: initialize libcallaudio on startup 2020-11-01 13:16:42 +01:00
Arnaud Ferraris d304c9cb32 call-display: replace ugly hacks with libcallaudio calls
`callaudiod` is a device-agnostic service for routing audio during voice
calls, called through `libcallaudio`.

It allows us to automatically switch profiles when entering a call,
enable the speaker output or mute the microphone, and can therefore be
used to replace the current Librem 5-specific hacks.
2020-11-01 13:15:58 +01:00
Adrien Plazas 576ea55e9f main-window: Use HdyViewSwitcherTitle
This makes the code simpler.
2020-10-06 14:06:51 +00:00
Adrien Plazas 6dba2c453b Port to libhandy 1
This ports Calls to libhandy 1 and drops the embedded HdyAvatar in favor
of the libhandy one.

Fixes https://source.puri.sm/Librem5/calls/-/issues/172
2020-10-06 14:06:51 +00:00
Guido Günther 4227e29009 calls-main-window: Bring back old error string when no modem is present
Calls can't tell the difference between no SIM and no modem
atm.

Closes: #159, #152
2020-09-10 08:58:25 +00:00
Guido Günther 91cdde3ac9 main-window: Allow the in app notification to wrap
Othewise we overflow the window. Center it too.
2020-09-10 08:58:25 +00:00
Evangelos Ribeiro Tzaras 9619ebb674 src/calls-call-window.c: Inhibit suspend during active call 2020-09-09 08:27:14 +00:00
Evangelos Ribeiro Tzaras c43bfe3ebb src/calls-notifier.c: Add call-back button 2020-09-08 16:08:51 +02:00
Guido Günther b95de5c9e0 calls-call-record-row: Ignore anonymous callsers
These have an empty string which leads to

    Error parsing phone number `': Keine Telefonnumme
2020-07-22 06:52:07 +00:00
Guido Günther 1f8435f4dd call-record-row: Use g_autoptr for the GError 2020-07-22 06:52:07 +00:00
Arnaud Ferraris aadd3e3515 ui: call-display: wrap toggle buttons' labels
For some locales, the buttons' labels can be quite long, making the
window wider than the display.

Using a line wrap will solve this issue when there wouldn't be shorter
translation alternatives. This requires reducing the encryption indicator's
margins so the window height doesn't grow beyond the available display size.
2020-07-13 10:51:02 +02:00
Guido Günther 803cec41a5 calls-call-record-row: Set call back button insensitive for anonymous caller
They can't be called back, we don't have a number

See: #144
2020-07-02 12:10:10 +02:00
Guido Günther 0bc8c7bc4e calls-call-record-row: Print 'Anonymous caller' on empty numbers
If no number is present use `Anonymous caller` instead of an
empty label in the call history.

See: #144
2020-07-02 12:10:10 +02:00
Evangelos Ribeiro Tzaras 9fc8ec5e1a Implement contact name lookup for call display
* src/calls-manager.h: Add lookup function to header
* src/calls-manager.c: Implement lookup function to be used for the call
  history, call notifier and call display
* src/calls-call-holder.c: Use calls_manager_get_contact_name ()
* src/calls-notifier.c: Use calls_manager_get_contact_name ()
2020-06-27 17:35:54 +02:00
Evangelos Ribeiro Tzaras 0f0d10e3f2 Make CallsContacts a singleton
Since passing a CallsContacts pointer down to every class it needs, started to
become laborous - especially since the intermediates classes don't need
the reference themselves - it was made a singleton

* src/calls-contacts.c: Added calls_contacts_get_default () function and
  removed calls_contacts_new ()
* src/calls-contacts.h: Added _get_default () prototype and removed the
  _new () prototype
* src/calls-application.c: Use calls_contacts_get_default () now
* src/calls-history-box.c: Removed self->contacts completely
* src/calls-history-box.h: Got rid of CallsContacts argument in _new()
* src/calls-main-window.c: Removed self->contacts completely
* src/calls-main-window.h: Got rid of CallsContacts argument in _new()
* src/calls-call-record-row.c: Use calls_contacts_get_default () now
* src/calls-call-record-row.h: Got rid of CallsContacts argument in
  _new()
* src/calls-call-holder.c: Use calls_contacts_get_default () now
* src/calls-call-holder.h: Got rid of CallsContacts argument in _new()
* src/calls-call-window.c: Removed self->contacts completely
* src/calls-call-window.h: Got rid of CallsContacts argument in _new()
* src/calls-notifier.c: Use calls_contacts_get_default () now
* src/calls-notifier.h: Got rid of CallsContacts argument in _new()
2020-06-23 17:43:19 +02:00
Evangelos Ribeiro Tzaras 4bf5cd5232 Implement delete call with context menu on longpress
* src/ui/call-record-row.ui: Add menu, GtkPopover. Surround existing
  elements with GtkEventBox to capture longpress/rightclicks
* src/calls-call-record-row.c: Provide functions emiting "call-delete"
  signal, add widgets from ui file
* src/calls-record.c: Add "call-delete" signal
* src/calls-history-box.c: Add callback for "call-delete" signal
* src/calls-record-store.c: Add callback for "call-delete" signal
* src/util.c: Add convenience function calls_find_in_store for finding
  items in ListModel
* src/util.h: Add declaration of calls_find_in_store
2020-06-10 20:49:44 +02:00
Evangelos Ribeiro Tzaras b15c2876da record-store: Use g_autoptr(GError) to avoid having to g_error_free 2020-06-10 20:49:44 +02:00
Guido Günther 281ccbd8e6 Show notification on missed calls
Closes: #153
2020-06-09 13:44:57 +02:00
Guido Günther ecca21b0ed ringer: Use libfeedback
This triggers e.g. haptic feeback as well and can later on be used
for LED feedback.

We can drop the audio theme setting completely since feedbackd picks up
the global GNOME setting.

Since feedbackd currently does not cancel gsound's via a cancellable
this might make the phone ring a bit too long atm but that will be fixed
on the feedbackd side
(https://source.puri.sm/Librem5/feedbackd/-/issues/10)
2020-06-05 16:42:24 +02:00
Guido Günther f96ad96b3f ringer: Make more functions static 2020-06-05 16:37:01 +02:00
Guido Günther f7185ea70e build: Specifify glib versions
This avoids deprecation warnings due to GTimeVal used in
libebook-contacts.h

See https://tecnocode.co.uk/2019/08/24/gtimeval-deprecation-in-glib-2-61-2/

It's already fixed in newer eds so we can drop
this once we move to a newer stack.
2020-06-05 16:36:32 +02:00
Guido Günther 09cbdf4181 calls-call-record-row: Ref the returned contact
calls_contacts_lookup_phone_number is transfer-none
2020-06-05 14:59:37 +02:00
Guido Günther fb73046e71 calls-contacts: Document lookup_phone_number
This makes sure we have clear ownership rules
2020-06-05 14:59:37 +02:00
Mohammed Sadiq ba00b174f9 call-display: Use real ellipsis
See https://wiki.gnome.org/Design/OS/Typography
2020-05-31 19:24:25 +05:30
Mohammed Sadiq 8f9c683158 main-window: Don’t set program-name in about dialog
program-name will be retrieved with g_get_application_name().
Let’s not do it explicitly so that there is one less string
to translate
2020-05-31 19:18:52 +05:30
Guido Günther 956916ae1f Drop translations from property names and descriptions
They're never used anywhere.

Closes: #155, #121
2020-05-29 13:11:44 +00:00
Evangelos Ribeiro Tzaras 31fa887f04 Build "ugly code" in calls-call-display conditionally
* meson_options.txt: Added option librem5-hack, defaults to true
* src/meson.build: Added conditional define USE_UGLY_CODE which will be
  set when librem5-hack option is used
* src/calls-call-display.c: ifdef'ed ugly_hacks call
2020-05-15 22:59:00 +02:00
Julian Sparber 0b44f6471f
History: Make avatars 48px big
Signed-off-by: Julian Sparber <julian@sparber.net>
2020-03-31 16:31:38 +02:00
Julian Sparber 4f03ab0441
History: use HdyAvatar
This disables the custom avatar. It will be added back later.

Signed-off-by: Julian Sparber <julian@sparber.net>
2020-03-31 16:31:38 +02:00
Julian Sparber 63e5bc8504
Add HdyAvatar
Signed-off-by: Julian Sparber <julian@sparber.net>
2020-03-31 12:00:18 +02:00
Julian Sparber a9bd1ebae6 MainWindow: show error message when making calls isn't possible 2020-03-30 15:00:06 +00:00
Julian Sparber f63936d772
HistoryBox: remove new-call property
The property wasn't removed correctly in f1f848c5f3

Signed-off-by: Julian Sparber <julian@sparber.net>
2020-03-30 11:35:58 +02:00
Julian Sparber f603f5be51
Remove Enumerate and EnumerateParams class
This classes where fully replaced by Manager
2020-03-27 12:05:35 +01:00
Julian Sparber 1a2c2f3036
RecordStore: Use Manager 2020-03-27 12:05:34 +01:00
Julian Sparber 3d4b547d04
Ringer: Use Manager 2020-03-27 12:05:34 +01:00
Julian Sparber c5cb1a97ed
Ringer: fix parent instance 2020-03-27 12:05:34 +01:00
Julian Sparber 5828fad63b
CallWindow: use Manager
As a side effect this removes also the disconnect message when a call
ends.
Fixes: https://source.puri.sm/Librem5/calls/issues/119
2020-03-27 12:05:33 +01:00
Julian Sparber ffa3e724dd
Use CallsManager in MainWindow and NewCallBox
This removes the status message at the end of the NewCallBox, since it
will be replaced by a permanent InfoBar.

As a side effect this removes also the disconnect message when a call
ends.
Fixes: https://source.puri.sm/Librem5/calls/issues/119
2020-03-27 12:05:33 +01:00
Julian Sparber 9055724f33
Add a CallsManager and move Provider handling to it
The manager is a central place for handling data e.g. calls history and
provider managment.

This introduces only the base for feature work. Therefore it manages
only the provider for now, but the manager isn't yet used anywhere.

The propagets events from the provider and origins. It also adds a new
signal called `error`. The `error` signal should be emited only when
something went wrong and we need to inform the user about it, containing
the message to be displayed to the user. Windows should connect to the
event and display a in-app-notification on error. This event isn't
emitted, because the plugins don't give us a usable error.
2020-03-27 12:05:32 +01:00
Julian Sparber f1f848c5f3 CallHistory: Don't pass the CallsNewCallBox to the CallsHistory
Since we now have a "dial" action we can uses it also in the History,
this way we don't need to pass arond the NewCallBox.
2020-03-19 16:54:33 +00:00
Julian Sparber 62a327a0ae CallHistory: Use dial action for recall button 2020-03-19 16:54:33 +00:00
Julian Sparber 19632e428b
CallWindow: use in-app notification 2020-03-18 11:20:47 +01:00
Julian Sparber e7c248ea30
MainWindow: use in-app notification for messages
This replaces the infobar with a in-app notification.
2020-03-18 11:20:47 +01:00
Julian Sparber e7e95efcfb
Add class for in-app notification 2020-03-18 11:20:46 +01:00
Daniel Abrecht a7a679c186 Convert calls call getters to readonly properties
This is part of a larger refactoring effort, with the goal to replace
all the get_*() member functions in provider abstraction interfaces with
GObject properties. See also: https://source.puri.sm/Librem5/calls/issues/6
2020-03-18 09:57:01 +00:00
Julian Sparber a91da3f84b
CallHistory: Disable selecting/activating rows and ellipzise
This makes the name in each row ellipzise in the middle.

Signed-off-by: Julian Sparber <julian@sparber.net>
2020-03-11 11:51:46 +01:00
Julian Sparber a14f3fd7a0
CallHistory: Add a frame to the call history
GNOMEs HIG recommands frames around a List.
This also moves the ScrollBar to the edge of the window in the
CallHistory.

Signed-off-by: Julian Sparber <julian@sparber.net>
2020-03-11 11:51:44 +01:00
Bob Ham e7ef61e1b7 application: Add "--dial" command-line option
This option allows the specification of a much broader set of numbers
that tel: URIs, which are limited to global phone numbers in
international form and prohibit local numbers and other useful strings
like "*100#".

This functionality is implemented as a command-line option rather than
a "dial:" or "callto:" URI scheme for the same reason given in RFC
3966, section 7.3:

  '"Callto" was discarded because URI schemes locate a resource and do
  not specify an action to be taken.'
2020-02-26 09:37:34 +00:00
Julian Sparber e911f391c6
Use correct parent class when chaining up overridden functions
How `g_type_class_peek ()` was used it didn't return the correct parent
class in most cases.
G_DEFINE_TYPE macro creates a pointer we can use to get the parent
class `n_p_parent_class`.
Because we didn't use the correct parent class the object initialisation
wasn't fully completed for some GtkWidgets.
See https://developer.gnome.org/gobject/stable/chapter-gobject.html#gobject-instantiation
for more information.

This commit makes use of the `n_p_parent_class pointer` created for this
specific use case where ever possible.

Fixes: https://source.puri.sm/Librem5/calls/issues/118
2020-02-19 12:49:58 +01:00
Julian Sparber 06481155fd
NewCallBox+CallDisplay: UI facelift
This adds a style.css file to allow the use of custom css

Fixes https://source.puri.sm/Librem5/calls/issues/115:
- Making the phone number larger
- Moving the delete button to the bottom
- Rounding all buttons, and making the grid buttons circular
- Making the call button a bit less wide
2020-01-28 17:58:01 +01:00
Julian Sparber 497fe072fc
Replace HdyDialer with HdyKeypad and bump libhandy to 0.0.12
HdyDialer was deprecated and therefore is replaced with HdyKeypad.
HdyDialer used a `gchr *` to store the entered phone number. On every
button press the entire text of the display entry was replaced with the new
string, which messed up selection and cursor position.
HdyKeypad connects directly to a GtkEntry and inserts each
button press the same way as a keyboard stroke would do.

In the case of the `call display` entry every new digit is appended to the
end of the input and therefore it also moves the cursor to the end of the
entry. Instead of making the Entry not editable, only the events which
would remove text form the entry are blocked, via the `delete-text`
signal. And the signal `insert-text` is used to block unwanted chars
from beeing inserted.

Same as for the `call display` entry also the `new call box` entry is
made editable and the signal `insert-text` is used to block unwanted
chars. All other user action possible on a entry arn't blocked
e.g. repositioning the cursor.

The advantage of making the Entry editable is that we can show
the cursor position.
It also allows the user to select the position where new digits are
inserted in the `new call box`.
On a button press the focus is set to the Entry to give the correct
feedback to the user.

This centers the text on the entry, as required by the design.
This also makes the delete button remove only one char at the time, to
move closer to the desired UX.
Related: https://source.puri.sm/Librem5/calls/issues/58

Fixes: https://source.puri.sm/Librem5/calls/issues/82
2020-01-27 14:27:06 +01:00
Bob Ham 7d02dcbb66 call-display: Only mute the microphone with the Mute button
Don't mute the sink (the codec speaker feed), only mute the source
(the microphone feed).

Fixes #112
2020-01-20 12:08:19 +00:00
Bob Ham cc41df44d6 Add initial avatar support
We change the code for dealing with contacts quite significantly,
adding a new class, CallsBestMatch, in order to encapsulate a lot of
the functionality that was in CallsCallRecordRow.

At present avatars are not rounded and there are no auto-generated
avatars for contacts with no avatar.  This work is awaiting discussion
of Apps_Issues#164.
2019-12-10 14:46:31 +00:00
Bob Ham 40b8793710 call-display: Add ugly, ugly hacks to enable speakerphone/mute buttons
We call pactl synchronously in order to (1) change the sink/source
port for speakerphone and (2) mute the sink/source for mute.  The
sink/source names are hardcoded.  This is all ugly and needs to not
exist.  This functionality should be in Wys, accessed over D-Bus, or
in some other, as-yet undefined component.
2019-12-10 11:03:53 +00:00
Bob Ham 8f2cddddcf Add -Wno-error=deprecated-declarations to build arguments
This works around the deprecation warning for HdyDialer.
2019-12-10 10:03:40 +00:00
Bob Ham 9fe575053d Use libfolks phone number lookup in call record display
Closes #85
2019-10-29 14:54:45 +00:00
Bob Ham 6a7fbf0b59 Add phone number lookup using libfolks
The CallsBestMatchView and CallsPhoneNumberQuery classes are written
in Vala because they may be generally useful and to leave open the
possibility of adding them to libfolks itself, which is written in
Vala.
2019-10-29 13:21:45 +00:00
Bob Ham e7ba7d731c ringer: Use the GTK sound theme 2019-09-23 15:22:31 +01:00
Bob Ham 6a4dbe6b18 ui/main-window: Hide contacts pane
While we have no integration with Contacts, the contacts pane
shouldn't be visible.

Closes #83
2019-09-18 13:38:48 +01:00
Bob Ham 3201c8e69b Display call window over the phosh lockscreen
Closes #41
2019-09-06 14:58:08 +01:00
Bob Ham 38dd76c714 Use GtkApplication::register-session property to register
We can use GtkApplication to register with the GNOME session rather
than doing it ourselves, simplifying things in CallsApplication very
slightly and allowing us to remove session.{c,h}.
2019-09-02 09:52:12 +01:00
Bob Ham df74a80594 calls-new-call-box: Allow entering of "+" symbol
Use the "number" property of the dial pad for the dialed number which
takes care of cycling buttons. While we're at it, also make the clear
button external to the number entry box, enlarging it and turning it
into a backspace button.

Closes #12
2019-08-22 16:05:24 +01:00
Bob Ham 646682b878 Start up in daemon mode when GNOME starts
Hat tip to Guido for the session.{c,h} files.

Closes #45
2019-08-13 11:53:54 +01:00
Bob Ham fc16ec7a71 calls-application: Add --daemon option to not display main window 2019-08-08 13:51:17 +01:00
Bob Ham cb2831eca4 Support opening of tel: URIs
Closes #73
2019-08-06 11:29:05 +01:00
Bob Ham 3c22bc9154 Hook up Recent Calls list to database
Closes use-cases#113
Closes use-cases#115
2019-08-01 14:39:55 +01:00
Bob Ham da298c0648 Record calls to an SQLite database via libgom
Closes use-cases#114
2019-07-22 14:37:41 +01:00
Bob Ham f12b411813 calls-call: Add calls_call_get_inbound function 2019-07-22 11:52:42 +01:00
David Boddie a27efedf7c Override the input method for entry widgets 2019-07-10 16:42:15 +02:00
Bob Ham d8cf2be9c6 Merge branch 'symbolic-switcher-icons' into 'master'
Switcher: symbolic icons, label capitalization

See merge request Librem5/calls!51
2019-07-09 10:04:56 +00:00
Bob Ham 4fcc846095 Merge branch 'recents-empty-state-label' into 'master'
Minor: Change recent calls empty state label

See merge request Librem5/calls!47
2019-07-09 09:58:10 +00:00
Bob Ham a80f816a67 util: Fix off-by-one in calls_entry_append
Append after the last character rather than insert before it.

Closes #70
2019-07-08 10:11:12 +01:00
Bob Ham 719b3e752f calls-call-display: Add a display of dial pad digits
Closes #57
2019-07-04 15:32:40 +01:00
Bob Ham 003adc709c Specify minimum libhandy version in meson and Debian packaging 2019-07-04 15:17:32 +01:00
Bob Ham b84370efe8 src: Remove extraneous classes, Calls{History,NewCall}HeaderBar
And add missing HDY type ensures.
2019-07-03 15:15:08 +01:00
Tobias Bernard aee2b247ca Switcher: symbolic icons, label capitalization 2019-07-03 14:55:09 +02:00
Bob Ham 251e3b0076 calls-main-window: Use HdyViewSwitcher and friends
Use HdyViewSwitcher to navigate between the dial pad, call history and
a contacts list.

Closes #56
2019-07-03 13:39:25 +01:00
Bob Ham 5937874c44 calls-call: Fix crash with null call state
Account for having a null (zero) call state in
calls_call_state_to_string.  This fixes a crash as a result of the
recent UI changes.
2019-07-01 15:04:03 +01:00
Bob Ham b0d9918f5a Update UI to better reflect the design
* Make the Answer button look nice and laid out properly.
* Merge the time and status labels, displaying simply the text
  "Calling..." until the call becomes active and then the call time
  afterwards.
* Fix info display bar in both the call and main windows so they use a
  GtkRevealer and work a lot better.
* Add a "new-call-symbolic" icon for the "Add call" button.
* General tweaks and clean-ups

Closes #55
Closes #35
2019-06-28 15:14:45 +01:00
Bob Ham 7ed3f5f16c calls-call: Add inbound property
This property signifies whether a call is to us from someone on the
network (inbound, TRUE) or from us to someone on the network
(outbound, FALSE).
2019-06-28 09:59:29 +01:00
Tobias Bernard 617822d6ce Minor: Change recent calls empty state label 2019-06-26 15:19:52 +00:00
Bob Ham 3160fbee15 Merge branch 'christopherdavis/change-about-label' into 'master'
history-header-bar: Change "About" to "About Calls"

See merge request Librem5/calls!45
2019-06-18 11:35:04 +00:00
Bob Ham 0947d7a1d1 Merge branch 'wip/sadiq/windows' into 'master'
window: hide windows on delete

See merge request Librem5/calls!44
2019-06-18 11:32:32 +00:00
Christopher Davis e0123e400e history-header-bar: Change "About" to "About Calls"
As a part of GNOME's initiative to move menus, "About" should be "About $APP_NAME" rather than "About".

See https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement#guidelines for reference
2019-02-19 23:08:24 -05:00
Mohammed Sadiq d4b6e92fc1 new-call-box: Use null-terminated string to set as buffer text
gtk_entry_buffer_insert_text expects a null-terminated string.

This was found when testing with asan.
2019-01-31 10:32:44 +05:30
Mohammed Sadiq d62976a9a1 window: hide windows on delete
As calls is supposed to run always in background,
destroying window on close results in unintended issues.
Let's simply hide the window instead.
2019-01-29 11:36:38 +05:30
Bob Ham 400c2fc041 src: Remove mutual reference between call -holder and -selector-item 2018-11-30 16:48:25 +00:00
Bob Ham 460c0c6c3d Turn providers into plugins courtesy of libpeas
This is an initial, static implementation of plugins.  The
CallsApplication has a plugin name which can be changed with a new
--provider command line option.  This plugin name is used to
instantiate the appropriate plugin when the application is activated.
From then on, the plugin cannot change.

In future, we can expand this support to include loading multiple
plugins at once, configurable through some UI.  This will have
far-reaching implications though, and complicate things like
enumerating the provider hierarchy.  There is also no practical
benefit right now; the mm and ofono plugins can't be used at the same
time because ModemManager and oFono don't play nice together, and the
whole raison d'être of the dummy plugin is undermined if you can make
use of one of the others.  So for now, we just implement one static
plugin.
2018-11-23 15:51:46 +00:00
Bob Ham 7252962139 Add ringtone support using GSound 2018-11-09 16:30:40 +00:00
Bob Ham 5e636edb7d main: Remove needless cast to GtkApplication 2018-11-09 16:20:39 +00:00
Bob Ham 027c49e8bd src: Add old state as argument to CallsCall's state-changed signal 2018-11-09 16:19:23 +00:00
Bob Ham 74c3987ce1 src: Generalise Provider object enumeration with calls_enumerate() 2018-11-01 11:14:49 +00:00
Bob Ham c203f470fe Fix modem addition/removal and deal with ModemManager appearing/vanishing
Modems being added or removed were not working.  To fix this, we pay
attention to the "object-removed" event and not just
"interface-removed".

Also, to deal with ModemManager appearing and vanishing, we add a
GDBus watch on ModemManager's D-Bus object.

Finally, we provide appropriate UI feedback when it's not possible to
make a call.

Closes #15
Closes #16
2018-10-19 10:24:00 +00:00
Bob Ham 5c52bb7e57 src: Remove errant calls-ofono-object files
Not even sure how these crept into the repository.
2018-10-10 13:23:01 +00:00
Bob Ham 3917edbcdb call-window: Reference selector item widget in creation callback
The return value of this callback, used for the call selector flow
box, should have a reference added to it.  The callback's return value
is annotated as "transfer full".
2018-10-10 09:13:54 +00:00
Bob Ham ef976cee04 call-window: Remove display and holder in the right order
In the current order, the holder is finalized before we can get the
display, causing an error.  We just have to switch the two around
2018-10-10 09:13:54 +00:00
Bob Ham 224ab410d0 call-holder,call-selector-item: Dispose mutual references properly 2018-10-10 08:56:00 +00:00
Bob Ham e88156380e call-holder: Fix widget references
The display and selector item have floating references when created,
not normal references.  Therefore we need to sink both floating
references.
2018-10-10 08:56:00 +00:00
Bob Ham 903782d90d call-window: Fix leak of initial CallHolder reference
Closes #20
2018-10-10 08:56:00 +00:00
Bob Ham 88e11d62b5 call-window: Don't maintain unneeded focus pointer
Closes #19
2018-10-10 08:56:00 +00:00
Bob Ham f60187c547 call-window: Fix leak of references returned by g_list_model_get_item()
Closes #18
2018-10-10 08:56:00 +00:00
Bob Ham 8d3ec069eb call-window: Don't update visibility unnecessarily
We only need to update visibility when the number of calls changes.
2018-10-09 14:44:04 +00:00
Bob Ham a33dbd139e main-window: Set up Provider in constructed callback 2018-10-08 10:46:00 +00:00
Bob Ham 9aa34cceff src: Give the Provider to the CallWindow on construction
This allows us to get rid of the signals on the MainWindow and
simplifies things dramatically.
2018-10-08 10:40:02 +00:00
Bob Ham 1843d72ad1 main-window: No need to store calls so remove holders here 2018-10-08 10:34:28 +00:00
Bob Ham f4eae98458 main-window,new-call-box: Move origin store from MainWindow to NewCallBox
The main window has no need to store origins now so this simplifies
things dramatically.
2018-10-08 10:16:04 +00:00
Mohammed Sadiq 08f19de326 Add calls-application class 2018-10-04 18:33:47 +05:30
Bob Ham b727916bc8 tests: Add tests for Origin and Calls 2018-10-03 14:21:28 +00:00
Bob Ham 58c3820f29 Merge branch 'i18n' into 'master'
Add i18n support

Closes #3

See merge request Librem5/calls!19
2018-10-03 10:26:10 +00:00
Claude Paroz f45e4d613f Add i18n basic structure
Closes #3.
2018-10-03 12:21:41 +02:00
Bob Ham 8a96c79eff Merge branch 'wip/sadiq/history' into 'master'
history-box: Add empty view

See merge request Librem5/calls!23
2018-10-03 10:10:10 +00:00