diff options
author | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-10-05 19:57:30 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-10-05 19:57:30 +0800 |
commit | 4ec46cc05fcb94d181fb9c2412984a1446647c85 (patch) | |
tree | d16ce30e77dd539c03509237dd4c723d46aea97a /smime/gui | |
parent | 5ea7e23aef0c239af2600c95419ba0bda0f08b3c (diff) | |
parent | 19163c2b71e6128fc9b32287b99b1f4422324c2d (diff) | |
download | gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.gz gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.bz2 gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.lz gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.xz gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.zst gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.zip |
Merge from master
Diffstat (limited to 'smime/gui')
-rw-r--r-- | smime/gui/Makefile.am | 3 | ||||
-rw-r--r-- | smime/gui/certificate-manager.c | 27 | ||||
-rw-r--r-- | smime/gui/component.c | 16 |
3 files changed, 23 insertions, 23 deletions
diff --git a/smime/gui/Makefile.am b/smime/gui/Makefile.am index 2a28121fc1..c8fe999fc7 100644 --- a/smime/gui/Makefile.am +++ b/smime/gui/Makefile.am @@ -17,8 +17,8 @@ libevolution_smime_la_CPPFLAGS = \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DPREFIX=\""$(prefix)"\" \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ $(CERT_UI_CFLAGS) libevolution_smime_la_SOURCES = \ @@ -41,6 +41,7 @@ libevolution_smime_la_LIBADD = \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/smime/lib/libessmime.la \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ + $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(CERT_UI_LIBS) diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 5e23e1d865..274fc32aae 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -127,7 +127,6 @@ static const gchar* authoritycerts_mime_types[] = { "application/x-x509-ca-cert typedef struct { GtkTreeView *treeview; - GtkTreeStore *treemodel; GtkTreeModel *streemodel; GHashTable *root_hash; GtkMenu *popup_menu; @@ -474,6 +473,7 @@ select_certificate (CertPage *cp, fcd.cp = cp; fcd.cert = cert; + fcd.path = NULL; gtk_tree_model_foreach (model, find_cert_cb, &fcd); @@ -483,7 +483,7 @@ select_certificate (CertPage *cp, selection = gtk_tree_view_get_selection (cp->treeview); gtk_tree_selection_select_path (selection, fcd.path); - gtk_tree_view_scroll_to_cell (cp->treeview, fcd.path, NULL, FALSE, 0.0, 0.0); + gtk_tree_view_scroll_to_cell (cp->treeview, fcd.path, NULL, TRUE, 0.5, 0.5); gtk_tree_path_free (fcd.path); } } @@ -644,10 +644,17 @@ delete_cert (GtkWidget *button, -1); if (cert && e_cert_db_delete_cert (e_cert_db_peek (), cert)) { - GtkTreeIter child_iter; + GtkTreeIter child_iter, parent_iter; + gboolean has_parent; + GtkTreeStore *store = GTK_TREE_STORE (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (cp->streemodel))); gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (cp->streemodel), &child_iter, &iter); - gtk_tree_store_remove (cp->treemodel, &child_iter); + has_parent = gtk_tree_model_iter_parent (GTK_TREE_MODEL (store), &parent_iter, &child_iter); + gtk_tree_store_remove (store, &child_iter); + + /* Remove parent if it became empty */ + if (has_parent && gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), &parent_iter) == 0) + gtk_tree_store_remove (store, &parent_iter); /* we need two unrefs here, one to unref the * gtk_tree_model_get above, and one to unref @@ -861,14 +868,9 @@ cert_page_free (CertPage *cp) if (!cp) return; - /* Free all certificates in treeviews */ - if (cp->treemodel) { - gtk_tree_model_foreach (GTK_TREE_MODEL (cp->treemodel), - (GtkTreeModelForeachFunc) free_cert, cp); - } - - /* Free streemodel */ if (cp->streemodel) { + gtk_tree_model_foreach (GTK_TREE_MODEL (cp->streemodel), + (GtkTreeModelForeachFunc) free_cert, cp); g_object_unref (cp->streemodel); cp->streemodel = NULL; } @@ -978,7 +980,6 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) priv->yourcerts_page = cp; cp->treeview = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "yourcerts-treeview")); cp->streemodel = NULL; - cp->treemodel = NULL; cp->view_button = e_builder_get_widget (priv->builder, "your-view-button"); cp->backup_button = e_builder_get_widget (priv->builder, "your-backup-button"); cp->backup_all_button = e_builder_get_widget (priv->builder, "your-backup-all-button"); @@ -996,7 +997,6 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) priv->contactcerts_page = cp; cp->treeview = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "contactcerts-treeview")); cp->streemodel = NULL; - cp->treemodel = NULL; cp->view_button = e_builder_get_widget (priv->builder, "contact-view-button"); cp->backup_button = NULL; cp->backup_all_button = NULL; @@ -1014,7 +1014,6 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) priv->authoritycerts_page = cp; cp->treeview = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "authoritycerts-treeview")); cp->streemodel = NULL; - cp->treemodel = NULL; cp->view_button = e_builder_get_widget (priv->builder, "authority-view-button"); cp->backup_button = NULL; cp->backup_all_button = NULL; diff --git a/smime/gui/component.c b/smime/gui/component.c index 091ebeefe8..fcbb9faf9f 100644 --- a/smime/gui/component.c +++ b/smime/gui/component.c @@ -50,10 +50,10 @@ smime_pk11_passwd (ECertDB *db, prompt = g_strdup_printf (_("Enter the password for '%s'"), slot_name); g_free (slot_name); - *passwd = e_passwords_ask_password (_("Enter password"), NULL, "", - prompt, - E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, - NULL); + *passwd = e_passwords_ask_password ( + _("Enter password"), NULL, "", prompt, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, + NULL, NULL); g_free (prompt); @@ -75,10 +75,10 @@ smime_pk11_change_passwd (ECertDB *db, /* we're setting the password initially */ prompt = _("Enter new password for certificate database"); - *passwd = e_passwords_ask_password (_("Enter new password"), NULL, "", - prompt, - E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, - NULL); + *passwd = e_passwords_ask_password ( + _("Enter new password"), NULL, "", prompt, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, + NULL, NULL); } else { /* we're changing the password */ |