mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-06 03:25:31 +00:00
Merge branch 'partial-ui-overhaul' into 'master'
Partial UI Overhaul See merge request Librem5/calls!11
This commit is contained in:
commit
13a1944a69
14 changed files with 803 additions and 396 deletions
|
@ -35,7 +35,7 @@
|
|||
|
||||
struct _CallsCallDisplay
|
||||
{
|
||||
GtkBox parent_instance;
|
||||
GtkOverlay parent_instance;
|
||||
|
||||
CallsCall *call;
|
||||
GTimer *timer;
|
||||
|
@ -51,9 +51,11 @@ struct _CallsCallDisplay
|
|||
GtkToggleButton *mute;
|
||||
GtkButton *hang_up;
|
||||
GtkToggleButton *speaker;
|
||||
|
||||
GtkRevealer *dial_pad_revealer;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CallsCallDisplay, calls_call_display, GTK_TYPE_BOX);
|
||||
G_DEFINE_TYPE (CallsCallDisplay, calls_call_display, GTK_TYPE_OVERLAY);
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
|
@ -99,6 +101,20 @@ speaker_toggled_cb (GtkToggleButton *togglebutton,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
dial_pad_symbol_clicked_cb (CallsCallDisplay *self,
|
||||
gchar symbol,
|
||||
HdyDialer *dialer)
|
||||
{
|
||||
calls_call_tone_start (self->call, symbol);
|
||||
}
|
||||
|
||||
static void
|
||||
hide_dial_pad_clicked_cb (CallsCallDisplay *self)
|
||||
{
|
||||
gtk_revealer_set_reveal_child (self->dial_pad_revealer, FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
timeout_cb (CallsCallDisplay *self)
|
||||
{
|
||||
|
@ -213,7 +229,7 @@ set_party (CallsCallDisplay *self, CallsParty *party)
|
|||
const gchar *name, *number;
|
||||
|
||||
image = calls_party_create_image (party);
|
||||
gtk_box_pack_start (self->party_box, image, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (self->party_box, image, TRUE, FALSE, 0);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 100);
|
||||
gtk_widget_show (image);
|
||||
|
||||
|
@ -255,7 +271,7 @@ set_property (GObject *object,
|
|||
static void
|
||||
constructed (GObject *object)
|
||||
{
|
||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_BOX);
|
||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_OVERLAY);
|
||||
CallsCallDisplay *self = CALLS_CALL_DISPLAY (object);
|
||||
|
||||
self->timer = g_timer_new ();
|
||||
|
@ -276,7 +292,7 @@ calls_call_display_init (CallsCallDisplay *self)
|
|||
static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_BOX);
|
||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_OVERLAY);
|
||||
CallsCallDisplay *self = CALLS_CALL_DISPLAY (object);
|
||||
|
||||
g_clear_object (&self->call);
|
||||
|
@ -287,7 +303,7 @@ dispose (GObject *object)
|
|||
static void
|
||||
finalize (GObject *object)
|
||||
{
|
||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_BOX);
|
||||
GObjectClass *parent_class = g_type_class_peek (GTK_TYPE_OVERLAY);
|
||||
CallsCallDisplay *self = CALLS_CALL_DISPLAY (object);
|
||||
|
||||
g_source_remove (self->timeout);
|
||||
|
@ -327,8 +343,11 @@ calls_call_display_class_init (CallsCallDisplayClass *klass)
|
|||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, mute);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, hang_up);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, speaker);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsCallDisplay, dial_pad_revealer);
|
||||
gtk_widget_class_bind_template_callback (widget_class, answer_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, hang_up_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, mute_toggled_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, speaker_toggled_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_pad_symbol_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, hide_dial_pad_clicked_cb);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ G_BEGIN_DECLS
|
|||
|
||||
#define CALLS_TYPE_CALL_DISPLAY (calls_call_display_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsCallDisplay, calls_call_display, CALLS, CALL_DISPLAY, GtkBox);
|
||||
G_DECLARE_FINAL_TYPE (CallsCallDisplay, calls_call_display, CALLS, CALL_DISPLAY, GtkOverlay);
|
||||
|
||||
CallsCallDisplay *calls_call_display_new (CallsCallData *data);
|
||||
|
||||
|
|
63
src/calls-history-box.c
Normal file
63
src/calls-history-box.c
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Purism SPC
|
||||
*
|
||||
* This file is part of Calls.
|
||||
*
|
||||
* Calls is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calls is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Adrien Plazas <adrien.plazas@puri.sm>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
#include "calls-history-box.h"
|
||||
#include "calls-origin.h"
|
||||
#include "calls-call-holder.h"
|
||||
#include "calls-call-selector-item.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#define HANDY_USE_UNSTABLE_API
|
||||
#include <handy.h>
|
||||
|
||||
|
||||
struct _CallsHistoryBox
|
||||
{
|
||||
GtkTreeView parent_instance;
|
||||
|
||||
GtkListStore *history_store;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CallsHistoryBox, calls_history_box, GTK_TYPE_TREE_VIEW);
|
||||
|
||||
|
||||
static void
|
||||
calls_history_box_init (CallsHistoryBox *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_history_box_class_init (CallsHistoryBoxClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/sm/puri/calls/ui/history-box.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsHistoryBox, history_store);
|
||||
}
|
41
src/calls-history-box.h
Normal file
41
src/calls-history-box.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Purism SPC
|
||||
*
|
||||
* This file is part of Calls.
|
||||
*
|
||||
* Calls is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calls is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Adrien Plazas <adrien.plazas@puri.sm>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALLS_HISTORY_BOX_H__
|
||||
#define CALLS_HISTORY_BOX_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define HANDY_USE_UNSTABLE_API
|
||||
#include <handy.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CALLS_TYPE_HISTORY_BOX (calls_history_box_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsHistoryBox, calls_history_box, CALLS, HISTORY_BOX, GtkTreeView);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* CALLS_HISTORY_BOX_H__ */
|
|
@ -26,6 +26,7 @@
|
|||
#include "calls-origin.h"
|
||||
#include "calls-call-holder.h"
|
||||
#include "calls-call-selector-item.h"
|
||||
#include "calls-new-call-box.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
@ -51,15 +52,8 @@ struct _CallsMainWindow
|
|||
GtkStack *call_stack;
|
||||
GtkScrolledWindow *call_scroll;
|
||||
GtkFlowBox *call_selector;
|
||||
GtkBox *dial_box;
|
||||
GtkExpander *new_call;
|
||||
GtkBox *dial_controls;
|
||||
GtkComboBox *origin;
|
||||
GtkSearchEntry *search;
|
||||
HdyDialer *dial_pad;
|
||||
|
||||
GtkListStore *origin_store;
|
||||
GtkListStore *history_store;
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -107,6 +101,18 @@ info_response_cb (GtkInfoBar *infobar,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
new_call_submitted_cb (CallsMainWindow *self,
|
||||
CallsOrigin *origin,
|
||||
const gchar *number,
|
||||
CallsNewCallBox *new_call_box)
|
||||
{
|
||||
g_return_if_fail (CALLS_IS_MAIN_WINDOW (self));
|
||||
|
||||
calls_origin_dial (origin, number);
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
call_holders_create_widget_cb (CallsCallHolder *holder,
|
||||
CallsMainWindow *self)
|
||||
|
@ -114,71 +120,6 @@ call_holders_create_widget_cb (CallsCallHolder *holder,
|
|||
return GTK_WIDGET (calls_call_holder_get_selector_item (holder));
|
||||
}
|
||||
|
||||
static void
|
||||
search_append_symbol (CallsMainWindow *self, gchar symbol)
|
||||
{
|
||||
GtkEntryBuffer *buf = gtk_entry_get_buffer (GTK_ENTRY (self->search));
|
||||
guint len = gtk_entry_buffer_get_length (buf);
|
||||
|
||||
gtk_entry_buffer_insert_text (buf, len, &symbol, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
dial_pad_symbol_clicked_cb (CallsMainWindow *self, gchar symbol, HdyDialer *dialer)
|
||||
{
|
||||
if (self->focus && !gtk_expander_get_expanded (self->new_call))
|
||||
{
|
||||
CallsCallData *data = calls_call_holder_get_data (self->focus);
|
||||
CallsCall *call = calls_call_data_get_call (data);
|
||||
|
||||
calls_call_tone_start (call, symbol);
|
||||
}
|
||||
else
|
||||
{
|
||||
search_append_symbol (self, symbol);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dial_pad_deleted_cb (CallsMainWindow *self, HdyDialer *dialer)
|
||||
{
|
||||
GtkEntryBuffer *buf = gtk_entry_get_buffer (GTK_ENTRY (self->search));
|
||||
guint len = gtk_entry_buffer_get_length (buf);
|
||||
|
||||
gtk_entry_buffer_delete_text (buf, len - 1, 1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dial_pad_submitted_cb (CallsMainWindow *self, const gchar *unused, HdyDialer *dialer)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean ok;
|
||||
CallsOrigin *origin;
|
||||
const gchar *number;
|
||||
|
||||
g_return_if_fail (CALLS_IS_MAIN_WINDOW (self));
|
||||
|
||||
if (gtk_widget_get_visible (GTK_WIDGET (self->new_call))
|
||||
&& !gtk_expander_get_expanded (self->new_call))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ok = gtk_combo_box_get_active_iter (self->origin, &iter);
|
||||
g_return_if_fail (ok);
|
||||
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (self->origin_store), &iter,
|
||||
ORIGIN_STORE_COLUMN_ORIGIN, &origin,
|
||||
-1);
|
||||
g_return_if_fail (CALLS_IS_ORIGIN (origin));
|
||||
|
||||
number = gtk_entry_get_text (GTK_ENTRY (self->search));
|
||||
|
||||
calls_origin_dial (origin, number);
|
||||
}
|
||||
|
||||
|
||||
typedef gboolean (*FindCallHolderFunc) (CallsCallHolder *holder,
|
||||
gpointer user_data);
|
||||
|
@ -259,65 +200,6 @@ set_focus (CallsMainWindow *self, CallsCallHolder *holder)
|
|||
}
|
||||
|
||||
|
||||
/* When we have an active call, we hide the dialpad action buttons and
|
||||
* put the dial_controls inside the new_call expander and use the
|
||||
* expanded state to determine whether key presses should be
|
||||
* considered dialing a new call or entering DTMF tones for the active
|
||||
* call.
|
||||
*/
|
||||
static void
|
||||
show_new_call (CallsMainWindow *self)
|
||||
{
|
||||
GtkWidget *dial_controls_widget = GTK_WIDGET (self->dial_controls);
|
||||
GObject *dial_controls_object = G_OBJECT (dial_controls_widget);
|
||||
|
||||
hdy_dialer_set_show_action_buttons (self->dial_pad, FALSE);
|
||||
|
||||
g_object_ref (dial_controls_object);
|
||||
gtk_container_remove (GTK_CONTAINER (self->dial_box), dial_controls_widget);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (self->new_call), dial_controls_widget);
|
||||
g_object_unref (dial_controls_object);
|
||||
|
||||
gtk_expander_set_expanded (self->new_call, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->new_call));
|
||||
|
||||
gtk_widget_queue_allocate (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
hide_new_call (CallsMainWindow *self)
|
||||
{
|
||||
GtkWidget *dial_controls_widget = GTK_WIDGET (self->dial_controls);
|
||||
GObject *dial_controls_object = G_OBJECT (dial_controls_widget);
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (self->new_call));
|
||||
|
||||
g_object_ref (dial_controls_object);
|
||||
gtk_container_remove (GTK_CONTAINER (self->new_call), dial_controls_widget);
|
||||
|
||||
gtk_box_pack_start (self->dial_box, dial_controls_widget, FALSE, TRUE, 0);
|
||||
g_object_unref (dial_controls_object);
|
||||
|
||||
gtk_box_reorder_child (self->dial_box, dial_controls_widget, 0);
|
||||
|
||||
hdy_dialer_set_show_action_buttons (self->dial_pad, TRUE);
|
||||
|
||||
gtk_widget_queue_allocate (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
new_call_expanded_notify_cb (GtkExpander *new_call,
|
||||
GParamSpec *param_spec,
|
||||
CallsMainWindow *self)
|
||||
{
|
||||
hdy_dialer_set_show_action_buttons (self->dial_pad,
|
||||
gtk_expander_get_expanded (new_call));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
back_clicked_cb (GtkButton *back,
|
||||
CallsMainWindow *self)
|
||||
|
@ -349,7 +231,6 @@ show_calls (CallsMainWindow *self, guint old_call_count)
|
|||
gtk_stack_add_titled (self->main_stack,
|
||||
GTK_WIDGET (self->call_stack),
|
||||
"call", "Call");
|
||||
show_new_call (self);
|
||||
}
|
||||
|
||||
if (old_call_count > 0)
|
||||
|
@ -364,7 +245,6 @@ hide_calls (CallsMainWindow *self, guint call_count)
|
|||
{
|
||||
if (call_count == 0)
|
||||
{
|
||||
hide_new_call (self);
|
||||
gtk_container_remove (GTK_CONTAINER (self->main_stack),
|
||||
GTK_WIDGET (self->call_stack));
|
||||
}
|
||||
|
@ -478,28 +358,14 @@ add_origin_calls (CallsMainWindow *self, CallsOrigin *origin)
|
|||
static void
|
||||
add_origin (CallsMainWindow *self, CallsOrigin *origin)
|
||||
{
|
||||
const gint n_origins = gtk_tree_model_iter_n_children
|
||||
(GTK_TREE_MODEL (self->origin_store), NULL);
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (n_origins == 1)
|
||||
{
|
||||
/* We have more than one origin now so show the origin combo box */
|
||||
gtk_widget_show (GTK_WIDGET (self->origin));
|
||||
}
|
||||
|
||||
gtk_list_store_append (self->origin_store, &iter);
|
||||
gtk_list_store_set (self->origin_store, &iter,
|
||||
ORIGIN_STORE_COLUMN_NAME, calls_origin_get_name(origin),
|
||||
ORIGIN_STORE_COLUMN_ORIGIN, G_OBJECT (origin),
|
||||
-1);
|
||||
|
||||
if (gtk_combo_box_get_active (self->origin) == -1)
|
||||
{
|
||||
/* We always want an item active */
|
||||
gtk_combo_box_set_active (self->origin, 0);
|
||||
}
|
||||
|
||||
|
||||
g_signal_connect_swapped (origin, "message",
|
||||
G_CALLBACK (show_message), self);
|
||||
|
@ -538,17 +404,6 @@ dump_list_store (GtkListStore *store)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
update_origin (CallsMainWindow *self)
|
||||
{
|
||||
if (gtk_tree_model_iter_n_children
|
||||
(GTK_TREE_MODEL (self->origin_store), NULL) < 2)
|
||||
{
|
||||
/* User has only one choice so hide the origin combo box */
|
||||
gtk_widget_hide (GTK_WIDGET (self->origin));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
remove_origin (CallsMainWindow *self, CallsOrigin *origin)
|
||||
{
|
||||
|
@ -560,8 +415,6 @@ remove_origin (CallsMainWindow *self, CallsOrigin *origin)
|
|||
g_return_if_fail (ok);
|
||||
|
||||
gtk_list_store_remove (self->origin_store, &iter);
|
||||
|
||||
update_origin (self);
|
||||
}
|
||||
|
||||
|
||||
|
@ -575,8 +428,6 @@ remove_origins (CallsMainWindow *self)
|
|||
{
|
||||
gtk_list_store_remove (self->origin_store, &iter);
|
||||
}
|
||||
|
||||
update_origin (self);
|
||||
}
|
||||
|
||||
|
||||
|
@ -723,19 +574,9 @@ calls_main_window_class_init (CallsMainWindowClass *klass)
|
|||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, call_stack);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, call_scroll);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, call_selector);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, dial_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, new_call);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, dial_controls);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, origin);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, search);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, dial_pad);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, origin_store);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, history_store);
|
||||
gtk_widget_class_bind_template_callback (widget_class, info_response_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, new_call_expanded_notify_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, call_selector_child_activated_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, back_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_pad_submitted_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_pad_deleted_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_pad_symbol_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, new_call_submitted_cb);
|
||||
}
|
||||
|
|
288
src/calls-new-call-box.c
Normal file
288
src/calls-new-call-box.c
Normal file
|
@ -0,0 +1,288 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Purism SPC
|
||||
*
|
||||
* This file is part of Calls.
|
||||
*
|
||||
* Calls is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calls is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Adrien Plazas <adrien.plazas@puri.sm>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
#include "calls-new-call-box.h"
|
||||
|
||||
#include "calls-origin.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#define HANDY_USE_UNSTABLE_API
|
||||
#include <handy.h>
|
||||
|
||||
|
||||
struct _CallsNewCallBox
|
||||
{
|
||||
GtkBox parent_instance;
|
||||
|
||||
GtkComboBox *origin_box;
|
||||
GtkSearchEntry *number_entry;
|
||||
HdyDialer *dial_pad;
|
||||
|
||||
gulong origin_store_row_deleted_id;
|
||||
gulong origin_store_row_inserted_id;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CallsNewCallBox, calls_new_call_box, GTK_TYPE_BOX);
|
||||
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_ORIGIN_STORE,
|
||||
PROP_LAST_PROP,
|
||||
};
|
||||
static GParamSpec *props[PROP_LAST_PROP];
|
||||
|
||||
|
||||
enum {
|
||||
SIGNAL_SUBMITTED,
|
||||
SIGNAL_LAST_SIGNAL,
|
||||
};
|
||||
static guint signals[SIGNAL_LAST_SIGNAL];
|
||||
|
||||
|
||||
enum {
|
||||
ORIGIN_STORE_COLUMN_NAME,
|
||||
ORIGIN_STORE_COLUMN_ORIGIN
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
dial_pad_symbol_clicked_cb (CallsNewCallBox *self,
|
||||
gchar symbol,
|
||||
HdyDialer *dialer)
|
||||
{
|
||||
GtkEntryBuffer *buf = gtk_entry_get_buffer (GTK_ENTRY (self->number_entry));
|
||||
guint len = gtk_entry_buffer_get_length (buf);
|
||||
|
||||
gtk_entry_buffer_insert_text (buf, len, &symbol, 1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dial_pad_deleted_cb (CallsNewCallBox *self,
|
||||
HdyDialer *dialer)
|
||||
{
|
||||
GtkEntryBuffer *buf = gtk_entry_get_buffer (GTK_ENTRY (self->number_entry));
|
||||
guint len = gtk_entry_buffer_get_length (buf);
|
||||
|
||||
gtk_entry_buffer_delete_text (buf, len - 1, 1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
dial_clicked_cb (CallsNewCallBox *self,
|
||||
const gchar *unused,
|
||||
GtkButton *button)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *origin_store;
|
||||
CallsOrigin *origin;
|
||||
const gchar *number;
|
||||
|
||||
gtk_combo_box_get_active_iter (self->origin_box, &iter);
|
||||
if (!gtk_combo_box_get_active_iter (self->origin_box, &iter))
|
||||
{
|
||||
g_debug ("Can't submit call with no origin.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
origin_store = gtk_combo_box_get_model (self->origin_box);
|
||||
gtk_tree_model_get (origin_store, &iter,
|
||||
ORIGIN_STORE_COLUMN_ORIGIN, &origin,
|
||||
-1);
|
||||
g_assert (CALLS_IS_ORIGIN (origin));
|
||||
|
||||
number = gtk_entry_get_text (GTK_ENTRY (self->number_entry));
|
||||
|
||||
g_signal_emit (self, signals[SIGNAL_SUBMITTED], 0, origin, number);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
update_origin_box (CallsNewCallBox *self)
|
||||
{
|
||||
GtkTreeModel *origin_store = gtk_combo_box_get_model (self->origin_box);
|
||||
GtkTreeIter iter;
|
||||
|
||||
if (origin_store == NULL ||
|
||||
!gtk_tree_model_get_iter_first (origin_store, &iter))
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (self->origin_box));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* We know there is a model and it's not empty. */
|
||||
|
||||
if (!gtk_tree_model_iter_next (origin_store, &iter))
|
||||
{
|
||||
gtk_combo_box_set_active (self->origin_box, 0);
|
||||
gtk_widget_hide (GTK_WIDGET (self->origin_box));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* We know there are multiple origins in the model. */
|
||||
|
||||
if (gtk_combo_box_get_active (self->origin_box) < 0)
|
||||
{
|
||||
gtk_combo_box_set_active (self->origin_box, 0);
|
||||
}
|
||||
|
||||
/* We know there are multiple origins and one is selected. */
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (self->origin_box));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_new_call_box_set_origin_store (CallsNewCallBox *self,
|
||||
GtkListStore *origin_store)
|
||||
{
|
||||
g_return_if_fail (CALLS_IS_NEW_CALL_BOX (self));
|
||||
g_return_if_fail (origin_store == NULL || GTK_IS_LIST_STORE (origin_store));
|
||||
|
||||
if (self->origin_store_row_deleted_id != 0)
|
||||
{
|
||||
g_signal_handler_disconnect (gtk_combo_box_get_model (self->origin_box),
|
||||
self->origin_store_row_deleted_id);
|
||||
g_signal_handler_disconnect (gtk_combo_box_get_model (self->origin_box),
|
||||
self->origin_store_row_inserted_id);
|
||||
}
|
||||
|
||||
gtk_combo_box_set_model (self->origin_box, GTK_TREE_MODEL (origin_store));
|
||||
|
||||
if (origin_store != NULL)
|
||||
{
|
||||
self->origin_store_row_deleted_id = g_signal_connect_swapped (origin_store, "row-deleted", G_CALLBACK (update_origin_box), self);
|
||||
self->origin_store_row_inserted_id = g_signal_connect_swapped (origin_store, "row-inserted", G_CALLBACK (update_origin_box), self);
|
||||
}
|
||||
else
|
||||
{
|
||||
self->origin_store_row_deleted_id = 0;
|
||||
self->origin_store_row_inserted_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_new_call_box_init (CallsNewCallBox *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
update_origin_box (self);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_new_call_box_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
CallsNewCallBox *self = CALLS_NEW_CALL_BOX (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_ORIGIN_STORE:
|
||||
calls_new_call_box_set_origin_store (self, g_value_get_object (value));
|
||||
g_object_notify_by_pspec (object, pspec);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_new_call_box_get_property (GObject *object,
|
||||
guint property_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
CallsNewCallBox *self = CALLS_NEW_CALL_BOX (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_ORIGIN_STORE:
|
||||
g_value_set_object (value, gtk_combo_box_get_model (self->origin_box));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
calls_new_call_box_class_init (CallsNewCallBoxClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->set_property = calls_new_call_box_set_property;
|
||||
object_class->get_property = calls_new_call_box_get_property;
|
||||
|
||||
props[PROP_ORIGIN_STORE] =
|
||||
g_param_spec_object ("origin-store",
|
||||
_("Origin store"),
|
||||
_("The storage for origins"),
|
||||
GTK_TYPE_LIST_STORE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
|
||||
|
||||
/**
|
||||
* CallsNewCallBox::submitted:
|
||||
* @self: The # CallsNewCallBox instance.
|
||||
* @origin: The origin of the call.
|
||||
* @number: The number at the time of activation.
|
||||
*
|
||||
* This signal is emitted when the dialer's 'dial' button is activated.
|
||||
* Connect to this signal to perform to get notified when the user
|
||||
* wants to submit the dialed number for a given call origin.
|
||||
*/
|
||||
signals[SIGNAL_SUBMITTED] =
|
||||
g_signal_new ("submitted",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
2,
|
||||
CALLS_TYPE_ORIGIN,
|
||||
G_TYPE_STRING);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/sm/puri/calls/ui/new-call-box.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, origin_box);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, number_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, dial_pad);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_pad_deleted_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_pad_symbol_clicked_cb);
|
||||
}
|
38
src/calls-new-call-box.h
Normal file
38
src/calls-new-call-box.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Purism SPC
|
||||
*
|
||||
* This file is part of Calls.
|
||||
*
|
||||
* Calls is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calls is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Adrien Plazas <adrien.plazas@puri.sm>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CALLS_NEW_CALL_BOX_H__
|
||||
#define CALLS_NEW_CALL_BOX_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CALLS_TYPE_NEW_CALL_BOX (calls_new_call_box_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (CallsNewCallBox, calls_new_call_box, CALLS, NEW_CALL_BOX, GtkBox);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* CALLS_NEW_CALL_BOX_H__ */
|
|
@ -5,5 +5,7 @@
|
|||
<file preprocess="xml-stripblanks">call-display.ui</file>
|
||||
<file preprocess="xml-stripblanks">call-selector-item.ui</file>
|
||||
<file preprocess="xml-stripblanks">encryption-indicator.ui</file>
|
||||
<file preprocess="xml-stripblanks">history-box.ui</file>
|
||||
<file preprocess="xml-stripblanks">new-call-box.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
|
|
@ -28,8 +28,10 @@
|
|||
#include <handy.h>
|
||||
|
||||
#include "calls-encryption-indicator.h"
|
||||
#include "calls-history-box.h"
|
||||
#include "calls-main-window.h"
|
||||
#include "calls-mm-provider.h"
|
||||
#include "calls-new-call-box.h"
|
||||
|
||||
#define APP_ID "sm.puri.Calls"
|
||||
|
||||
|
@ -42,6 +44,8 @@ show_window (GtkApplication *app)
|
|||
CallsMainWindow *main_window;
|
||||
|
||||
CALLS_TYPE_ENCRYPTION_INDICATOR;
|
||||
CALLS_TYPE_HISTORY_BOX;
|
||||
CALLS_TYPE_NEW_CALL_BOX;
|
||||
HDY_TYPE_DIALER;
|
||||
|
||||
connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
|
||||
|
|
|
@ -46,6 +46,8 @@ calls_sources = ['calls-message-source.c', 'calls-message-source.h',
|
|||
'calls-call-display.c', 'calls-call-display.h',
|
||||
'calls-call-selector-item.c', 'calls-call-selector-item.h',
|
||||
'calls-encryption-indicator.c', 'calls-encryption-indicator.h',
|
||||
'calls-history-box.c', 'calls-history-box.h',
|
||||
'calls-new-call-box.c', 'calls-new-call-box.h',
|
||||
'calls-main-window.c', 'calls-main-window.h',
|
||||
'util.c', 'util.h',
|
||||
]
|
||||
|
|
|
@ -2,170 +2,251 @@
|
|||
<!-- Generated with glade 3.22.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<template class="CallsCallDisplay" parent="GtkBox">
|
||||
<template class="CallsCallDisplay" parent="GtkOverlay">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin_bottom">8</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="margin_right">12</property>
|
||||
<property name="margin_top">8</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="width_request">300</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="party_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="primary_contact_info">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
<attribute name="scale" value="1.6"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="secondary_contact_info">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin_bottom">8</property>
|
||||
<property name="margin_left">12</property>
|
||||
<property name="margin_right">12</property>
|
||||
<property name="margin_top">8</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="width_request">300</property>
|
||||
<property name="sensitive" bind-source="dial_pad_revealer" bind-property="reveal-child" bind-flags="invert-boolean|bidirectional|sync-create"/>
|
||||
<child>
|
||||
<object class="GtkLabel" id="status">
|
||||
<object class="GtkBox" id="party_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="time">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">00:00</property>
|
||||
<property name="margin_top">30</property>
|
||||
<property name="margin_bottom">40</property>
|
||||
<attributes>
|
||||
<attribute name="scale" value="1.6"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="answer">
|
||||
<property name="label" translatable="yes">Answer</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<signal name="clicked" handler="answer_clicked_cb" swapped="no"/>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="primary_contact_info">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
<attribute name="scale" value="1.6"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="secondary_contact_info">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="height_request">65</property>
|
||||
<property name="margin_bottom">65</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="mute">
|
||||
<object class="GtkLabel" id="status">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="time">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">00:00</property>
|
||||
<property name="margin_top">30</property>
|
||||
<property name="margin_bottom">40</property>
|
||||
<attributes>
|
||||
<attribute name="scale" value="1.6"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="answer">
|
||||
<property name="label" translatable="yes">Answer</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<signal name="toggled" handler="mute_toggled_cb" swapped="no"/>
|
||||
<signal name="clicked" handler="answer_clicked_cb" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="height_request">65</property>
|
||||
<property name="margin_bottom">65</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<object class="GtkToggleButton" id="mute">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">microphone-sensitivity-muted-symbolic</property>
|
||||
<property name="icon_size">3</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<signal name="toggled" handler="mute_toggled_cb" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">microphone-sensitivity-muted-symbolic</property>
|
||||
<property name="icon_size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="dial_pad">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="active" bind-source="dial_pad_revealer" bind-property="reveal-child" bind-flags="bidirectional|sync-create"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">input-dialpad-symbolic</property>
|
||||
<property name="icon_size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="speaker">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<signal name="toggled" handler="speaker_toggled_cb" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">audio-volume-high-symbolic</property>
|
||||
<property name="icon_size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="dial_pad">
|
||||
<object class="CallsEncryptionIndicator" id="encryption_indicator">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">input-dialpad-symbolic</property>
|
||||
<property name="icon_size">3</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="speaker">
|
||||
<property name="visible">True</property>
|
||||
<object class="GtkButton" id="hang_up">
|
||||
<property name="always_show_image">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<signal name="toggled" handler="speaker_toggled_cb" swapped="no"/>
|
||||
<property name="halign">center</property>
|
||||
<property name="height_request">65</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="width_request">150</property>
|
||||
<signal name="clicked" handler="hang_up_clicked_cb" swapped="no"/>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-hang-up">
|
||||
<property name="accessible-name" translatable="yes">Hang up</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">audio-volume-high-symbolic</property>
|
||||
<property name="icon_size">3</property>
|
||||
<property name="icon-name">call-stop-symbolic</property>
|
||||
<property name="icon-size">5</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="overlay">
|
||||
<object class="GtkRevealer" id="dial_pad_revealer">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">fill</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">False</property>
|
||||
<property name="transition-type">slide-up</property>
|
||||
<property name="reveal-child" bind-source="dial_pad" bind-property="active" bind-flags="bidirectional|sync-create"/>
|
||||
<child>
|
||||
<object class="CallsEncryptionIndicator" id="encryption_indicator">
|
||||
<object class="GtkActionBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_bottom">30</property>
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="hang_up">
|
||||
<property name="always_show_image">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="height_request">65</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="width_request">150</property>
|
||||
<signal name="clicked" handler="hang_up_clicked_cb" swapped="no"/>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
<class name="image-button"/>
|
||||
<class name="background"/>
|
||||
</style>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-hang-up">
|
||||
<property name="accessible-name" translatable="yes">Hang up</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<child type="center">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">call-stop-symbolic</property>
|
||||
<property name="icon-size">5</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="width_request">300</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<property name="margin_top">12</property>
|
||||
<child>
|
||||
<object class="HdyDialer">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="column_spacing">10</property>
|
||||
<property name="margin_bottom">10</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="row_spacing">8</property>
|
||||
<property name="show_action_buttons">False</property>
|
||||
<property name="hexpand">False</property>
|
||||
<signal name="symbol-clicked" handler="dial_pad_symbol_clicked_cb" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="always_show_image">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="height_request">65</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="width_request">150</property>
|
||||
<signal name="clicked" handler="hide_dial_pad_clicked_cb" swapped="yes"/>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-hide-dial-pad">
|
||||
<property name="accessible-name" translatable="yes">Hide the dial pad</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">go-down-symbolic</property>
|
||||
<property name="icon-size">5</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
15
src/ui/history-box.ui
Normal file
15
src/ui/history-box.ui
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<requires lib="libhandy" version="0.0"/>
|
||||
<object class="GtkListStore" id="history_store"/>
|
||||
<template class="CallsHistoryBox" parent="GtkTreeView">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="model">history_store</property>
|
||||
<property name="visible">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
|
@ -3,7 +3,6 @@
|
|||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<requires lib="libhandy" version="0.0"/>
|
||||
<object class="GtkListStore" id="history_store"/>
|
||||
<object class="GtkListStore" id="origin_store">
|
||||
<columns>
|
||||
<!-- column-name name -->
|
||||
|
@ -14,7 +13,7 @@
|
|||
</object>
|
||||
<template class="CallsMainWindow" parent="GtkApplicationWindow">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Call</property>
|
||||
<property name="title" translatable="yes">Calls</property>
|
||||
<property name="hide_titlebar_when_maximized">True</property>
|
||||
<property name="show_menubar">False</property>
|
||||
<child>
|
||||
|
@ -163,114 +162,26 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="dial_box">
|
||||
<object class="CallsNewCallBox" id="new_call_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="dial_controls">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="origin">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="model">origin_store</property>
|
||||
<property name="id_column">0</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="search">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="primary_icon_name">edit-find-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="new_call">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="expanded">True</property>
|
||||
<signal name="notify::expanded" handler="new_call_expanded_notify_cb" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">New call</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HdyDialer" id="dial_pad">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="deleted" handler="dial_pad_deleted_cb" swapped="yes"/>
|
||||
<signal name="submitted" handler="dial_pad_submitted_cb" swapped="yes"/>
|
||||
<signal name="symbol-clicked" handler="dial_pad_symbol_clicked_cb" swapped="yes"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="origin_store">origin_store</property>
|
||||
<signal name="submitted" handler="new_call_submitted_cb" swapped="yes"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">dial-pad</property>
|
||||
<property name="title" translatable="yes">Dial pad</property>
|
||||
<property name="position">1</property>
|
||||
<property name="name">new-call</property>
|
||||
<property name="title" translatable="yes">New call</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="history_view">
|
||||
<object class="CallsHistoryBox" id="history_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">history_store</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">history</property>
|
||||
<property name="title" translatable="yes">History</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -286,4 +197,4 @@
|
|||
<placeholder/>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
</interface>
|
102
src/ui/new-call-box.ui
Normal file
102
src/ui/new-call-box.ui
Normal file
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<requires lib="libhandy" version="0.0"/>
|
||||
<template class="CallsNewCallBox" parent="GtkBox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="margin_left">24</property>
|
||||
<property name="margin_right">24</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="origin_box">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="id_column">0</property>
|
||||
<property name="margin_bottom">8</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSearchEntry" id="number_entry">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="primary_icon_name">edit-find-symbolic</property>
|
||||
<property name="primary_icon_sensitive">False</property>
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="HdyDialer" id="dial_pad">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="column_spacing">10</property>
|
||||
<property name="margin_bottom">20</property>
|
||||
<property name="margin_top">20</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="row_spacing">8</property>
|
||||
<property name="show_action_buttons">False</property>
|
||||
<property name="width_request">300</property>
|
||||
<property name="hexpand">False</property>
|
||||
<signal name="deleted" handler="dial_pad_deleted_cb" swapped="yes"/>
|
||||
<signal name="symbol-clicked" handler="dial_pad_symbol_clicked_cb" swapped="yes"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dial">
|
||||
<property name="always_show_image">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="height_request">65</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="width_request">150</property>
|
||||
<signal name="clicked" handler="dial_clicked_cb" swapped="yes"/>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-dial">
|
||||
<property name="accessible-name" translatable="yes">Dial</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="back_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">call-start-symbolic</property>
|
||||
<property name="icon-size">5</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
Loading…
Reference in a new issue