Commit 37b02e80 authored by Emmanuel Milou's avatar Emmanuel Milou

Add comments, tooltip and new button to the contextual menu

parent 3cbbbab6
......@@ -1037,53 +1037,55 @@ static void ok_cb (GtkWidget *widget, gpointer userdata) {
new_number = gtk_entry_get_text (GTK_WIDGET (editable_num));
original = (call_t*)userdata;
//from = call_get_name (original);
// Edit the from field with the updated phone number value
from = g_strconcat("\"", call_get_name (original), "\" <", new_number, ">",NULL);
g_print ("name:%s \n", from);
// Create the new call
create_new_call (g_strdup (new_number), from, CALL_STATE_DIALING, g_strdup (original->accountID), &modified_call);
//modified_call->to = call_get_number (modified_call);
// Update the internal data structure and the GUI
calllist_add(current_calls, modified_call);
calltree_add_call(current_calls, modified_call);
calltree_display (current_calls);
// Close the contextual menu
gtk_widget_destroy (GTK_WIDGET (edit_dialog));
static void change_number_cb (GtkWidget *widget, gpointer userdata) {
gchar *new_number;
call_t *current_call;
void show_edit_number (call_t *call) {
GtkWidget *ok, *hbox;
GtkWidget *ok, *hbox, *image;
GdkPixbuf *pixbuf;
edit_dialog = GTK_DIALOG (gtk_dialog_new());
// Set window properties
gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 200, 20);
gtk_window_set_title(GTK_WINDOW(edit_dialog), _("Edit phone number"));
gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 300, 20);
gtk_window_set_title(GTK_WINDOW(edit_dialog), _("Edit phone"));
gtk_window_set_resizable (GTK_WINDOW (edit_dialog), FALSE);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start(GTK_BOX (edit_dialog->vbox), hbox, TRUE, TRUE, 0);
// Set the number to be edited
editable_num = gtk_entry_new ();
gtk_widget_set_tooltip_text(GTK_WIDGET(editable_num), _("Edit the phone number before making a call"));
if (call)
gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup (call_get_number (call)));
g_print ("This a bug, the call should be defined. menus.c line 1051\n");
g_signal_connect(G_OBJECT (editable_num), "changed", G_CALLBACK (change_number_cb), call);
gtk_box_pack_start(GTK_BOX (hbox), editable_num, TRUE, TRUE, 0);
ok = gtk_button_new_from_stock (GTK_STOCK_OK);
// Set a custom image for the button
pixbuf = gdk_pixbuf_new_from_file_at_scale (ICONS_DIR "/outgoing.svg", 32, 32, TRUE, NULL);
image = gtk_image_new_from_pixbuf (pixbuf);
ok = gtk_button_new ();
gtk_button_set_image (GTK_BUTTON (ok), image);
gtk_box_pack_start(GTK_BOX (hbox), ok, TRUE, TRUE, 0);
g_signal_connect(G_OBJECT (ok), "clicked", G_CALLBACK (ok_cb), call);
Markdown is supported
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