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
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.
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.
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.
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.
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
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.
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
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.
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.
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.
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
`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.
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.
* 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 ()
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()
* 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
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)
* 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
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
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.
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
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>
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.'
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
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
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
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.
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.
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.
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}.
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
* 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#55Closes#35
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.
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#15Closes#16
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".
We're only looking for modems with voice capabilities. Warning that
there are no modems available at all might be confusing to the person
trying to track down a problem.
This will be needed by the next commit to display an "About" dialog via
the corresponding entry in the app menu that will be added.
This also adds the PACKAGE_URL, PACKAGE_VERSION and VCS_TAG
configuration data.
This makes sure we end up with the correct xdg app_id in Wayland:
before:
[943832,359] -> xdg_toplevel@27.set_app_id("calls")
after:
[1180814,499] -> xdg_toplevel@27.set_app_id("sm.puri.Calls")
Closes#8
Replace the custom inplementation of a call box by a CallsNewCallBox
which is used to dial new calls and not to send DTMF tones as the call
display can now handle that.
Put the call display in an GtkOverlay and add a dial pad sending DTMF
tones as an overlay. Also make the dial pad overlay be triggered by the
dial pad button.
Add 'mute' and 'dial pad' buttons, drop the 'hold' button, change the
size of the central buttons, make them use icons and drop the now
useless group size.
The oFono DTMF support doesn't match our model; you can only send
tones to the network and not to a particular call. The telephony
standards dictate that only a single call can be active at a time so
we just get the call to emit a "tone" signal if the call is in the
active state and get the origin to listen for the signal.
Some implementations, like oFono, only allow fixed-length tones to be
sent to the network, not started and stopped at will. To account for
this, we make the tone_start member function nullable and add a new
function, calls_call_tone_stoppable, to determine whether there is a
stop function.
* Preliminary documentation of CallsCall and CallsMessageSource
* Documentation and cleaning up of CallsCallData
* Add data files and meson rules to create gtk-doc documentation
* Move some macros from util.h to calls-message-source.h