Commit 61cbab07 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

gnome: add account settings

Refs #68670

Change-Id: I24684d1562a27180dcf684747e90d8c92cc07250
parent dd84cf9a
......@@ -140,6 +140,14 @@ SET( SRC_FILES
src/backends/minimalhistorybackend.cpp
src/models/gtkqsortfiltertreemodel.h
src/models/gtkqsortfiltertreemodel.cpp
src/accountview.h
src/accountview.cpp
src/accountgeneraltab.h
src/accountgeneraltab.cpp
src/accountaudiotab.h
src/accountaudiotab.cpp
src/accountvideotab.h
src/accountvideotab.cpp
)
# compile glib resource files to c code
......
/*
* Copyright (C) 2015 Savoir-Faire Linux Inc.
* Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include "accountaudiotab.h"
#include <gtk/gtk.h>
#include <account.h>
#include <audio/codecmodel.h>
#include "models/gtkqsortfiltertreemodel.h"
struct _AccountAudioTab
{
GtkBox parent;
};
struct _AccountAudioTabClass
{
GtkBoxClass parent_class;
};
typedef struct _AccountAudioTabPrivate AccountAudioTabPrivate;
struct _AccountAudioTabPrivate
{
Account *account;
GtkWidget *treeview_codecs;
GtkWidget *button_moveup;
GtkWidget *button_movedown;
};
G_DEFINE_TYPE_WITH_PRIVATE(AccountAudioTab, account_audio_tab, GTK_TYPE_BOX);
#define ACCOUNT_AUDIO_TAB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ACCOUNT_AUDIO_TAB_TYPE, AccountAudioTabPrivate))
static void
account_audio_tab_dispose(GObject *object)
{
G_OBJECT_CLASS(account_audio_tab_parent_class)->dispose(object);
}
static void
account_audio_tab_init(AccountAudioTab *view)
{
gtk_widget_init_template(GTK_WIDGET(view));
}
static void
account_audio_tab_class_init(AccountAudioTabClass *klass)
{
G_OBJECT_CLASS(klass)->dispose = account_audio_tab_dispose;
gtk_widget_class_set_template_from_resource(GTK_WIDGET_CLASS (klass),
"/cx/ring/RingGnome/accountaudiotab.ui");
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), AccountAudioTab, treeview_codecs);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), AccountAudioTab, button_moveup);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), AccountAudioTab, button_movedown);
}
static void
codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, AccountAudioTab *view)
{
g_return_if_fail(IS_ACCOUNT_AUDIO_TAB(view));
AccountAudioTabPrivate *priv = ACCOUNT_AUDIO_TAB_GET_PRIVATE(view);
/* we want to set it to the opposite of the current value */
gboolean toggle = !gtk_cell_renderer_toggle_get_active(renderer);
/* get iter which was clicked */
GtkTreePath *tree_path = gtk_tree_path_new_from_string(path);
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(priv->treeview_codecs));
GtkTreeIter iter;
gtk_tree_model_get_iter(model, &iter, tree_path);
/* get qmodelindex from iter and set the model data */
QModelIndex idx = gtk_q_sort_filter_tree_model_get_source_idx(GTK_Q_SORT_FILTER_TREE_MODEL(model), &iter);
if (idx.isValid()) {
priv->account->codecModel()->audioCodecs()->setData(idx, QVariant(toggle), Qt::CheckStateRole);
priv->account->codecModel()->save();
}
}
static QModelIndex
get_index_from_selection(GtkTreeSelection *selection)
{
GtkTreeIter iter;
GtkTreeModel *model = NULL;
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
return gtk_q_sort_filter_tree_model_get_source_idx(GTK_Q_SORT_FILTER_TREE_MODEL(model), &iter);
} else {
return QModelIndex();
}
}
static void
move_selected_codec(AccountAudioTab *view, int position_diff)
{
g_return_if_fail(IS_ACCOUNT_AUDIO_TAB(view));
AccountAudioTabPrivate *priv = ACCOUNT_AUDIO_TAB_GET_PRIVATE(view);
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->treeview_codecs));
QModelIndex idx = get_index_from_selection(selection);
if(!idx.isValid())
return;
QMimeData* mime = priv->account->codecModel()->audioCodecs()->mimeData(QModelIndexList() << idx);
priv->account->codecModel()->audioCodecs()->dropMimeData(
mime,
Qt::MoveAction,
idx.row() + position_diff,
0,
QModelIndex());
priv->account->saveCodecs();
/* now make sure to select the same codec which was moved
* TODO: UGLY! this should be somehow done in the qt modle bindings,
* or via a selection model, not here
*/
int new_row = idx.row() + position_diff;
int row_count = priv->account->codecModel()->audioCodecs()->rowCount(idx.parent());
if (new_row < 0)
new_row = row_count - 1;
else if (new_row >= row_count)
new_row = 0;
idx = idx.sibling(new_row, idx.column());
GtkTreeIter iter;
if (gtk_q_sort_filter_tree_model_source_index_to_iter(
GTK_Q_SORT_FILTER_TREE_MODEL(gtk_tree_view_get_model(GTK_TREE_VIEW(priv->treeview_codecs))),
idx,
&iter)) {
gtk_tree_selection_select_iter(selection, &iter);
}
}
static void
move_codec_up(G_GNUC_UNUSED GtkButton *button, AccountAudioTab *view)
{
move_selected_codec(view, -1);
}
static void
move_codec_down(G_GNUC_UNUSED GtkButton *button, AccountAudioTab *view)
{
move_selected_codec(view, +1);
}
static void
build_tab_view(AccountAudioTab *view)
{
g_return_if_fail(IS_ACCOUNT_AUDIO_TAB(view));
AccountAudioTabPrivate *priv = ACCOUNT_AUDIO_TAB_GET_PRIVATE(view);
/* codec model */
GtkQSortFilterTreeModel *codec_model;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
codec_model = gtk_q_sort_filter_tree_model_new(
priv->account->codecModel()->audioCodecs(),
4,
Qt::CheckStateRole, G_TYPE_BOOLEAN,
CodecModel::Role::NAME, G_TYPE_STRING,
CodecModel::Role::BITRATE, G_TYPE_STRING,
CodecModel::Role::SAMPLERATE, G_TYPE_STRING);
gtk_tree_view_set_model(GTK_TREE_VIEW(priv->treeview_codecs), GTK_TREE_MODEL(codec_model));
renderer = gtk_cell_renderer_toggle_new();
column = gtk_tree_view_column_new_with_attributes("Enabled", renderer, "active", 0, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(priv->treeview_codecs), column);
g_signal_connect(renderer, "toggled", G_CALLBACK(codec_active_toggled), view);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Name", renderer, "text", 1, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(priv->treeview_codecs), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Bitrate", renderer, "text", 2, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(priv->treeview_codecs), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes("Samplerate", renderer, "text", 3, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(priv->treeview_codecs), column);
/* connect move codecs up/down signals */
g_signal_connect(priv->button_moveup, "clicked", G_CALLBACK(move_codec_up), view);
g_signal_connect(priv->button_movedown, "clicked", G_CALLBACK(move_codec_down), view);
}
GtkWidget *
account_audio_tab_new(Account *account)
{
g_return_val_if_fail(account != NULL, NULL);
gpointer view = g_object_new(ACCOUNT_AUDIO_TAB_TYPE, NULL);
AccountAudioTabPrivate *priv = ACCOUNT_AUDIO_TAB_GET_PRIVATE(view);
priv->account = account;
build_tab_view(ACCOUNT_AUDIO_TAB(view));
return (GtkWidget *)view;
}
/*
* Copyright (C) 2015 Savoir-Faire Linux Inc.
* Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef _ACCOUNTAUDIOTAB_H
#define _ACCOUNTAUDIOTAB_H
#include <gtk/gtk.h>
#include <account.h>
G_BEGIN_DECLS
#define ACCOUNT_AUDIO_TAB_TYPE (account_audio_tab_get_type ())
#define ACCOUNT_AUDIO_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ACCOUNT_AUDIO_TAB_TYPE, AccountAudioTab))
#define ACCOUNT_AUDIO_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ACCOUNT_AUDIO_TAB_TYPE, AccountAudioTabClass))
#define IS_ACCOUNT_AUDIO_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ACCOUNT_AUDIO_TAB_TYPE))
#define IS_ACCOUNT_AUDIO_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ACCOUNT_AUDIO_TAB_TYPE))
typedef struct _AccountAudioTab AccountAudioTab;
typedef struct _AccountAudioTabClass AccountAudioTabClass;
GType account_audio_tab_get_type (void) G_GNUC_CONST;
GtkWidget *account_audio_tab_new (Account *account);
G_END_DECLS
#endif /* _ACCOUNTAUDIOTAB_H */
\ No newline at end of file
/*
* Copyright (C) 2015 Savoir-Faire Linux Inc.
* Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include "accountgeneraltab.h"
#include <gtk/gtk.h>
#include <account.h>
struct _AccountGeneralTab
{
GtkBox parent;
};
struct _AccountGeneralTabClass
{
GtkBoxClass parent_class;
};
typedef struct _AccountGeneralTabPrivate AccountGeneralTabPrivate;
struct _AccountGeneralTabPrivate
{
Account *account;
GtkWidget *grid_account;
GtkWidget *grid_parameters;
};
G_DEFINE_TYPE_WITH_PRIVATE(AccountGeneralTab, account_general_tab, GTK_TYPE_BOX);
#define ACCOUNT_GENERAL_TAB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ACCOUNT_GENERAL_TAB_TYPE, AccountGeneralTabPrivate))
static void
account_general_tab_dispose(GObject *object)
{
G_OBJECT_CLASS(account_general_tab_parent_class)->dispose(object);
}
static void
account_general_tab_init(AccountGeneralTab *view)
{
gtk_widget_init_template(GTK_WIDGET(view));
}
static void
account_general_tab_class_init(AccountGeneralTabClass *klass)
{
G_OBJECT_CLASS(klass)->dispose = account_general_tab_dispose;
gtk_widget_class_set_template_from_resource(GTK_WIDGET_CLASS (klass),
"/cx/ring/RingGnome/accountgeneraltab.ui");
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), AccountGeneralTab, grid_account);
gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), AccountGeneralTab, grid_parameters);
}
static void
account_alias_changed(GtkEditable *entry, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setAlias(QString(gtk_editable_get_chars(entry, 0, -1)));
}
static void
account_hostname_changed(GtkEditable *entry, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setHostname(QString(gtk_editable_get_chars(entry, 0, -1)));
}
static void
account_username_changed(GtkEditable *entry, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setUsername(QString(gtk_editable_get_chars(entry, 0, -1)));
}
static void
account_password_changed(GtkEditable *entry, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setPassword(QString(gtk_editable_get_chars(entry, 0, -1)));
}
static void
show_password(GtkToggleButton *checkbutton, GtkEntry *entry)
{
gtk_entry_set_visibility(GTK_ENTRY(entry), gtk_toggle_button_get_active(checkbutton));
}
static void
account_proxy_changed(GtkEditable *entry, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setProxy(QString(gtk_editable_get_chars(entry, 0, -1)));
}
static void
account_mailbox_changed(GtkEditable *entry, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setMailbox(QString(gtk_editable_get_chars(entry, 0, -1)));
}
static void
auto_answer(GtkToggleButton *checkbutton, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setAutoAnswer(gtk_toggle_button_get_active(checkbutton));
}
static void
upnp_enabled(GtkToggleButton *checkbutton, AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
priv->account->setUpnpEnabled(gtk_toggle_button_get_active(checkbutton));
}
static void
build_tab_view(AccountGeneralTab *view)
{
g_return_if_fail(IS_ACCOUNT_GENERAL_TAB(view));
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
int grid_row = 0;
GtkWidget *label = NULL;
GtkWidget *entry = NULL;
GtkWidget *checkbutton = NULL;
/* build account grid */
/* check if its ip2ip account */
const QByteArray& alias = priv->account->alias().toLocal8Bit();
if (strcmp(alias.constData(), "IP2IP") == 0) {
label = gtk_label_new("IP2IP");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_account), label, 0, grid_row, 1, 1);
++grid_row;
} else {
/* account alias */
label = gtk_label_new("Alias");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_account), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), alias.constData());
gtk_widget_set_halign(entry, GTK_ALIGN_START);
g_signal_connect(entry, "changed", G_CALLBACK(account_alias_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_account), entry, 1, grid_row, 1, 1);
++grid_row;
/* account type */
label = gtk_label_new("Type");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_account), label, 0, grid_row, 1, 1);
label = gtk_label_new("");
gtk_widget_set_halign(label, GTK_ALIGN_START);
switch (priv->account->protocol()) {
case Account::Protocol::SIP:
gtk_label_set_text(GTK_LABEL(label), "SIP");
break;
case Account::Protocol::IAX:
gtk_label_set_text(GTK_LABEL(label), "IAX");
break;
case Account::Protocol::RING:
gtk_label_set_text(GTK_LABEL(label), "RING");
break;
case Account::Protocol::COUNT__:
break;
}
gtk_grid_attach(GTK_GRID(priv->grid_account), label, 1, grid_row, 1, 1);
++grid_row;
}
if (priv->account->protocol() == Account::Protocol::RING) {
label = gtk_label_new("Hash");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_account), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->username().toLocal8Bit().constData());
g_object_set(G_OBJECT(entry), "editable", FALSE, NULL);
g_object_set(G_OBJECT(entry), "max-width-chars", 50, NULL);
gtk_widget_override_font(entry, pango_font_description_from_string("monospace"));
gtk_entry_set_alignment(GTK_ENTRY(entry), 0.5);
gtk_grid_attach(GTK_GRID(priv->grid_account), entry, 1, grid_row, 1, 1);
++grid_row;
}
gtk_widget_show_all(priv->grid_account);
/* build parameters grid */
grid_row = 0;
if (strcmp(alias.constData(), "IP2IP") != 0) {
if (priv->account->protocol() != Account::Protocol::RING) {
/* SIP and IAX have the same params */
/* host name */
label = gtk_label_new("Host name");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->hostname().toLocal8Bit().constData());
g_signal_connect(entry, "changed", G_CALLBACK(account_hostname_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry, 1, grid_row, 1, 1);
++grid_row;
/* user name */
label = gtk_label_new("User name");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->username().toLocal8Bit().constData());
g_signal_connect(entry, "changed", G_CALLBACK(account_username_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry, 1, grid_row, 1, 1);
++grid_row;
/* password */
label = gtk_label_new("Password");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_input_purpose(GTK_ENTRY(entry), GTK_INPUT_PURPOSE_PASSWORD);
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(entry), GTK_ENTRY_ICON_PRIMARY, "dialog-password");
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->username().toLocal8Bit().constData());
g_signal_connect(entry, "changed", G_CALLBACK(account_password_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry, 1, grid_row, 1, 1);
++grid_row;
/* show password */
checkbutton = gtk_check_button_new_with_label("Show password");
gtk_grid_attach(GTK_GRID(priv->grid_parameters), checkbutton, 1, grid_row, 1, 1);
g_signal_connect(checkbutton, "toggled", G_CALLBACK(show_password), entry);
++grid_row;
/* proxy */
label = gtk_label_new("Proxy");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->proxy().toLocal8Bit().constData());
g_signal_connect(entry, "changed", G_CALLBACK(account_proxy_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry, 1, grid_row, 1, 1);
++grid_row;
/* voicemail number */
label = gtk_label_new("Voicemail number");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->mailbox().toLocal8Bit().constData());
g_signal_connect(entry, "changed", G_CALLBACK(account_mailbox_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry, 1, grid_row, 1, 1);
++grid_row;
} else {
/* RING accoutn */
/* bootstrap */
label = gtk_label_new("Bootstrap");
gtk_widget_set_halign(label, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), label, 0, grid_row, 1, 1);
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), priv->account->hostname().toLocal8Bit().constData());
g_signal_connect(entry, "changed", G_CALLBACK(account_hostname_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry, 1, grid_row, 1, 1);
++grid_row;
}
}
/* auto answer */
checkbutton = gtk_check_button_new_with_label("Auto-answer calls");