Commit 8f736744 authored by Tristan Matthews's avatar Tristan Matthews

* #19195: gnome: GtkTable -> GtkGrid for config

parent ac3c0bd8
......@@ -667,15 +667,15 @@ static void same_as_local_cb(GtkWidget * widget, G_GNUC_UNUSED gpointer data)
static GtkWidget* create_credential_widget(const account_t *account)
{
/* Credentials tree view */
GtkWidget *frame, *table;
gnome_main_section_new_with_table(_("Credential"), &frame, &table, 1, 1);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
GtkWidget *frame, *grid;
gnome_main_section_new_with_grid(_("Credential"), &frame, &grid);
gtk_container_set_border_width(GTK_CONTAINER(grid), 10);
gtk_grid_set_row_spacing(GTK_GRID(grid), 10);
GtkWidget *scrolled_window_credential = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window_credential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window_credential), GTK_SHADOW_IN);
gtk_table_attach_defaults(GTK_TABLE(table), scrolled_window_credential, 0, 1, 0, 1);
gtk_grid_attach(GTK_GRID(grid), scrolled_window_credential, 0, 0, 1, 1);
credential_store = gtk_list_store_new(COLUMN_CREDENTIAL_COUNT,
G_TYPE_STRING, // Realm
......@@ -721,7 +721,8 @@ static GtkWidget* create_credential_widget(const account_t *account)
/* Credential Buttons */
GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 3, 1, 2);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), hbox, 0, 1, 2, 1);
GtkWidget *addButton = gtk_button_new_from_stock(GTK_STOCK_ADD);
g_signal_connect(addButton, "clicked", G_CALLBACK(add_credential_cb), credential_store);
......@@ -761,18 +762,18 @@ create_security_widget(account_t *account, SFLPhoneClient *client)
curTLSEnabled = "false";
}
GtkWidget *frame, *table;
gnome_main_section_new_with_table(_("Security"), &frame, &table, 2, 3);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
gtk_table_set_col_spacings(GTK_TABLE(table), 10);
GtkWidget *frame, *grid;
gnome_main_section_new_with_grid(_("Security"), &frame, &grid);
gtk_container_set_border_width(GTK_CONTAINER(grid), 10);
gtk_grid_set_row_spacing(GTK_GRID(grid), 10);
gtk_grid_set_column_spacing(GTK_GRID(grid), 10);
/* TLS subsection */
OptionsData *options = g_new0(OptionsData, 1);
options->account = account;
options->client = client;
GtkWidget *sip_tls_advanced_button = gtk_button_new_from_stock(GTK_STOCK_EDIT);
gtk_table_attach_defaults(GTK_TABLE(table), sip_tls_advanced_button, 2, 3, 0, 1);
gtk_grid_attach(GTK_GRID(grid), sip_tls_advanced_button, 2, 0, 1, 1);
gtk_widget_set_sensitive(sip_tls_advanced_button, FALSE);
g_signal_connect(G_OBJECT(sip_tls_advanced_button), "clicked",
G_CALLBACK(show_advanced_tls_options_cb),
......@@ -782,7 +783,8 @@ create_security_widget(account_t *account, SFLPhoneClient *client)
g_signal_connect(use_sip_tls_check_box, "toggled", G_CALLBACK(use_sip_tls_cb), sip_tls_advanced_button);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_sip_tls_check_box),
g_strcmp0(curTLSEnabled, "true") == 0);
gtk_table_attach_defaults(GTK_TABLE(table), use_sip_tls_check_box, 0, 2, 0, 1);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), use_sip_tls_check_box, 0, 0, 2, 1);
/* ZRTP subsection */
GtkWidget *label = gtk_label_new_with_mnemonic(_("SRTP key exchange"));
......@@ -815,11 +817,11 @@ create_security_widget(account_t *account, SFLPhoneClient *client)
g_signal_connect(G_OBJECT(GTK_COMBO_BOX(key_exchange_combo)), "changed",
G_CALLBACK(key_exchange_changed_cb), NULL);
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
gtk_table_attach_defaults(GTK_TABLE(table), key_exchange_combo, 1, 2, 1, 2);
gtk_table_attach_defaults(GTK_TABLE(table), zrtp_button, 2, 3, 1, 2);
gtk_grid_attach(GTK_GRID(grid), label, 0, 1, 1, 1);
gtk_grid_attach(GTK_GRID(grid), key_exchange_combo, 1, 1, 1, 1);
gtk_grid_attach(GTK_GRID(grid), zrtp_button, 2, 1, 1, 1);
gtk_widget_show_all(table);
gtk_widget_show_all(grid);
return frame;
}
......@@ -854,18 +856,18 @@ static GtkWidget* create_registration_expire(const account_t *account)
g_warning("Could not retrieve %s from account properties",
CONFIG_ACCOUNT_REGISTRATION_EXPIRE);
GtkWidget *table, *frame;
gnome_main_section_new_with_table(_("Registration"), &frame, &table, 2, 3);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 5);
GtkWidget *grid, *frame;
gnome_main_section_new_with_grid(_("Registration"), &frame, &grid);
gtk_container_set_border_width(GTK_CONTAINER(grid), 10);
gtk_grid_set_row_spacing(GTK_GRID(grid), 5);
GtkWidget *label = gtk_label_new_with_mnemonic(_("Registration expire"));
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
gtk_grid_attach(GTK_GRID(grid), label, 0, 0, 1, 1);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
expire_spin_box = gtk_spin_button_new_with_range(1, 65535, 1);
gtk_label_set_mnemonic_widget(GTK_LABEL(label), expire_spin_box);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(expire_spin_box), g_ascii_strtod(account_expire, NULL));
gtk_table_attach_defaults(GTK_TABLE(table), expire_spin_box, 1, 2, 0, 1);
gtk_grid_attach(GTK_GRID(grid), expire_spin_box, 1, 0, 1, 1);
return frame;
}
......@@ -881,10 +883,10 @@ create_network(const account_t *account)
local_port = account_lookup(account, CONFIG_LOCAL_PORT);
}
GtkWidget *table, *frame;
gnome_main_section_new_with_table(_("Network Interface"), &frame, &table, 2, 3);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 5);
GtkWidget *grid, *frame;
gnome_main_section_new_with_grid(_("Network Interface"), &frame, &grid);
gtk_container_set_border_width(GTK_CONTAINER(grid), 10);
gtk_grid_set_row_spacing(GTK_GRID(grid), 5);
/**
* Retrieve the list of IP interface from the
......@@ -893,7 +895,7 @@ create_network(const account_t *account)
local_address_combo = gtk_combo_box_text_new();
GtkWidget *label = gtk_label_new_with_mnemonic(_("Local address"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), label, 0, 0, 1, 1);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gchar **iface_list = dbus_get_all_ip_interface_by_name();
......@@ -908,7 +910,7 @@ create_network(const account_t *account)
gtk_combo_box_set_active(GTK_COMBO_BOX(local_address_combo), 0);
gtk_label_set_mnemonic_widget(GTK_LABEL(label), local_address_combo);
gtk_table_attach(GTK_TABLE(table), local_address_combo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), local_address_combo, 1, 0, 1, 1);
// Fill the text entry with the ip address of local interface selected
local_address_entry = gtk_entry_new();
......@@ -922,24 +924,24 @@ create_network(const account_t *account)
gtk_entry_set_text(GTK_ENTRY(local_address_entry), local_iface_addr);
g_free(local_iface_addr);
gtk_widget_set_sensitive(local_address_entry, FALSE);
gtk_table_attach(GTK_TABLE(table), local_address_entry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), local_address_entry, 2, 0, 1, 1);
// Local port widget
label = gtk_label_new_with_mnemonic(_("Local port"));
gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
gtk_grid_attach(GTK_GRID(grid), label, 0, 1, 1, 1);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
local_port_spin_box = gtk_spin_button_new_with_range(1, 65535, 1);
gtk_label_set_mnemonic_widget(GTK_LABEL(label), local_port_spin_box);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(local_port_spin_box), g_ascii_strtod(local_port, NULL));
gtk_table_attach_defaults(GTK_TABLE(table), local_port_spin_box, 1, 2, 1, 2);
gtk_grid_attach(GTK_GRID(grid), local_port_spin_box, 1, 1, 1, 1);
return frame;
}
GtkWidget* create_published_address(const account_t *account)
{
GtkWidget *table, *frame;
GtkWidget *frame;
gchar *use_tls = NULL;
gchar *published_address = NULL;
gchar *published_port = NULL;
......@@ -965,30 +967,33 @@ GtkWidget* create_published_address(const account_t *account)
published_sameas_local = account_lookup(account, CONFIG_PUBLISHED_SAMEAS_LOCAL);
}
gnome_main_section_new_with_table(_("Published address"), &frame, &table, 2, 3);
gtk_container_set_border_width(GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 5);
GtkWidget *grid;
gnome_main_section_new_with_grid(_("Published address"), &frame, &grid);
gtk_container_set_border_width(GTK_CONTAINER(grid), 10);
gtk_grid_set_row_spacing(GTK_GRID(grid), 5);
use_stun_check_box = gtk_check_button_new_with_mnemonic(_("Using STUN"));
gtk_table_attach_defaults(GTK_TABLE(table), use_stun_check_box, 0, 1, 0, 1);
gtk_grid_attach(GTK_GRID(grid), use_stun_check_box, 0, 0, 1, 1);
g_signal_connect(use_stun_check_box, "toggled", G_CALLBACK(use_stun_cb), NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_stun_check_box),
utf8_case_equal(stun_enable, "true"));
gtk_widget_set_sensitive(use_stun_check_box, !utf8_case_equal(use_tls, "true"));
stun_server_label = gtk_label_new_with_mnemonic(_("STUN server URL"));
gtk_table_attach_defaults(GTK_TABLE(table), stun_server_label, 0, 1, 1, 2);
gtk_grid_attach(GTK_GRID(grid), stun_server_label, 0, 1, 1, 1);
gtk_misc_set_alignment(GTK_MISC(stun_server_label), 0, 0.5);
stun_server_entry = gtk_entry_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(stun_server_label), stun_server_entry);
gtk_entry_set_text(GTK_ENTRY(stun_server_entry), stun_server);
gtk_table_attach_defaults(GTK_TABLE(table), stun_server_entry, 1, 2, 1, 2);
gtk_grid_attach(GTK_GRID(grid), stun_server_entry, 1, 1, 1, 1);
same_as_local_radio_button = gtk_radio_button_new_with_mnemonic_from_widget(NULL, _("Same as local parameters"));
gtk_table_attach_defaults(GTK_TABLE(table), same_as_local_radio_button, 0, 2, 3, 4);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), same_as_local_radio_button, 0, 3, 2, 1);
published_addr_radio_button = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(same_as_local_radio_button), _("Set published address and port:"));
gtk_table_attach_defaults(GTK_TABLE(table), published_addr_radio_button, 0, 2, 4, 5);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), published_addr_radio_button, 0, 4, 2, 1);
if (utf8_case_equal(published_sameas_local, "true")) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button), TRUE);
......@@ -999,22 +1004,22 @@ GtkWidget* create_published_address(const account_t *account)
}
published_address_label = gtk_label_new_with_mnemonic(_("Published address"));
gtk_table_attach_defaults(GTK_TABLE(table), published_address_label, 0, 1, 5, 6);
gtk_grid_attach(GTK_GRID(grid), published_address_label, 0, 5, 1, 1);
gtk_misc_set_alignment(GTK_MISC(published_address_label), 0, 0.5);
published_address_entry = gtk_entry_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(published_address_label), published_address_entry);
gtk_entry_set_text(GTK_ENTRY(published_address_entry), published_address);
gtk_table_attach_defaults(GTK_TABLE(table), published_address_entry, 1, 2, 5, 6);
gtk_grid_attach(GTK_GRID(grid), published_address_entry, 1, 5, 1, 1);
published_port_label = gtk_label_new_with_mnemonic(_("Published port"));
gtk_table_attach_defaults(GTK_TABLE(table), published_port_label, 0, 1, 6, 7);
gtk_grid_attach(GTK_GRID(grid), published_port_label, 0, 6, 1, 1);
gtk_misc_set_alignment(GTK_MISC(published_port_label), 0, 0.5);
published_port_spin_box = gtk_spin_button_new_with_range(1, 65535, 1);
gtk_label_set_mnemonic_widget(GTK_LABEL(published_port_label), published_port_spin_box);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(published_port_spin_box), g_ascii_strtod(published_port, NULL));
gtk_table_attach_defaults(GTK_TABLE(table), published_port_spin_box, 1, 2, 6, 7);
gtk_grid_attach(GTK_GRID(grid), published_port_spin_box, 1, 6, 1, 1);
// This will trigger a signal, and the above two
// widgets need to be instanciated before that.
......@@ -1077,12 +1082,12 @@ create_audiocodecs_configuration(const account_t *account)
gtk_container_add(GTK_CONTAINER(audiocodecs), box);
// Add DTMF type selection for SIP account only
GtkWidget *table;
GtkWidget *grid;
if (account_is_SIP(account)) {
// Box for dtmf
GtkWidget *dtmf;
gnome_main_section_new_with_table(_("DTMF"), &dtmf, &table, 1, 2);
gnome_main_section_new_with_grid(_("DTMF"), &dtmf, &grid);
gtk_box_pack_start(GTK_BOX(vbox), dtmf, FALSE, FALSE, 0);
gtk_widget_show(dtmf);
......@@ -1090,17 +1095,17 @@ create_audiocodecs_configuration(const account_t *account)
const gchar * const dtmf_type = account_lookup(account, CONFIG_ACCOUNT_DTMF_TYPE);
const gboolean dtmf_are_rtp = utf8_case_equal(dtmf_type, OVERRTP);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(overrtp), dtmf_are_rtp);
gtk_table_attach(GTK_TABLE(table), overrtp, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), overrtp, 0, 0, 1, 1);
GtkWidget *sipinfo = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(overrtp), _("SIP"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sipinfo), !dtmf_are_rtp);
g_signal_connect(G_OBJECT(sipinfo), "clicked", G_CALLBACK(select_dtmf_type), NULL);
gtk_table_attach(GTK_TABLE(table), sipinfo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), sipinfo, 1, 0, 1, 1);
}
// Box for the ringtones
GtkWidget *frame;
gnome_main_section_new_with_table(_("Ringtones"), &frame, &table, 1, 2);
gnome_main_section_new_with_grid(_("Ringtones"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
file_chooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN);
......@@ -1110,7 +1115,7 @@ create_audiocodecs_configuration(const account_t *account)
const gboolean ringtone_enabled = g_strcmp0(ptr, "true") == 0;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enable_tone), ringtone_enabled);
g_signal_connect(G_OBJECT(enable_tone) , "clicked", G_CALLBACK(ringtone_enabled_cb), file_chooser);
gtk_table_attach(GTK_TABLE(table), enable_tone, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), enable_tone, 0, 0, 1, 1);
// file chooser button
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(file_chooser) , g_get_home_dir());
......@@ -1125,8 +1130,7 @@ create_audiocodecs_configuration(const account_t *account)
gtk_file_filter_add_pattern(filter, "*.au");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(file_chooser), filter);
gtk_table_attach(GTK_TABLE(table), file_chooser, 0, 1, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), file_chooser, 0, 1, 1, 1);
gtk_widget_show_all(vbox);
......
......@@ -300,7 +300,7 @@ addressbook_config_fill_book_list()
GtkWidget*
create_addressbook_settings()
{
GtkWidget *result_frame, *table, *value, *item;
GtkWidget *result_frame, *value, *item;
GtkListStore *store;
GtkCellRenderer *renderer;
......@@ -312,14 +312,16 @@ create_addressbook_settings()
GtkWidget *ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
gnome_main_section_new_with_table(_("General"), &result_frame, &table, 3, 3);
GtkWidget *grid;
gnome_main_section_new_with_grid(_("General"), &result_frame, &grid);
gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0);
// PHOTO DISPLAY
item = gtk_check_button_new_with_mnemonic(_("_Use Evolution address books"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(item), addressbook_config->enable);
g_signal_connect(G_OBJECT(item) , "clicked" , G_CALLBACK(enable_cb), NULL);
gtk_table_attach(GTK_TABLE(table), item, 1, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), item, 1, 0, 2, 1);
// SCALE BUTTON - NUMBER OF RESULTS
scale_button = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
......@@ -330,54 +332,57 @@ create_addressbook_settings()
gtk_spin_button_set_value(GTK_SPIN_BUTTON(value) , addressbook_config->max_results);
g_signal_connect(G_OBJECT(value) , "value-changed" , G_CALLBACK(max_results_cb), NULL);
gtk_box_pack_start(GTK_BOX(scale_button),value,TRUE,TRUE,10);
gtk_table_attach(GTK_TABLE(table), scale_button, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND |GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), scale_button, 1, 1, 1, 1);
cards_label = gtk_label_new(_("cards"));
gtk_table_attach(GTK_TABLE(table), cards_label, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), cards_label, 2, 1, 1, 1);
gtk_widget_show_all(scale_button);
// PHOTO DISPLAY
photo = gtk_check_button_new_with_mnemonic(_("_Display contact photo if available"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(photo), addressbook_config->display_contact_photo);
g_signal_connect(G_OBJECT(photo) , "clicked" , G_CALLBACK(display_contact_photo_cb), NULL);
gtk_table_attach(GTK_TABLE(table), photo, 1, 3, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), photo, 1, 2, 2, 1);
// Fields
gnome_main_section_new_with_table(_("Fields from Evolution's address books"), &result_frame, &table, 1, 3);
gnome_main_section_new_with_grid(_("Fields from Evolution's address books"), &result_frame, &grid);
gtk_box_pack_start(GTK_BOX(ret), result_frame, FALSE, FALSE, 0);
business = gtk_check_button_new_with_mnemonic(_("_Work"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(business), addressbook_config->search_phone_business);
g_signal_connect(G_OBJECT(business) , "clicked" , G_CALLBACK(search_phone_business_cb) , NULL);
gtk_table_attach(GTK_TABLE(table), business, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), business, 0, 0, 1, 1);
gtk_widget_set_sensitive(business, FALSE);
home = gtk_check_button_new_with_mnemonic(_("_Home"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(home), addressbook_config->search_phone_home);
g_signal_connect(G_OBJECT(home) , "clicked" , G_CALLBACK(search_phone_home_cb) , NULL);
gtk_table_attach(GTK_TABLE(table), home, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), home, 0, 1, 1, 1);
gtk_widget_set_sensitive(home, FALSE);
mobile = gtk_check_button_new_with_mnemonic(_("_Mobile"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mobile), addressbook_config->search_phone_mobile);
g_signal_connect(G_OBJECT(mobile) , "clicked" , G_CALLBACK(search_phone_mobile_cb) , NULL);
gtk_table_attach(GTK_TABLE(table), mobile, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), mobile, 0, 2, 1, 1);
// Address Book
gnome_main_section_new_with_table(_("Address Books"), &result_frame, &table, 2, 3);
gnome_main_section_new_with_grid(_("Address Books"), &result_frame, &grid);
gtk_box_pack_start(GTK_BOX(ret), result_frame, TRUE, TRUE, 0);
gtk_widget_show(result_frame);
scrolled_label = gtk_label_new(_("Select which Evolution address books to use"));
gtk_misc_set_alignment(GTK_MISC(scrolled_label), 0.00, 0.2);
gtk_table_attach(GTK_TABLE(table), scrolled_label, 1, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
/* 3x1 */
gtk_grid_attach(GTK_GRID(grid), scrolled_label, 1, 1, 3, 1);
gtk_widget_set_sensitive(scrolled_label, FALSE);
scrolled_window = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_IN);
gtk_table_attach(GTK_TABLE(table), scrolled_window, 1, 4, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
/* 3x1 */
gtk_grid_attach(GTK_GRID(grid), scrolled_window, 1, 2, 3, 1);
store = gtk_list_store_new(3,
G_TYPE_BOOLEAN, // Active
......
......@@ -848,8 +848,8 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
gtk_container_set_border_width(GTK_CONTAINER(audio_vbox), 10);
GtkWidget *frame;
GtkWidget *table;
gnome_main_section_new_with_table(_("Sound Manager"), &frame, &table, 1, 4);
GtkWidget *grid;
gnome_main_section_new_with_grid(_("Sound Manager"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(audio_vbox), frame, FALSE, FALSE, 0);
gchar *audio_manager = dbus_get_audio_manager();
......@@ -858,8 +858,7 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
GtkWidget *pulse_button = gtk_radio_button_new_with_mnemonic(NULL , _("_Pulseaudio"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pulse_button), using_pulse);
gtk_table_attach(GTK_TABLE(table), pulse_button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), pulse_button, 0, 0, 1, 1);
// Box for the Pulse configuration
pulse_conf = gnome_main_section_new(_("Pulseaudio settings"));
......@@ -869,8 +868,7 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
GtkWidget *alsa_button = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(pulse_button), _("_ALSA"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(alsa_button), !using_pulse);
g_signal_connect(G_OBJECT(alsa_button), "clicked", G_CALLBACK(select_audio_manager), client->settings);
gtk_table_attach(GTK_TABLE(table), alsa_button, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), alsa_button, 1, 0, 1, 1);
// Box for the ALSA configuration
alsa_conf = gnome_main_section_new(_("ALSA settings"));
......@@ -888,13 +886,12 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
gtk_widget_hide(pulse_conf);
}
gnome_main_section_new_with_table(_("Recordings"), &frame, &table, 2, 3);
gnome_main_section_new_with_grid(_("Recordings"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(audio_vbox), frame, FALSE, FALSE, 0);
// label
GtkWidget *label = gtk_label_new(_("Destination folder"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
0, 5);
gtk_grid_attach(GTK_GRID(grid), label, 0, 0, 1, 1);
// folder chooser button
GtkWidget *folderChooser = gtk_file_chooser_button_new(_("Select a folder"),
......@@ -904,20 +901,18 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
g_signal_connect(G_OBJECT(folderChooser) , "selection-changed", G_CALLBACK(record_path_changed),
NULL);
gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 5);
gtk_grid_attach(GTK_GRID(grid), folderChooser, 1, 0, 1, 1);
// isAlwaysRecording functionality checkbox
gboolean isAlwaysRecording = dbus_get_is_always_recording();
GtkWidget *enableIsAlwaysRecording = gtk_check_button_new_with_mnemonic(_("_Always recording"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableIsAlwaysRecording), isAlwaysRecording);
g_signal_connect(G_OBJECT(enableIsAlwaysRecording), "clicked", active_is_always_recording, NULL);
gtk_table_attach(GTK_TABLE(table), enableIsAlwaysRecording, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 5);
gtk_grid_attach(GTK_GRID(grid), enableIsAlwaysRecording, 0, 1, 1, 1);
gtk_widget_show(GTK_WIDGET(enableIsAlwaysRecording));
// Box for the voice enhancement configuration
gnome_main_section_new_with_table(_("Voice enhancement settings"), &frame, &table, 2, 1);
gnome_main_section_new_with_grid(_("Voice enhancement settings"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(audio_vbox), frame, FALSE, FALSE, 0);
GtkWidget *enableNoiseReduction = gtk_check_button_new_with_mnemonic(_("_Noise Reduction"));
......@@ -932,8 +927,7 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
state = NULL;
g_signal_connect(G_OBJECT(enableNoiseReduction), "clicked", active_noise_suppress, NULL);
gtk_table_attach(GTK_TABLE(table), enableNoiseReduction, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), enableNoiseReduction, 0, 1, 1, 1);
GtkWidget *enableEchoCancel = gtk_check_button_new_with_mnemonic(_("_Echo Cancellation"));
state = dbus_get_echo_cancel_state();
......@@ -946,8 +940,7 @@ GtkWidget* create_audio_configuration(SFLPhoneClient *client)
g_free(state);
g_signal_connect(G_OBJECT(enableEchoCancel), "clicked", active_echo_cancel, NULL);
gtk_table_attach(GTK_TABLE(table), enableEchoCancel, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL,
GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), enableEchoCancel, 0, 2, 1, 1);
gtk_widget_show_all(audio_vbox);
......
......@@ -139,7 +139,7 @@ static void phone_number_enabled_cb(GtkWidget *widget)
GtkWidget*
create_hooks_settings(SFLPhoneClient *client)
{
GtkWidget *ret, *frame, *table, *label, *widg;
GtkWidget *ret, *frame, *label, *widg;
// Load the user value
hooks_load_parameters(&_urlhook_config);
......@@ -147,52 +147,55 @@ create_hooks_settings(SFLPhoneClient *client)
ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
gnome_main_section_new_with_table(_("URL Argument"), &frame, &table, 5, 2);
GtkWidget *grid;
gnome_main_section_new_with_grid(_("URL Argument"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
gtk_widget_show(frame);
gchar *message = "<small>Custom commands on incoming calls with URL. %s will be replaced with the passed URL.</small>";
GtkWidget *info_bar = gnome_info_bar(message, GTK_MESSAGE_INFO);
gtk_table_attach(GTK_TABLE(table), info_bar, 0, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 10, 10);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), info_bar, 0, 0, 2, 1);
widg = gtk_check_button_new_with_mnemonic(_("Trigger on specific _SIP header"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), utf8_case_equal(_urlhook_config->sip_enabled, "true"));
g_signal_connect(G_OBJECT(widg) , "clicked" , G_CALLBACK(sip_enabled_cb), NULL);
gtk_table_attach(GTK_TABLE(table), widg, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), widg, 0, 2, 1, 1);
field = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(field), _urlhook_config->sip_field);
gtk_table_attach(GTK_TABLE(table), field, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), field, 1, 2, 1, 1);
widg = gtk_check_button_new_with_mnemonic(_("Trigger on _IAX2 URL"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), utf8_case_equal(_urlhook_config->iax2_enabled, "true"));
g_signal_connect(G_OBJECT(widg) , "clicked" , G_CALLBACK(iax2_enabled_cb), NULL);
gtk_table_attach(GTK_TABLE(table), widg, 0, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
/* 2x1 */
gtk_grid_attach(GTK_GRID(grid), widg, 0, 3, 2, 1);
label = gtk_label_new_with_mnemonic(_("Command to _run"));
gtk_misc_set_alignment(GTK_MISC(label), 0.05, 0.5);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), label, 0, 4, 1, 1);
command = gtk_entry_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), command);
gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command);
gtk_table_attach(GTK_TABLE(table), command, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10);
gtk_grid_attach(GTK_GRID(grid), command, 1, 4, 1, 1);
gnome_main_section_new_with_table(_("Phone number rewriting"), &frame, &table, 4, 2);
gnome_main_section_new_with_grid(_("Phone number rewriting"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
gtk_widget_show(frame);
widg = gtk_check_button_new_with_mnemonic(_("_Prefix dialed numbers with"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widg), utf8_case_equal(_urlhook_config->phone_number_enabled, "true"));
g_signal_connect(G_OBJECT(widg) , "clicked" , G_CALLBACK(phone_number_enabled_cb), NULL);
gtk_table_attach(GTK_TABLE(table), widg, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_grid_attach(GTK_GRID(grid), widg, 0, 0, 1, 1);
prefix = gtk_entry_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefix);
gtk_entry_set_text(GTK_ENTRY(prefix), _urlhook_config->phone_number_prefix);
gtk_widget_set_sensitive(GTK_WIDGET(prefix), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widg)));
gtk_table_attach(GTK_TABLE(table), prefix, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10);
gtk_grid_attach(GTK_GRID(grid), prefix, 1, 0, 1, 1);
gnome_main_section_new_with_table(_("Messaging"), &frame, &table, 4, 2);
gnome_main_section_new_with_grid(_("Messaging"), &frame, &grid);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
gtk_widget_show(frame);
......@@ -206,8 +209,8 @@ create_hooks_settings(SFLPhoneClient *client)
} else
gtk_entry_set_text(GTK_ENTRY(url), "xdg-open");
gtk_label_set_mnemonic_widget(GTK_LABEL(label), url);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10);
gtk_table_attach(GTK_TABLE(table), url , 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10);
gtk_grid_attach(GTK_GRID(grid), label, 0, 4, 1, 1);
gtk_grid_attach(GTK_GRID(grid), url, 1, 4, 1, 1);
gtk_widget_show_all(ret);
......