Commit 22c7a6a2 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files
parents 51323333 807f103e
......@@ -284,12 +284,14 @@ create_toolbar (){
image = gtk_image_new_from_file( ICONS_DIR "/call.svg");
callButton = gtk_tool_button_new (image, "Place a Call");
gtk_widget_set_tooltip_text(GTK_WIDGET(callButton), "Place a call");
g_signal_connect (G_OBJECT (callButton), "clicked",
G_CALLBACK (call_button), NULL);
gtk_toolbar_insert(GTK_TOOLBAR(ret), GTK_TOOL_ITEM(callButton), -1);
image = gtk_image_new_from_file( ICONS_DIR "/accept.svg");
pickupButton = gtk_tool_button_new(image, "Pick up");
gtk_widget_set_tooltip_text(GTK_WIDGET(pickupButton), "Pick up");
gtk_widget_set_state( GTK_WIDGET(pickupButton), GTK_STATE_INSENSITIVE);
g_signal_connect(G_OBJECT (pickupButton), "clicked",
G_CALLBACK (call_button), NULL);
......@@ -297,6 +299,7 @@ create_toolbar (){
image = gtk_image_new_from_file( ICONS_DIR "/hang_up.svg");
hangupButton = gtk_tool_button_new (image, "Hang up");
gtk_widget_set_tooltip_text(GTK_WIDGET(hangupButton), "Hang up");
gtk_widget_set_state( GTK_WIDGET(hangupButton), GTK_STATE_INSENSITIVE);
g_signal_connect (G_OBJECT (hangupButton), "clicked",
G_CALLBACK (hang_up), NULL);
......@@ -304,6 +307,7 @@ create_toolbar (){
image = gtk_image_new_from_file( ICONS_DIR "/unhold.svg");
unholdButton = gtk_tool_button_new (image, "Off Hold");
gtk_widget_set_tooltip_text(GTK_WIDGET(unholdButton), "Off Hold");
gtk_widget_set_state( GTK_WIDGET(unholdButton), GTK_STATE_INSENSITIVE);
g_signal_connect (G_OBJECT (unholdButton), "clicked",
G_CALLBACK (unhold), NULL);
......@@ -311,6 +315,7 @@ create_toolbar (){
image = gtk_image_new_from_file( ICONS_DIR "/hold.svg");
holdButton = gtk_tool_button_new (image, "On Hold");
gtk_widget_set_tooltip_text(GTK_WIDGET(holdButton), "On Hold");
gtk_widget_set_state( GTK_WIDGET(holdButton), GTK_STATE_INSENSITIVE);
g_signal_connect (G_OBJECT (holdButton), "clicked",
G_CALLBACK (hold), NULL);
......@@ -319,6 +324,7 @@ create_toolbar (){
image = gtk_image_new_from_file( ICONS_DIR "/transfert.svg");
transfertButton = gtk_toggle_tool_button_new ();
gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(transfertButton), image);
gtk_widget_set_tooltip_text(GTK_WIDGET(transfertButton), "Transfer");
gtk_tool_button_set_label(GTK_TOOL_BUTTON(transfertButton), "Transfer");
gtk_widget_set_state( GTK_WIDGET(transfertButton), GTK_STATE_INSENSITIVE);
transfertButtonConnId = g_signal_connect (G_OBJECT (transfertButton), "toggled",
......
......@@ -124,7 +124,7 @@ config_window_fill_codec_list()
COLUMN_CODEC_ACTIVE, c->is_active, // Active
COLUMN_CODEC_NAME, c->name, // Name
COLUMN_CODEC_FREQUENCY, g_strdup_printf("%d kHz", c->sample_rate/1000), // Frequency (kHz)
COLUMN_CODEC_BITRATE, g_strdup_printf("%.1f kbps", c->_bitrate), // Bitrate (?)
COLUMN_CODEC_BITRATE, g_strdup_printf("%.1f kbps", c->_bitrate), // Bitrate (kbps)
COLUMN_CODEC_BANDWIDTH, g_strdup_printf("%.1f kbps", c->_bandwidth), // Bandwidth (kpbs)
-1);
}
......@@ -257,7 +257,8 @@ select_codec(GtkTreeSelection *selection, GtkTreeModel *model)
}
/**
* TOSEE not working
* Toggle active value of codec on click and update changes to the deamon
* and in configuration files
*/
static void
codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer *data)
......@@ -278,11 +279,9 @@ codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer *dat
COLUMN_CODEC_ACTIVE, &active,
-1);
active = !active;
// Toggle active value
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
COLUMN_CODEC_ACTIVE, active,
COLUMN_CODEC_ACTIVE, !active,
-1);
gtk_tree_path_free(treePath);
......@@ -291,7 +290,8 @@ codec_active_toggled(GtkCellRendererToggle *renderer, gchar *path, gpointer *dat
}
/**
* Move codec in list depending on direction and selected codec
* Move codec in list depending on direction and selected codec and
* update changes in the deamon list and the configuration files
*/
static void
moveCodec(gboolean moveUp, gpointer data)
......@@ -378,7 +378,7 @@ bold_if_default_account(GtkTreeViewColumn *col,
GValue val;
val.g_type = G_TYPE_POINTER;
gtk_tree_model_get_value(tree_model, iter, 3, &val);
account_t* current = (account_t*) g_value_get_pointer(&val);
account_t *current = (account_t*) g_value_get_pointer(&val);
g_value_unset(&val);
if(g_strcasecmp(current->accountID, account_list_get_default()) == 0)
g_object_set(G_OBJECT(rend), "weight", 800, NULL);
......@@ -534,13 +534,10 @@ create_accounts_tab()
GtkTreeSelection *treeSelection;
GtkWidget *label;
GValue val;
val.g_type = G_TYPE_POINTER;
selectedAccount = NULL;
ret = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (ret), 10);
gtk_container_set_border_width(GTK_CONTAINER (ret), 10);
label = gtk_label_new("This is the list of accounts previously setup.");
......@@ -643,36 +640,37 @@ create_accounts_tab()
GtkWidget*
create_audio_tab ()
{
GtkWidget * ret;
GtkWidget * deviceLabel;
GtkWidget * deviceBox;
GtkWidget * deviceTable;
GtkWidget * codecLabel;
GtkWidget * codecBox;
GtkWidget * titleLabel;
GtkWidget * comboBox;
GtkWidget * refreshButton;
GtkCellRenderer * renderer;
GtkWidget *ret;
GtkWidget *deviceLabel;
GtkWidget *deviceBox;
GtkWidget *deviceTable;
GtkWidget *codecLabel;
GtkWidget *codecBox;
GtkWidget *titleLabel;
GtkWidget *comboBox;
GtkWidget *refreshButton;
GtkCellRenderer *renderer;
GtkTreeIter iter;
GtkWidget *codecTable;
// Main widget
ret = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
// Device section label
deviceLabel = gtk_label_new("Devices");
deviceLabel = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(deviceLabel), "<b>Devices</b>");
gtk_label_set_line_wrap(GTK_LABEL(deviceLabel), TRUE);
gtk_misc_set_alignment(GTK_MISC(deviceLabel), 0, 0.5);
gtk_label_set_justify(GTK_LABEL(deviceLabel), GTK_JUSTIFY_LEFT);
gtk_box_pack_start(GTK_BOX(ret), deviceLabel, FALSE, FALSE, 0);
gtk_widget_show(deviceLabel);
// Main device widget
deviceBox = gtk_hbox_new(FALSE, 10);
gtk_box_pack_start(GTK_BOX(ret), deviceBox, FALSE, FALSE, 0);
gtk_widget_show(codecBox);
// Main device widget
deviceTable = gtk_table_new(4, 3, FALSE);
......@@ -683,7 +681,7 @@ create_audio_tab ()
// Device : Audio manager
// Create title label
titleLabel = gtk_label_new("Audio manager:");
titleLabel = gtk_label_new("Audio manager");
gtk_misc_set_alignment(GTK_MISC(titleLabel), 0, 0.5);
gtk_table_attach(GTK_TABLE(deviceTable), titleLabel, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0);
gtk_widget_show(titleLabel);
......@@ -743,10 +741,12 @@ create_audio_tab ()
// Create detect button
refreshButton = gtk_button_new_with_label("Detect all");
gtk_button_set_image(GTK_BUTTON(refreshButton), gtk_image_new_from_stock(GTK_STOCK_REFRESH, GTK_ICON_SIZE_BUTTON));
gtk_table_attach(GTK_TABLE(deviceTable), refreshButton, 3, 4, 0, 3, GTK_EXPAND, GTK_EXPAND, 0, 0);
// Codec section label
codecLabel = gtk_label_new("Codecs");
codecLabel = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(codecLabel), "<b>Codecs</b>");
gtk_label_set_line_wrap(GTK_LABEL(codecLabel), TRUE);
gtk_misc_set_alignment(GTK_MISC(codecLabel), 0, 0.5);
gtk_label_set_justify(GTK_LABEL(codecLabel), GTK_JUSTIFY_LEFT);
......@@ -759,8 +759,8 @@ create_audio_tab ()
gtk_widget_show(codecBox);
// Codec : List
GtkWidget * codecTable;
codecTable = create_codec_table();
gtk_widget_set_size_request(GTK_WIDGET(codecTable), -1, 150);
gtk_box_pack_start(GTK_BOX(codecBox), codecTable, TRUE, TRUE, 0);
gtk_widget_show(codecTable);
......
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