Commit 0f9267d3 authored by Emmanuel Milou's avatar Emmanuel Milou

Open the accounts settings in an other window

parent ab48f777
......@@ -850,24 +850,16 @@ create_accounts_tab()
GtkCellRenderer *renderer;
GtkTreeViewColumn *treeViewColumn;
GtkTreeSelection *treeSelection;
GtkWidget *accountsFrame;
selectedAccount = NULL;
ret = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER (ret), 10);
accountsFrame = gtk_frame_new(_("Accounts previously setup."));
gtk_box_pack_start(GTK_BOX(ret), accountsFrame, TRUE, TRUE, 0);
gtk_widget_show_all(accountsFrame);
scrolledWindow = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN);
gtk_box_pack_start(GTK_BOX(accountsFrame), scrolledWindow, TRUE, TRUE, 0);
gtk_container_add( GTK_CONTAINER( accountsFrame ) , scrolledWindow);
gtk_box_pack_start(GTK_BOX(ret), scrolledWindow, TRUE, TRUE, 0);
accountStore = gtk_list_store_new(4,
G_TYPE_STRING, // Name
......@@ -877,7 +869,6 @@ create_accounts_tab()
);
treeView = gtk_tree_view_new_with_model(GTK_TREE_MODEL(accountStore));
//gtk_widget_set_tooltip_text( GTK_WIDGET( treeView ) , _("Double-click to edit the information on this account"));
treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeView));
g_signal_connect(G_OBJECT (treeSelection), "changed",
G_CALLBACK (select_account),
......@@ -1167,9 +1158,9 @@ show_config_window ()
gtk_widget_show(notebook);
// Accounts tab
tab = create_accounts_tab();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Accounts")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
//tab = create_accounts_tab();
//gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Accounts")));
//gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
// Audio tab
tab = create_audio_tab();
......@@ -1184,3 +1175,41 @@ show_config_window ()
gtk_widget_destroy(GTK_WIDGET(dialog));
}
/*
* Show accounts tab in a different window
*/
void
show_accounts_window( void )
{
GtkDialog * dialog;
GtkWidget * accountFrame;
GtkWidget * tab;
dialogOpen = TRUE;
dialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Accounts"),
GTK_WINDOW(get_main_window()),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE,
GTK_RESPONSE_ACCEPT,
NULL));
// Set window properties
gtk_dialog_set_has_separator(dialog, FALSE);
gtk_window_set_default_size(GTK_WINDOW(dialog), 400, 400);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 0);
accountFrame = gtk_frame_new( _("Accounts previously setup"));
gtk_box_pack_start( GTK_BOX( dialog->vbox ), accountFrame , TRUE, TRUE, 0);
gtk_container_set_border_width(GTK_CONTAINER(accountFrame), 10);
gtk_widget_show(accountFrame);
// Accounts tab
tab = create_accounts_tab();
gtk_container_add(GTK_CONTAINER(accountFrame) , tab);
gtk_dialog_run( dialog );
dialogOpen=FALSE;
gtk_widget_destroy(GTK_WIDGET(dialog));
}
......@@ -42,5 +42,6 @@ GtkWidget * create_codec_table();
GtkWidget * create_accounts_tab();
GtkWidget * create_audio_tab();
void show_config_window();
void show_accounts_window();
#endif
......@@ -264,6 +264,12 @@ edit_preferences ( void * foo)
show_config_window();
}
static void
edit_accounts ( void * foo)
{
show_accounts_window();
}
// The menu Edit/Copy should copy the current selected call's number
static void
edit_copy ( void * foo)
......@@ -414,6 +420,13 @@ create_edit_menu()
menu_items = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
menu_items = gtk_menu_item_new_with_mnemonic( _("_Accounts") );
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
G_CALLBACK (edit_accounts),
NULL);
gtk_widget_show (menu_items);
menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_PREFERENCES, get_accel_group());
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items);
g_signal_connect_swapped (G_OBJECT (menu_items), "activate",
......
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