Commit bd029589 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

gnome: improve account creation

Refs #68670

Change-Id: I522a059b80bb4a13faae6b9fd2019b5355cc7690
parent 57058800
......@@ -163,6 +163,8 @@ SET( SRC_FILES
src/defines.h
src/video/xrectsel.h
src/video/xrectsel.c
src/dialogs.h
src/dialogs.c
)
# compile glib resource files to c code
......
......@@ -50,6 +50,8 @@ struct _AccountGeneralTabPrivate
Account *account;
GtkWidget *grid_account;
GtkWidget *grid_parameters;
QMetaObject::Connection account_updated;
};
G_DEFINE_TYPE_WITH_PRIVATE(AccountGeneralTab, account_general_tab, GTK_TYPE_BOX);
......@@ -59,6 +61,11 @@ G_DEFINE_TYPE_WITH_PRIVATE(AccountGeneralTab, account_general_tab, GTK_TYPE_BOX)
static void
account_general_tab_dispose(GObject *object)
{
AccountGeneralTab *view = ACCOUNT_GENERAL_TAB(object);
AccountGeneralTabPrivate *priv = ACCOUNT_GENERAL_TAB_GET_PRIVATE(view);
QObject::disconnect(priv->account_updated);
G_OBJECT_CLASS(account_general_tab_parent_class)->dispose(object);
}
......@@ -159,8 +166,16 @@ build_tab_view(AccountGeneralTab *view)
int grid_row = 0;
GtkWidget *label = NULL;
GtkWidget *entry = NULL;
GtkWidget *checkbutton = NULL;
/* separate pointers for each so that we reference them in the account changed callback */
GtkWidget *entry_alias = NULL;
GtkWidget *entry_username = NULL;
GtkWidget *entry_hostname = NULL;
GtkWidget *entry_password = NULL;
GtkWidget *entry_proxy = NULL;
GtkWidget *entry_voicemail = NULL;
GtkWidget *checkbutton_autoanswer = NULL;
GtkWidget *checkbutton_upnp = NULL;
/* build account grid */
......@@ -177,11 +192,11 @@ build_tab_view(AccountGeneralTab *view)
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);
entry_alias = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry_alias), alias.constData());
gtk_widget_set_halign(entry_alias, GTK_ALIGN_START);
g_signal_connect(entry_alias, "changed", G_CALLBACK(account_alias_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_account), entry_alias, 1, grid_row, 1, 1);
++grid_row;
/* account type */
......@@ -213,13 +228,14 @@ build_tab_view(AccountGeneralTab *view)
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);
entry_username = gtk_entry_new();
gtk_entry_set_placeholder_text(GTK_ENTRY(entry_username), "auto-generating...");
gtk_entry_set_text(GTK_ENTRY(entry_username), priv->account->username().toLocal8Bit().constData());
g_object_set(G_OBJECT(entry_username), "editable", FALSE, NULL);
g_object_set(G_OBJECT(entry_username), "max-width-chars", 50, NULL);
gtk_widget_override_font(entry_username, pango_font_description_from_string("monospace"));
gtk_entry_set_alignment(GTK_ENTRY(entry_username), 0.5);
gtk_grid_attach(GTK_GRID(priv->grid_account), entry_username, 1, grid_row, 1, 1);
++grid_row;
}
......@@ -235,59 +251,59 @@ build_tab_view(AccountGeneralTab *view)
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);
entry_hostname = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry_hostname), priv->account->hostname().toLocal8Bit().constData());
g_signal_connect(entry_hostname, "changed", G_CALLBACK(account_hostname_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry_hostname, 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);
entry_username = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry_username), priv->account->username().toLocal8Bit().constData());
g_signal_connect(entry_username, "changed", G_CALLBACK(account_username_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry_username, 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);
entry_password = gtk_entry_new();
gtk_entry_set_input_purpose(GTK_ENTRY(entry_password), GTK_INPUT_PURPOSE_PASSWORD);
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(entry_password), GTK_ENTRY_ICON_PRIMARY, "dialog-password");
gtk_entry_set_visibility(GTK_ENTRY(entry_password), FALSE);
gtk_entry_set_text(GTK_ENTRY(entry_password), priv->account->password().toLocal8Bit().constData());
g_signal_connect(entry_password, "changed", G_CALLBACK(account_password_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry_password, 1, grid_row, 1, 1);
++grid_row;
/* show password */
checkbutton = gtk_check_button_new_with_label("Show password");
GtkWidget *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);
g_signal_connect(checkbutton, "toggled", G_CALLBACK(show_password), entry_password);
++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);
entry_proxy = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry_proxy), priv->account->proxy().toLocal8Bit().constData());
g_signal_connect(entry_proxy, "changed", G_CALLBACK(account_proxy_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry_proxy, 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);
entry_voicemail = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry_voicemail), priv->account->mailbox().toLocal8Bit().constData());
g_signal_connect(entry_voicemail, "changed", G_CALLBACK(account_mailbox_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry_voicemail, 1, grid_row, 1, 1);
++grid_row;
} else {
/* RING accoutn */
......@@ -296,30 +312,52 @@ build_tab_view(AccountGeneralTab *view)
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);
entry_hostname = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry_hostname), priv->account->hostname().toLocal8Bit().constData());
g_signal_connect(entry_hostname, "changed", G_CALLBACK(account_hostname_changed), view);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), entry_hostname, 1, grid_row, 1, 1);
++grid_row;
}
}
/* auto answer */
checkbutton = gtk_check_button_new_with_label("Auto-answer calls");
gtk_widget_set_halign(checkbutton, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), checkbutton, 0, grid_row, 1, 1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton), priv->account->isAutoAnswer());
g_signal_connect(checkbutton, "toggled", G_CALLBACK(auto_answer), view);
checkbutton_autoanswer = gtk_check_button_new_with_label("Auto-answer calls");
gtk_widget_set_halign(checkbutton_autoanswer, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), checkbutton_autoanswer, 0, grid_row, 1, 1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_autoanswer), priv->account->isAutoAnswer());
g_signal_connect(checkbutton_autoanswer, "toggled", G_CALLBACK(auto_answer), view);
++grid_row;
/* upnp */
checkbutton = gtk_check_button_new_with_label("UPnP enabled");
gtk_widget_set_halign(checkbutton, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), checkbutton, 0, grid_row, 1, 1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton), priv->account->isUpnpEnabled());
g_signal_connect(checkbutton, "toggled", G_CALLBACK(upnp_enabled), view);
checkbutton_upnp = gtk_check_button_new_with_label("UPnP enabled");
gtk_widget_set_halign(checkbutton_upnp, GTK_ALIGN_START);
gtk_grid_attach(GTK_GRID(priv->grid_parameters), checkbutton_upnp, 0, grid_row, 1, 1);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_upnp), priv->account->isUpnpEnabled());
g_signal_connect(checkbutton_upnp, "toggled", G_CALLBACK(upnp_enabled), view);
++grid_row;
/* update account parameters if model is updated */
priv->account_updated = QObject::connect(
priv->account,
&Account::changed,
[=] () {
if (strcmp(alias.constData(), "IP2IP") != 0) {
gtk_entry_set_text(GTK_ENTRY(entry_alias), priv->account->alias().toLocal8Bit().constData());
gtk_entry_set_text(GTK_ENTRY(entry_username), priv->account->username().toLocal8Bit().constData());
gtk_entry_set_text(GTK_ENTRY(entry_hostname), priv->account->hostname().toLocal8Bit().constData());
if (priv->account->protocol() != Account::Protocol::RING) {
gtk_entry_set_text(GTK_ENTRY(entry_password), priv->account->password().toLocal8Bit().constData());
gtk_entry_set_text(GTK_ENTRY(entry_proxy), priv->account->proxy().toLocal8Bit().constData());
gtk_entry_set_text(GTK_ENTRY(entry_voicemail), priv->account->mailbox().toLocal8Bit().constData());
}
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_autoanswer), priv->account->isAutoAnswer());
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_upnp), priv->account->isUpnpEnabled());
}
);
gtk_widget_show_all(priv->grid_parameters);
}
......
......@@ -41,6 +41,7 @@
#include "accountgeneraltab.h"
#include "accountaudiotab.h"
#include "accountvideotab.h"
#include "dialogs.h"
struct _AccountView
{
......@@ -208,7 +209,7 @@ account_active_toggled(GtkCellRendererToggle *renderer, gchar *path, AccountView
}
static gboolean
remove_account_dialog(Account *account)
remove_account_dialog(AccountView *view, Account *account)
{
gboolean response = FALSE;
GtkWidget *dialog = gtk_message_dialog_new(NULL,
......@@ -217,6 +218,15 @@ remove_account_dialog(Account *account)
"Are you sure you want to delete account \"%s\"?",
account->alias().toLocal8Bit().constData());
gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
/* get parent window so we can center on it */
GtkWidget *parent = gtk_widget_get_toplevel(GTK_WIDGET(view));
if (gtk_widget_is_toplevel(parent)) {
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
}
switch (gtk_dialog_run(GTK_DIALOG(dialog))) {
case GTK_RESPONSE_OK:
response = TRUE;
......@@ -231,6 +241,16 @@ remove_account_dialog(Account *account)
return response;
}
static gboolean
save_account(GtkWidget *working_dialog)
{
AccountModel::instance()->save();
if (working_dialog)
gtk_widget_destroy(working_dialog);
return G_SOURCE_REMOVE;
}
static void
remove_account(G_GNUC_UNUSED GtkWidget *entry, AccountView *view)
{
......@@ -243,8 +263,18 @@ remove_account(G_GNUC_UNUSED GtkWidget *entry, AccountView *view)
if (idx.isValid()) {
/* this is a destructive operation, ask the user if they are sure */
Account *account = AccountModel::instance()->getAccountByModelIndex(idx);
if (remove_account_dialog(account)) {
if (remove_account_dialog(view, account)) {
/* show working dialog in case save operation takes time */
GtkWidget *working = ring_dialog_working(GTK_WIDGET(view), NULL);
gtk_window_present(GTK_WINDOW(working));
AccountModel::instance()->remove(idx);
/* now save the time it takes to transition the account view to the new account (300ms)
* the save doesn't happen before the "working" dialog is presented
* the timeout function should destroy the "working" dialog when done saving
*/
g_timeout_add_full(G_PRIORITY_LOW, 300, (GSourceFunc)save_account, working, NULL);
}
}
}
......@@ -264,7 +294,18 @@ add_account(G_GNUC_UNUSED GtkWidget *entry, AccountView *view)
&protocol_iter);
if (protocol_idx.isValid()) {
protocol_idx = priv->active_protocols->mapToSource(protocol_idx);
/* show working dialog in case save operation takes time */
GtkWidget *working = ring_dialog_working(GTK_WIDGET(view), NULL);
gtk_window_present(GTK_WINDOW(working));
AccountModel::instance()->add(QString("New Account"), protocol_idx);
/* now save after a short timeout to make sure that
* the save doesn't happen before the "working" dialog is presented
* the timeout function should destroy the "working" dialog when done saving
*/
g_timeout_add_full(G_PRIORITY_LOW, 300, (GSourceFunc)save_account, working, NULL);
}
}
}
......
/*
* 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 "dialogs.h"
#include <gtk/gtk.h>
GtkWidget *
ring_dialog_working(GtkWidget *parent, const gchar *msg)
{
GtkWidget *dialog = gtk_dialog_new();
gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
if (parent && GTK_IS_WIDGET(parent)) {
/* get parent window so we can center on it */
parent = gtk_widget_get_toplevel(GTK_WIDGET(parent));
if (gtk_widget_is_toplevel(parent)) {
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
}
}
GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
gtk_box_set_spacing(GTK_BOX(content_area), 10);
GtkWidget *message = NULL;
if (msg) {
message = gtk_label_new(msg);
} else {
message = gtk_label_new("Working...");
}
gtk_box_pack_start(GTK_BOX(content_area), message, FALSE, TRUE, 0);
GtkWidget *spinner = gtk_spinner_new();
gtk_spinner_start(GTK_SPINNER(spinner));
gtk_box_pack_start(GTK_BOX(content_area), spinner, FALSE, TRUE, 0);
gtk_widget_show_all(content_area);
return dialog;
}
\ 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.
*/
#ifndef _DIALOGS_H
#define _DIALOGS_H
#include <gtk/gtk.h>
G_BEGIN_DECLS
GtkWidget *ring_dialog_working(GtkWidget *parent, const gchar *msg);
G_END_DECLS
#endif /* _DIALOGS_H */
......@@ -45,6 +45,7 @@
#include "accountview.h"
#include <accountmodel.h>
#include <audio/codecmodel.h>
#include "dialogs.h"
#define CALL_VIEW_NAME "calls"
#define GENERAL_SETTINGS_VIEW_NAME "general"
......@@ -366,6 +367,23 @@ navbutton_history_toggled(GtkToggleButton *navbutton, RingMainWindow *win)
}
}
static gboolean
save_accounts(GtkWidget *working_dialog)
{
/* save changes to accounts */
AccountModel::instance()->save();
/* save changes to codecs */
for (int i = 0; i < AccountModel::instance()->rowCount(); i++) {
QModelIndex idx = AccountModel::instance()->index(i, 0);
AccountModel::instance()->getAccountByModelIndex(idx)->codecModel()->save();
}
if (working_dialog)
gtk_widget_destroy(working_dialog);
return G_SOURCE_REMOVE;
}
static void
settings_clicked(G_GNUC_UNUSED GtkButton *button, RingMainWindow *win)
{
......@@ -386,6 +404,16 @@ settings_clicked(G_GNUC_UNUSED GtkButton *button, RingMainWindow *win)
gtk_stack_set_transition_type(GTK_STACK(priv->stack_main_view), GTK_STACK_TRANSITION_TYPE_SLIDE_UP);
gtk_stack_set_visible_child_name(GTK_STACK(priv->stack_main_view), ACCOUNT_SETTINGS_VIEW_NAME);
} else {
/* show working dialog in case save operation takes time */
GtkWidget *working = ring_dialog_working(GTK_WIDGET(win), NULL);
gtk_window_present(GTK_WINDOW(working));
/* now save after the time it takes to transition back to the call view (400ms)
* the save doesn't happen before the "working" dialog is presented
* the timeout function should destroy the "working" dialog when done saving
*/
g_timeout_add_full(G_PRIORITY_LOW, 400, (GSourceFunc)save_accounts, working, NULL);
/* show calls */
gtk_image_set_from_icon_name(GTK_IMAGE(priv->image_settings), "emblem-system-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);
......@@ -394,14 +422,6 @@ settings_clicked(G_GNUC_UNUSED GtkButton *button, RingMainWindow *win)
gtk_stack_set_transition_type(GTK_STACK(priv->stack_main_view), GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN);
gtk_stack_set_visible_child_name(GTK_STACK(priv->stack_main_view), CALL_VIEW_NAME);
/* save changes to accounts */
AccountModel::instance()->save();
/* save changes to codecs */
for (int i = 0; i < AccountModel::instance()->rowCount(); i++) {
QModelIndex idx = AccountModel::instance()->index(i, 0);
AccountModel::instance()->getAccountByModelIndex(idx)->codecModel()->save();
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment