seahorse r2260 - trunk/libcryptui
- From: sadam svn gnome org
- To: svn-commits-list gnome org
- Subject: seahorse r2260 - trunk/libcryptui
- Date: Sun, 6 Jul 2008 01:18:22 +0000 (UTC)
Author: sadam
Date: Sun Jul 6 01:18:21 2008
New Revision: 2260
URL: http://svn.gnome.org/viewvc/seahorse?rev=2260&view=rev
Log:
2008-07-05 Adam Schreiber <sadam clemson edu>
* libcryptui/cryptui.c:
* libcryptui/cryptui.h: Add function for consumers to launch
seahorse when
a key needs to be created.
Modified:
trunk/libcryptui/cryptui.c
trunk/libcryptui/cryptui.h
Modified: trunk/libcryptui/cryptui.c
==============================================================================
--- trunk/libcryptui/cryptui.c (original)
+++ trunk/libcryptui/cryptui.c Sun Jul 6 01:18:21 2008
@@ -21,6 +21,7 @@
#include "config.h"
#include <gtk/gtk.h>
+#include <glib/gi18n-lib.h>
#include <string.h>
#include <stdlib.h>
@@ -200,6 +201,22 @@
return signer;
}
+void
+cryptui_need_to_get_keys ()
+{
+ GtkWidget *dialog;
+ gchar *argv[2] = {"seahorse", NULL};
+
+ dialog = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
+ _("No encryption keys were found with which to perform the operation you requested. The program <b>Passwords and Encryption Keys</b> will now be started so that you may either create a key or import one."));
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
+ gtk_widget_destroy (dialog);
+
+ g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
+ }
+}
+
/* -----------------------------------------------------------------------------
* GCONF HELPERS
*/
Modified: trunk/libcryptui/cryptui.h
==============================================================================
--- trunk/libcryptui/cryptui.h (original)
+++ trunk/libcryptui/cryptui.h Sun Jul 6 01:18:21 2008
@@ -109,6 +109,16 @@
gchar* cryptui_prompt_signer (CryptUIKeyset *keyset, const gchar *title);
+/*
+ * This function creates a dialog when a consumer of the library needs the user to
+ * create or import at least one key for the application to perform the necessary
+ * action. It will inform the user of the need to create or import a key and launch
+ * the seahorse (Passwords and Encryption Keys) application so that they may do so.
+ *
+ * quit: whether to run gtk_main_quit () after launching seahorse
+ */
+void cryptui_need_to_get_keys ();
+
G_END_DECLS
#endif /* __CRYPT_UI_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]