Page MenuHome GnuPG

No OneTemporary

diff --git a/src/ChangeLog b/src/ChangeLog
index 47ff50b..45c09c5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3874 +1,3891 @@
+2003-07-28 Miguel Coca <mcoca@gnu.org>
+
+ * Makefile.am (gpa_SOURCES): Add gpakeysignop.{c,h}
+
+ * gpakeysignop.h, gpakeysignop.c: New. The key signing operation.
+
+ * gpgmeedit.h, gpgmeedit.c (gpa_gpgme_edit_sign_parms_new)
+ (gpa_gpgme_edit_sign_parms_release): New.
+ (gpa_gpgme_edit_sign): Renamed to:
+ (gpa_gpgme_edit_sign_start): Use the event loop. Now receives a
+ GpaContext so that it can attach itself to the "done" signal and do
+ clean up after the signing completes.
+
+ * keyring.c (keyring_editor_sign): Use the GpaKeySignOperation.
+
+ * keylist.c (gpa_keylist_start_reload): Fix typo.
+
2003-07-25 Miguel Coca <mcoca@gnu.org>
* gpakeydeleteop.c, gpakeydeleteop.h, gpakeyop.c, gpakeyop.h: New.
* Makefile.am (gpa_SOURCES): Add gpakeyop.{c,h} and
gpakeydeleteop.{c,h}.
* keyring.c (gpa_keyring_editor_changed_wot_cb): New.
(register_operation): New.
(keyring_editor_delete): Use the GpaKeyDeleteOperation.
* keylist.h, keylist.c (gpa_keylist_init, gpa_keylist_start_reload)
(gpa_keylist_next): Display a warning while the trustdb rebuilds.
* gpafileverifyop.c (gpa_file_verify_operation_done_error_cb): Remove
obsolete comment.
* gpafilesignop.c (gpa_file_sign_operation_done_error_cb): Likewise.
* gpafiledecryptop.c (gpa_file_decrypt_operation_done_error_cb):
Likewise.
* gpafileencryptop.c (gpa_file_encrypt_operation_done_error_cb):
Likewise.
* keyring.c (keyring_editor_selection_changed): Run update_widgets
after loading the new current key,
2003-06-29 Miguel Coca <mcoca@gnu.org>
* gpaprogressdlg.c (gpa_progress_dialog_set_property)
(gpa_progress_dialog_progress_cb): Receive progress signals from the
context.
(gpa_progress_dialog_pulse, gpa_progress_dialog_start_cb)
(gpa_progress_dialog_done_cb): Remove the iddle function.
* gpacontext.h, gpacontext.c (gpa_context_class_init, gpa_context_init)
(gpa_context_progress, gpa_context_progress_cb): Add "progress" signal.
* keylist.c (gpa_keylist_start_reload): Empty the list before
reloading.
* gpakeyselector.c, keydeletedlg.c, keyeditdlg.c, keyexportdlg.c,
keylist.c, keyring.c, keytable.c, options.c: Fix syntax for accessing
the primary key.
2003-06-27 Miguel Coca <mcoca@gnu.org>
* keyring.c (keyring_signatures_page_fill_key): Save the label in the
signature page for later use.
(keyring_signatures_page_fill_key): Only show the list of user ids if
there is more than one.
2003-06-26 Miguel Coca <mcoca@gnu.org>
* gpakeyselector.c (gpa_key_selector_done): Don't sort automatically.
(gpa_key_selector_init): Allow sorting by different fields.
* keylist.c (gpa_keylist_next): Remove deprecated gpgme call.
(gpa_keylist_set_brief, gpa_keylist_set_detailed): Allow sorting
by columns.
(gpa_keylist_init, gpa_keylist_next): Add auxiliary sorting columns.
2003-06-22 Miguel Coca <mcoca@gnu.org>
* gpakeyselector.c (gpa_key_selector_new): Hack to fix default key
selection.
* options.c (gpa_options_set_default_key): Create a reference for
the key.
2003-06-22 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c (gpa_generate_key): Return the key, not the fingerprint.
* keygenwizard.c (gpa_keygen_wizard_generate_action):
* keyring.c (keyring_editor_generate_key_advanced): Likewise.
* gpgmetools.c: Add missing include.
* keytable.c (gpa_keytable_lookup_key): Fix warning.
* keylist.c: Add missing include.
* keyeditdlg.c (key_edit_change_passphrase): Remove unused variable.
* gpakeyselector.c (gpa_key_selector_next_key): Fix default key check.
* settingsdlg.c (key_selected_cb): Fix crash.
2003-06-22 Miguel Coca <mcoca@gnu.org>
* All files: Replace old style error checking with libgpg-error.
* gpakeyselector.h, gpakeyselector.c: Use the keytable instead of
listing keys ourselves.
2003-06-21 Miguel Coca <mcoca@gnu.org>
* siglist.h, siglist.c (gpa_siglist_set_all)
(gpa_siglist_set_userid, gpa_siglist_set_signatures): Use
gpgme_key_t instead of fingerprints.
* options.h, options.c (gpa_options_init, gpa_options_finalize)
(gpa_options_set_default_key, gpa_options_get_default_key)
(determine_default_key, gpa_options_update_default_key)
(gpa_options_save_settings): The default key is now a
gpgme_key_t.
* keytable.h, keytable.h: Redo using a GpaContext to work
inside the Gtk main loop.
* keyring.c (struct _GPAKeyringEditor): Rename clist_keys to
keylist (since it's no longer a GtkCList). Add current_key field.
(keyring_editor_fill_keylist): Remove obsolete.
(key_has_been_signed): Use new keylist interface. Work with
keys instead of fingerprints.
(keyring_editor_can_sign):
(keyring_editor_has_private_selected):
(keyring_editor_delete):
(keyring_editor_sign, keyring_editor_edit, keyring_editor_trust)
(keyring_editor_import_do_import)
(keyring_editor_export_do_export, keyring_editor_export)
(keyring_editor_generate_key_advanced)
(keyring_editor_generate_key_advanced)
(idle_update_details)
(keyring_set_brief_listing, keyring_set_detailed_listing)
(keyring_update_status_bar)
(display_popup_menu, keyring_editor_new):
(keyring_editor_generate_key_simple): Likewise.
(keyring_editor_current_key): Rename from _current_key_id.
(keyring_editor_selection_changed): Set the current key with
all it's sigs here.
(keyring_editor_select_all): Use a TreeView instead of a CList.
(signatures_uid_selected): Use new siglist interface.
(keyring_editor_mapped): Change secret key tests.
(keyring_details_page_fill_key): Likewise.
(is_selected_row): Removed.
* keylist.h, keylist.c: Rewrite as a GtkTreeView. Change the
interface to a more sensible one.
* keyexportdlg.h, keyexportdlg.c (key_backup_dialog_run): Receive
the key to backup, not it's fingerprint
* keyeditdlg.h, keyeditdlg.c (gpa_key_edit_dialog_run): Receive
a key, not it's fingerprint.
(gpa_key_edit_dialog_run): Use new keytable
* keydeletedlg.h, keydeletedlg.c (gpa_delete_dialog_run): Figure
out whether the key is secret here, remove has_secret argument.
* icons.h, icons.c (gpa_create_icon_pixbuf): New.
* helpmenu.c (help_license): Replace deprecated GtkText with
GtkTextView.
* gpgmetools.c (gpa_generate_key): Don't save the key into the
keytable. With the new keytable, it should just be reloaded.
* gpgmeedit.h, gpgmeedit.c (gpa_gpgme_edit_sign): Receive the
signer as a gpgmekey, too. Use new keytable.
* gpa.h: Remove keytable variable.
(gpa_default_key, gpa_set_default_key)
(gpa_update_default_key): Remove obsolete.
* gpa.c: Remove keytable global varible.
(main): Don't initialize it.
2003-06-07 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c (gpa_backup_key): Make backups 600. Patch by
Bastian Blank <waldi@debian.org>.
2003-05-30 Miguel Coca <mcoca@gnu.org>
* gpgmeedit.c (passwd_passphrase_cb): Use new passphrase interface.
(edit_fnc): New prototype.
* settingsdlg.c (key_selected_cb): Fix pointer type.
* qdchkpwd.c: Add include to remove warning.
* passwddlg.c (gpa_change_passphrase_dialog_run): New prototype.
* gpgmetools.h, gpgmetools.c (gpa_passphrase_cb)
(passphrase_question_label): Use new passphrase interface.
* keyring.c (keyring_editor_import_do_import): Use new gpgme type
names.
(keyring_editor_export_do_export): Use the new way to export keys
from gpgme.
* keyimportdlg.h, keyimportdlg.c (key_import_results_dialog_run): Use
new type name.
* gpafileencryptop.h: Change the way recipients are specified.
* gpafileencryptop.c (gpa_file_encrypt_operation_done_cb)
(set_recipients, gpa_file_encrypt_operation_start): Likewise.
2003-05-22 Miguel Coca <mcoca@gnu.org>
* encryptdlg.c, encryptdlg.h, expirydlg.c, expirydlg.h, fileman.c,
fileman.h, filesigndlg.c, filesigndlg.h, gpa.c, gpa.h,
gpa_license.c, gpa_license.h, gpacontext.c, gpacontext.h,
gpafiledecryptop.c, gpafiledecryptop.h, gpafileencryptop.c,
gpafileencryptop.h, gpafileop.c, gpafileop.h, gpafilesignop.c,
gpafilesignop.h, gpafileverifyop.c, gpafileverifyop.h,
gpakeyselector.c, gpakeyselector.h, gpaoperation.c,
gpaoperation.h, gpapastrings.c, gpapastrings.h, gpaprogressdlg.c,
gpaprogressdlg.h, gpawidgets.c, gpawidgets.h, gpawindowkeeper.c,
gpawindowkeeper.h, gpawizard.c, gpawizard.h, gpgmeedit.c,
gpgmeedit.h, gpgmetools.c, gpgmetools.h, gtktools.c, gtktools.h,
helpmenu.c, helpmenu.h, hidewnd.c, hidewnd.h, i18n.h, icons.c,
icons.h, keydeletedlg.c, keydeletedlg.h, keyeditdlg.c,
keyeditdlg.h, keyexportdlg.c, keyexportdlg.h, keygendlg.c,
keygendlg.h, keygenwizard.c, keygenwizard.h, keyimportdlg.c,
keyimportdlg.h, keyimpseldlg.c, keyimpseldlg.h, keylist.c,
keylist.h, keyring.c, keyring.h, keyserver.c, keyserver.h,
keysigndlg.c, keysigndlg.h, keytable.c, keytable.h, options.c,
options.h, ownertrustdlg.c, ownertrustdlg.h, passwddlg.c,
passwddlg.h, qdchkpwd.c, qdchkpwd.h, server_access.c,
server_access.h, settingsdlg.c, settingsdlg.h, siglist.c,
siglist.h, simple-gettext.c, verifydlg.c, verifydlg.h, w32reg.c,
w32reg.h: Do a global search and replace for new Gpgme type names.
2003-05-20 Miguel Coca <mcoca@gnu.org>
* gpawidgets.c (gpa_key_info_new): Fix memory leak.
2003-05-17 Miguel Coca <mcoca@gnu.org>
* gpakeyselector.c (gpa_key_selector_get_selected_keys): Don't
reference returned keys.
* settingsdlg.c (key_selected_cb): Don't unreference keys.
* gpafileencryptop.c (gpa_file_encrypt_operation_response_cb):
* gpafilesignop.c (gpa_file_sign_operation_response_cb): Likewise.
2003-05-16 Miguel Coca <mcoca@gnu.org>
* Makefile.am (gpa_SOURCES): Remove keyimpseldlg.{c,h}, as they
were not being used.
* gpawidgets.c (gpa_key_list_add_key, gpa_secret_key_list_new)
(gpa_public_key_list_new, gpa_key_list_new_from_glist)
(gpa_key_list_selection_length, gpa_key_list_selected_ids)
(gpa_key_list_selected_id): Remove the gpa_key_list.
* gpawidgets.h, gpawidgets.c (gpa_key_list_new):
* settingsdlg.c (default_key_frame): Use a GpaKeySelector.
2003-05-15 Miguel Coca <mcoca@gnu.org>
* Makefile.am (gpa_SOURCES): Add gpakeyselector.{c,h}
* gpakeyselector.h, gpakeyselector.c: New. A replacement for the
gpa_key_list that lists the keys itself.
* gpafilesignop.c (gpa_file_sign_operation_response_cb)
(set_signers):
* gpafileencryptop.c (set_recipients, set_signers)
(gpa_file_encrypt_operation_response_cb): Adapt to receive GLists of
keys instead of fingerprints from the encrypt dialog.
* filesigndlg.c (gpa_file_sign_dialog_constructor)
(gpa_file_sign_dialog_signers): Use a key selector.
* encryptdlg.c (select_row_cb, unselect_row_cb): Delete.
(changed_select_row_cb): New.
(gpa_file_encrypt_dialog_init)
(gpa_file_encrypt_dialog_recipients)
(gpa_file_encrypt_dialog_signers): Use key selectors.
2003-05-04 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c, server_access.c: Remove gpgmeparsers.h include.
2003-05-04 Miguel Coca <mcoca@gnu.org>
* gpgmeparsers.c, gpgmeparsers.h: Delete.
* Makefile.am (gpa_SOURCES): Remove gpgmeparsers.{c,h}
* keyimportdlg.c (key_import_results_dialog_run):
* keyring.c (keyring_editor_import_do_import): Use a GpgmeImportResult.
* gpafileverifyop.c (gpa_file_verify_operation_done_error_cb):
* gpafilesignop.c (gpa_file_sign_operation_done_error_cb):
* gpafileencryptop.c (gpa_file_encrypt_operation_done_error_cb):
* gpafiledecryptop.c (gpa_file_decrypt_operation_done_error_cb): Remove
error codes that no longer exist.
* siglist.c (gpa_siglist_set_all, gpa_siglist_set_userid):
* options.c (gpa_options_update_default_key):
* keyring.c (key_has_been_signed):
* gpafilesignop.c (set_signers):
* keyeditdlg.c (key_edit_change_passphrase):
* gpafileencryptop.c (set_recipients, set_signers): New gpgme_get_key
prototype.
2003-04-27 Miguel Coca <mcoca@gnu.org>
* gpafiledecryptop.c (gpa_file_decrypt_operation_done_error_cb):
* gpafileencryptop.c (gpa_file_encrypt_operation_done_error_cb):
* gpafilesignop.c (gpa_file_sign_operation_done_error_cb):
* gpafileverifyop.c (gpa_file_verify_operation_done_error_cb): Use
new names for error codes.
* gpgmetools.c (gpa_generate_key): Use new gpgme_op_genkey.
2003-04-05 Miguel Coca <mcoca@gnu.org>
* gpa.c (main): Open extra arguments as files in the filemanager.
* fileman.h, fileman.c (gpa_file_manager_open_file): New.
2003-04-05 Miguel Coca <mcoca@gnu.org>
* fileman.c (fileman_menu_new): Add a "clear" entry.
(fileman_toolbar_new): Likewise.
(toolbar_close_all, close_all_files): New.
2003-04-05 Miguel Coca <mcoca@gnu.org>
* gpa.c (quit_if_no_window, gpa_open_filemanager): Use new filemanager.
(gpa_get_filenamager): Remove.
* gpafileop.c (gpa_file_operation_finalize): Free the filenames too.
* verifydlg.c (signature_list): Show alternate colors for the list.
* siglist.c (gpa_siglist_new): Likewise.
* fileman.h, fileman.c: Reworked file manager. Use pure GTK+2 lists,
disable buttons when no file is selected, and don't display scrollbars
unless they are needed.
2003-03-23 Andy Ruddock <andy.ruddock@minnesund.net>
* options.h: Added 'detailed_view' configuration file option for
keylist window key view.
* options.c: Added functions to read/write 'detailed_view'
configuration file option.
* keyring.c: keylist window view reads configuration file and
defaults to brief/detailed view last used.
2003-03-22 Miguel Coca <mcoca@gnu.org>
* Makefile.am (gpa_SOURCES): Really remove gtkhacks.h.
2003-03-22 Miguel Coca <mcoca@gnu.org>
* options.h, options.c (gpa_options_get_instance): New. Turn the
GpaOptions object into a singleton.
* Change all users of GpaOptions.
* gpafileverifyop.c (gpa_file_verify_operation_done_error_cb):
* gpafilesignop.c (gpa_file_sign_operation_done_error_cb):
* gpafileencryptop.c (gpa_file_encrypt_operation_done_error_cb):
* gpafiledecryptop.c (gpa_file_decrypt_operation_done_error_cb): Make
all error cheking here.
* gpafileop.c (gpa_file_operation_done_error_cb): Remove error
handling.
* gpaoperation.c (gpa_operation_done_error_cb): Same here.
* gpgmetools.h, gpgmetools.c (gpa_gpgme_warning): New.
* fileman.c (gpa_fileman_toolbar_new): Remove GTK+ 1.2 compatibility.
* gpa.h: Remove gtkhacks.h. Remove gpa_options global variable.
* gtkhacks.h: Deleted.
2003-03-18 Miguel Coca <mcoca@gnu.org>
* verifydlg.h, verifydlg.c: Rewrite as widget.
* gpafileverifyop.c, gpafileverifyop.h: New.
* Makefile.am (gpa_SOURCES): Add new files.
* gpafileencryptop.c (gpa_file_encrypt_operation_done_cb): Advance the
current file here.
* gpafiledecryptop.c (gpa_file_decrypt_operation_done_cb): Likewise.
* gpafilesignop.c (gpa_file_sign_operation_done_cb): Likewise.
* gpafileop.c (gpa_file_operation_done_cb): Remove.
2003-03-09 Miguel Coca <mcoca@gnu.org>
* keyring.c (keyring_editor_delete): Remove the key from the keytable
before deleting the key from the list.
2003-03-07 Miguel Coca <mcoca@gnu.org>
* gpaoperation.c (gpa_operation_class_init)
(gpa_operation_constructor): Use a constructor.
* gpafileop.c, gpafileencryptop.c, gpafiledecryptop.c: Likewise.
* filesigndlg.c, filesigndlg.h: New API. Rewrite as a widget.
* fileman.c (sign_files): Use the GpaFileSignOperation.
* gpafilesignop.c, gpafilesignop.h: New.
* Makefile.am (gpa_SOURCES): Add new files.
2003-02-12 Miguel Coca <mcoca@gnu.org>
* fileman.c (encrypt_files): Use the GpaFileEncryptOperation.
* gpafiledecryptop.c (destination_filename): Mark static.
(gpa_file_decrypt_operation_start): Save the GpgmeData's for later.
(gpa_file_decrypt_operation_done_cb): Do proper cleanup.
* gpafiledecryptop.h: Add the GpgmeData's to the structure.
* gpaoperation.h, gpafileop.h: Include gpa.h
* encryptdlg.h, encryptdlg.c: New API. Remove encryption itself from
this file, as it is handled by the operation.
* Makefile.am (gpa_SOURCES): Add new files.
* gpafileencryptop.h, gpafileencryptop.c: New.
2003-02-10 Miguel Coca <mcoca@gnu.org>
* options.c (read_next_word): Fix unsafe use of char with getc.
2003-02-07 Miguel Coca <mcoca@gnu.org>
* fileman.c (get_selected_files): List files in the order they appear
on the screen.
(add_file): Add const to prototype.
(file_created_cb, register_operation): New. For use with operation
objects.
(decrypt_files): Use GpaFileDecryptOperation.
* passwddlg.c (gpa_change_passphrase_dialog_run): Use new prototype.
* gpgmetools.c (gpa_gpgme_new): Don't pass the context as data to
the passphrase callback.
(check_overwriting): New.
(gpa_fopen): Use it.
(gpa_open_output, gpa_open_input): New.
(gpa_passphrase_cb): Use new prototype.
* gpgmeedit.c (passwd_passphrase_cb): Use new prototype.
* gpacontext.c (gpa_context_busy): New function.
(gpa_context_destroy): Add some checking.
(struct gpa_io_cb_data): Add "registered" field.
(queue_callback): Rename to...
(add_callback): New.
(register_queued_callbacks): Rename to...
(register_all_callbacks): New. Don't remove from the list, as it now
holds all callbacks.
(unregister_all_callbacks): New.
(gpa_context_register_cb): Always add callbacks to the list.
(gpa_context_remove_cb): Always remove callbacks from the list.
(gpa_context_passphrase_cb): New. Our own passphrase callback.
(gpa_context_start, gpa_context_done): Remove debugging
* Makefile.am (gpa_SOURCES): Add new files.
* gpaprogressdlg.h, gpaprogressdlg.c: New. The progress dialog.
* gpaoperation.h, gpaoperation.c, gpafileop.h, gpafileop.c,
gpafiledecryptop.h, gpafiledecryptop.c: New. All operations will
now be objects.
2003-02-02 Miguel Coca <mcoca@gnu.org>
* gpacontext.c (register_callback, gpa_context_remove_cb): Fix clean
up issues.
2003-02-01 Miguel Coca <mcoca@gnu.org>
* Makefile.am (gpa_SOURCES): Add gpacontext.{c,h}
* gpacontext.h, gpacontext.c: New. A wrapper around the GpgmeCtx to
hook it to the gtk event loop.
* gpa.c (main): Remove unneeded variable.
* fileman.c (decrypt_files): Use one GpgmeCtx per operation.
* filesigndlg.c (sign_files):
* encryptdlg.c (encrypt_file, set_signers, do_encrypt):
* keyring.c (keyring_editor_delete, key_has_been_signed)
(keyring_editor_import_do_import)
(keyring_editor_export_do_export, keyring_editor_sign):
* keyeditdlg.c (key_edit_change_passphrase)
(key_edit_change_expiry):
* options.c (determine_default_key):
* gpgmetools.c (gpa_generate_key):
* keytable.c (do_keylisting, keytable_fill, load_keys):
* siglist.c (gpa_siglist_set_all, gpa_siglist_set_userid):
* keylist.c (keylist_fill_list): Likewise.
* gpgmeedit.h, gpgmeedit.c (gpa_gpgme_edit_trust)
(gpa_gpgme_edit_expire, gpa_gpgme_edit_sign)
(gpa_gpgme_edit_passwd): Add ctx argument.
* gpgmetools.c (gpa_passphrase_cb): Use the context as user data.
* passwddlg.c (gpa_change_passphrase_dialog_run): Likewise.
* gpa.h: Remove ctx global variable.
* gpa.c (main): Remove GpgmeCtx initialitation.
* gpgmetools.h, gpgmetools.c (gpa_gpgme_new): New.
2003-01-30 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c (gpa_gpgme_key_get_fingerprint): Remove unnecessary
variable.
(get_gpg_path): New function.
(gpa_backup_key): Use it.
* verifydlg.c (verify_file): Remove gpgme 0.4.0 compatibility.
* gpgmeparsers.h, gpgmeparsers.c (gpa_parse_engine_info)
(parse_engine_info_text, parse_engine_info_end)
(parse_engine_info_start): Removed. No longer needed due to changes
in GPGME.
* helpmenu.c (help_about): Fix formatting and copyright message.
2003-01-24 Miguel Coca <mcoca@gnu.org>
* gpa.c (main): Replace getenv with more portable putenv.
2003-01-23 Miguel Coca <mcoca@gnu.org>
* verifydlg.c (verify_file): Another ugly hack, this time to allow
compilation with both gpgme 0.4.0 and 0.4.1.
* server_access.c (strsep): Ugly hack to get this to compile on
systems without strsep. To be fixed after the next release.
2003-01-21 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c (gpa_gpgme_key_get_fingerprint): Check the fingerprint
length, instead of the algorithm, when deciding how to format the
fingerprint.
* gpgmetools.h (gpa_gpgme_key_get_fingerprint): Fix function
description.
2003-01-19 Miguel Coca <mcoca@gnu.org>
* gpa.h: Remove IS_DEVELOPMENT_VERSION define from this file.
* keygenwizard.c (gpa_keygen_wizard_run): Use the new wizard
interface.
* gpawizard.c, gpawizard.h (gpa_wizard_update_buttons)
(gpa_wizard_new, gpa_wizard_append_page): Changes to use GTK+2 stock
buttons.
2003-01-17 Miguel Coca <mcoca@gnu.org>
* keygendlg.c (gpa_key_gen_run_dialog): More UI Fixes.
(response_cb): Add check for empty or easy passphrase.
2003-01-15 Miguel Coca <mcoca@gnu.org>
* gpawidgets.c (gpa_expiry_frame_get_expiration): Fix bug in previous
change.
* gpawidgets.c (gpa_expiry_frame_dont, gpa_expiry_frame_after)
(gpa_expiry_frame_at, expire_date_toggled_cb)
(gpa_expiry_frame_new, gpa_expiry_frame_get_expiration)
(gpa_expiry_frame_validate): Use a calendar for choosing the
expiration date.
* keygendlg.c (gpa_key_gen_run_dialog): Port to use GTK+2 widgets.
(key_gen_cancel, key_gen_ok): Removed.
(response_cb): New.
* gpawidgets.c (gpa_expiry_frame_new):
* keygenwizard.c (gpa_keygen_wizard_generate_action): Don't set the
removed fields.
* gpgmetools.c (key_gen_params_new): Likewise.
* gpgmetools.h (GPAKeyGenParameters): Remove unused revocation and
send_to_server fields.
* options.c (gpa_options_update_default_key): Fix check for default
key, so that it is triggered if the key is deleted.
2003-01-08 Miguel Coca <mcoca@gnu.org>
* expirydlg.c (gpa_expiry_dialog_run): Fix label typo.
(gpa_expiry_dialog_run): Use a GtkCalendar for choosing the
expiration date.
(expire_date_toggled_cb): New.
(expiry_ok): Change to use the calendar.
* gpafilesel.c, gpafilesel.h: Remove.
* Makefile.am (gpa_SOURCES): Remove gpafilesel.{c,h}
* gtktools.c (file_dialog_ok, gpa_get_save_file_name): Use
GtkFileSelection.
* verifydlg.c (verify_file): Use the GPGME 0.4.0 interface.
2002-12-31 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c (gpa_gpgme_key_get_userid): Tag revoked UID's as such.
* gpawidgets.c (gpa_key_info_new): Don't display revoked UID's.
* keysigndlg.c (gpa_key_sign_run_dialog): Likewise.
* keyring.c (keyring_editor_popup_menu_new): New. Creates the popup
menu.
(is_selected_row, display_popup_menu): Display it.
(keyring_editor_new): Use the above.
2002-12-30 Miguel Coca <mcoca@gnu.org>
* gpgmetools.c (gpa_passphrase_cb): Fix cleanup.
* gpgmeedit.c (edit_fnc): Ignore NEED_PASSPHRASE_SYM too.
(edit_passwd_fnc_action, edit_passwd_fnc_transit)
(passwd_passphrase_cb, gpa_gpgme_edit_passwd): New. Change the key's
passphrase.
* gpgmeedit.h (gpa_gpgme_edit_passwd): New.
* keyeditdlg.c (gpa_key_edit_dialog_run): Add "change passphrase"
button.
(key_edit_change_passphrase): New.
* qdchkpwd.c, qdchkpwd.h (qdchkpwd): Change prototype to remove
warnings.
* passwddlg.c, passwddlg.h: New. The "new passphrase" dialog.
* Makefile.am (gpa_SOURCES): Add passwddlh.{c,h}.
2002-12-29 Miguel Coca <mcoca@gnu.org>
* verifydlg.c (verify_file): Update for GPGME 0.4.1.
* keyring.c (keyring_editor_delete): Update the default key, in case
it's been deleted.
* server_access.c: Include signal.h.
2002-12-26 Miguel Coca <mcoca@gnu.org>
* keyring.c (key_has_been_signed): Account for a missing signing key.
* options.c (gpa_options_update_default_key): Check whether the
default key is really available.
2002-12-24 Miguel Coca <mcoca@gnu.org>
* keyring.c (keyring_editor_mapped): Fix backup at startup.
2002-12-18 Miguel Coca <mcoca@gnu.org>
* keyserver.c (keyserver_read_list): Clean default server list.
2002-12-17 Miguel Coca <mcoca@gnu.org>
* gpa.c (i18n_init): Output is always UTF-8.
2002-12-16 Miguel Coca <mcoca@gnu.org>
* keyring.c (keyring_editor_new): Remove specific font name.
* gpa.h: Include config.h here. Solves i18n problems.
2002-12-15 Miguel Coca <mcoca@gnu.org>
* gpawidgets.c (gpa_key_list_new): Use "User Name", as the rest of GPA
does.
* ownertrustdlg.c (gpa_ownertrust_run_dialog): Fix typo in "ultimate"
description.
* fileman.c (gpa_fileman_toolbar_new): Remove extra spaces around
"decrypt".
* expirydlg.c (gpa_expiry_dialog_run): Fix dialog title.
* helpmenu.c (help_about): Fix formatting of copyright notice.
* keyring.c (keyring_editor_paste): Fix segfault when the clipboard
was empty.
2002-12-13 Miguel Coca <mcoca@gnu.org>
* gpgmetools.h, gpgmetools.c (gpa_gpgme_key_sig_get_sig_status): Use
a hash of revoked signatures to check for them.
* siglist.c (gpa_siglist_set_userid, gpa_siglist_set_all)
(gpa_siglist_clear_columns, gpa_siglist_all_add_columns)
(gpa_siglist_uid_add_columns, gpa_siglist_new): Use different number
of columns and type for "all signatures" and individual uids.
(revoked_signatures, gpa_siglist_set_userid): Keep a list of revoked
signatures and use it.
* expirydlg.c (expiry_ok): Remove unused variable.
* keyring.c (keyring_editor_menubar_new): Add some checks to avoid
crashes on bad translations, as the menu items are not found, and
NULL's are appended to the selection sensitive lists.
2002-12-12 Miguel Coca <mcoca@gnu.org>
* fileman.c (gpa_fileman_toolbar_new, toolbar_preferences):
Disable the preferences button in the toolbar. It's long label
makes the toolbar far too long.
* keyring.c (keyring_toolbar_new, toolbar_preferences): Likewise.
* expirydlg.c (expiry_ok): Replace the gpa_message_box_run.
* keylist.c (keylist_fill_list): Likewise.
* keygenwizard.c (gpa_keygen_wizard_password_validate): Likewise.
* gtktools.h, gtktools.c (message_box_destroy, message_box_clicked)
(gpa_message_box_run, gpa_window_passphrase): Removed obsolete.
* Makefile.am (gpa_SOURCES): Remove icons.xpm
(INCLUDES): Add pixmap directory.
* icons.c: Include new icon files.
* icons.xpm: Removed, replaced by files in ../pixmaps.
* encrypt.xpm: Removed.
* verify.xpm, floppy.xpm, folder.xpm, icons.xpm, open_folder.xpm: Moved
to pixmap directory.
* fileman.c (gpa_fileman_toolbar_new): Add Preferences.
(toolbar_preferences): New.
* keyring.c (keyring_toolbar_new): Change tooltip for edit to make it
clear it's only for private keys.
Use stock icon for "Delete".
Add "Preferences".
(toolbar_preferences): New.
* options.c (gpa_options_read_settings): Don't report error if the
config file doesn't exist.
2002-12-11 Miguel Coca <mcoca@gnu.org>
* fileman.c (fileman_menu_new): Add the edit menu and stock icons.
Rename "Check" as "Verify" to match the toolbar button.
(fileman_select_all): New.
* helpmenu.c (gpa_help_menu_add_to_factory): Change order of buttons
to a more standard one.
* keyring.c (keyring_editor_import_get_source)
(keyring_editor_import_do_import, keyring_editor_import): Split import
into these functions.
(keyring_editor_export_do_export): New.
(keyring_editor_export): Use the above.
(keyring_editor_menubar_new): Add an edit menu. Move preferences
there. Use stock icons where possible.
(keyring_editor_select_all, keyring_editor_paste)
(keyring_editor_copy): New. The edit menu actions.
* keyexportdlg.c, keyexportdlg.h (key_backup_dialog_run, do_backup):
Add const to prototype. Fixes warning.
* keyexportdlg.c (key_export_dialog_run): Remove clipboard option.
Available from edit menu.
* keyimportdlg.c (key_import_dialog_run): Remove clipboard option,
as it is now available from the edit menu.
* gpgmetools.h, gpgmetools.c (fill_data_from_clipboard): Removed.
* keyring.c (keyring_editor_backup): Backup the selected key, not
the default one.
(keyring_editor_menubar_new): Enable "backup" only if a private key
has been selected.
2002-12-10 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_has_private_selected): New.
(key_has_been_signed): Reimplement.
(keyring_editor_can_sign): Use new key_has_been_signed.
(keyring_editor_sign): No need to check whether the key has been
signed, as the edit function handles that case gracefully (and it
should never happen anyway).
(keyring_editor_current_key): Removed #ifdef'ed out function.
(keyring_editor_menubar_new): Bring some order to the keys menu.
Only enable menu items when appropiate.
(keyring_toolbar_new): Only show the "edit" button if a private key
is selected.
2002-12-09 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_details_page_fill_key)
(keyring_details_notebook): Add key length and type to the details
notebook. They replace the public/private label, which is moved to the
top of the notebook.
2002-12-07 Miguel Coca <e970095@zipi.fi.upm.es>
* siglist.c (gpa_siglist_set_userid): Fix idiot bug.
* settingsdlg.c (gpa_settings_dialog_new): Close on enter.
* siglist.c (gpa_siglist_new): Sort the list by user ID. We should
find a way to make Unknown come last always.
* keyring.c (keyring_details_notebook): Add label to the menu.
(keyring_details_page_fill_num_keys): Change the text for "all
signatures."
* gpa.c (gpa_open_settings_dialog): Use the close_main_window callback
to track the destruction of the dialog.
* settingsdlg.c (gpa_settings_dialog_new): Destroy, not hide, the
dialog on close.
* keyring.c (keyring_editor_menubar_new): Move the settings menu item
to the file menu.
* fileman.c (fileman_menu_new): Likewise.
* keyring.c (signatures_uid_selected): New.
(keyring_details_notebook): Add the User ID popdown menu.
(keyring_signatures_page_fill_key): Rewrite to use the new siglist.
(keyring_signatures_page_empty): Clear the UID menu too.
(idle_update_details): Use new prototype of signatures_page_fill_key.
(keyring_editor_new): Increase default window size, leave more space
for the details notebook.
* siglist.h, siglist.c (gpa_siglist_new)
(gpa_siglist_set_signatures): Completely new signature list, for key
signatures only.
* gpgmetools.c (string_to_utf8): New.
(gpa_gpgme_key_get_userid): Use string_to_utf8.
* gpgmetools.h, gpgmetools.c (gpa_gpgme_key_sig_get_userid)
(gpa_gpgme_key_sig_get_short_keyid)
(gpa_gpgme_key_sig_get_sig_status): New.
2002-12-04 Miguel Coca <e970095@zipi.fi.upm.es>
* gpawidgets.c (gpa_key_list_new): Set the columns to autoresize.
* gpa.c, gpa.h (gpa_open_settings_dialog)
(gpa_get_settings_dialog): New.
* fileman.c (fileman_menu_new): Remove "Options" menu. Add "settings"
to the "Window" menu.
* keyring.c (keyring_editor_menubar_new): Likewise.
* settingsdlg.c, settingsdlg.h: New.
* optionsmenu.c, optionsmenuc.h: Removed.
* Makefile.am (gpa_SOURCES): Remove optionsmenu.{c,h}, add
settingsdlg.{c,h}.
2002-12-03 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmeedit.h, gpgmeedit.c (gpa_gpgme_edit_sign): Add const to
fingerprint declaration.
* keyring.c (keyring_editor_sign): Check for new return codes from
gpa_gpgme_edit_sign.
* gpgmeedit.c (edit_sign_fnc_transit): Set the error to GPGME_Conflict
if the key was already signed.
(gpa_gpgme_edit_sign): Check that there is really a default key.
2002-12-02 Miguel Coca <e970095@zipi.fi.upm.es>
* server_access.c (do_spawn): Fix shutdown of GIOChannel. Should fix
segfault on some systems.
2002-11-29 Miguel Coca <e970095@zipi.fi.upm.es>
* gpawidgets.c (struct add_key_data_s, gpa_key_list_add_key)
(gpa_public_key_list_new): Remove the default key row from here, as
reordering the clist was messing it up.
(gpa_secret_key_list_new): Add a loop to find and select the default
key.
* gpa.c: Rework the main function, and parsing of command line
arguments to use getopt.
* gpa.h, gpa.c (gpa_simplified_ui, gpa_set_simplified_ui)
(gpa_backup_generated, gpa_set_backup_generated)
(gpa_remember_backup_generated): Remove, superseded by the options
object.
* filesigndlg.c (file_sign_ok, gpa_file_sign_dialog_run)
(gpa_file_sign_dialog_run): Use the options object.
* gpawidgets.c (gpa_key_list_add_key):
* keyexportdlg.c (do_backup):
* keyimportdlg.c (key_import_dialog_run):
* keyring.c (keyring_editor_backup)
(keyring_editor_generate_key_advanced)
(keyring_editor_generate_key_simple, keyring_editor_generate_key)
(keyring_editor_mapped, keyring_editor_mapped)
(keyring_signatures_page_fill_key, keyring_update_status_bar)
(keyring_default_key_changed, keyring_editor_new):
* keysigndlg.c (gpa_key_sign_run_dialog):
* optionsmenu.c (options_keyserver_set, options_keyserver)
(options_key_set, options_key): Likewise.
* keyserver.c, keyserver.h: Remove management of the current
keyserver.
* fileman.c: Remove jnlib includes.
* gpa.h:
* helpmenu.c: Likewise.
* Makefile.am (INCLUDES, LDADD): Remove jnlib.
(gpa_SOURCES): Add options.c.
* options.c: New.
* options.h: Might as well be considered new.
* helpmenu.c (help_about): Fix copyright notice.
2002-11-28 Miguel Coca <e970095@zipi.fi.upm.es>
* server_access.c (protocol_version): The version number is
printed to stdout, not stderr!
2002-11-27 Miguel Coca <e970095@zipi.fi.upm.es>
* keyreceivedlg.c, keyreceivedlg.h: Removed obsolete.
* gpgmeedit.c (edit_trust_fnc_action)
(edit_trust_fnc_transit): Added a state for the "set_ultimate.okay"
prompt. Fixes a crash when setting a key to ultimate trust.
2002-11-22 Miguel Coca <e970095@zipi.fi.upm.es>
* Makefile.am (gpa_SOURCES): Add gtkhacks.h
* keylist.c (keylist_fill_list): Don't release the key until we are
done with it.
2002-11-20 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (gpa_generate_key): Load the generated key into the
keytable.
* keygenwizard.c (file_dirname, isdir): Removed.
(gpa_keygen_wizard_run): Remove the backup directory page.
(gpa_keygen_wizard_backup_dir_browse)
(gpa_keygen_wizard_backup_dir_page)
(gpa_keygen_wizard_backup_get_text)
(gpa_keygen_wizard_backup_dir_action): Removed.
(gpa_keygen_wizard_backup_action): Removed, replaced by
_generate_action.
(gpa_keygen_wizard_run, free_keygen_wizard): Remove backup filenames.
(gpa_keygen_wizard_generate_action): Do the key backup here.
(gpa_keygen_wizard_run): Make generate the action for the backup page.
* keyexportdlg.c (do_backup): New.
(key_backup_dialog_run): Do the backup here.
* keyring.c (keyring_editor_backup): Assume backups are done by the
dialog.
* gpa.c (main): Remove unused variable.
* keyring.c (keyring_editor_generate_key_advanced): Use the new
prototype of gpa_generate_key().
* keygenwizard.c (gpa_keygen_wizard_generate_action): Likewise.
* gpgmetools.h, gpgmetools.c (gpa_generate_key): Return the key
fingerprint.
* gpgmetools.c (dump_data_to_file, fill_data_from_clipboard)
(dump_data_to_clipboard): Change for GPGME 0.4.0.
* verifydlg.c (is_detached_sig): Fix dettached signatures.
(verify_file): Change for GPGME 0.4.0.
* verifydlg.c (verify_file): Changes for new verify ptrtotype on
GPGME 0.4.0.
* gpa.c (main): We no longer use a gtkrc.
Remove jnlib logging.
2002-11-13 Miguel Coca <e970095@zipi.fi.upm.es>
* keyserver.c: Replace all free() calls with g_free ().
* keyring.c: Likewise.
* keygenwizard.c: Likewise.
* keyeditdlg.c: Likewise.
* gpgmetools.c: Likewise.
* gpawindowkeeper.c: Likewise.
* gpawidgets.c: Likewise.
* gpa.c: Likewise.
* fileman.c: Likewise.
* expirydlg.c: Likewise.
2002-11-12 Miguel Coca <e970095@zipi.fi.upm.es>
* keylist.c (get_trust_value, get_ownertrust_value): Fix compiler
warnings.
* gpgmetools.c (gpa_backup_key): Likewise.
* gpgmeparsers.c (gpa_parse_engine_info, gpa_parse_import_info): Ditto.
* keyeditdlg.c: Removed obsolete ownertrust prototype.
* fileman.c: Forgot one of Francis's patches.
* gpa.c, gpa.h, gpawidgets.c, gpawindowkeeper.c, gpawizard.c,
gpgmetools.c, gtktools.c, gtktools.h, helpmenu.c, gtktools.h,
helpmenu.c, helpmenu.h, keyexportdlg.c, keygendlg.c,
keygenwizard.c, keyimportdlg.c, keyserver.c, optionsmenu.c,
siglist.c: Remove all calls to jnlib memory management and string
functions, fix compiler warnings and add conditional compilation
of headers where missing.
Submitted by Francis J. A. Pinteric <linuxdoctor@linux.ca>
2002-11-11 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (build_genkey_parms): Fix the date string.
* keyring.c (keyring_editor_generate_key_advanced): Remove bogus error
check.
2002-11-10 Miguel Coca <e970095@zipi.fi.upm.es>
* helpmenu.c (gpa_help_menu_add_to_factory): Renamed "Info" menu
back to "Help" for consistency with other programs.
(scroll_text): Added myself to the about dialog.
* keygenwizard.c (gpa_keygen_wizard_email_page)
(gpa_keygen_wizard_comment_page): Fix spelling of "address".
2002-11-09 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (gpa_key_validity_string): Add disabled and invalid
keys. Use "incomplete" for invalid.
(gpa_key_ownertrust_string): Add default option.
* keyring.c (keyring_editor_edit, keyring_editor_trust): New functions.
(keyring_editor_menubar_new): Add "edit" and "ownertrust" menu items.
(toolbar_edit_key): Use keyring_editor_edit.
* keyeditdlg.c (gpa_key_edit_dialog_run): Remove owner trust editing.
(key_edit_change_trust): Remove.
2002-11-08 Miguel Coca <e970095@zipi.fi.upm.es>
* verifydlg.c (signature_status_label): Add support for
revoked/expired keys. Don't talk about trust for keys.
* server_access.c (check_errors): Always return something.
(do_spawn): Report exec errors here, return boolean indicating
success.
(invoke_helper): Return boolean indicating success. Properly check
the return code of check_errors.
(server_send_keys, server_get_key): Check the return value of
invoke_helper.
* keyring.c (keyring_editor_import): Check for errors getting keys
from the server.
* server_access.c (server_get_key): Make sure a proper value is
returned for "data" everytime.
(helper_path): New function.
(check_errors): New function.
(server_get_key, server_send_keys): Removed dialog from here...
(invoke_helper): and added it here. Send some functionality into
other functions.
(protocol_version): Use the -V option of the plugins to find out the
version of a given plugin.
(do_spawn): New function. Run the helper asyncronously, and redraw the
dialog until it completes.
(close_dialog): New function.
* server_access.c, server_access.h (server_send_keys)
(server_get_key): Return a boolean indicating success.
* keyimportdlg.c (key_import_results_dialog_run): Added special
message if no keys were found in the import.
2002-11-06 Miguel Coca <e970095@zipi.fi.upm.es>
* verifydlg.c (verify_file): Check for GPGME_SIG_STAT_NONE too.
* encryptdlg.c (revoked_key, expired_key): New functions.
(set_recipients): Complain about revoked and expired keys.
* keyserver.c (keyserver_read_list): Added a couple of LDAP keyservers
to the default list.
2002-11-02 Miguel Coca <e970095@zipi.fi.upm.es>
* fileman.c (open_file, add_file): Only complain about an already
opened file when the user opens it from the menu.
* verifydlg.c (is_detached_sig): Take into account files without an
extension. Fixes segfault.
2002-10-30 Miguel Coca <e970095@zipi.fi.upm.es>
* gpapastrings.c, gpapastrings.h (gpa_trust_string)
(gpa_ownertrust_from_string, gpa_ownertrust_icon_name): Remove
obsolete.
* ownertrustdialog.h, ownertrustdlg.c (gpa_ownertrust_run_dialog):
Completedy redo the owner trust dialog. Edit the key inside this
function.
* keylist.c (get_trust_value, get_ownertrust_value): Rename key
trust as validity. Use new string functions.
* keyring.c (keyring_details_notebook)
(keyring_details_page_fill_key): Likewise.
* keyeditdlg.c (gpa_key_edit_dialog_run): Use the new string
functions.
(key_edit_change_trust): Use new version of owner trust dialog.
* gpgmetools.h, gpgmetools.c (gpa_key_ownertrust_string)
(gpa_key_validity_string): New functions.
* gpawidgets.c (gpa_key_info_new): Cosmetic fix to the label
alignment.
2002-10-27 Miguel Coca <e970095@zipi.fi.upm.es>
* helpmenu.c (gpa_help_menu_add_to_factory, help_warranty): Remove
the "warranty" item, as it just an exact copy of "license".
* encryptdlg.c (gpa_file_encrypt_dialog_run, file_encrypt_ok):
Enable encrypt+sign.
(toggle_sign_cb): New function.
* gpgmeparsers.c (gpa_parse_import_info): Free the operation
information.
* keyimportdlg.h, keyimportdlg.c (key_import_results_dialog_run):
New function.
* keyring.c (keyring_editor_import): Load only those keys we just
imported. Display a summary of the import results.
* keytable.c (keytable_fill, do_keylisting): Split the begining of
a keylist operation from actually reading the keys.
(load_keys): New function.
* keytable.h, keytable.c (gpa_keytable_load_key): New function.
* gpgmeparsers.c (gpa_parse_import_info, parse_import_info_text)
(parse_import_info_end, parse_import_info_start): Parse the import
operation detailed results.
2002-10-26 Miguel Coca <e970095@zipi.fi.upm.es>
* gtkrc: Remove.
* Makefile.am: Remove references to gtkrc.
* keyring.c (keyring_editor_new): Set the font of the large label
with pango markup. The gtkrc file is no longer needed.
2002-10-25 Miguel Coca <e970095@zipi.fi.upm.es>
* ownertrustdlg.c (gpa_ownertrust_run_dialog): Use new prototype of
gpa_key_info_new.
* keydeletedlg.c (gpa_delete_dialog_run): Likewise.
* encryptdlg.c (ignore_key_trust): Likewise.
* gpawidgets.c, gpawidgets.h (gpa_key_info_new): Remove the unused
"window" argument.
* keyeditdlg.c (gpa_key_edit_dialog_run): Use gpa_key_info_new to show
the key information.
(add_details_row): Remove.
* gpawidgets.c (gpa_key_info_new): Show all user ID's.
* server_access.c (protocol_version): New function.
(invoke_helper): Added support for error reporting under both
GnuPG 1.2 and 1.3.
* gpgmetools.c (parse_engine_info_start, parse_engine_info_end)
(parse_engine_info_text, find_gpg_executable): Remove from here.
Mostly moved (and expanded) to gpgmeparsers.c.
(gpa_backup_key): Use gpa_parse_engine_info.
* gpgmeparsers.c, gpgmeparsers.h: New files.
* Makefile.am (gpa_SOURCES): Add gpgmeparsers.{c,h}.
2002-10-20 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_mapped): Use GtkMessageDialog's for the
questions.
(keyring_editor_backup): Likewise.
* Makefile.am (gpa_SOURCES): Added verifydlc.{c,h}.
* verifydlg.h, verifydlg.c: New files. The "Verify files" dialog.
* fileman.c (verify_files): Implement.
* gpgmetools.h, gpgmetools.c (gpa_gpgme_data_new_from_file): New
function.
* encryptdlg.c (encrypt_file): Use gpa_gpgme_data_new_from_file.
* server_access.c (server_get_key): Likewise.
* keyring.c (keyring_editor_import): Likewise.
* fileman.c (decrypt_files): Likewise.
* filesigndlg.c (sign_files): Likewise.
* fileman.c (decrypt_files): Fix "typo" in error message.
2002-10-12 Miguel Coca <e970095@zipi.fi.upm.es>
* gpawizard.c (gpa_wizard_new, gpa_wizard_append_page): Use g_free()
instead of free().
* filesigndlg.c: Don't include passphrasedlg.h.
* fileman.c: Likewise.
* expirydlg.c: Likewise.
* Makefile.am (gpa_SOURCES): Removed passphrasedlg.c, passphrasedlg.h.
* passphrasedlg.c, passphrasedlg.h: Removed files.
* gpa.h, gpa.c: Removed global_lastCallbackResult.
* keyring.c: Don't include gpgpa.h.
* siglist.c: Likewise.
* keyimpseldlg.c: Likewise.
* keyexportdlg.c: Likewise.
* keyimportdlg.c: Likewise.
* keyeditdlg.c: Likewise.
* gpapastrings.c: Likewise.
* gpapastrings.c, gpapastrings.h (gpa_ownertrust_from_string)
(gpa_ownertrust_icon_name): Fix prototype.
(gpa_file_status_string)
(gpa_sig_validity_string): Removed.
* filesigndlg.c: Likewise.
* gpa.c: Likewise.
* encryptdlg.c: Likewise.
* gpapastrings.h: Likewise.
* gpa.h: Likewise.
* siglist.c (gpa_siglist_set_signatures): Disable until port to gpgme.
* keyimpseldlg.c (key_import_selection_do_import): Disable imports
from here until there is a way to search keys again.
* Makefile.am (gpa_SOURCES): Removed filemenu.{c,h}, keysmenu.{c,h},
gpapa.h and dummy_gpapa.c.
* optionsmenu.c (add_key): Fix warning.
* gpa.c, gpa.h (gpa_callback, gpa_get_global_clist_file, sigs_append)
(compareInts, gpa_selectRecipient, gpa_unselectRecipient)
(gpa_removeRecipients, gpa_addRecipient, gpa_addRecipients)
(freeRowData, gpa_recipientWindow_close): Removed obsolete.
* optionsmenu.c (options_recipients_fillDefault)
(options_recipients_set, options_recipients_destroy)
(options_recipients): Ditto.
* filemenu.c, filemenu.h, keysmenu.c, keysmenu.h, gpapa.h,
dummy_gpapa.c: Likewise for the whole files.
* ownertrustdlg.c (gpa_ownertrust_run_dialog): Use a gpa_key_info
instead of a gpa_tableKey.
* fileman.c (fileman_menu_new): Use gtk_main_quit() directly for
the quit menu entry.
* keyring.c (keyring_editor_menubar_new): Likewise.
* keyring.c (keyring_editor_export): Use gpa_fopen.
* fileman.c (decrypt_files): Implemented using Gpgme.
(show_file_detail): Removed.
(verify_files): New. Empty for now.
(toolbar_file_verify, fileman_menu_new): Use verify_files instead
of show_file_detail.
(encrypt_files): Free the list of files.
(gpa_window_file_new, add_file): Set the file list to have
just one column, the filename, as the other one left was useless.
* filesigndlg.c (open_destination_file): Make sure there is proper
cleanup on error. Use gpa_fopen.
* encryptdlg.c (open_destination_file): Likewise.
* gpgmetools.h, gpgmetools.c (gpa_fopen): New function.
* gpafile.h, gpafile.c: Removed obsolete files.
2002-10-11 Miguel Coca <e970095@zipi.fi.upm.es>
* server_access.c (error_string): Added KEYSERVER_UNREACHABLE error
code.
* gpgmeedit.c (edit_fnc, edit_expire_fnc_action)
(edit_expire_fnc_transit, edit_trust_fnc_action)
(edit_trust_fnc_transit, edit_sign_fnc_action)
(edit_sign_fnc_transit, gpa_gpgme_edit_trust)
(gpa_gpgme_edit_sign, gpa_gpgme_edit_expire): Rebuilt key editing to
follow a more consistent model. Use the same edit callback, with
different data, for all operations. Hopefully this will make it easier
to understand and write new operations.
* gpgmeedit.h, gpgmeedit.c (gpa_gpgme_edit_trust)
(gpa_gpgme_edit_expire)
(gpa_gpgme_edit_ownertrust)
(gpa_gpgme_edit_expiry): Renamed functions to match the edit commands.
* keyeditdlg.c (key_edit_change_trust, key_edit_change_expiry): Use
new names for edit operations.
2002-10-09 Miguel Coca <e970095@zipi.fi.upm.es>
* encryptdlg.c: Ported the dialog to Gpgme and a GtkDialog. Major
changes. Support for sign & encrypt as soon as some way to choose the
signing key is provided by the GUI.
* fileman.c (sign_files, encrypt_files): Use g_free() instead of
free().
* filesigndlg.c (sign_files): Only set the signer once for each group
of files. Other minor fixes.
2002-10-03 Miguel Coca <e970095@zipi.fi.upm.es>
* fileman.c (count_sigs, free_file_info, attach_file),
(get_file): Removed obsolete.
(get_selected_files, add_file, show_file_detail, sign_files)
(gpa_window_file_new): Change to use Gpgme.
* filesigndlg.c: Ported dialog to Gpgme. Use a GtkDialog.
* gpawidget.h, gpawidgets.c (gpa_key_list_new, gpa_key_list_add_key)
(gpa_secret_key_list_new, gpa_public_key_list_new): Port to Gpgme.
(gpa_key_list_new_from_glist): Disable. Unused at the moment.
* encryptdlg.c (gpa_file_encrypt_dialog_run): Fix call to
gpa_public_key_list_new.
* keyring.c (isdir): Remove obsolote.
2002-09-28 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (add_details_row): Use GtkLabel's always. Change alignment
of labels, so that we can have multiline fields.
(keyring_details_notebook): Add scrollbars. Make User names and
Key ID's scrollable.
(keyring_details_page_fill_key): Show all user ID's.
(keyring_editor_new): Increase default height of the details area.
* gpgmetools.c, gpgmetools.h (gpa_gpgme_key_get_short_keyid): Added
const qualifier.
* keylist.c (get_identifier_value): Always display short key ID's.
* keyexportdlg.c (key_backup_dialog_run): Likewise.
* keyeditdlg.c (gpa_key_edit_dialog_run): Likewise.
* gpawidgets.c (gpa_key_info_new): Likewise.
* keysmenu.c (gpa_tableKey_new): Likewise.
* keyring.c (keyring_details_page_fill_key)
(keyring_update_status_bar): Likewise.
2002-09-27 Miguel Coca <e970095@zipi.fi.upm.es>
* server_access.c: Copied error codes from gnupg code.
(parse_helper_output): New function.
(invoke_helper): Try to parse the helper output if it returned and
error code.
(server_send_keys): Remove placeholder code.
* keyring.c (keyring_editor_export): Minor fixes.
2002-09-24 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.h, gpgmetools.c (gpa_gpgme_key_get_short_keyid): New
function.
* keyring.c (keyring_editor_import, keyring_editor_export): Add
keyserver support.
* server_access.c, server_access.h: New files with the implementation
of all calls to the keyserver helpers.
* Makefile.am (gpa_SOURCES): Added server_access.{c,h}.
2002-09-17 Miguel Coca <e970095@zipi.fi.upm.es>
* keytable.c (keytable_fill): Make the progress bar move faster.
2002-09-13 Werner Koch <wk@gnupg.org>
* keytable.c (keytable_fill): Update progressbar only every 10 keys.
2002-09-12 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmeedit.c (gpa_gpgme_edit_ownertrust, gpa_gpgme_edit_expiry)
(gpa_gpgme_edit_sign): Fix error reporting: always report errors to
the caller.
* keyring.c (keyring_details_page_fill_key): Display the
fingerprint in a proper format (using
gpa_gpgme_key_get_fingerprint).
* keysigndlg.c (gpa_key_sign_run_dialog): Likewise.
* gpgmetools.c (gpa_gpgme_key_get_userid): A bit of cleaning up.
(gpa_gpgme_key_get_fingerprint): New function. Based on GPAPA code.
* gpgmeedit.c (edit_sign_fnc): Ignore "bad passphrase" status
lines. This solves the problem where a wrong passphrase terminated
GPA.
2002-09-11 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmeedit.c (edit_sign_fnc_action, edit_sign_fnc_transit)
(edit_sign_fnc): Use an enum for the state names. Minor fixes.
* gpgmetools.c, gpgmetools.h, gpgmeedit.c, gpgmeedit.h: Moved the
wrappers around gpgme_op_edit and related functions to the new
files gpgmeedit.{c,h}
(gpa_gpgme_key_get_userid): Return NULL if
gpgme_key_key_string_attr does.
* gpgmetools.c, gpgmetools.h (gpa_gpgme_key_get_userid): New
function, returns the User ID's of a key, always in UTF-8.
* optionsmenu.c (add_key): Get the user ID's with
gpa_gpgme_key_get_userid, so that it is always in UTF-8.
* keysmenu.c (gpa_tableKey_new): Likewise.
* keysigndlg.c (gpa_key_sign_run_dialog): Likewise.
* keyring.c (keyring_details_page_fill_key)
(keyring_update_status_bar): Likewise.
* keylist.c (get_name_value): Likewise.
* keyeditdlg.c (gpa_key_edit_dialog_run): Likewise.
* gpawidgets.c (gpa_key_info_new): Likewise.
* Makefile.am (gpa_SOURCES): Added gpgmeedit.{c,h} files.
* keyeditdlg.c (key_edit_change_expiry): Report an error if a wrong
passphrase was provided.
2002-09-04 Miguel Coca <e970095@zipi.fi.upm.es>
* keytable.c (keytable_fill): Display a dialog indicating that the
keyring is being read.
2002-08-31 Miguel Coca <e970095@zipi.fi.upm.es>
* expirydlg.c (expiry_cancel, expiry_destroy): Removed.
(expiry_ok): Modify not to be a callback.
(gpa_expiry_dialog_run): Use a GtkDialog.
* ownertrustdlg.c (ownertrust_cancel, ownertrust_destroy)
(ownertrust_ok): Remove functions.
(gpa_ownertrust_run_dialog): Use a GtkDialog.
* gtktools.c (gpa_window_message): Use a GtkDialog.
(gpa_window_error): Fixed border widths.
2002-08-30 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (gpa_gpgme_edit_sign): Fix reference count for the key.
* keyexportdlg.c (key_export_dialog_run, key_backup_dialog_run): Minor
UI fixes (dialog border width).
* keyimportdlg.c (key_import_dialog_run): Likewise.
* keyeditdlg.c (key_edit_close, key_edit_destroy): Removed.
(gpa_key_edit_dialog_run): Use a GtkDialog.
2002-08-29 Miguel Coca <e970095@zipi.fi.upm.es>
* keydeletedlg.c (confirm_delete_secret): Make "No" the default reply
to the dialog.
2002-08-28 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (find_gpg_executable): New function.
(parse_engine_info_text, parse_engine_info_end)
(parse_engine_info_start): Helper functions for a GLib XML parser.
* keyexportdlg.c (key_backup_dialog_run): Ask for a file, not a dir.
Give the focus to the entry, and close when enter is pressed on it.
Give a sane default value to the filename.
(key_export_dialog_run): Connect pressing enter on the filename entry
with the OK button.
* keyring.c (keyring_editor_backup): Backup to a file, not to a
directory.
* gpgmetools.c (gpa_backup_key): New function.
2002-08-27 Miguel Coca <e970095@zipi.fi.upm.es>
* keydeletedlg.c (confirm_delete_secret): New function.
(gpa_delete_dialog_run): Emit an extra warning if a secret key is to
be removed.
* keyexportdlg.c (export_destroy, export_cancel): Removed.
(secret_key_export_dialog_run): Removed. We don't support exporting
secret keys anymore.
(key_export_dialog_run, key_backup_dialog_run): Use GtkDialog.
(key_export_dialog_run): Armor by default, even when in advanced ui
mode.
2002-08-26 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_import): Implement importing keys from
the clipboard. Uses a GtkClipboard, so it should work on both X
and Win32. Don't abort if the import found no data.
(keyring_editor_export): Implement export to clipboard.
* gpgmetools.c (fill_data_from_clipboard)
(dump_data_to_clipboard): New function.
* keyimportdlg.c (import_destroy, import_cancel): Removed.
(key_import_dialog_run): Use a GtkDialog.
* gpgmetools.c (passphrase_question_label): Add empty line between
question and key.
(gpa_passphrase_cb): Added question icon.
* gtktools.c (gpa_window_error): Add error icon.
* gpgmetools.c (_gpa_gpgme_error): Use gpa_window_error.
* gtktools.c (gpa_window_error): Use a GtkDialog.
* keysigndlg.c (gpa_key_sign_run_dialog): Increase the width of the
border of the dialog. Make "Yes" the default action.
* keydeletedlg.c (delete_ok, delete_cancel, delete_destroy): Removed.
A GtkDialog does not need callbacks.
(gpa_delete_dialog_run): Use a GtkDialog.
2002-08-24 Miguel Coca <e970095@zipi.fi.upm.es>
* optionsmenu.c (add_key, options_key): Use the fingerprint
instead of the key ID. This is a a bit of a kludge to make it work.
* gpgmetools.c (edit_sign_fnc_transit, edit_sign_fnc_action): Correctly
detect when a key has expired.
2002-08-23 Miguel Coca <e970095@zipi.fi.upm.es>
* keysigndlg.c (gpa_key_sign_run_dialog): Change to use a GtkDialog.
(key_sign_cancel, key_sign_ok, key_sign_destroy): Deleted
functions, as the dialog does not need them.
(gpa_key_sign_run_dialog): Display all user ID's. Warn that all of
them will be signed. Use "user name" instead of "user id" on
screen.
2002-08-22 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (edit_sign_fnc, gpa_gpgme_edit_sign)
(edit_sign_fnc_action): New funtions.
* keyring.c (keyring_editor_sign): Reimplement with gpgme.
* keysigndlg.c (key_sign_ok): Remove passphrase stuff.
(gpa_key_sign_run_dialog): Port to gpgme. Remove unneeded
parameters and change the sign_type to just say whether the key
should be signed locally.
2002-08-21 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (_gpa_gpgme_error): Changed "OK" button to "Close".
* fileman.c: Reordered includes to avoid warnings. Kludge to avoid
a bug in GLib.
* gpa.c: Likewise.
* gpafilesel.c: Likewise.
* gpapa.h: Likewise.
* gpapastrings.c: Likewise.
* gpapastrings.h: Likewise.
* gpawidgets.c: Likewise.
* gtktools.c: Likewise.
* helpmenu.c: Likewise.
* icons.c: Likewise.
* keyeditdlg.c: Likewise.
* keyexportdlg.c: Likewise.
* keyimportdlg.c: Likewise.
* keyring.c: Likewise.
* keyserver.c: Likewise.
* optionsmenu.c: Likewise.
* siglist.c: Likewise.
* gpapastrings.c (gpa_unit_expiry_time_string): Renamed index
argument to idx.
* gpa.c (gpa_determine_default_key): Fixed bug when the secret keyring
was empty.
(gpa_set_default_key): Only save the default key if there is one.
* gpgmetools.h, gpgmetools.c (gpa_gpgme_error, _gpa_gpgme_error):
Turned the error reporting function into a macro. Report also the file
and line it was invoked from.
* keyring.c (keyring_editor_export): Cleaned up a bit, removing old
GPAPA code.
(keyring_editor_import): Don't expect EOF from gpgme. It's no longer
emited.
(keyring_editor_current_key): Change declaration of disabled function
for gpgme.
(keyring_editor_backup): Disable function until key backup is
implemented.
2002-08-20 Miguel Coca <e970095@zipi.fi.upm.es>
* gpgmetools.c (gpa_gpgme_edit_ownertrust, edit_ownertrust_fnc):
Implemented editing ownertrust values.
* keyeditdlg.c (key_edit_change_expiry): Account for cancelled
operations.
(key_edit_change_trust): No need to worry about passphrase errors.
Reload keys after editing.
* gpgmetools.c (gpa_passphrase_cb): Got the cancel button working.
2002-08-19 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_import): Fix to behave properly when gpgme
returns EOF error code. Clean up code.
* keytable.c (gpa_keytable_load_key): New function.
* gpgmetools.c (edit_expiry_fnc, gpa_gpgme_edit_expiry):
Implemented changing the expiry date of a key.
(gpa_passphrase_cb): Remove the cancel button, since it does nothing.
Make the question understandable.
(passphrase_question_label): New function.
* keyeditdlg.c (key_edit_change_expiry)
(key_edit_change_trust): Don't terminate on a bad passphrase.
2002-08-18 Miguel Coca <e970095@zipi.fi.upm.es>
* expirydlg.c (GPAExpiryDialog, gpa_expiry_dialog_run): Port to gpgme.
(expiry_ok): Don't ask for the passphrase here. That's gpgme's job.
* keyeditdlg.c (key_edit_change_expiry): Port to gpgme.
* keysmenu.c (gpa_tableKey_new): Port to gpgme.
* ownertrustdlg.c (GPAOwnertrustDialog, ownertrust_ok)
(gpa_ownertrust_run_dialog): Port to gpgme.
* gpgmetools.c (gpa_gpgme_edit_ownertrust)
(gpa_gpgme_edit_expiry): New (empty) functions.
* keyeditdlg.c (key_edit_change_trust): Change to use gpgme.
* gpa.c (main): Set the passphrase callback.
* gpgmetools.c, gpgmetools.h (gpa_passphrase_cb): New function.
* keylist.c (get_expirydate_value): Use new gpa_*_date_string
functions.
* keyring.c (keyring_details_page_fill_key): Likewise.
* keyeditdlg.c (key_edit_change_expiry): Likewise.
* gpawidgets.c (gpa_expiry_frame_new, gpa_expiry_frame_at): Likewise.
* gpapastrings.c (gpa_expiry_date_string): Change to receive the
expiration time instead of a GDate.
(gpa_creation_date_string): Likewise.
* keyeditdlg.c: Rename all key_id variables as fpr, since now they
represent the key's fingerprint.
(gpa_key_edit_dialog_run): Port to GPGME.
2002-08-17 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_generate_key_simple)
(keyring_editor_generate_key_advanced): Reload the keytable after
generating a key.
* keygendlg.c (gpa_key_gen_run_dialog): Use the new algorithm enums.
* gpapastrings.c, gpgmetools.c: Moved the algorithm string
functions, and fixed them for the new enums.
* gtktools.c, gtktools.h (gpa_window_error): Added const qualifier
to the error message.
* keyring.c (keyring_editor_generate_key_advanced): Port to GPGME.
* keygenwizard.c (GPAKeyGenWizard): Remove the members related to
GPAPA.
(gpa_keygen_generate_key): Removed.
(gpa_keygen_wizard_generate_action): Change to use
gpa_generate_key and a GPAKeyGenParmeters struct instead of gpapa.
(string_strip_dup): Use GLib.
* gpgmetools.c (gpa_generate_key)
(build_genkey_parms): New functions.
* keygendlg.c, gpgmetools.c (gpa_key_gen_free_parameters)
(key_gen_params_new): Moved functions to where they can be used by
other files.
* keygendlg.h, gpgmetools.h: Moved the GPAKeyGenParameters
definition and related functions to gpgmetools.h and changed the
fields that depended on GPAPA.
2002-08-16 Miguel Coca <e970095@zipi.fi.upm.es>
* keysmenu.c, keysmenu.h (keys_openSecret)
(keys_generateRevocation)
(keys_import)
(keys_importOwnertrust)
(keys_updateTrust)
(keys_openPublic_export_export_exec)
(keys_openPublic_export_export)
(keys_export_dialog)
(keys_openPublic_send_key)
(keys_openPublic_send)
(keys_openPublic_exportTrust_export)
(keys_openSecret_export_export)
(keys_openSecret_delete)
(keys_openSecret_revocation)
(keys_openSecret_editKey_close)
(keys_openSecret_editKey)
(keys_openSecret_evalMouse)
(keys_openSecret)
(keys_generateRevocation_generate_exec)
(keys_generateRevocation_generate)
(keys_generateRevocation)
(keys_import_ok)
(keys_import)
(keys_importOwnertrust_ok)
(keys_importOwnertrust)
(keys_updateTrust)
(gpa_frameExpire_dont)
(gpa_frameExpire_after)
(gpa_frameExpire_at)
(gpa_frameExpire_new): Removed obsolete functions.
* passphrasedlg.c (gpa_passphrase_run_dialog): In dialogs, set the
button ordering to [OK] [Cancel] in all cases.
* ownertrustdlg.c (gpa_ownertrust_run_dialog): Likewise.
* keyreceivedlg.c (key_receive_run_dialog): Likewise.
* keyimpseldlg.c (gpa_key_import_selection_dialog_run): Likewise.
* keyimportdlg.c (key_import_dialog_run): Likewise.
* keyexportdlg.c (key_export_dialog_run)
(secret_key_export_dialog_run, key_backup_dialog_run): Likewise.
* filesigndlg.c (gpa_file_sign_dialog_run): Likewise.
* encryptdlg.c (gpa_file_encrypt_dialog_run): Likewise.
* keyring.c (keyring_editor_import): Reload the keytable after
importing keys.
2002-08-14 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_menubar_new): Remove commented out
menu entries.
2002-08-13 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_can_sign): Use the keytable instead of
gpapa.
(key_has_been_signed): Disable function until it can be
implemented with gpgme.
* gtktools.c, gpgmetools.c (gpa_gpgme_error): Move function to
gpgmetools.c
2002-08-12 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_export_secret)
(keyring_editor_menubar_new): Removed the option to export secret
keys.
2002-08-11 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_export): Use a function in
gpgmetools.c to dump the data to a file.
(keyring_editor_import): Import keys from files using gpgme.
* Makefile.am (gpa_SOURCES): Added new files.
* gpgmetools.h, gpgmetools.c: New files.
2002-08-10 Miguel Coca <e970095@zipi.fi.upm.es>
* gpapastrings.h: Include gpgme.h
* Makefile.am (gpa_SOURCES): Added new file.
* gpapa.h: New file. All gpapa headers combined in one file that
can be used to compile GPA during the migration without any
problems.
* Makefile.am (INCLUDES): Removed gpapa directory.
2002-08-09 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_editor_export): Export keys to a file using
gpgme.
* gpawidgets.c (gpa_key_info_new): Port to GPGME.
* keydeletedlg.c (gpa_delete_dialog_run): Use GPGME instead of
GPAPA.
* keyring.c (keyring_editor_delete): Port to gpgme. Just delete
the selected keys from the clist and the keytable, but don't
reload anything else. Doesn't work right now, because of a known
bug in gpgme.
* keytable.c (gpa_keytable_remove): New function.
2002-08-08 Miguel Coca <e970095@zipi.fi.upm.es>
* gpa.c (main): Changed the default value of gpa_options.homedir
on Unix. The metacharacter '~' is interpreted by the shell, not by
libc, so we read the HOME environmental variable ourselves.
* optionsmenu.c (add_key): New function.
(options_key): Iterate over the keyring using the keytable
_foreach function instead of gpapa.
* keyring.c (keyring_editor_mapped): Change to use the keytable
instead of gpgme.
(keyring_signatures_page_fill_key): Disabled for now.
* keytable.c (gpa_keytable_size, gpa_keytable_secret_size): New
functions.
* keylist.c (get_key_type_pixmap_value): Fixed to properly detect
secret keys.
* keytable.c (keytable_fill, keytable_empty, gpa_keytable_new)
(gpa_keytable_reload, gpa_keytable_secret_lookup)
(gpa_keytable_secret_foreach, gpa_keytable_destroy): Added the
secret keyring to the keytable.
* keyring.c (idle_update_details): Port to gpgme.
(keyring_details_page_fill_key): Remove secret key argument. Port
to GPGME, minus checking for a secret key.
* keylist.c (gpa_keylist_set_column_defs, keylist_fill_list)
(gpa_keylist_new): Added calls to sort the CList according to the
user name. Use g_malloc and g_free.
* keyeditdlg.c (gpa_key_edit_dialog_run, key_edit_change_trust),
ownertrustdlg.c (gpa_ownertrust_run_dialog),
keyring.c (keyring_details_page_fill_key): Replace string functions.
* gpapastrings.c, gpapastrings.h
(gpa_keytrust_string, gpa_ownertrust_string, gpa_trust_string)
(gpa_ownertrust_from_string): Merged the trust strings fuctions
and arrays, since gpgme does not have different values for key
trust and owner trust.
* keylist.c (gpa_keylist_current_key): Ported to use gpgme and the
keytable.
2002-08-06 Miguel Coca <e970095@zipi.fi.upm.es>
* keylist.c (keylist_fill_list): Ported to gpgme. Use a foreach on
the key table for iterating over the keys. Removed the
keep_selection argument, since it was always called as true, and
would be needed in the new keylist_fill_row too.
(keylist_fill_row): Ported to gpgme. Now it's a callback for a
foreach iteration on a GpaKeyTable. Use fingerprints instead of
key ID's as the row data.
(get_name_value): Return the whole UserID, not just the name.
(get_expirydate_value): Fix the label for keys that don't expire.
2002-08-05 Miguel Coca <e970095@zipi.fi.upm.es>
* keylist.c (get_name_value, get_trust_value, get_ownertrust_value)
(get_identifier_value, get_key_type_pixmap_value): Ported to use GPGME.
* gpa.c (main): Remove commented out code.
* keytable.c (keytable_fill): Check for errors in gpgme.
* gpa.c (gpa_determine_default_key, main): Add proper error
checking for gpgme.
* gtktools.c, gtktools.h (gpa_gpgme_error): New function for
reporting unexpected (and therefore fatal) errors in GPGME.
* gpa.h (IS_DEVELOPMENT_VERSION): Define macro.
2002-08-04 Miguel Coca <e970095@zipi.fi.upm.es>
* keyring.c (keyring_update_status_bar): Use gpgme to read the
default key attributes.
* keylist.c, keylist.h (gpa_keylist_new): Use g_malloc instead of
xmalloc.
* keyring.c (keyring_editor_new): Use g_malloc instead of xmalloc.
* gpa.c, gpa.h : Added keytable and ctx global variables.
* gpa.c (main): Create a keytable here.
* keytable.h, keytable.c: New files. They implement a hash table
of all the keys in the keyring that can be accessed by fingerprint
or by iterating over it.
* gpa.c, gpa.h (main): Add creation of a GpgmeCtx for use by the
rest of the program.
(gpa_determine_default_key): Port to gpgme.
* gpa.h: Include gpgme.h.
* Makefile.am (LDADD): Removed gpapa.
(gpa_SOURCES): Added dummy_gpapa.c
* dummy_gpapa.c: New file. Just a dummy gpapa to assist during the
migration.
2002-08-02 Miguel Coca <e970095@zipi.fi.upm.es>
* gpa.c (main): Use GLib to find out where the gpa executable
resides, instead of walking the pathname ourselves.
(search_config_file): Use different search order for Unix and
Windows. We should never use the executable path on Unix. Use
standard GLib functions. This does not fix the fact that if a
GPA_DATADIR/gpa.conf (i.e. /usr/local/share/gpa/gpa.conf) file
exists, gpa will try to write to it to remember options.
2002-07-31 Miguel Coca <e970095@zipi.fi.upm.es>
* folder1.xpm, folder2.xpm, harddisk1.xpm, harddisk2.xpm,
harddisk3.xpm, open_folder1.xpm, open_folder2.xpm: Removed unused
icons. They were drafts of the final icons and should never have
been included.
* helpmenu.c (help_warranty): Changed the position of the cursor
in the GPL editable to a value less dependent on the length of
license text.
* gpa_license.c: Use the license in English, since it's the only
authoritative one.
2002-07-30 Miguel Coca <e970095@zipi.fi.upm.es>
* gpawidgets.c (gpa_key_list_new, gpa_secret_key_list_new)
(gpa_public_key_list_new, gpa_key_list_new_from_glist): Move the
repeated code for creating the CList to a new gpa_key_list_new
function. Changed the others to use it.
* filemenu.c (file_sign_sign_exec): Remove unused function.
2002-07-29 Werner Koch <wk@gnupg.org>
* Makefile.am (LDADD): Don't hardcode libs but take them all from
configure.
2002-02-25 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* gpafilesel.c (gpa_file_selection_dir_expand): Account for the
use of UTF8 for filenames.
Include io.h just when compiling for Windows.
(correct_parent): Fix to compile under non-Windows OS's.
* gpafilesel.h (gpa_file_selection_get_filename): Change return type
to const gchar*.
* keygenwizard.c: Include errno.h.
* keyring.c: Include errno.h.
(keyring_editor_import): Use different ways to import keys
depending on whether we are using HKP or gpg --recv-keys.
2002-02-24 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* Makefile.am (gpa_SOURCES): Added keyimpseldlg.c and keyimpseldlg.h.
* encrypt.xpm, verify.xpm: New icons.
* fileman.c (show_file_detail): Changed all the references to
"detail view" to "verify signature" in messages.
(toolbar_file_verify): New function.
(gpa_fileman_toolbar_new): Added "verify" button.
* filesigndlg.c: Small formatting changes.
* gpafilesel.c: Fixes to comments and spelling.
* gpawidgets.c (gpa_secret_key_list_new, gpa_public_key_list_new):
Swapped column titles. Changed default widths.
(gpa_key_list_new_from_glist): New function.
* gpawidgets.h: Added "extern" to declarations. Adde
gpa_key_list_new_from_glist function.
* gtktools.c (gpa_window_error): Remove call to gettext for the
error message. Was not needed.
* icons.c (xpms): Added verify_xpm to the list.
* keyimpseldlg.h, keyimpseldlg.c: New files. A new "key import
selection dialog" which shows the result of a key search on the
server and letws the user import them.
* keyring.c: Formatting changes all over.
(keyring_editor_import): Use the key import selection dialog when
the search returns more than one result.
* keysmenu.c (keys_generateRevocation): Swapped column titles.
Changed default widths.
* optionsmenu.c (options_recipients_set)
(options_recipients)
(options_key_select)
(options_key): Swapped column titles. Changed default widths.
2002-02-22 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* Makefile.am (gpa_SOURCES): Added gpa.rc
* fileman.c (fileman_menu_new): Renamed "Show Detail" menu item to
"Check".
* filesigndlg.c (gpa_file_sign_dialog_run): Renamed "copy and add
signature" button to "cleartext signature". Cleaned the code for
the creation of the different radio buttons a bit.
* gpa.rc: New MS-Windows resource file, which adds a custom icon
to GPA.
* gpa.c (cmd_and_opt_values, opts, main): Added new option,
default-key.
(opts): Changed description of --advanced-ui.
(gpa_set_default_key): Save the default key to the config file.
2002-02-21 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* filemenu.c, filesigndlg.c: Reformatted to completely comply with
the GNU Coding Standards.
* filemenu.c (file_sign_sign_exec): Choose the filename for the
dettached signature here, and not in gpapa.
* filesigndlg.c (file_sign_do_sign): Choose the filename for the
dettached signature here, and not in gpapa.
(file_sign_ok): If on simplified mode, assume the user wants armor
on non dettached signature, and doesn't want it on dettached ones.
(gpa_file_sign_dialog_run): Remove the armor option for simplified
mode. Don't offer to compress the signed file when in simplified
mode.
2002-02-20 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* helpmenu.c (help_warranty): Account for the different length of
the license in german.
2002-02-19 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* Makefile.am (LDADD): Added two win32 specific libraries.
* gtkhacks.h: New file, contains some definitions to work around
incompatibilities between GTK+ 1.2 and 2.0.
* fileman.c (show_file_detail): Use the new compatibility
functions defined in gtkhacks.h.
(gpa_fileman_toolbar_new): Allow compilation under both GTK 1.2
and 2.0.
* filemenu.c (file_encrypt_detail): Use the new compatibility
functions defined in gtkhacks.h.
* gpa.c (gpa_default_key_changed_marshal)
(gpa_create_default_key_signal): Enabled when compiling for GTK+
1.2, disabled for 2.0.
(dummy_log_func): New empty function.
(main): Disabled Glib/Gdk/Gtk error logging under all platforms to
keep MS-Windows from opening a console.
* gpa.h: Include the new gtkhacks.h. Define mkdir() and S_ISDIR
macros for win32.
* gpalicense.c, gpalicense.h: Cosmetic changes to the comments,
and added separated license texts for english and german. The
german text is used by default.
* gpafilesel.c, gpafilesel.h: Large changes for compatibility
between GTK+ versions.
* i18n.h: Removed "const" from gettext declaration.
* keyexportdlg.c (key_backup_dialog_run): Removed unused variable.
* keyring.c (keyring_editor_backup): Changed the type of some
variables to remove some warnings.
(keyring_editor_menubar_new): Removed unused variable.
(keyring_toolbar_new): Added some conditional compilation to allow
it to work with both GTK+ 1.2 and 2.0.
* keysmenu.c (gpa_tableKey_new): Use the new compatibility
functions defined in gtkhacks.h.
* optionsmenu.c: Removed everything related to the "default
recipients" menu item, to avoid confusing new users.
* simple-gettext.c (set_gettext_file): Return 0 instead of NULL,
since the function returns "int".
2002-02-15 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* keyring.c (keyring_editor_menubar_new): Added "Delete Keys" menu
item.
2002-02-14 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* fileman.c: Reformatted to completely comply with the GNU
Coding Standards.
(add_file): Display filenames in UTF8.
* gpa.c (keyservers_configname)
(main): Find out the file where keyserver list using the new
search_config_file(). Changed the order in which config files are
read.
(search_config_file): Fixed broken g_strconcat calls.
* gpafilesel.c (read_directory): Display the directory names using
UTF8.
* gtktools.c (gpa_window_error): i18n the message string.
* keyexportdlg.c (export_browse)
(export_ok)
keyimportdlg.c (import_browse)
(import_ok): Display filenames in UTF8.
* keyring.c (keyring_editor_backup): Only write to disk that we've
generated the backup (for later sessions) if the action was not
cancelled.
* keyserver.c (serverlist): Initialize as NULL.
(read_list): Changed to assume we receive the full pathname to the
keyserver file. Commented out error messages.
2002-02-13 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* gpa.c, keylist.c: Reformatted to completely comply with the GNU
Coding Standards.
* gpa.c (gpa_homedir): New global variable. Contains the directory
where the gpa executable is installed.
(search_config_file): New funtion to search for config
files in a series of typical locations.
(main) Set the gpa_homedir variable by manipulating argv[0]. Use
search_config_file. Delayed reading the gtkrc until we know the
GnuPG homedir.
* keygenwizard.c (gpa_keygen_wizard_backup_dir_action): Create the
backup directory if needed.
(gpa_keygen_wizard_generate_action): Save whether the key backup
was generated to the config file.
* keylist.c (keylist_fill_list): Added checks to verify that every
secret key has a corresponding public key in the keyring.
2002-02-11 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* keyring.c (keyring_editor_backup): Test for the directory the user
provided, and create it if it doesn't exist.
* optionsmenu.c (gpa_options_menu_add_to_factory): Disabled
"Default Recipients" menu item.
* gpafilesel.c: Extensive changes to the way directories are
handled. Now the directory list is a tree that expands as the user
navigates the filesystem.
2002-02-10 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* Makefile.am (LDADD): Added -lm and -lz to the hardcoded libraries.
(gpa_SOURCES): Added qdchkpwd.c and qdchkpwd.h to the list.
* qdchkpwd.c, qdchkpwd.h: New files. They contain a "Quick and
Dirty CHecK for PassWorDs", based on the zlib library.
* gpa.h: Some code cleaning.
* gpa.c, icons.c, keyserver.c, keyring.c: Fixed debug output.
* keyeditdlg.c, keyexportdlg.c, keyserver.c, keygenwizard.c,
keyring.c, gpawizard.h: Reformatted to completely comply with the
GNU Coding Standards.
* fileman.c, filemenu.c, gpawidgets.c: Use the GTK+ 2.0 API for
finding out the right width for GtkEntry's.
* keyserver.h, keyserver.c (keyserver_get_current): Added new
argument that requests that the returned value never be NULL.
* keyexportdlg.c, keyimportdlg.c, keysmenu.c, optionsmenu.c: Use
new keyserver_get_current().
* gpa.h, gpa.c (gpa_backup_generated)
(gpa_set_backup_generated)
(gpa_remember_backup_generated): New functions for implementing
new option "backup_generated".
* gpa.c (cmd_and_opt_values)
(opts)
(main): Added oBackupGenerated option. It signals whether the
user should be warned to generate a backup of his private key.
* gpafilesel.c (gpa_file_selection_init): Changed "Open" button to
read "Ok".
(gpa_file_selection_dir_button)
(gpa_file_selection_populate): Removed some debug output, other
fixes.
* gpawizard.c (gpa_wizard_update_buttons): Disable all buttons
when in the "wait" page. So, we explicitly enable the "Close"
button when we reach the last page.
* helpmenu.c (about_dialog_timer): Fixed wrong call to
gdk_draw_string.
(help_about): Added G-N-U GmbH copyright notice and other
documentation. Changed the way the text widths are calculated.
(gpa_help_menu_add_to_factory): Renamed help menu to "Info".
* keyexportdlg.c (export_ok): Cleaned up code a bit, reordered if
conditions (in preparation for adding export to clipboard).
* keyexportdlg.c, keyexportdlg.h (secret_key_export_dialog_run)
(key_backup_dialog_run): New dialogues. First exports secret keys,
and the second makes a backup of the user's keys.
* keygenwizard.c (gpa_keygen_wizard_password_validate): Added
check of the strength of the passphrase, using the new qdchkpwd.
* keyimportdlg.c (import_ok): Cleaned up code a bit, reordered if
conditions (in preparation for adding import to clipboard).
* keyring.c (keyring_editor_sign)
(keyring_editor_import)
(keyring_editor_export)
(keyring_editor_export_secret)
(keyring_editor_backup): Added prototypes.
(keyring_editor_import): Added support for import from the
clipboard.
(keyring_editor_export): Export to clipboard.
(keyring_editor_export_secret)
(isdir)
(keyring_editor_backup): New functions.
(keyring_editor_mapped): Reordered "if" conditions for speed.
Enabled key backups.
(keyring_editor_menubar_new): Changed the various menu items to
use the keyring_editor_* functions instead of the toolbar ones.
Added some code, but disabled it (doesn't work).
(export_secret_key): Removed function.
* keysmenu.c (gpa_tableKey_new)
(gpa_frameExpire_new): Changed the way GtkEntries widths are
calculated.
2002-02-05 Benedikt Wildenhain <benedikt.wildenhain@g-n-u.de>
* fileman.c (gpa_fileman_toolbar_new): Disabled the help button,
since it does nothing at the moment.
* keyring.c (keyring_toolbar_new): Disabled the help button, since
it does nothing at the moment.
2002-02-05 Peter Gerwinski <peter.gerwinski@g-n-u.de>
* Makefile.am (gpa_SOURCES): Included gpafilesel.c and gpafilesel.h
to the list.
* harddisk.xpm, harddisk1.xpm, harddisk2.xpm, harddisk3.xpm,
open_folder.xpm, open_folder1.xpm, open_folder2.xpm, floppy.xpm,
folder.xpm, folder1.xpm, folder2.xpm: New icons.
* encryptdlg.c, expirydlg.c, fileman.c, filemenu.c, filesigndlg.c,
gpawidgets.c, gpawidgets.c, gtktools.c, keygendlg.c,
keygenwizard.c, keysmenu.c, passphrasedlg.c: Small corrections to
message strings.
* encryptdlg.c, fileman.c, filemenu.c, filesigndlg.c,
gpawidgets.c, keyexportdlg.c, keygendlg.c, keygenwizard.c,
keyimportdlg.c, keysigndlg.c, keysmenu.c, optionsmenu.c,
ownertrustdlg.c, passphrasedlg.c: Added casts to remove compile
time warnings and other code cleanups. Changed comment layout.
* encryptdlg.c, expirydlg.c, fileman.c, filemenu.c, filesigndlg.c,
gtktools.c, helpmenu.c, keydeletedlg.c, keyeditdlg.c,
keyexportdlg.c, keygendlg.c, keygenwizard.c, keyimportdlg.c,
keysigndlg.c, keysmenu.c, optionsmenu.c, ownertrustdlg.c,
passphrasedlg.c: Changed to use GTK_WINDOW_TOPLEVEL instead of
GTK_WINDOW_DIALOG in all calls to gtk_window_new, since
GTK_WINDOW_DIALOG doesn't exist in GTK+ 2.0.
* fileman.c (show_file_detail)
filemenu.c (file_encrypt_detail)
gpawidgets.c (gpa_expiry_frame_new)
helpmenu.c (help_about)
keysmenu.c (gpa_tableKey_new): Use the GTK+ 2.0 API for finding out
the right width for GtkEntry's.
* gpafilesel.c, gpafilesel.h: New files. They define a version of
the GtkFileSelection dialog (GpaFileSelection) modified to look
more like what users of MS-Windows are accustomed to. It is
directly based on the source code for GTK+ 2.0.
* icons.c, siglist.c: Formatting change.
* fileman.c (gpa_fileman_toolbar_new): Use new GTK+ 2.0 API.
* filemenu.c, gtktools.c, keysmenu.c: Now uses the new GpaFileSelection
instead of GtkFileSelection.
* gpa.c: Added include for w32reg.h.
(gpa_default_key_changed_marshal)
(gpa_create_default_key_signal): Disabled functions for
compilation with GTK+ 2.0.
(main): Fixed several compile time errors on win32. Now we use
UTF-8 for output.
* gtktools.c (gpa_button_set_text): Disabled code that doesn't
compile with GTK+ 2.0.
* helpmenu.c (scroll_text): Updated.
(about_dialog_timer)
(help_about): Use gtk_style_get_font instead of directly accessing
the style struct.
(gpa_help_menu_add_to_factory): Disabled help button.
* keyexportdlg.c (_GPAKeyExportDialog)
(key_export_dialog_run): Support for exporting keys to the
clipboard.
* keygenwizard.c (gpa_keygen_wizard_password_validate): Added
check for a passphrase that is obviously too simple. At the moment
that is defined as being less than 10 characters long.
* keyring.c (keyring_editor_current_key): Removed prototype.
(toolbar_edit_key)
(toolbar_remove_key)
(toolbar_sign_key)
(toolbar_export_key)
(toolbar_import_keys): Added prototypes.
(export_secret_key): New (empty) function.
(keyring_editor_generate_key_advanced): Changed #warning to a comment.
(keyring_editor_mapped): Remind the user to make a backup of his
private key.
(keyring_editor_menubar_new): Added keyboard accelerator to the
File/Close menu item. Added key operations (sign, export, export
private, backup) to the menu. Moved "Options" menu to before
"Keys" menu.
(keyring_toolbar_new): Use new GTK+ 2.0 API. Added button to open
the file manager.
(keyring_editor_new): Changed default window size. Increased area
reserved for the key list.
* keyimportdlg.c (_GPAKeyImportDialog)
(key_import_dialog_run): Support for exporting keys to the
clipboard.
2002-01-14 Werner Koch <wk@gnupg.org>
* gpa.c (my_strusage): Take bug report address from configure.
2001-12-31 Werner Koch <wk@gnupg.org>
* gpapastrings.c, gpapastrings.h: Suport for creation dates.
* keyring.c:Ditto.
* keyring.c (keyring_update_status_bar): Fixed segv in case a key
does not exist. All by Michael Mauch.
* helpmenu.c (help_warranty): Added real code. By Michael Fischer
v. Mollard.
2001-08-23 Werner Koch <wk@gnupg.org>
* gpapastrings.c: Added a few more strings and made
keytrust_strings_advanced code. By Miguel Coca.
2001-06-06 Werner Koch <wk@gnupg.org>
* gpa.c (main): Convert the characters in the homedir from
backslash to standard slash. Note: We sill need to figure out a
way to handle the '\\server\path' style filenames - however, I am
pretty sure that a lot of other functions are not able to handle
them.
2001-05-30 Werner Koch <wk@gnupg.org>
* i18n.h, options.h: New.
* gpa.h: Moved some code to the new header files.
* keyserver.c, keyserver.h: New.
* keyexportdlg.c (key_export_dialog_run): Use functions from
keyserver to setup the list.
* keyimportdlg.c (key_import_dialog_run): Ditto.
* optionsmenu.c (options_keyserver): Ditto.
* gpa.c (main): Ditto.
* keysmenu.c (keys_openPublic_send_key): Ditto.
* keyreceivedlg.c (receive_ok): Ditto.
* optionsmenu.c (options_keyserver_set): Ditto.
* gpa.c, gpa.h (global_keyserver): Removed.
* gpa.c: New option --keyserver.
2001-03-28 Werner Koch <wk@gnupg.org>
* gpa.c (gpa_determine_default_key): Replaced xstrdup by
xstrdup_or_null to avoid a segv.
* optionsmenu.c (options_key_set): Ditto, to make it more robust.
(options_keyserver_set): Ditto.
* passphrasedlg.c (passphrase_ok): Ditto.
* keyimportdlg.c (import_ok): Ditto.
* keygendlg.c (gpa_key_gen_run_dialog): Ditto.
* keyexportdlg.c (export_ok): Ditto.
* gtktools.c (file_dialog_ok): Ditto.
* gpawidgets.c (gpa_secret_key_list_new): Ditto.
(gpa_public_key_list_new): Ditto.
* keylist.c (keylist_fill_list): Insert only if we got a keyID.
2001-02-27 Jan-Oliver Wagner <jan@intevation.de>
* helpmenu.c: Added some authors for scroll text
2001-02-15 Thomas Koester <tkoester@intevation.de>
* gpa.c (i18n_init): call gtk_set_locale even with USE_SIMPLE_GETTEXT
* keysmenu.c (gpa_frameExpire_at, gpa_frameExpire_after): obsolete
2001-02-15 Bernhard Herzog <bh@intevation.de>
* keygenwizard.c (gpa_keygen_wizard_backup_dir_browse): Check for
a cancelled dialog.
* encryptdlg.c (file_encrypt_ok, file_encrypt_cancel): Instead of
quitting the main loop, destroy the dialog window.
(file_sign_destroy, gpa_file_encrypt_dialog_run):Add a destroy
event handler and quit the recursive main loop there.Make the
dialog properly modal.
* filesigndlg.c (file_sign_ok, file_sign_cancel): Instead of
quitting the main loop, destroy the dialog window.
(file_sign_destroy, gpa_file_sign_dialog_run): Add a destroy event
handler and quit the recursive main loop there.
(gpa_file_sign_dialog_run): Make the dialog properly modal.
* gpapastrings.c (gpa_algorithm_from_string): Translate the
strings before comparing them.
* gpapastrings.c (gpa_ownertrust_from_string): Translate the
strings before comparing them.
* filesigndlg.c (gpa_file_sign_dialog_run): Make the key list
resize properly
* helpmenu.c (help_license): Display the text of the GPL, not
just the title
* gpa_license.h:
* gpa_license.c: New file containing the GPL as a C string and the
corresponding header.
* Makefile.am (gpa_SOURCES): Add the new files
* icons.xpm:
* icons.c (xpms): Add the new logo
* helpmenu.c (about_dialog_logo_expose, about_dialog_load_logo)
removed. The logo is now an xpm just lkike the icons.
(help_about): Use a pixmap widget instead of the drawing area to
display the logo
* keygenwizard.c (page_switched): Remove a debug printf
(gpa_keygen_wizard_backup_page): Change the wording a little
* gpa_logo.ppm: Update to new logo
* gpawizard.c (GPAWizard):
(gpa_wizard_new): Add some fields for a callback that's called
whenever a page is switched. (This should really be implemented as
a GTK signal)
(gpa_wizard_set_page_switched): Call the callback
(gpa_wizard_page_switched): Set the callback
(gpa_wizard_notebook_destroy): New. Handler for the notebook's
destroy signal to remove the callback to avoid segfaults
(gpa_wizard_new): Connect to the notebook's destroy signal.
* gpawizard.h: Add the new type and prototype
* keygenwizard.c (gpa_keygen_wizard_password_validate,
gpa_keygen_wizard_backup_action,
gpa_keygen_wizard_backup_dir_action): Don't change the pixmap.
(page_switched): Callback for the page switches of the wizard.
Change the pixmap depending on the current page.
* icons.xpm: Tweak the import icon a little
* keylist.c (gpa_keylist_update_list): Update the column widths
also when the list was empty before
2001-02-14 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_import): Update the widgets after
importing the key
(keyring_toolbar_new): Change "details" to "detailed"
* icons.xpm:
* icons.c (xpms): Add some new graphics
* keyring.c (keyring_toolbar_new):
* fileman.c (gpa_fileman_toolbar_new): Use the new toolbar icons
* keylist.c (get_key_type_pixmap_value): Use the new key icons
* keygenwizard.c: Add an option to create backup copies of the
keys and add some graphics:
(GPAKeyGenWizard): Add a few fields for the backup feature and the
graphics
(gpa_keygen_wizard_password_page): The passphrase page is not the
last page before the actual key generation anymore, so change the
wording.
(gpa_keygen_wizard_password_validate): Now used directly as the
action callback of the passphrase page, so change it display the
messages instead of returning them and return the appropriate
boolean.
(gpa_keygen_wizard_backup_page):
(gpa_keygen_wizard_backup_action):
(gpa_keygen_wizard_backup_dir_page):
(gpa_keygen_wizard_backup_get_text):
(gpa_keygen_wizard_backup_dir_action): New functions implementing
the backup pages, actions and helper functions.
(gpa_keygen_generate_key): Store the generated keys in the
keygenwizard struct
(gpa_keygen_wizard_generate_action): Remove the password
validation because that's already been done. Create the backups
after generating the key pair.
(free_keygen_wizard): New function to free the keygenwizard struct
and the file names.
(gpa_keygen_wizard_run): Add the new pages and the pixmap window
(isdir):
(file_dirname): Two new helper functions
2001-02-13 Thomas Koester <tkoester@intevation.de>
* expirydlg.c (gpa_expiry_dialog_run): Conflicting accelerator.
2001-02-13 Bernhard Herzog <bh@intevation.de>
* keysmenu.c (gpa_tableKey_new): Swap the table rows and change
the labels to be more consistent with the rest of the UI.
* keyring.c (keyring_editor_mapped): Add accelerators for the
message box
* gtktools.c (gpa_message_box_run): Add an accelgroup and handle
accelerators in the button labels.
* keyimportdlg.c (key_import_dialog_run): Make the accelerators
for the radio buttons and entry fields work
* keyeditdlg.c (gpa_key_edit_dialog_run): Remove the sign frame.
Add an accel-group and make the accelerators work.
2001-02-13 Thomas Koester <tkoester@intevation.de>
* expirydlg.c (expiry_ok):
(gpa_expiry_dialog_run):
keydeletedlg.c (gpa_delete_dialog_run):
* keyexportdlg.c (key_export_dialog_run):
* keyimportdlg.c (key_import_dialog_run): Use "_OK" instead of "Ok".
* keyeditdlg.c (gpa_key_edit_dialog_run):
* gpawizard.c (gpa_wizard_new):
* keyexportdlg.c (key_export_dialog_run):
* keyimportdlg.c (key_import_dialog_run): Add/Change accelerators.
2001-02-13 Bernhard Herzog <bh@intevation.de>
* gpawizard.h: Add prototype of gpa_wizard_next_page
* gpawizard.c (gpa_wizard_next_page):
(gpa_wizard_next): Put practically all of gpa_wizard_next in the
new public function gpa_wizard_next_page and just call the public
function in gpa_wizard_next. The user data parameter of
gpa_wizard_next is now the vbox widget.
(gpa_wizard_new): Pass the vbox widget as parameter to the
Next-button's callback.
* keygenwizard.c (switch_to_next_page): New. Handler for the
activate signals of several entry fields to switch the wizard to
the next page
(gpa_keygen_wizard_simple_page): Add the keygen_wizard as
parameter and connect to the entry's activate signal to switch to
the next page.
(gpa_keygen_wizard_comment_page):
(gpa_keygen_wizard_email_page):
(gpa_keygen_wizard_name_page): Add the keygen_wizard as parameter
and pass it through to gpa_keygen_wizard_simple_page
(focus_repeat_passphrase): New. Handler for the activate signal of
the passphrase entry to focus the repeat passhrase entry
(gpa_keygen_wizard_password_page): Add the keygen_wizard as
parameter and connect to the repeat pasphrase entry's activate
signal to switch to the next page. Also focus the repeat entry in
the activate handler of the passphrase entry.
* siglist.c (gpa_siglist_set_signatures): Call
gtk_container_check_resize to make sure that the sizes of the
title buttons are also taken into account.
* keyexportdlg.c (key_export_dialog_run): Use function from
gtktools.c to create the radio buttons, so that the accelerators
are handled correctly.
2001-02-13 Thomas Koester <tkoester@intevation.de>
* gtktools.c (gpa_window_error):
(gpa_window_message): Translate window titles.
* keygenwizard.c (gpa_keygen_wizard_run): Use "Finish" button
instead of "Next" on wait_page and final_page.
* gpawizard.c (gpa_wizard_new): Add accelerator to "Next" and "Prev"
2001-02-13 Bernhard Herzog <bh@intevation.de>
* Makefile.am (install-data-local):
(pkgdata_DATA): Remove install-data-local and use pkgdata_DATA to
install data files.
(logo):
(EXTRA_DIST): Add the gpa logo file and put it into pkgdata_DATA
and EXTRA_DIST
* helpmenu.c (about_dialog_load_logo): Take the logo from the data
dir.
* keygendlg.c (gpa_key_gen_run_dialog): Add some comments
2001-02-13 Jan-Oliver Wagner <jan@intevation.de>
* hidewnd.c (new): Hiding console window on W98 and ME
* hidewnd.h (new): Hiding console window on W98 and ME
* Makefile.am: added hidewnd.(h|c)
* gpa.c (main): added hiding of console window for W98, ME
2001-02-12 Bernhard Herzog <bh@intevation.de>
* optionsmenu.c (options_recipients):
(options_key): Translate the CList column titles
(options_keyserver): Translate the buttons
* keyring.c (keyring_details_page_fill_key):
(keyring_details_notebook):
(GPAKeyringEditor): Add the owner trust to the details page.
* gpapastrings.c (gpa_ownertrust_string):
(gpa_unit_expiry_time_string): Translate the returned strings.
* keyring.c (keyring_editor_new): Mark the big label for
translation
* keylist.c (gpa_keylist_update_list): Call
gtk_container_check_resize to make sure that the size changes in
the title buttons are correctly accounted for
(ColumnDef): title may now be NULL to indicate an empty title.
(keylist_fill_row): Handle NULL column titles.
* keyring.c (keyring_editor_mapped): Check for cancelling the
dialog via WM, in which case result is NULL
* fileman.c (gpa_fileman_toolbar_new): Use the new help icon
* gpapastrings.c (algorithm_strings): Add a missing ')'
* gtktools.c (GPASaveFileNameDialog): Rename the dialog field to
window as it's done in all other dialogs
(file_dialog_destroy):
(gpa_get_save_file_name): Add a destroy event handler and quit the
recursive main loop there.
(file_dialog_ok):
(file_dialog_cancel): Instead of quitting the main loop, destroy
the dialog window.
* gpa.c (gpa_addRecipient): Only add the key if it's not already
in the recipients list.
* keysmenu.c (keys_openPublic_exportTrust_export):
(keys_openPublic_exportTrust):
(keys_openSecret_editKey_close):
(keys_openSecret_editKey):
(keys_openSecret):
* filemenu.c (file_sign_sign):
(file_encryptAs):
(file_protect):
(file_protectAs): Don't translate the tip-strings. They aren't
used anymore at all and should be removed completely evetually.
* gpa.c (gpa_open_keyring_editor):
(gpa_open_filemanager): Only do a show_all once, when the window
is created for the first time. With recent changes not all
children of the keyring editor window are shown all the time and a
show_all will make them all visible again.
* fileman.c (gpa_fileman_new):
* keyring.c (keyring_editor_new): Realize the window before
creating the toolbar so that we can create pixmaps without
warnings
* keyring.c (keylist_columns_brief):
(keylist_columns_detailed): Add the new key type pixmap as the
first column
* keylist.h (GPAKeyListColumn):
* keylist.c (column_defs):
(get_key_type_pixmap_value): New value func and column defintion
to return a pixmap indicating the type of key: public only or
secret+public.
* keylist.c (ColumnValueFunc):
(ColumnDef):
(get_name_value):
(get_trust_value):
(get_ownertrust_value):
(get_expirydate_value):
(get_identifier_value): Change the prototype of ColumnValueFunc
and update all value functions accordingly. Now the value may be a
pixmap, but all existing functions only rerturn text as before.
The function itself now also indicates whether the text has to be
freed.
(keylist_row_labels):
(keylist_free_row_labels): Removed.
(keylist_fill_row): New function to fill a row with the
labels/pixmaps for one key
* keyring.c (keyring_toolbar_new): Use the new help icon
* icons.xpm:
* icons.c (xpms): Add some new icons
* keyring.c (keyring_editor_delete): Deleting keys has changed in
gpapa, so call either gpapa_secret_key_delete or
gpapa_public_key_delete, depending on whether there's a secret key
or not.
2001-02-09 Bernhard Herzog <bh@intevation.de>
* keyring.c (key_has_been_signed): New function to test whether a
key has been signed by a given other key id
(keyring_editor_can_sign): Use the new function
(keyring_editor_sign): For each key, test whether it has already
been signed by the secret key.
* keygenwizard.c (string_strip_dup): Helper function to create a
copy of a string stripped off leading and trailing whitespace
(gpa_keygen_wizard_simple_get_text): Return a string_strip_dup'ed
version of the user input
(gpa_keygen_wizard_password_action): Free the values read from the
"simple pages" because they're now malloced copies.
(gpa_keygen_wizard_name_validate):
(gpa_keygen_wizard_email_validate): New functions to validate the
user input for the name and email pages. The validation for the
emails address could be much more thorough.
(gpa_keygen_wizard_run): Hook up the new validation functions with
the pages.
* optionsmenu.c (options_keyserver):
(options_keyserver_destroy): Make the default key server dialog
properly modal with a recursive main loop and a handler for the
destroy signal
(options_keyserver_set): Actually set the default key server.
* optionsmenu.h: Remove the prototypes of functions that are long
gone or that are now static
* optionsmenu.c (options_recipients_fillDefault):
(options_recipients_set):
(options_recipients):
(options_key):
(options_key_set):
(options_key_select):
(options_keyserver):
(options_keyserver_set): Make them static. They're only used in
this file.
* keyring.c (toolbar_edit_key): Update the details notebook too
when the key has been changed
* keyeditdlg.c (key_edit_change_expiry): Set the key_has_changed
flag if the date has been changed
* keyring.c (keyring_details_notebook): Add a missing : in the key
type label
* helpmenu.h
* helpmenu.c (help_license):
(help_about):
(help_warranty): Make them static and remove them from the header
file as they're only used in helpmenu.c.
* helpmenu.c (help_license_destroy):
(help_license): Make the default license dialog properly modal
with a recursive main loop and a handler for the destroy signal
* optionsmenu.c (options_key):
(options_key_destroy): Make the default key dialog properly modal
with a recursive main loop and a handler for the destroy signal
(options_recipients):
(options_recipients_destroy): Make the default recipients dialog
properly modal with a recursive main loop and a handler for the
destroy signal
* filesigndlg.c (file_sign_ok): Pass the selected secret key to
the passphrase dialog
2001-02-08 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_new): Initialize the details notebook
properly
(keyring_details_page_fill_key):
(keyring_details_notebook): Add some new fields to the details
page.
(keyring_details_page_fill_key): Add the secret key as a parameter
to be able to show whether the key is owned by the user
(idle_update_details): Determine the secret key too to pass to
keyring_details_page_fill_key
* expirydlg.c (gpa_expiry_dialog_run): Pass the secret key into
the dialog instead of the expiry date so that we can display it in
the password dialog. Update the headerfile accordingly.
(GPAExpiryDialog): Add the key field.
(expiry_ok): Pass the key to the password dialog.
* keyeditdlg.c (key_edit_change_expiry): gpa_expiry_dialog_run has
a new calling sequence.
* gpawidgets.c (gpa_key_info_new): Tweak the spacing a bit
* passphrasedlg.c (gpa_passphrase_run_dialog): Add a label asking
for the passphrase
* keysigndlg.c (key_sign_ok): Pass the default key to the password
dialog
* passphrasedlg.h (gpa_passphrase_run_dialog):
* passphrasedlg.c (gpa_passphrase_run_dialog): Add a key parameter
and display information about the key whose password is required.
* keysigndlg.c (key_sign_ok):
* filesigndlg.c (file_sign_ok):
* fileman.c (decrypt_files):
* expirydlg.c (expiry_ok): Call gpa_passphrase_run_dialog with
NULL as the new key parameter. Should be replaced with the correct
key later.
* keyring.c (keyring_editor_toggle_show_trust): Removed because
it's no longer used. A similar effect is available with the
brief/detailed listings.
* keydeletedlg.h:
* keydeletedlg.c: New files for the key delete dialog.
* Makefile.am (gpa_SOURCES): Add the new key delete dialog files.
* keyring.c (keyring_editor_delete): Use the new delete dialog
instead of a simple message box.
* gpawidgets.h (gpa_key_info_new):
* gpawidgets.c (gpa_key_info_new): New function to create a simple
table with info about a key.
* keygenwizard.c (GPAKeyGenWizard): Add fields for the wizard
widget and the wait-page.
(gpa_keygen_wizard_password_action): Switch to the wait-page.
(gpa_keygen_wizard_wait_page): New function to create the
wait-page.
(gpa_keygen_wizard_run): Put the waitpage into the wizard. Also,
store the gpa wizard widget in the struct.
* gpawizard.h (gpa_wizard_next_page_no_action):
* gpawizard.c (gpa_wizard_next_page_no_action): New public
function to switch the wizard to the next page without running the
action callback associated with the page. This is used by the
action callback that is invoked by the finish button to display a
"wait" message.
2001-02-07 Thomas Koester <tkoester@intevation.de>
* gpapastrings.c (gpa_expiry_date_string): Use %x instead of
%d.%m.%Y as date format string.
* expirydlg.c (gpa_expiry_dialog_run):
* gpawidgets.c (gpa_expiry_frame_at):
(gpa_expiry_frame_new):
* keysmenu.c (gpa_frameExpire_at):
(gpa_frameExpire_new): Use gpa_expiry_date_string.
* keyring.c (keyring_details_page_fill_key): free unused text.
2001-02-07 Bernhard Herzog <bh@intevation.de>
* gpawidgets.h (gpa_signature_list_new):
* gpawidgets.c (add_sigs_to_clist):
(gpa_signature_list_new): Removed. Superseded by the siglist in
siglist.c
* fileman.c (show_file_detail): Use the siglist to display the
list of signatures
* siglist.h: Change the include guard to something more unique
* keyring.c (keyring_editor_sign):
(keyring_selection_update_widgets): Use the new
keyring_update_details_notebook function to update the pages in
the details notebook
(keyring_details_notebook): Add a label to the details page and
introduce a vbox holding both the label and the table so that we
can switch between either the label or the table to show very
different information when exactly one key is selected or when
zero or more than one key is selected
(keyring_update_signatures_page):
(keyring_update_details_page): Removed
(keyring_details_page_fill_key):
(keyring_details_page_fill_num_keys):
(keyring_signatures_page_fill_key):
(keyring_signatures_page_empty):
(idle_update_details):
(keyring_update_details_notebook): New functions replacing
keyring_update_details_page and keyring_update_signatures_page so
that either the details of the current key is shown or the number
of selected keys if several or no key is selected. Also only
update the notebook when idle.
(GPAKeyringEditor): Add some new fields for the new widgets and
idle handling
(keyring_editor_new): Initialize the idle handler id.
* keylist.h (gpa_keylist_selection_length):
* keylist.c (gpa_keylist_selection_length): New function to
determine the number of selected keys
* keyring.c (keyring_editor_generate_key_advanced): Pass the
password to gpapa_key_set_expiry_date
* keysmenu.c (keys_openSecret_editKey_close):
(keys_openSecret_editKey_close): Provide dummy passwords for
gpapa_key_set_expiry_date just to make them compile. The functions
are currently unused.
* keyeditdlg.c (key_edit_change_expiry): Use the new password
parameter of the expiry dialog and pass it to gpapa.
* expirydlg.h (gpa_expiry_dialog_run):
* expirydlg.c (gpa_expiry_dialog_run): Add a parameter to return
the password
(GPAExpiryDialog): Add a field for the password
(expiry_ok): Ask for the password and set the password field in
the dialog struct
2001-02-06 Bernhard Herzog <bh@intevation.de>
* gpa.h (global_defaultKey): Removed. Its definition was deleted
some time ago.
* gpa.h (global_homeDirectory):
* gpa.c (global_homeDirectory): Removed as it's no longer used.
* gpa.c (main): Don't init the home dir and load/save options dialogs.
* optionsmenu.c (homeDirSelect):
(loadOptionsSelect):
(saveOptionsSelect):
(gpa_homeDirSelect_ok):
(gpa_homeDirSelect_init):
(gpa_loadOptionsSelect_ok):
(gpa_loadOptionsSelect_init):
(gpa_saveOptionsSelect_ok):
(gpa_saveOptionsSelect_init):
(options_homedir):
(options_load):
(options_save): Removed. Loading and saving options wasn't
actually implemented in gpapa anyway and the home directory was
only used by the load/save options functions.
(gpa_options_menu_add_to_factory): Remove the menu entries for the
home directory and loading/saving options.
* fileman.c (decrypt_files): Update cur to the next list element
at the end of the while loop.
* helpmenu.c: Reformat several functions to conform more to GNU
standards.
(about_dialog_logo_expose): Don't add new timers here. Should fix
the segfaults that happened when the about dialog was closed.
* Makefile.am (gpa_SOURCES): Replace the keyreceivedlg files with
the keyimportdlg files.
* keyimportdlg.h:
* keyimportdlg.c: New files implementing the import dialog
* keyring.c (keyring_editor_import):
(keyring_editor_receive): Rename keyring_editor_receive to
keyring_editor_import and implement it with the new import dialog
(toolbar_import_keys): call keyring_editor_import.
2001-02-05 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_export): Use the server returned by
the dialog and not the default server.
* siglist.c (GPASigList):
(gpa_siglist_new):
(gpa_siglist_set_signatures): Don't try to be too clever about
when to set the columns to their optimal widths. Do it whenever
the list is changed and get rid of the widths_set flag.
* keyring.c (keyring_editor_export): Actually call the appropriate
gpap functions and handle sending keys to key servers as well.
* keyexportdlg.h:
* keyexportdlg.c: Substantial changes in practically all functions
to extend the dialog to support sending keys to key servers (which
includes a new parameter in key_export_dialog_run) as well and to
handle delete-event and destroy correctly.
2001-02-02 Bernhard Herzog <bh@intevation.de>
* gpa.c (gpa_removeRecipients): Change "files" to "keys" in the
error message when no items are selected
* keyring.c (toolbar_export_key): Call keyring_editor_export
* gtktools.c (gpa_window_show_centered): Set the WM_TRANSIENT_FOR
window manager hint so that the window manager treats dialog
windows properly
* keyring.c (keyring_toolbar_new): Correct the tooltip for the
remove button
2001-02-01 Bernhard Herzog <bh@intevation.de>
* Makefile.am (gpa_SOURCES): Add the new expiry dialog files
* expirydlg.h:
* expirydlg.c: New files implementing the dialog to change the
expiry date
* keyeditdlg.c (key_edit_change_expiry): New function. Handler for
the change button of the expiry date
(gpa_key_edit_dialog_run): Add the signal handler for the expiry
date change
* keyring.c (keyring_editor_generate_key_advanced):
* keygenwizard.c (gpa_keygen_wizard_password_action): Remove some
debug printfs
* gtktools.c (GPAMessageBox):
(message_box_clicked):
(message_box_destroy):
(message_box_delete):
(gpa_message_box_run): Connect to destroy instead of delete-event
and quit the main loop there. Also introduce the struct
GPAMessageBox to pass data to the various signal handlers and
results back to the message box function.
* keyring.c (keyring_editor_delete): Check whether the return
value from the message box is NULL, too, when checking for
"cancel". (it may be null if the user exited the message box
through the window manager)
* keyeditdlg.c (key_edit_change_trust):
* ownertrustdlg.h (gpa_ownertrust_run_dialog):
* ownertrustdlg.c (gpa_ownertrust_run_dialog): Remove the tip
parameter of gpa_ownertrust_run_dialog which was intended for the
now removed tip window. Update callers.
* keyring.c (keyring_editor_can_sign): Don't check explicitly
whether the selected key is the default key because the list of
signatures contains the self signature now.
2001-01-31 Bernhard Herzog <bh@intevation.de>
* gpa.h (global_noTips):
* gpa.c (global_noTips): Removed. not needed anymore now that the
tip window's gone
* optionsmenu.c (gpa_options_menu_add_to_factory): Remove the
"Online _tips" entry
* optionsmenu.h (options_tips):
* optionsmenu.c (options_tips):
* gpa.h (gpa_switch_tips):
* gpa.c (gpa_switch_tips): Removed because they're not needed
anymore now that the tip window's gone
* keyring.c (keyring_update_status_bar): Make the parameter
explicitly a GPAKeyringEditor pointer because it's not directly
used as a signal handler anymore
(keyring_default_key_changed): New signal handler for the
gpa_default_key_changed signal that updates the statusbar and the
selection sensitive widgets because some of them depend on the
default key
(keyring_editor_new): Use keyring_default_key_changed as the
handler for gpa_default_key_changed
(keyring_editor_sign): Update the selection sensitive widgets too
because some depend on what signatures a key has.
* keysmenu.h: Remove the prototypes of the functions deleted from
keysmenu.c
* keysmenu.c (keys_generateKey):
(keys_generateKey_generate):
(keys_openPublic):
(keys_openPublic_evalMouse):
(keys_openPublic_toggleClistKeys):
(keys_openPublic_fillClistKeys):
(keys_openPublic_receive):
(keys_openPublic_receive_receive):
(keys_openPublic_editKey):
(keys_openPublic_sign):
(keys_openPublic_sign_exec):
(keys_openPublic_editTrust):
(keys_openPublic_editTrust_accept):
(keys_openPublic_delete):
(getStringForKeytrust):
(getOwnertrustForString):
(writtenKeytrust):
(writtenOwnertrust):
(unitTime):
(writtenAlgorithm): Removed because they're not used anymore.
* optionsmenu.c (gpa_homeDirSelect_init):
(gpa_loadOptionsSelect_init):
(gpa_saveOptionsSelect_init): Remove commented out window tip code
* encryptdlg.c:
* fileman.c:
* filemenu.c:
* filesigndlg.c:
* gpa.c:
* gpawidgets.c:
* gtktools.c:
* optionsmenu.c: Don't include help.h
* tipwindow.c:
* help.h:
* help.c: Removed because the tip windows are not used anymore.
tipwindow.c wasn't actually used anyway
* Makefile.am (gpa_SOURCES): Removed help.c and help.h
* gpa.c (main): Don't init the tipwindow.
* optionsmenu.c (options_homedir):
(options_load):
(options_save): Remove the gpa_window_tip_show calls.
* gtktools.c (gpa_window_destroy): Remove the window tip handling
* filemenu.c (file_open):
(gpa_fileOpenSelect_init):
(file_open_ok):
(file_showDetail):
(file_close):
(file_sign):
(get_file_selection_count):
(file_encrypt):
(file_decrypt_decrypt_exec):
(file_decrypt_decrypt):
(file_decrypt): Remove because they're not used anymore
* filemenu.h: Removed the prototypes of the functions removed from
filemenu.c
* gtktools.h (gpa_widget_set_centered):
* gtktools.c (gpa_widget_set_centered): Removed. Use
gpa_window_show_centered instead
* gtktools.c (gpa_window_passphrase):
(gpa_window_message):
* helpmenu.c (help_license): Use gpa_window_show_centered instead
of gpa_widget_set_centered.
* gtktools.h (gpa_widget_show):
* gtktools.c (gpa_widget_show): Removed. Use
gpa_window_show_centered instead
* encryptdlg.c (gpa_file_encrypt_dialog_run):
* fileman.c (show_file_detail):
* filemenu.c (file_showDetail):
(file_sign_dialog):
(file_encrypt_detail):
(file_encrypt_dialog):
(file_protect_dialog):
(file_decryptAs):
* filesigndlg.c (gpa_file_sign_dialog_run):
* gtktools.c (gpa_window_error):
* keyexportdlg.c (key_export_dialog_run):
* keyreceivedlg.c (key_receive_run_dialog):
* keysmenu.c (keys_export_dialog):
(keys_openPublic_editTrust):
(keys_openPublic_editKey):
(keys_openPublic_receive):
(keys_openPublic_exportTrust):
(keys_openPublic):
(keys_openSecret_editKey):
(keys_openSecret):
(keys_generateKey):
(keys_generateRevocation):
(keys_import):
(keys_importOwnertrust):
* optionsmenu.c (options_keyserver):
(options_recipients):
(options_key):
(options_tips):
Call gpa_window_show_centered instead of gpa_widget_show
* keygendlg.c (gpa_key_gen_run_dialog): Remove the commented out
gpa_widget_show call
* keyring.c (keyring_editor_edit_trust): Removed because its now
replaced by the key edit dialog.
* keygenwizard.c (gpa_keygen_wizard_destroy):
(gpa_keygen_wizard_run): Add a destroy event handler and quit the
recursive main loop there.
(gpa_keygen_wizard_close): Instead of quitting the main loop,
destroy the dialog window. Also, use the correct prototype.
* keysigndlg.c (gpa_key_sign_run_dialog): Make sure dialog.result
is set to FALSE by default.
2001-01-30 Bernhard Herzog <bh@intevation.de>
* keysigndlg.c (key_sign_destroy):
(gpa_key_sign_run_dialog): Add a destroy event handler and quit
the recursive main loop there.
(key_sign_cancel):
(key_sign_ok): Instead of quitting the main loop, destroy the
dialog window.
(key_sign_delete): Removed because the default handler does
exactly what we need now.
(GPAKeySignDialog):
(key_sign_ok): Remove the clist_keys field completely and don't
access it in key_sign_ok.
* ownertrustdlg.c (ownertrust_ok):
(ownertrust_cancel): Fix comments
* passphrasedlg.c (passphrase_destroy):
(gpa_passphrase_run_dialog): Add a destroy event handler and quit
the recursive main loop there.
(passphrase_ok):
(passphrase_cancel): Instead of quitting the main loop, destroy
the dialog window.
(passphrase_delete_event): Removed because the default handler
does exactly what we need now.
(gpa_passphrase_run_dialog): use gtk_window_set_modal to get a
modal dialog and focus the password entry widget
(GPAPassphraseDialog): Add the window field to pass the dialog
window into the callbacks.
* ownertrustdlg.c: Add comments
(ownertrust_ok):
(ownertrust_cancel): Destroy the dialog window
(gpa_ownertrust_run_dialog):
(ownertrust_destroy): Add a destroy event handler and quit the
recursive main loop there.
(ownertrust_delete_event): Removed because the default handler
does exactly what we need now.
(gpa_ownertrust_run_dialog): Use gpa_window_show_centered instead
of gpa_widget_show and use gtk_window_set_modal to get a modal
dialog
* keyeditdlg.c (gpa_key_edit_dialog_run):
(key_edit_destroy): Add a destroy event handler and quit the
recursive main loop there.
(key_edit_close): Destroy the dialog window. Quitting the mainloop
is now handled in the destroy callback.
(key_edit_delete_event): Removed because the default handler does
exactly what we need now.
* keyeditdlg.h:
* keyeditdlg.c: New files implementing the key edit dialog (still
incomplete, though)
* Makefile.am (gpa_SOURCES): Add the edit dialog files
* keyring.c (toolbar_edit_key): Run the key edit dialog
2001-01-26 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_new): Initialize the status bar
properly
* gpa.c (gpa_update_default_key): If the default key is not set
yet, set it to (an approximation of) gpg's default key.
(gpa_determine_default_key): Make it static. It's better to use
gpa_update_default_key now.
* gpa.h: Update the prototypes accordingly.
* gpa.c (main):
* keyring.c (keyring_editor_generate_key_simple):
(keyring_editor_generate_key_advanced):
Use gpa_update_default_key instead of gpa_determine_default_key
* keyring.c (keyring_editor_mapped): Fix a typo
(keyring_statusbar_new): new function to create a status bar
showing the default key
(GPAKeyringEditor): Add the labels of the status bar.
(keyring_update_status_bar): New function to update the status bar
whenever the default key changes.
(keyring_editor_new): Add the status bar.
* gpa.h: Add the prototypes for gpa_get_keyring_editor and
gpa_get_filenamager
* gpa.c (gpa_default_key_changed_marshal):
(gpa_create_default_key_signal):
(gpa_emit_default_key_changed): New functions to implement a user
signal "gpa_default_key_changed" for GtkWindows that is emit on
all toplevel windows whenever the default key changes.
(main): Initialize the user signal
(gpa_set_default_key): Emit the new signal when the key changes.
(gpa_get_keyring_editor): New function to return the keyring
editor window
(gpa_get_filenamager): New function to return the filemanager
editor window
* keyring.c (keyring_editor_new): Remove the close button.
2001-01-25 Bernhard Herzog <bh@intevation.de>
* filemenu.c:
* gtktools.c:
* helpmenu.c:
* keysmenu.c:
* optionsmenu.c: Replace all those silly _("") with ""
2001-01-25 Jan-Oliver Wagner <jan@intevation.de>
* simple-gettext.c (get_string): removed ISO-8859-1 to IBM-CP-850
conversion (assuming .mo file is adequately encoded)
2001-01-24 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_update_signatures_page): Don't list the self
signaturs in simplified UI mode.
* siglist.c: Add some comments
* siglist.h:
* siglist.c (gpa_siglist_set_signatures): Add a key_id parameter
to filter out signatures of a given key. Useful to hide the self
signatures of keys.
* keyring.c (keyring_editor_new): Make the scrollbars of the
keylist appear automatically.
(keyring_editor_new): Put the keylist and the details notebook
into a paned window so that users can allocate the vertical space
for the widgets. Clean up the code a bit, too.
* Makefile.am (gpa_SOURCES):
* siglist.h:
* siglist.c: New files implementing the list of signatures in the
keying editor.
* keyring.c (keyring_details_notebook): Add the signatures page
(keyring_update_signatures_page): New function to update the
signatures page
(keyring_selection_update_widgets): Update the signatures page
too.
(GPAKeyringEditor): Add the signatures list widget
* keylist.c: Remove some uneeded includes
* keylist.c (keylist_fill_list): Try to keep the current selection
if the new keep_selection parameter is TRUE.
(gpa_keylist_update_list): Keep the current selection.
* keyring.c (keylist_columns_detailed):
(keylist_columns_brief): Put the name at the end.
* keylist.c (gpa_keylist_update_list): Make all columns have the
optimal width.
(gpa_keylist_new): Use gpa_keylist_update_list to fill the keylist
and create the title buttons, so that the columns havethe optimal
width.
2001-01-23 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_toolbar_new): Add buttons for brief and
detailed listing.
(keyring_set_brief_listing):
(keyring_set_detailed_listing): New. Signal handlers for the diref
and detailed listing buttons of the toolbar.
(keylist_columns_detailed):
(keylist_columns_brief): Definitions of the brief and detailed key
listing.
(keyring_editor_new): Use keylist_columns_brief to initialize the
key list
(add_details_row):
(keyring_details_notebook):
(keyring_update_details_page): Turn the fingerprint label in the
details notebook into an uneditable entry field so that users can
copy and paste the fingerprint. To that end add a new parameter to
add_details_row to indicate whether a label or entry is to be
created.
* keylist.c (keylist_fill_column_titles): Set the first
keylist->ncolumns to visible.
2001-01-23 Jan-Oliver Wagner <jan@intevation.de>
* simple-gettext.c: (new) "simple gettext method for
Windows (copied from gnupg
* Makefile.am: added simple-gettext
2001-01-23 Bernhard Herzog <bh@intevation.de>
* Makefile.am (gpa_SOURCES): Add the keylist files.
* keylist.h:
* keylist.c: New files implementing the key list of the key ring
editor.
* keyring.c (keyring_editor_new):
(keyring_editor_edit_trust):
(keyring_editor_delete):
(keyring_editor_sign):
(keyring_editor_export): replace the CList of the keys with the
keylist of keylist.c and modify all functions that use it to use
the appropriate functions of keylist.c
(keyring_editor_has_selection):
(keyring_editor_has_single_selection):
(keyring_editor_fill_keylist):
(keyring_editor_current_key_id):
(keyring_editor_current_key):
These function are now just frontends for the corresponding
functions in keylist.c
2001-01-23 Jan-Oliver Wagner <jan@intevation.de>
* w32reg: new module copied from gnupg
Access to Windows Registry
* Makefile.am: added w32reg
* gpa.c (main): now reads from Registry under Windows
2001-01-22 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_delete): Ask for confirmation before
deleting keys.
2001-01-19 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_can_sign): Check whether the default
has already signed the selected key and return FALSE in that case.
(keyring_editor_current_key_id): New function that returns the id
of the currently selected key.
* gpa.c (main): Read the gtkrc file
* Makefile.am: Add the gtkrc file
* gtkrc: New file with GTK style defaults
* keyring.c (keyring_editor_selection_changed):
(keyring_editor_end_selection):
(keyring_editor_fill_keylist):
(keyring_editor_menubar_new): make them static
(add_selection_sensitive_widget): Add the callback as a new
parameter.
(GPA_SENSITIVE_BUTTON): Get rid of this widget and use
add_selection_sensitive_widget.
(keyring_editor_new): Add a notebook showing details of the
selected key and a toolbar at the top which replaces the buttons
at the bottom
(GPAKeyringEditor): Add three new fields for the labels of the
details view.
(keyring_toolbar_new): New function to create the new toolbar
(toolbar_import_keys):
(toolbar_export_key):
(toolbar_sign_key):
(toolbar_remove_key):
(toolbar_edit_key): Signal handlers for the toolbar.
(add_details_row):
(keyring_details_notebook):
(keyring_update_details_page): New functions to create and update
the new details notebook.
(keyring_editor_current_key): New function to return the currently
selected key.
(keyring_selection_update_widgets): New function that bundles all
the updates that have to happen when the selection changes. Change
the relevant signal handlers to use it.
(keyring_editor_fill_keylist): The "show ownertrust" button is
unavailable for now, so assume that it's not checked by default,
just to make it work without the button.
(keyring_editor_delete): Check for the existence of a private key
and delete that first if it exists.
* keyring.c: Substantial code reorganization
2001-01-18 Bernhard Herzog <bh@intevation.de>
* gpa.c (cmd_and_opt_values):
(opts):
(main):
Rename the option simplified-ui to advanced-ui and
reverse its meaning. The simplified UI is now the default.
* keyring.c (keyring_editor_menubar_new): Add ... to "generate
key" because it pops up a dialog
2001-01-17 Bernhard Herzog <bh@intevation.de>
* keyring.c (keyring_editor_can_sign): Change the condition.
Signing is possible when at least one key is selected and there is
a default key.
(keyring_editor_generate_key_simple):
(keyring_editor_generate_key_advanced): Update the default key and
make sure all potentially sensitive widgets are updated.
* keysigndlg.h (gpa_key_sign_run_dialog): Update the parameter
list.
* keysigndlg.c (gpa_key_sign_run_dialog): Remove the list box with
the secret keys and the key_id paramter because we assume the
selected keys are always signed with the default key. Also, in
simplified ui mode, don't show the "sign locally" check box and
set dialog.check_local to NULL.
(key_sign_ok): Check whether dialog->check_local is NULL, i.e.
whether the dialog was created in simplified ui mode, before
retrieving the value. If it's NULL, set sign_type to normal.
(struct _GPAKeySignDialog): remove the key_id field and update all
users.
* keyring.c (keyring_editor_sign): Change default sign type to
normal which is probably better for the simplified UI mode. Also,
private_key_id is the default key now, because it's not a retrun
value of the key sign dialog anymore.
* gpa.c (gpa_determine_default_key): New function to guess a
useful default key.
(main): Use gpa_determine_default_key to initialize the default
key.
* gtktools.c (gpa_window_error): Make the messenger parameter
optional, i.e. it may be NULL now, so that gpa_callback can be
used with NULL as calldata.
* gpa.h:
* gpa.c: Turn the definition of opt in gpa.h into an extern
declaration and define it in gpa.c. Rename it to gpa_options. Fix
all references to it. Introduce a typedef for the struct.
* keysigndlg.h:
* keysigndlg.c (gpa_key_sign_run_dialog): Add the key to be signed
to the parameter list and display its user id and fingerprint.
* keyring.c (keyring_editor_generate_key_advanced): Do some error
checking after generating the key pair.
(keyring_editor_sign): Run the keysing dialog for each selected
key separately
2001-01-16 Bernhard Herzog <bh@intevation.de>
* filemenu.c (file_sign_dialog):
* gpawidgets.c (gpa_secret_key_list_new):
* optionsmenu.c (gpa_loadOptionsSelect_ok):
(gpa_saveOptionsSelect_ok):
(options_key_set):
(options_key): Use gpa_default_key and gpa_set_default_key instead
of accessing global_defaultKey directly.
* gpa.h: Add the two new functions gpa_default_key
gpa_set_default_key
* gpa.c (global_defaultKey):
(gpa_default_key):
(gpa_set_default_key): Turn global_defaultKey into a static
varible default_key and introduce gpa_set_default_key and
gpa_default_key to set and get its value
* gpa.c (gpa_popupMenu_init):
(global_popupMenu) Removed because they're no longer used.
* gpa.h: Removed global_tempWindows
* gpa.c:
* gpawindowkeeper.c:
Moved global_tempWindows to gpawindowkeeper as it's only used
there, made it static and renamed it to tempWindows because it's
not a global variable anymore.
2001-01-15 Bernhard Herzog <bh@intevation.de>
* keygenwizard.c (gpa_keygen_wizard_final_page):
Fix typo
* keyring.c: Add and update comments
(keyring_editor_can_sign): New function. Sensitivity callback for
the sign key button.
* keyring.c (keyring_editor_generate_key):
(keyring_editor_generate_key_advanced): Renamed
keyring_editor_generate_key to
keyring_editor_generate_key_advanced.
(keyring_editor_generate_key_simple): New function to call the key
generation wizard
(keyring_editor_generate_key): New function. Depending on the
simple_ui flag call either keyring_editor_generate_key_advanced or
keyring_editor_generate_key_simple
(keyring_editor_mapped): New function. Signal handler handler for
the map signal. If the simple_ui flag is set and no private key
is in the keyring, suggest creating a new keypair.
(keyring_editor_new): Connect to the map signal
* gpawizard.c:
* gpawizard.h:
New files implementing a simple generic wizard interface
* keygenwizard.h:
* keygenwizard.c:
New files implementing the key generation wizard
* Makefile.am: Add the new files.
* keygendlg.c (gpa_key_gen_run_dialog): Connect to delete-event
and use the new gpa_window_show_centered function.
* gtktools.h: Update the prototype of gpa_button_set_text and add
the new message box functions
* gtktools.c (gpa_button_set_text): Handle accelerators
(message_box_delete):
(message_box_clicked):
(gpa_message_box_run):
New functions implementing a flexible message box with caller
definable buttons.
* gpa.h: Add the prototypes for gpa_simplified_ui and
gpa_set_simplified_ui
* gpa.c (opts):
(cmd_and_opt_values)
Add a new option "simplified-ui" to turn on the simplified interface
(gpa_simplified_ui):
(gpa_set_simplified_ui):
New functions to read and set the simplified ui flag
(main): handle the simplified ui option in argument parsing
2001-01-11 Bernhard Herzog <bh@intevation.de>
* keysigndlg.c (gpa_key_sign_run_dialog):
(key_sign_delete): Add signal handler for the delete-event signal.
(gpa_key_sign_run_dialog): Use gpa_window_show_centered instead of
gpa_widget_show
* passphrasedlg.c
Add some comments
(gpa_passphrase_run_dialog): The handler for the
delete-event expected to be connected with gtk_signal_connect not
with gtk_signal_connect_object.
Use the new gpa_window_show_centered function
(passphrase_delete_event): Return FALSE to indicate that the
window is to be closed.
* gtktools.c (gpa_window_show_centered): Make it actually work.
2001-01-10 Bernhard Herzog <bh@intevation.de>
* gtktools.c (gpa_window_show_centered): Removed the debug
printf()s
2001-01-09 Bernhard Herzog <bh@intevation.de>
* gtktools.c (gpa_window_show_centered): New function. This is a
better way to center windows and it should replace
gpa_widget_set_centered one day.
(gpa_window_error): Use the new gpa_window_show_centered instead
of gpa_widget_show
(gpa_button_set_text): New function to update the text of a button
widget
* gtktools.h: Add the two new function in gtktools.c
* gpa.c (evalMouseClistFile):
(gpa_menubar_new):
(delete_event):
(evalKeyClistFile):
Removed because they're no longer used
* keyexportdlg.c (key_export_dialog_run):
get rid of the gpa_space_new () call
2001-01-05 Bernhard Herzog <bh@intevation.de>
* encryptdlg.c
* encryptdlg.h
* fileman.c
* fileman.h
* filesigndlg.c
* filesigndlg.h
* gpapastrings.c
* gpapastrings.h
* gpawidgets.c
* gpawidgets.h
* help.h
* keyexportdlg.c
* keyexportdlg.h
* keygendlg.c
* keygendlg.h
* keyreceivedlg.c
* keyreceivedlg.h
* keyring.c
* keyring.h
* keysigndlg.c
* keysigndlg.h
* ownertrustdlg.c
* ownertrustdlg.h
* passphrasedlg.c
* passphrasedlg.h
* tipwindow.c
new files
* filemenu.c:
* gpa.c:
* gpa.h:
* gtktools.c:
* gtktools.h:
* help.c:
* helpmenu.c:
* helpmenu.h:
* optionsmenu.c:
* optionsmenu.h:
A lot of changes and reorganization of the code. Much of the code
is now in the new files.
The reorganization has two goals:
1. Change the user interface to make the keyring editor the main
window.
2. Internal changes to make the code more object oriented and more
maintainable.
The changes are very extensive and touch practically all parts of
the UI code.
* Makefile.am: Added the new files
2000-09-01 Werner Koch <wk@gnupg.org>
* icons.c, icons.h: New. Changed all other includes of icons.xpm
to icons.h.
* gpa.c (gpa_file_toolbar_new): Use this new function here.
* gtktools.c (gpa_xpm_label_box): Ditto
* keysmenu.c (getIconNameForOwnertrust): Replaces
getIconForOwnertrust. Chnaged all callers to provide a string now.
2000-08-17 Werner Koch <wk@gnupg.org>
* gpa.c (i18n_init,main): Fixed locale setting as suggested by
Clive Lin.
2000-07-25 09:02:34 Werner Koch (wk@habibti.openit.de)
* gpa.c (gpa_windowTips_show): Moved from here to ...
* help.c: ... here. Complete rewrote to read the tips rom a file.
(get_language): New.
(gpa_tips.en, gpa_tips.de): New.
2000-06-28 17:23:03 Werner Koch (wk@habibti.openit.de)
* gpa.c: Removed the --tooltip-kludge option, becuase the bug as
been fixed meanwhile.
* gtktools.c (gpa_widget_show): Removed it here too.
2000-06-28 15:32:07 Jan-Oliver Wagner (jan@intevation.de)
* gtktools.c (gpa_widget_set_centered): fixed minimization bug
* icons.xpm: replaced temporary icons and added ownertrust icons
* keysmenu.c: added icon to button 'sign' in public keyring editor dialog,
added ownertrust icons in keylist of public keyring editor dialog
2000-06-23 16:05:04 Jan-Oliver Wagner (jan@intevation.de)
* keysmenu.c: added icon to the delete button in the
public keyring editor dialog
2000-06-23 16:00:53 Jan-Oliver Wagner (jan@intevation.de)
* icons.xpm: added a trashcan (taken from KDE)
2000-06-23 10:11:02 Jan-Oliver Wagner (jan@intevation.de)
* icons.xpm: test icons for tool bar added
2000-06-23 10:10:44 Jan-Oliver Wagner (jan@intevation.de)
* gpa.c: test icons for tool bar added, seldom actions removed from toolbar
2000-06-22 13:27:35 Jan-Oliver Wagner (jan@intevation.de)
* icons.xpm: new file, contains icon xpm's. Just tempory until
icons are treated in a more convenient way.
2000-06-20 16:45:31 Jan-Oliver Wagner (jan@intevation.de)
* gpa.c: added toolbar for main window - experimental stage, but functioning
2000-05-25 17:54:29 Werner Koch (wk@habibti.openit.de)
* gpa.c (main): Add a call to gpapa_init
New option --gpg-program.
2000-05-24 10:01:06 Werner Koch (wk@habibti.openit.de)
* gpa.c (gpa_menubar_new): Reformated menu list.
* helpmenu.c (help_version): renamed to ...
(help_about): .. this and implemented.
* gpa.c, gpa.h (namesKeyservers): Replaced by ..
(main): ... opt.keyserver_names and malloced array.
* optionsmenu.c (options_keyserver): Put all keyservers into the list.
* gtktools.c (gpa_widget_show): Kludge for Sawmill and Windowmaker.
2000-05-16 19:57:28 Werner Koch (wk@habibti.openit.de)
Ran "indent -gnu -sc" on all source files.
2000-05-04 18:40:08 Werner Koch (wk@habibti.openit.de)
* *.c: Moved all gpa_widget_set_centered() before the
gtk_widget_show_all(), so that the windows are displayed correctly.
2000-05-02 19:57:29 Werner Koch (wk@habibti.openit.de)
* gpa.c, keymenu.c, filemenu.c: Removed libiberty header.
* gpa.h: Included xmalloc header.
diff --git a/src/Makefile.am b/src/Makefile.am
index 18f3d71..633603a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,62 +1,63 @@
## Process this file with automake to produce Makefile.in
tip_files = gpa_tips.en gpa_tips.de
logo = gpa_logo.ppm
pkgdata_DATA = $(tip_files) $(logo)
EXTRA_DIST = $(tip_files) $(logo)
bin_PROGRAMS = gpa
INCLUDES = -I$(top_srcdir)/intl -I$(top_srcdir)/pixmaps
LDADD = @INTLLIBS@
gpa_SOURCES = gpa.c gpa.h i18n.h options.h \
gpawindowkeeper.c gpawindowkeeper.h \
gtktools.c gtktools.h \
helpmenu.c helpmenu.h \
icons.c icons.h \
gpawidgets.c gpawidgets.h \
fileman.c fileman.h \
filesigndlg.c filesigndlg.h \
encryptdlg.c encryptdlg.h \
verifydlg.c verifydlg.h \
keyring.c keyring.h \
ownertrustdlg.c ownertrustdlg.h \
keysigndlg.c keysigndlg.h \
keyimportdlg.c keyimportdlg.h \
keyexportdlg.c keyexportdlg.h \
keygendlg.c keygendlg.h \
keygenwizard.c keygenwizard.h \
qdchkpwd.c qdchkpwd.h \
keyeditdlg.c keyeditdlg.h \
expirydlg.c expirydlg.h \
keydeletedlg.c keydeletedlg.h \
keylist.c keylist.h \
siglist.c siglist.h \
gpawizard.c gpawizard.h \
gpapastrings.c gpapastrings.h\
gpa_license.c gpa_license.h \
keyserver.c keyserver.h \
w32reg.c w32reg.h \
simple-gettext.c \
hidewnd.c hidewnd.h \
keytable.c keytable.h \
gpgmetools.h gpgmetools.c \
gpgmeedit.h gpgmeedit.c \
server_access.h server_access.c \
settingsdlg.h settingsdlg.c \
passwddlg.h passwddlg.c \
gpacontext.h gpacontext.c \
gpaprogressdlg.h gpaprogressdlg.c \
gpaoperation.h gpaoperation.c \
gpafileop.h gpafileop.c \
gpafiledecryptop.h gpafiledecryptop.c \
gpafileencryptop.h gpafileencryptop.c \
gpafilesignop.h gpafilesignop.c \
gpafileverifyop.h gpafileverifyop.c \
gpakeyop.h gpakeyop.c \
gpakeydeleteop.h gpakeydeleteop.c \
+ gpakeysignop.h gpakeysignop.c \
gpakeyselector.h gpakeyselector.c \
options.c gpa.rc
diff --git a/src/gpakeysignop.c b/src/gpakeysignop.c
new file mode 100644
index 0000000..c2969ca
--- /dev/null
+++ b/src/gpakeysignop.c
@@ -0,0 +1,256 @@
+/* gpakeysignop.c - The GpaKeySignOperation object.
+ * Copyright (C) 2003, Miguel Coca.
+ *
+ * This file is part of GPA
+ *
+ * GPA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GPA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <glib.h>
+
+#ifdef G_OS_UNIX
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#else
+#include <io.h>
+#endif
+
+#include "gpa.h"
+#include "gpakeysignop.h"
+#include "keysigndlg.h"
+#include "gpgmeedit.h"
+#include "gtktools.h"
+
+/* Internal functions */
+static gboolean gpa_key_sign_operation_idle_cb (gpointer data);
+static void gpa_key_sign_operation_done_error_cb (GpaContext *context,
+ gpg_error_t err,
+ GpaKeySignOperation *op);
+static void gpa_key_sign_operation_done_cb (GpaContext *context,
+ gpg_error_t err,
+ GpaKeySignOperation *op);
+
+/* GObject */
+
+static GObjectClass *parent_class = NULL;
+
+static void
+gpa_key_sign_operation_finalize (GObject *object)
+{
+ GpaKeySignOperation *op = GPA_KEY_SIGN_OPERATION (object);
+ if (op->signer_key)
+ {
+ gpgme_key_unref (op->signer_key);
+ }
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+
+
+static void
+gpa_key_sign_operation_init (GpaKeySignOperation *op)
+{
+ op->signer_key = NULL;
+ op->signed_keys = 0;
+}
+
+static GObject*
+gpa_key_sign_operation_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties)
+{
+ GObject *object;
+ GpaKeySignOperation *op;
+
+ /* Invoke parent's constructor */
+ object = parent_class->constructor (type,
+ n_construct_properties,
+ construct_properties);
+ op = GPA_KEY_SIGN_OPERATION (object);
+ /* Initialize */
+
+ /* Connect to the "done" signal */
+ g_signal_connect (G_OBJECT (GPA_OPERATION (op)->context), "done",
+ G_CALLBACK (gpa_key_sign_operation_done_error_cb), op);
+ g_signal_connect (G_OBJECT (GPA_OPERATION (op)->context), "done",
+ G_CALLBACK (gpa_key_sign_operation_done_cb), op);
+ /* Start with the first key after going back into the main loop */
+ g_idle_add (gpa_key_sign_operation_idle_cb, op);
+
+ return object;
+}
+
+static void
+gpa_key_sign_operation_class_init (GpaKeySignOperationClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->constructor = gpa_key_sign_operation_constructor;
+ object_class->finalize = gpa_key_sign_operation_finalize;
+}
+
+GType
+gpa_key_sign_operation_get_type (void)
+{
+ static GType key_sign_operation_type = 0;
+
+ if (!key_sign_operation_type)
+ {
+ static const GTypeInfo key_sign_operation_info =
+ {
+ sizeof (GpaKeySignOperationClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) gpa_key_sign_operation_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GpaKeySignOperation),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gpa_key_sign_operation_init,
+ };
+
+ key_sign_operation_type = g_type_register_static
+ (GPA_KEY_OPERATION_TYPE, "GpaKeySignOperation",
+ &key_sign_operation_info, 0);
+ }
+
+ return key_sign_operation_type;
+}
+
+/* API */
+
+/* Creates a new key deletion operation.
+ */
+GpaKeySignOperation*
+gpa_key_sign_operation_new (GtkWidget *window, GList *keys)
+{
+ GpaKeySignOperation *op;
+
+ op = g_object_new (GPA_KEY_SIGN_OPERATION_TYPE,
+ "window", window,
+ "keys", keys,
+ NULL);
+
+ return op;
+}
+
+/* Internal */
+
+static gboolean
+gpa_key_sign_operation_start (GpaKeySignOperation *op)
+{
+ gpgme_key_t key = gpa_key_operation_current_key (GPA_KEY_OPERATION (op));
+ gboolean sign_locally = FALSE;
+
+ if (gpa_key_sign_run_dialog (GPA_OPERATION (op)->window, key, &sign_locally))
+ {
+ gpg_error_t err;
+ err = gpa_gpgme_edit_sign_start (GPA_OPERATION(op)->context, key,
+ op->signer_key, sign_locally);
+ if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
+ {
+ gpa_gpgme_warning (err);
+ return FALSE;
+ }
+ }
+ else
+ {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static gboolean
+gpa_key_sign_operation_idle_cb (gpointer data)
+{
+ GpaKeySignOperation *op = data;
+
+ /* Get the signer key and abort if there isn't one */
+ op->signer_key = gpa_options_get_default_key (gpa_options_get_instance ());
+ if (!op->signer_key)
+ {
+ gpa_window_error (_("No private key for signing."),
+ GPA_OPERATION (op)->window);
+ g_signal_emit_by_name (GPA_OPERATION (op), "completed");
+ return FALSE;
+ }
+ gpgme_key_ref (op->signer_key);
+
+ if (!gpa_key_sign_operation_start (op))
+ {
+ g_signal_emit_by_name (GPA_OPERATION (op), "completed");
+ }
+
+ return FALSE;
+}
+
+static void
+gpa_key_sign_operation_next (GpaKeySignOperation *op)
+{
+ if (!GPA_KEY_OPERATION (op)->current ||
+ !gpa_key_sign_operation_start (op))
+ {
+ if (op->signed_keys > 0)
+ {
+ g_signal_emit_by_name (GPA_OPERATION (op), "changed_wot");
+ }
+ g_signal_emit_by_name (GPA_OPERATION (op), "completed");
+ }
+}
+
+static void gpa_key_sign_operation_done_error_cb (GpaContext *context,
+ gpg_error_t err,
+ GpaKeySignOperation *op)
+{
+ switch (gpg_err_code (err))
+ {
+ case GPG_ERR_NO_ERROR:
+ op->signed_keys++;
+ case GPG_ERR_CANCELED:
+ /* Ignore these */
+ break;
+ case GPG_ERR_BAD_PASSPHRASE:
+ gpa_window_error (_("Wrong passphrase!"), GPA_OPERATION (op)->window);
+ break;
+ case GPG_ERR_UNUSABLE_PUBKEY:
+ /* Couldn't sign because the key was expired */
+ gpa_window_error (_("This key has expired! "
+ "Unable to sign."), GPA_OPERATION (op)->window);
+ break;
+ case GPG_ERR_CONFLICT:
+ gpa_window_error (_("This key has already been signed with "
+ "your own!"), GPA_OPERATION (op)->window);
+ break;
+ case GPG_ERR_NO_SECKEY:
+ /* Couldn't sign because there is no default key */
+ gpa_window_error (_("You haven't selected a default key "
+ "to sign with!"), GPA_OPERATION (op)->window);
+ break;
+ default:
+ gpa_gpgme_warning (err);
+ break;
+ }
+}
+
+static void gpa_key_sign_operation_done_cb (GpaContext *context,
+ gpg_error_t err,
+ GpaKeySignOperation *op)
+{
+ GPA_KEY_OPERATION (op)->current = g_list_next
+ (GPA_KEY_OPERATION (op)->current);
+ gpa_key_sign_operation_next (op);
+}
diff --git a/src/gpakeysignop.h b/src/gpakeysignop.h
new file mode 100644
index 0000000..8c1904e
--- /dev/null
+++ b/src/gpakeysignop.h
@@ -0,0 +1,61 @@
+/* gpakeysignop.h - The GpaKeySignOperation object.
+ * Copyright (C) 2003, Miguel Coca.
+ *
+ * This file is part of GPA
+ *
+ * GPA is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GPA is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef GPA_KEY_SIGN_OP_H
+#define GPA_KEY_SIGN_OP_H
+
+#include <glib.h>
+#include <glib-object.h>
+#include "gpa.h"
+#include "gpakeyop.h"
+#include "keysigndlg.h"
+
+/* GObject stuff */
+#define GPA_KEY_SIGN_OPERATION_TYPE (gpa_key_sign_operation_get_type ())
+#define GPA_KEY_SIGN_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GPA_KEY_SIGN_OPERATION_TYPE, GpaKeySignOperation))
+#define GPA_KEY_SIGN_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GPA_KEY_SIGN_OPERATION_TYPE, GpaKeySignOperationClass))
+#define GPA_IS_KEY_SIGN_ENCRYPT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GPA_KEY_SIGN_OPERATION_TYPE))
+#define GPA_IS_KEY_SIGN_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GPA_KEY_SIGN_OPERATION_TYPE))
+#define GPA_KEY_SIGN_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GPA_KEY_SIGN_OPERATION_TYPE, GpaKeySignOperationClass))
+
+typedef struct _GpaKeySignOperation GpaKeySignOperation;
+typedef struct _GpaKeySignOperationClass GpaKeySignOperationClass;
+
+struct _GpaKeySignOperation {
+ GpaKeyOperation parent;
+
+ gpgme_key_t signer_key;
+ int signed_keys;
+};
+
+struct _GpaKeySignOperationClass {
+ GpaKeyOperationClass parent_class;
+};
+
+GType gpa_key_sign_operation_get_type (void) G_GNUC_CONST;
+
+/* API */
+
+/* Creates a new key deletion operation.
+ */
+GpaKeySignOperation*
+gpa_key_sign_operation_new (GtkWidget *window, GList *keys);
+
+#endif
diff --git a/src/gpgmeedit.c b/src/gpgmeedit.c
index 5d50c91..efbdec9 100644
--- a/src/gpgmeedit.c
+++ b/src/gpgmeedit.c
@@ -1,823 +1,865 @@
/* gpgmetools.c - The GNU Privacy Assistant
* Copyright (C) 2002, Miguel Coca.
*
* This file is part of GPA
*
* GPA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GPA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "gpgmeedit.h"
#include "passwddlg.h"
#include <unistd.h>
/* The edit callback for all the edit operations is edit_fnc(). Each
* operation is modelled as a sequential machine (a Moore machine, to be
* precise). Therefore, for each operation you must write two functions.
*
* One of them is "action" or output function, that chooses the right value
* for *result (the next command issued in the edit command line) based on
* the current state. The other is the "transit" function, which chooses
* the next state based on the current state and the input (status code and
* args).
*
* See the comments below for details.
*/
/* Prototype of the action function. Returns the error if there is one */
typedef gpg_error_t (*EditAction) (int state, void *opaque,
char **result);
/* Prototype of the transit function. Returns the next state. If and error
* is found changes *err. If there is no error it should NOT touch it */
typedef int (*EditTransit) (int current_state, gpgme_status_code_t status,
const char *args, void *opaque, gpg_error_t *err);
/* Data to be passed to the edit callback. Must be filled by the caller of
* gpgme_op_edit() */
struct edit_parms_s
{
/* Current state */
int state;
/* Last error: The return code of gpgme_op_edit() is the return value of
* the last invocation of the callback. But returning an error from the
* callback does not abort the edit operation, so we must remember any
* error. In other words, errors from action() or transit() are sticky.
*/
gpg_error_t err;
/* The action function */
EditAction action;
/* The transit function */
EditTransit transit;
+ /* The output data object */
+ gpgme_data_t out;
+ /* Signal attachment id */
+ gulong signal_id;
/* Data to be passed to the previous functions */
void *opaque;
};
/* The edit callback proper */
static gpg_error_t
edit_fnc (void *opaque, gpgme_status_code_t status,
const char *args, int fd)
{
struct edit_parms_s *parms = opaque;
char *result = NULL;
/* Ignore these status lines, as they don't require any response */
if (status == GPGME_STATUS_EOF ||
status == GPGME_STATUS_GOT_IT ||
status == GPGME_STATUS_NEED_PASSPHRASE ||
status == GPGME_STATUS_NEED_PASSPHRASE_SYM ||
status == GPGME_STATUS_GOOD_PASSPHRASE ||
status == GPGME_STATUS_BAD_PASSPHRASE ||
status == GPGME_STATUS_USERID_HINT ||
status == GPGME_STATUS_SIGEXPIRED ||
status == GPGME_STATUS_KEYEXPIRED)
{
return parms->err;
}
/* Choose the next state based on the current one and the input */
parms->state = parms->transit (parms->state, status, args, parms->opaque,
&parms->err);
if (gpg_err_code (parms->err) == GPG_ERR_NO_ERROR)
{
gpg_error_t err;
/* Choose the action based on the state */
err = parms->action (parms->state, parms->opaque, &result);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
parms->err = err;
}
/* Send the command, if any was provided */
if (result)
{
write (fd, result, strlen (result));
write (fd, "\n", 1);
}
}
return parms->err;
}
/* Change expiry time */
typedef enum
{
EXPIRE_START,
EXPIRE_COMMAND,
EXPIRE_DATE,
EXPIRE_QUIT,
EXPIRE_SAVE,
EXPIRE_ERROR
} ExpireState;
static gpg_error_t
edit_expire_fnc_action (int state, void *opaque, char **result)
{
gchar *date = opaque;
switch (state)
{
/* Start the operation */
case EXPIRE_COMMAND:
*result = "expire";
break;
/* Send the new expire date */
case EXPIRE_DATE:
*result = date;
break;
/* End the operation */
case EXPIRE_QUIT:
*result = "quit";
break;
/* Save */
case EXPIRE_SAVE:
*result = "Y";
break;
/* Special state: an error ocurred. Do nothing until we can quit */
case EXPIRE_ERROR:
break;
/* Can't happen */
default:
return gpg_error (GPG_ERR_GENERAL);
}
return gpg_error (GPG_ERR_NO_ERROR);
}
static int
edit_expire_fnc_transit (int current_state, gpgme_status_code_t status,
const char *args, void *opaque, gpg_error_t *err)
{
int next_state;
switch (current_state)
{
case EXPIRE_START:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = EXPIRE_COMMAND;
}
else
{
next_state = EXPIRE_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case EXPIRE_COMMAND:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keygen.valid"))
{
next_state = EXPIRE_DATE;
}
else
{
next_state = EXPIRE_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case EXPIRE_DATE:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = EXPIRE_QUIT;
}
else
{
next_state = EXPIRE_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case EXPIRE_QUIT:
if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "keyedit.save.okay"))
{
next_state = EXPIRE_SAVE;
}
else
{
next_state = EXPIRE_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case EXPIRE_ERROR:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
/* Go to quit operation state */
next_state = EXPIRE_QUIT;
}
else
{
next_state = EXPIRE_ERROR;
}
break;
default:
next_state = EXPIRE_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
return next_state;
}
/* Change the key ownertrust */
typedef enum
{
TRUST_START,
TRUST_COMMAND,
TRUST_VALUE,
TRUST_REALLY_ULTIMATE,
TRUST_QUIT,
TRUST_SAVE,
TRUST_ERROR
} TrustState;
static gpg_error_t
edit_trust_fnc_action (int state, void *opaque, char **result)
{
gchar *trust = opaque;
switch (state)
{
/* Start the operation */
case TRUST_COMMAND:
*result = "trust";
break;
/* Send the new trust date */
case TRUST_VALUE:
*result = trust;
break;
/* Really set to ultimate trust */
case TRUST_REALLY_ULTIMATE:
*result = "Y";
break;
/* End the operation */
case TRUST_QUIT:
*result = "quit";
break;
/* Save */
case TRUST_SAVE:
*result = "Y";
break;
/* Special state: an error ocurred. Do nothing until we can quit */
case TRUST_ERROR:
break;
/* Can't happen */
default:
return gpg_error (GPG_ERR_GENERAL);
}
return gpg_error (GPG_ERR_NO_ERROR);
}
static int
edit_trust_fnc_transit (int current_state, gpgme_status_code_t status,
const char *args, void *opaque, gpg_error_t *err)
{
int next_state;
switch (current_state)
{
case TRUST_START:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = TRUST_COMMAND;
}
else
{
next_state = TRUST_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case TRUST_COMMAND:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "edit_ownertrust.value"))
{
next_state = TRUST_VALUE;
}
else
{
next_state = TRUST_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case TRUST_VALUE:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = TRUST_QUIT;
}
else if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "edit_ownertrust.set_ultimate.okay"))
{
next_state = TRUST_REALLY_ULTIMATE;
}
else
{
next_state = TRUST_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case TRUST_REALLY_ULTIMATE:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = TRUST_QUIT;
}
else
{
next_state = TRUST_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case TRUST_QUIT:
if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "keyedit.save.okay"))
{
next_state = TRUST_SAVE;
}
else
{
next_state = TRUST_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case TRUST_ERROR:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
/* Go to quit operation state */
next_state = TRUST_QUIT;
}
else
{
next_state = TRUST_ERROR;
}
break;
default:
next_state = TRUST_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
return next_state;
}
/* Sign a key */
typedef enum
{
SIGN_START,
SIGN_COMMAND,
SIGN_UIDS,
SIGN_SET_EXPIRE,
SIGN_SET_CHECK_LEVEL,
SIGN_CONFIRM,
SIGN_QUIT,
SIGN_SAVE,
SIGN_ERROR
} SignState;
struct sign_parms_s
{
gchar *check_level;
gboolean local;
};
static gpg_error_t
edit_sign_fnc_action (int state, void *opaque, char **result)
{
struct sign_parms_s *parms = opaque;
switch (state)
{
/* Start the operation */
case SIGN_COMMAND:
*result = parms->local ? "lsign" : "sign";
break;
/* Sign all user ID's */
case SIGN_UIDS:
*result = "Y";
break;
/* The signature expires at the same time as the key */
case SIGN_SET_EXPIRE:
*result = "Y";
break;
/* Set the check level on the key */
case SIGN_SET_CHECK_LEVEL:
*result = parms->check_level;
break;
/* Confirm the signature */
case SIGN_CONFIRM:
*result = "Y";
break;
/* End the operation */
case SIGN_QUIT:
*result = "quit";
break;
/* Save */
case SIGN_SAVE:
*result = "Y";
break;
/* Special state: an error ocurred. Do nothing until we can quit */
case SIGN_ERROR:
break;
/* Can't happen */
default:
return gpg_error (GPG_ERR_GENERAL);
}
return gpg_error (GPG_ERR_NO_ERROR);
}
static int
edit_sign_fnc_transit (int current_state, gpgme_status_code_t status,
const char *args, void *opaque, gpg_error_t *err)
{
int next_state;
switch (current_state)
{
case SIGN_START:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = SIGN_COMMAND;
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_COMMAND:
if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "keyedit.sign_all.okay"))
{
next_state = SIGN_UIDS;
}
else if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "sign_uid.expire"))
{
next_state = SIGN_SET_EXPIRE;
break;
}
else if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "sign_uid.class"))
{
next_state = SIGN_SET_CHECK_LEVEL;
}
else if (status == GPGME_STATUS_ALREADY_SIGNED)
{
/* The key has already been signed with this key */
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_CONFLICT);
}
else if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
/* Failed sign: expired key */
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_UNUSABLE_PUBKEY);
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_UIDS:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "sign_uid.expire"))
{
next_state = SIGN_SET_EXPIRE;
break;
}
else if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "sign_uid.class"))
{
next_state = SIGN_SET_CHECK_LEVEL;
}
else if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
/* Failed sign: expired key */
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_UNUSABLE_PUBKEY);
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_SET_EXPIRE:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "sign_uid.class"))
{
next_state = SIGN_SET_CHECK_LEVEL;
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_SET_CHECK_LEVEL:
if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "sign_uid.okay"))
{
next_state = SIGN_CONFIRM;
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_CONFIRM:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = SIGN_QUIT;
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_QUIT:
if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "keyedit.save.okay"))
{
next_state = SIGN_SAVE;
}
else
{
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case SIGN_ERROR:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
/* Go to quit operation state */
next_state = SIGN_QUIT;
}
else
{
next_state = SIGN_ERROR;
}
break;
default:
next_state = SIGN_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
return next_state;
}
/* Change passphrase */
typedef enum
{
PASSWD_START,
PASSWD_COMMAND,
PASSWD_QUIT,
PASSWD_SAVE,
PASSWD_ERROR
} PasswdState;
static gpg_error_t
edit_passwd_fnc_action (int state, void *opaque, char **result)
{
switch (state)
{
/* Start the operation */
case PASSWD_COMMAND:
*result = "passwd";
break;
/* End the operation */
case PASSWD_QUIT:
*result = "quit";
break;
/* Save */
case PASSWD_SAVE:
*result = "Y";
break;
/* Special state: an error ocurred. Do nothing until we can quit */
case PASSWD_ERROR:
break;
/* Can't happen */
default:
return gpg_error (GPG_ERR_GENERAL);
}
return gpg_error (GPG_ERR_NO_ERROR);
}
static int
edit_passwd_fnc_transit (int current_state, gpgme_status_code_t status,
const char *args, void *opaque, gpg_error_t *err)
{
int next_state;
switch (current_state)
{
case PASSWD_START:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = PASSWD_COMMAND;
}
else
{
next_state = PASSWD_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case PASSWD_COMMAND:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
next_state = PASSWD_QUIT;
}
else
{
next_state = PASSWD_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case PASSWD_QUIT:
if (status == GPGME_STATUS_GET_BOOL &&
g_str_equal (args, "keyedit.save.okay"))
{
next_state = PASSWD_SAVE;
}
else
{
next_state = PASSWD_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
break;
case PASSWD_ERROR:
if (status == GPGME_STATUS_GET_LINE &&
g_str_equal (args, "keyedit.prompt"))
{
/* Go to quit operation state */
next_state = PASSWD_QUIT;
}
else
{
next_state = PASSWD_ERROR;
}
break;
default:
next_state = PASSWD_ERROR;
*err = gpg_error (GPG_ERR_GENERAL);
}
return next_state;
}
/* Change the ownertrust of a key */
gpg_error_t gpa_gpgme_edit_trust (gpgme_ctx_t ctx, gpgme_key_t key,
gpgme_validity_t ownertrust)
{
const gchar *trust_strings[] = {"1", "1", "2", "3", "4", "5"};
struct edit_parms_s parms = {TRUST_START, gpg_error (GPG_ERR_NO_ERROR),
edit_trust_fnc_action, edit_trust_fnc_transit,
- (char*) trust_strings[ownertrust]};
+ NULL, 0, (char*) trust_strings[ownertrust]};
gpg_error_t err;
gpgme_data_t out = NULL;
err = gpgme_data_new (&out);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
return err;
}
err = gpgme_op_edit (ctx, key, edit_fnc, &parms, out);
gpgme_data_release (out);
return err;
}
/* Change the expire date of a key */
gpg_error_t gpa_gpgme_edit_expire (gpgme_ctx_t ctx, gpgme_key_t key, GDate *date)
{
gchar buf[12];
struct edit_parms_s parms = {EXPIRE_START, gpg_error (GPG_ERR_NO_ERROR),
edit_expire_fnc_action, edit_expire_fnc_transit,
- buf};
+ NULL, 0, buf};
gpg_error_t err;
gpgme_data_t out = NULL;
err = gpgme_data_new (&out);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
return err;
}
/* The new expiration date */
if (date)
{
g_date_strftime (buf, sizeof(buf), "%F", date);
}
else
{
strncpy (buf, "0", sizeof (buf));
}
err = gpgme_op_edit (ctx, key, edit_fnc, &parms, out);
gpgme_data_release (out);
return err;
}
+/* Release the edit parameters needed for signing. The prototype is that of
+ * a GpaContext's "done" signal handler.
+ */
+static void
+gpa_gpgme_edit_sign_parms_release (GpaContext *ctx, gpg_error_t err,
+ struct edit_parms_s* parms)
+{
+ gpgme_data_release (parms->out);
+ if (parms->signal_id != 0)
+ {
+ g_signal_handler_disconnect (ctx, parms->signal_id);
+ }
+ g_free (parms->opaque);
+ g_free (parms);
+}
+
+/* Generate the edit parameters needed for signing
+ */
+static struct edit_parms_s*
+gpa_gpgme_edit_sign_parms_new (GpaContext *ctx, char *check_level,
+ gboolean local, gpgme_data_t out)
+{
+ struct sign_parms_s *sign_parms = g_malloc (sizeof (struct sign_parms_s));
+ struct edit_parms_s *edit_parms = g_malloc (sizeof (struct edit_parms_s));
+
+ edit_parms->state = SIGN_START;
+ edit_parms->err = gpg_error (GPG_ERR_NO_ERROR);
+ edit_parms->action = edit_sign_fnc_action;
+ edit_parms->transit = edit_sign_fnc_transit;
+ edit_parms->signal_id = 0;
+ edit_parms->out = out;
+ edit_parms->opaque = sign_parms;
+ sign_parms->check_level = check_level;
+ sign_parms->local = local;
+
+ g_signal_connect (G_OBJECT (ctx), "done",
+ G_CALLBACK (gpa_gpgme_edit_sign_parms_release),
+ edit_parms);
+
+ return edit_parms;
+}
+
/* Sign this key with the given private key */
-gpg_error_t gpa_gpgme_edit_sign (gpgme_ctx_t ctx, gpgme_key_t key,
- gpgme_key_t secret_key, gboolean local)
+gpg_error_t gpa_gpgme_edit_sign_start (GpaContext *ctx, gpgme_key_t key,
+ gpgme_key_t secret_key, gboolean local)
{
-
- struct sign_parms_s sign_parms = {"0", local};
- struct edit_parms_s parms = {SIGN_START, gpg_error (GPG_ERR_NO_ERROR),
- edit_sign_fnc_action, edit_sign_fnc_transit,
- &sign_parms};
+ struct edit_parms_s *parms = NULL;
gpg_error_t err = gpg_error (GPG_ERR_NO_ERROR);
gpgme_data_t out;
err = gpgme_data_new (&out);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
return err;
}
- gpgme_signers_clear (ctx);
- err = gpgme_signers_add (ctx, secret_key);
+ gpgme_signers_clear (ctx->ctx);
+ err = gpgme_signers_add (ctx->ctx, secret_key);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
return err;
}
- err = gpgme_op_edit (ctx, key, edit_fnc, &parms, out);
- gpgme_data_release (out);
-
+ parms = gpa_gpgme_edit_sign_parms_new (ctx, "0", local, out);
+ err = gpgme_op_edit_start (ctx->ctx, key, edit_fnc, parms, out);
+
return err;
}
/* Change the passphrase of the key.
*/
/* Special passphrase callback for use within the passwd command */
gpg_error_t passwd_passphrase_cb (void *hook, const char *uid_hint,
- const char *passphrase_info,
- int prev_was_bad, int fd)
+ const char *passphrase_info,
+ int prev_was_bad, int fd)
{
int *i = hook;
if (!prev_was_bad) /* It's the beginning of a passphrase question */
{
(*i)++;
}
if (*i == 1)
{
return gpa_passphrase_cb (hook, uid_hint, passphrase_info,
prev_was_bad, fd);
}
else
{
return gpa_change_passphrase_dialog_run (hook, uid_hint,
passphrase_info,
prev_was_bad, fd);
}
}
gpg_error_t gpa_gpgme_edit_passwd (gpgme_ctx_t ctx, gpgme_key_t key)
{
struct edit_parms_s parms = {PASSWD_START, gpg_error (GPG_ERR_NO_ERROR),
edit_passwd_fnc_action, edit_passwd_fnc_transit,
- (gchar *) ""};
+ NULL, 0, (gchar *) ""};
gpg_error_t err;
gpgme_data_t out;
int i = 0;
err = gpgme_data_new (&out);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
return err;
}
/* Use our own passphrase callback */
gpgme_set_passphrase_cb (ctx, passwd_passphrase_cb, &i);
err = gpgme_op_edit (ctx, key, edit_fnc, &parms, out);
gpgme_data_release (out);
/* Make sure the normal passphrase callback is used */
gpgme_set_passphrase_cb (ctx, gpa_passphrase_cb, NULL);
return gpg_error (GPG_ERR_NO_ERROR);
}
diff --git a/src/gpgmeedit.h b/src/gpgmeedit.h
index 4ed1c6f..75e52f6 100644
--- a/src/gpgmeedit.h
+++ b/src/gpgmeedit.h
@@ -1,48 +1,49 @@
/* gpgmeedit.h - The GNU Privacy Assistant
* Copyright (C) 2002, Miguel Coca.
*
* This file is part of GPA
*
* GPA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GPA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* Wrappers around gpgme_op_edit for common tasks */
#ifndef GPGMEEDIT_H
#define GPGMEEDIT_H
#include "gpa.h"
+#include "gpacontext.h"
#include <glib.h>
#include <gpgme.h>
/* Change the ownertrust of a key */
gpg_error_t gpa_gpgme_edit_trust (gpgme_ctx_t ctx, gpgme_key_t key,
gpgme_validity_t ownertrust);
/* Change the expiry date of a key */
gpg_error_t gpa_gpgme_edit_expire (gpgme_ctx_t ctx, gpgme_key_t key,
GDate *date);
/* Sign this key with the given private key. If local is true, make a local
* signature. */
-gpg_error_t gpa_gpgme_edit_sign (gpgme_ctx_t ctx, gpgme_key_t key,
- gpgme_key_t secret_key,
- gboolean local);
+gpg_error_t gpa_gpgme_edit_sign_start (GpaContext *ctx, gpgme_key_t key,
+ gpgme_key_t secret_key,
+ gboolean local);
/* Change the key's passphrase.
*/
gpg_error_t gpa_gpgme_edit_passwd (gpgme_ctx_t ctx, gpgme_key_t key);
#endif
diff --git a/src/keylist.c b/src/keylist.c
index 1506e16..2f59bea 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -1,440 +1,440 @@
/* gpakeyselector.c - The GNU Privacy Assistant
* Copyright (C) 2003 Miguel Coca.
*
* This file is part of GPA
*
* GPA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GPA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "gpa.h"
#include "keylist.h"
#include "gpapastrings.h"
#include "keytable.h"
#include "icons.h"
/* Callbacks */
static void gpa_keylist_next (gpgme_key_t key, gpointer data);
static void gpa_keylist_end (gpointer data);
static void gpa_keylist_clear_columns (GpaKeyList *keylist);
/* GObject */
static GObjectClass *parent_class = NULL;
static void
gpa_keylist_finalize (GObject *object)
{
GpaKeyList *list = GPA_KEYLIST (object);
/* Dereference all keys in the list */
g_list_foreach (list->keys, (GFunc) gpgme_key_unref, NULL);
g_list_free (list->keys);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gpa_keylist_class_init (GpaKeyListClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gpa_keylist_finalize;
}
typedef enum
{
/* These are the displayed columns */
GPA_KEYLIST_COLUMN_IMAGE,
GPA_KEYLIST_COLUMN_KEYID,
GPA_KEYLIST_COLUMN_EXPIRY,
GPA_KEYLIST_COLUMN_OWNERTRUST,
GPA_KEYLIST_COLUMN_VALIDITY,
GPA_KEYLIST_COLUMN_USERID,
/* This column contains the gpgme_key_t */
GPA_KEYLIST_COLUMN_KEY,
/* These columns are used only internally for sorting */
GPA_KEYLIST_COLUMN_HAS_SECRET,
GPA_KEYLIST_COLUMN_EXPIRY_TS,
GPA_KEYLIST_COLUMN_OWNERTRUST_VALUE,
GPA_KEYLIST_COLUMN_VALIDITY_VALUE,
GPA_KEYLIST_N_COLUMNS
} GpaKeyListColumn;
static void
gpa_keylist_init (GpaKeyList *list)
{
GtkListStore *store;
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
list->secret = FALSE;
list->keys = NULL;
list->dialog = NULL;
/* Init the model */
store = gtk_list_store_new (GPA_KEYLIST_N_COLUMNS,
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_POINTER,
G_TYPE_INT,
G_TYPE_ULONG,
G_TYPE_ULONG,
G_TYPE_ULONG);
/* The view */
gtk_tree_view_set_model (GTK_TREE_VIEW (list), GTK_TREE_MODEL (store));
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (list), TRUE);
gpa_keylist_set_brief (list);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
/* Load the keyring */
gpa_keytable_list_keys (gpa_keytable_get_public_instance(),
gpa_keylist_next, gpa_keylist_end, list);
}
GType
gpa_keylist_get_type (void)
{
static GType keylist_type = 0;
if (!keylist_type)
{
static const GTypeInfo keylist_info =
{
sizeof (GpaKeyListClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gpa_keylist_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GpaKeyList),
0, /* n_preallocs */
(GInstanceInitFunc) gpa_keylist_init,
};
keylist_type = g_type_register_static (GTK_TYPE_TREE_VIEW,
"GpaKeyList",
&keylist_info, 0);
}
return keylist_type;
}
/* API */
GtkWidget *gpa_keylist_new (GtkWidget * window)
{
GtkWidget *list = (GtkWidget*) g_object_new (GPA_KEYLIST_TYPE, NULL);
return list;
}
void gpa_keylist_set_brief (GpaKeyList * keylist)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
gpa_keylist_clear_columns (keylist);
renderer = gtk_cell_renderer_pixbuf_new ();
column = gtk_tree_view_column_new_with_attributes ("", renderer,
"pixbuf",
GPA_KEYLIST_COLUMN_IMAGE,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_HAS_SECRET);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Key ID"), renderer,
"text",
GPA_KEYLIST_COLUMN_KEYID,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_KEYID);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("User Name"), renderer,
"text",
GPA_KEYLIST_COLUMN_USERID,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_USERID);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
}
void gpa_keylist_set_detailed (GpaKeyList * keylist)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
gpa_keylist_clear_columns (keylist);
renderer = gtk_cell_renderer_pixbuf_new ();
column = gtk_tree_view_column_new_with_attributes ("", renderer,
"pixbuf",
GPA_KEYLIST_COLUMN_IMAGE,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_HAS_SECRET);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Key ID"), renderer,
"text",
GPA_KEYLIST_COLUMN_KEYID,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_KEYID);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Expiry Date"),
renderer,
"text",
GPA_KEYLIST_COLUMN_EXPIRY,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_EXPIRY_TS);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Owner Trust"),
renderer,
"text",
GPA_KEYLIST_COLUMN_OWNERTRUST,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_OWNERTRUST_VALUE);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Key Validity"),
renderer,
"text",
GPA_KEYLIST_COLUMN_VALIDITY,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_VALIDITY_VALUE);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("User Name"), renderer,
"text",
GPA_KEYLIST_COLUMN_USERID,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (keylist), column);
gtk_tree_view_column_set_sort_column_id (column, GPA_KEYLIST_COLUMN_USERID);
gtk_tree_view_column_set_sort_indicator (column, TRUE);
}
gboolean gpa_keylist_has_selection (GpaKeyList * keylist)
{
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (keylist));
return gtk_tree_selection_count_selected_rows (selection) > 0;
}
gboolean gpa_keylist_has_single_selection (GpaKeyList * keylist)
{
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (keylist));
return gtk_tree_selection_count_selected_rows (selection) == 1;
}
gboolean gpa_keylist_has_single_secret_selection (GpaKeyList * keylist)
{
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (keylist));
if (gtk_tree_selection_count_selected_rows (selection) == 1)
{
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (keylist));
GList *list = gtk_tree_selection_get_selected_rows (selection, &model);
gpgme_key_t key;
GtkTreeIter iter;
GtkTreePath *path = list->data;
GValue value = {0,};
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get_value (model, &iter, GPA_KEYLIST_COLUMN_KEY,
&value);
key = g_value_get_pointer (&value);
g_value_unset(&value);
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
return (gpa_keytable_lookup_key (gpa_keytable_get_secret_instance(),
key->subkeys->fpr) != NULL);
}
else
{
return FALSE;
}
}
GList *gpa_keylist_get_selected_keys (GpaKeyList * keylist)
{
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (keylist));
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (keylist));
GList *list = gtk_tree_selection_get_selected_rows (selection, &model);
GList *keys = NULL;
GList *cur;
for (cur = list; cur; cur = g_list_next (cur))
{
gpgme_key_t key;
GtkTreeIter iter;
GtkTreePath *path = cur->data;
GValue value = {0,};
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get_value (model, &iter, GPA_KEYLIST_COLUMN_KEY,
&value);
key = g_value_get_pointer (&value);
g_value_unset(&value);
keys = g_list_append (keys, key);
}
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
return keys;
}
void gpa_keylist_start_reload (GpaKeyList * keylist)
{
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (keylist));
gtk_tree_selection_unselect_all (selection);
gtk_list_store_clear (GTK_LIST_STORE (gtk_tree_view_get_model
(GTK_TREE_VIEW (keylist))));
g_list_foreach (keylist->keys, (GFunc) gpgme_key_unref, NULL);
g_list_free (keylist->keys);
keylist->keys = NULL;
/* Display this warning until the first key is received.
* It may be shown at times when it's not needed. But it shouldn't appear
* for long those times.
*/
keylist->dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO,
GTK_BUTTONS_NONE,
_("GnuPG is rebuilding the trust "
"database.\nThis might take a "
"few seconds."));
- gtk_widget_show_all (keylist->dia log);
+ gtk_widget_show_all (keylist->dialog);
gpa_keytable_force_reload (gpa_keytable_get_public_instance (),
gpa_keylist_next, gpa_keylist_end, keylist);
}
/* Internal functions */
static GdkPixbuf*
get_key_pixbuf (gpgme_key_t key)
{
static gboolean pixmaps_created = FALSE;
static GdkPixbuf *secret_pixbuf = NULL;
static GdkPixbuf *public_pixbuf = NULL;
if (!pixmaps_created)
{
secret_pixbuf = gpa_create_icon_pixbuf ("blue_yellow_key");
public_pixbuf = gpa_create_icon_pixbuf ("blue_key");
pixmaps_created = TRUE;
}
if (gpa_keytable_lookup_key
(gpa_keytable_get_secret_instance(),
key->subkeys->fpr) != NULL)
{
return secret_pixbuf;
}
else
{
return public_pixbuf;
}
}
static void gpa_keylist_next (gpgme_key_t key, gpointer data)
{
GpaKeyList *list = data;
GtkListStore *store;
GtkTreeIter iter;
const gchar *keyid, *ownertrust, *validity;
gchar *userid, *expiry;
/* Remove the dialog if it is being displayed */
if (list->dialog)
{
gtk_widget_destroy (list->dialog);
list->dialog = NULL;
}
list->keys = g_list_append (list->keys, key);
store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (list)));
/* Get the column values */
keyid = gpa_gpgme_key_get_short_keyid (key, 0);
expiry = gpa_expiry_date_string (key->subkeys->expires);
ownertrust = gpa_key_ownertrust_string (key);
validity = gpa_key_validity_string (key);
userid = gpa_gpgme_key_get_userid (key, 0);
/* Append the key to the list */
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
GPA_KEYLIST_COLUMN_IMAGE, get_key_pixbuf (key),
GPA_KEYLIST_COLUMN_KEYID, keyid,
GPA_KEYLIST_COLUMN_EXPIRY, expiry,
GPA_KEYLIST_COLUMN_OWNERTRUST, ownertrust,
GPA_KEYLIST_COLUMN_VALIDITY, validity,
GPA_KEYLIST_COLUMN_USERID, userid,
GPA_KEYLIST_COLUMN_KEY, key,
GPA_KEYLIST_COLUMN_HAS_SECRET,
(gpa_keytable_lookup_key
(gpa_keytable_get_secret_instance(),
key->subkeys->fpr) != NULL),
/* Set "no expiration" to a large value for sorting */
GPA_KEYLIST_COLUMN_EXPIRY_TS,
key->subkeys->expires ?
key->subkeys->expires : G_MAXULONG,
GPA_KEYLIST_COLUMN_OWNERTRUST_VALUE, key->owner_trust,
GPA_KEYLIST_COLUMN_VALIDITY_VALUE, key->uids[0].validity,
-1);
/* Clean up */
g_free (userid);
g_free (expiry);
}
static void gpa_keylist_end (gpointer data)
{
}
static void gpa_keylist_clear_columns (GpaKeyList *keylist)
{
GList *columns, *i;
columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (keylist));
for (i = columns; i; i = g_list_next (i))
{
gtk_tree_view_remove_column (GTK_TREE_VIEW (keylist),
(GtkTreeViewColumn*) i->data);
}
}
diff --git a/src/keyring.c b/src/keyring.c
index 2d4181d..2b57164 100644
--- a/src/keyring.c
+++ b/src/keyring.c
@@ -1,1854 +1,1785 @@
/* keyring.c - The GNU Privacy Assistant
* Copyright (C) 2000, 2001 G-N-U GmbH.
*
* This file is part of GPA
*
* GPA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GPA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "gpa.h"
#include <config.h>
#include <gpgme.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "gtktools.h"
#include "icons.h"
#include "helpmenu.h"
#include "gpapastrings.h"
#include "gpawidgets.h"
#include "ownertrustdlg.h"
#include "keysigndlg.h"
#include "keyimportdlg.h"
#include "keyexportdlg.h"
#include "keygendlg.h"
#include "keygenwizard.h"
#include "keyeditdlg.h"
#include "keydeletedlg.h"
#include "keyimpseldlg.h"
#include "keylist.h"
#include "siglist.h"
#include "keyring.h"
#include "gpgmetools.h"
#include "gpgmeedit.h"
#include "keytable.h"
#include "server_access.h"
#include "options.h"
#include "gpakeydeleteop.h"
+#include "gpakeysignop.h"
/*
* The public keyring editor
*/
/* Struct passed to all signal handlers of the keyring editor as user
* data */
struct _GPAKeyringEditor {
/* The toplevel window of the editor */
GtkWidget *window;
/* The central list of keys */
GpaKeyList *keylist;
/* The "Show Ownertrust" toggle button */
GtkWidget *toggle_show;
/* The details notebook */
GtkWidget *notebook_details;
/* idle handler id for updates of the notebook. Will be nonzero
* whenever a handler is currently set and zero otherwise */
guint details_idle_id;
/* Widgets in the details notebook page */
GtkWidget *details_num_label;
GtkWidget *details_table;
GtkWidget *detail_public_private;
GtkWidget *detail_name;
GtkWidget *detail_fingerprint;
GtkWidget *detail_expiry;
GtkWidget *detail_key_id;
GtkWidget *detail_owner_trust;
GtkWidget *detail_key_trust;
GtkWidget *detail_key_type;
GtkWidget *detail_creation;
/* The signatures list in the notebook */
GtkWidget *signatures_list;
GtkWidget *signatures_uids;
GtkWidget *signatures_label;
/* Labels in the status bar */
GtkWidget *status_key_user;
GtkWidget *status_key_id;
/* List of sensitive widgets. See below */
GList * selection_sensitive_widgets;
/* The currently selected key */
gpgme_key_t current_key;
};
typedef struct _GPAKeyringEditor GPAKeyringEditor;
/*
* Internal API
*/
static gboolean keyring_editor_has_selection (gpointer param);
static gboolean keyring_editor_has_single_selection (gpointer param);
static gpgme_key_t keyring_editor_current_key (GPAKeyringEditor * editor);
static void keyring_update_details_notebook (GPAKeyringEditor *editor);
static void toolbar_edit_key (GtkWidget *widget, gpointer param);
static void toolbar_remove_key (GtkWidget *widget, gpointer param);
static void toolbar_sign_key (GtkWidget *widget, gpointer param);
static void toolbar_export_key (GtkWidget *widget, gpointer param);
static void toolbar_import_keys (GtkWidget *widget, gpointer param);
static void keyring_editor_sign (gpointer param);
static void keyring_editor_edit (gpointer param);
static void keyring_editor_trust (gpointer param);
static void keyring_editor_import (gpointer param);
static void keyring_editor_export (gpointer param);
static void keyring_editor_backup (gpointer param);
/*
* A simple sensitivity callback mechanism
*
* The basic idea is that buttons (and other widgets like menu items as
* well) should know when they should be sensitive or not. The
* implementation here is very simple and quite specific for the keyring
* editor's needs.
*
* We maintain a list of sensitive widgets each of which has a
* sensitivity callback associated with them as the "gpa_sensitivity"
* data. The callback returns TRUE when the widget should be sensitive
* and FALSE otherwise.
*
* Whenever the selection in the key list widget changes we call
* update_selection_sensitive_widgets which iterates through the widgets
* in the list, calls the sensitivity callback and changes the widget's
* sensitivity accordingly.
*/
/* Prototype of a sensitivity callback. Return TRUE if the widget should
* be senstitive, FALSE otherwise. The parameter is a pointer to the
* GPAKeyringEditor struct.
*/
typedef gboolean (*SensitivityFunc)(gpointer);
/* Add widget to the list of sensitive widgets of editor
*/
static void
add_selection_sensitive_widget (GPAKeyringEditor *editor,
GtkWidget *widget,
SensitivityFunc callback)
{
gtk_object_set_data (GTK_OBJECT (widget), "gpa_sensitivity", callback);
editor->selection_sensitive_widgets \
= g_list_append(editor->selection_sensitive_widgets, widget);
}
/* Update the sensitivity of the widget data and pass param through to
* the sensitivity callback. Usable as iterator function in
* g_list_foreach */
static void
update_selection_sensitive_widget (gpointer data, gpointer param)
{
SensitivityFunc func;
func = gtk_object_get_data (GTK_OBJECT (data), "gpa_sensitivity");
gtk_widget_set_sensitive (GTK_WIDGET (data), func (param));
}
/* Call update_selection_sensitive_widget for all widgets in the list of
* sensitive widgets and pass editor through as the user data parameter
*/
static void
update_selection_sensitive_widgets (GPAKeyringEditor * editor)
{
g_list_foreach (editor->selection_sensitive_widgets,
update_selection_sensitive_widget,
(gpointer) editor);
}
/* Return TRUE if the key list widget of the keyring editor has at least
* one selected item. Usable as a sensitivity callback.
*/
static gboolean
keyring_editor_has_selection (gpointer param)
{
GPAKeyringEditor * editor = param;
return gpa_keylist_has_selection (editor->keylist);
}
/* Return TRUE if the key list widget of the keyring editor has exactly
* one selected item. Usable as a sensitivity callback.
*/
static gboolean
keyring_editor_has_single_selection (gpointer param)
{
GPAKeyringEditor * editor = param;
return gpa_keylist_has_single_selection (editor->keylist);
}
/* Return TRUE if the key list widget of the keyring editor has exactly
* one selected item and it's a private key. Usable as a sensitivity
* callback.
*/
static gboolean
keyring_editor_has_private_selected (gpointer param)
{
GPAKeyringEditor * editor = param;
return gpa_keylist_has_single_secret_selection
(GPA_KEYLIST(editor->keylist));
}
/*
* Operations
*/
static void
gpa_keyring_editor_changed_wot_cb (gpointer data)
{
GPAKeyringEditor *editor = data;
gpa_keylist_start_reload (editor->keylist);
}
static void
register_operation (GPAKeyringEditor * editor, GpaKeyOperation *op)
{
g_signal_connect_swapped (G_OBJECT (op), "changed_wot",
G_CALLBACK (gpa_keyring_editor_changed_wot_cb),
editor);
g_signal_connect (G_OBJECT (op), "completed",
G_CALLBACK (gpa_operation_destroy), editor);
}
/* delete the selected keys */
static void
keyring_editor_delete (GPAKeyringEditor * editor)
{
GList *selection = gpa_keylist_get_selected_keys (editor->keylist);
GpaKeyDeleteOperation *op = gpa_key_delete_operation_new (editor->window,
selection);
register_operation (editor, op);
}
/* Return true, if the public key key has been signed by the key with
* the id key_id, otherwise return FALSE. The window parameter is needed
* for error reporting */
static gboolean
key_has_been_signed (const gpgme_key_t key,
const gpgme_key_t signer_key)
{
gint uid, idx;
gboolean uid_signed, key_signed;
const char *signer_id;
signer_id = gpgme_key_get_string_attr (signer_key, GPGME_ATTR_KEYID, 0, 0);
/* We consider the key signed if all user ID's have been signed */
key_signed = TRUE;
for (uid = 0;
key_signed &&
gpgme_key_get_string_attr (key, GPGME_ATTR_USERID, 0, uid); uid++)
{
const gchar *keyid;
uid_signed = FALSE;
for (idx = 0; !uid_signed && (keyid = gpgme_key_sig_get_string_attr
(key, uid, GPGME_ATTR_KEYID, NULL, idx));
idx++)
{
if (g_str_equal (signer_id, keyid))
{
uid_signed = TRUE;
}
}
key_signed = key_signed && uid_signed;
}
return key_signed;
}
/* Return true if the key sign button should be sensitive, i.e. if
* there's at least one selected key and there is a default key.
*/
static gboolean
keyring_editor_can_sign (gpointer param)
{
GPAKeyringEditor * editor = param;
const gpgme_key_t default_key = gpa_options_get_default_key
(gpa_options_get_instance ());
gboolean result = FALSE;
if (keyring_editor_has_selection (param) && default_key)
{
/* the most important requirements have been met, now find out
* whether the selected key was already signed with the default
* key */
gpgme_key_t key = keyring_editor_current_key (editor);
result = !key_has_been_signed (key, default_key);
}
return result;
} /* keyring_editor_can_sign */
/* sign the selected keys */
static void
keyring_editor_sign (gpointer param)
{
GPAKeyringEditor *editor = param;
- gpgme_key_t key, signer_key;
- gpg_error_t err;
- gboolean sign_locally = FALSE;
- GList *selection;
- gint signed_count = 0;
- gpgme_ctx_t ctx = gpa_gpgme_new ();
if (!gpa_keylist_has_selection (editor->keylist))
{
/* this shouldn't happen because the button should be grayed out
* in this case
*/
gpa_window_error (_("No keys selected for signing."), editor->window);
return;
}
-
- signer_key = gpa_options_get_default_key (gpa_options_get_instance ());
- if (!signer_key)
- {
- /* this shouldn't happen because the button should be grayed out
- * in this case
- */
- gpa_window_error (_("No private key for signing."), editor->window);
- return;
- }
-
- for (selection = gpa_keylist_get_selected_keys (editor->keylist);
- selection; selection = g_list_next (selection))
- {
- key = selection->data;
- if (gpa_key_sign_run_dialog (editor->window, key, &sign_locally))
- {
- err = gpa_gpgme_edit_sign (ctx, key, signer_key, sign_locally);
- if (gpg_err_code (err) == GPG_ERR_NO_ERROR)
- {
- signed_count++;
- }
- else if (gpg_err_code (err) == GPG_ERR_BAD_PASSPHRASE)
- {
- gpa_window_error (_("Wrong passphrase!"),
- editor->window);
- }
- else if (gpg_err_code (err) == GPG_ERR_UNUSABLE_PUBKEY)
- {
- /* Couldn't sign because the key was expired */
- gpa_window_error (_("This key has expired! "
- "Unable to sign."), editor->window);
- }
- else if (gpg_err_code (err) == GPG_ERR_CONFLICT)
- {
- /* Couldn't sign because the key was already signed */
- gpa_window_error (_("This key has already been signed with "
- "your own!"), editor->window);
- }
- else if (gpg_err_code (err) == GPG_ERR_NO_SECKEY)
- {
- /* Couldn't sign because there is no default key */
- gpa_window_error (_("You haven't selected a default key "
- "to sign with!"), editor->window);
- }
- else if (gpg_err_code (err) == GPG_ERR_CANCELED)
- {
- /* Do nothing, the user should know if he cancelled the
- * operation */
- }
- else
- {
- gpa_gpgme_error (err);
- }
- }
- selection = g_list_next (selection);
- }
- g_list_free (selection);
- /* Update the signatures details page and the widgets because some
- * depend on what signatures a key has
- */
- if (signed_count > 0)
+ else
{
- /* Reload the list of keys: a new signature may change the
- * trust values on several keys.*/
- gpa_keylist_start_reload (editor->keylist);
- keyring_update_details_notebook (editor);
- update_selection_sensitive_widgets (editor);
+ GList *selection = gpa_keylist_get_selected_keys (editor->keylist);
+ GpaKeySignOperation *op = gpa_key_sign_operation_new (editor->window,
+ selection);
+ register_operation (editor, op);
}
-
- gpgme_release (ctx);
}
/* Invoke the "edit key" dialog */
static void
keyring_editor_edit (gpointer param)
{
GPAKeyringEditor * editor = param;
gpgme_key_t key = keyring_editor_current_key (editor);
if (key)
{
/* Should be called when just one key is selected.
*/
if (gpa_key_edit_dialog_run (editor->window, key))
{
gpa_keylist_start_reload (editor->keylist);
update_selection_sensitive_widgets (editor);
keyring_update_details_notebook (editor);
}
}
}
static void
keyring_editor_trust (gpointer param)
{
GPAKeyringEditor * editor = param;
gpgme_key_t key = keyring_editor_current_key (editor);
if (key)
{
if (gpa_ownertrust_run_dialog (key, editor->window))
{
gpa_keylist_start_reload (editor->keylist);
update_selection_sensitive_widgets (editor);
keyring_update_details_notebook (editor);
}
}
}
static gboolean
keyring_editor_import_get_source (GPAKeyringEditor *editor, gpgme_data_t *data)
{
gchar *filename, *server, *key_id;
gpg_error_t err;
if (key_import_dialog_run (editor->window, &filename, &server, &key_id))
{
if (filename)
{
/* Read keys from the user specified file.
*/
err = gpa_gpgme_data_new_from_file (data, filename, editor->window);
/* Check if a file error ocurred */
if (gpgme_err_code_to_errno (gpg_err_code (err)))
{
return FALSE;
}
else if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
gpa_gpgme_error (err);
}
}
else if (server)
{
if (!server_get_key (server, key_id, data, editor->window))
{
g_free (filename);
g_free (server);
return FALSE;
}
}
g_free (filename);
g_free (server);
return TRUE;
}
else
{
return FALSE;
}
}
static void
keyring_editor_import_do_import (GPAKeyringEditor *editor, gpgme_data_t data)
{
gpg_error_t err;
gpgme_ctx_t ctx = gpa_gpgme_new ();
/* Import the key */
err = gpgme_op_import (ctx, data);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR &&
gpg_err_code (err) != GPG_ERR_NO_DATA)
{
gpa_gpgme_error (err);
}
/* Load the keys we just imported */
if (gpg_err_code (err) != GPG_ERR_NO_DATA)
{
gpgme_import_result_t info;
info = gpgme_op_import_result (ctx);
/* If keys were imported, load them */
if (info->imports)
{
gpa_keylist_start_reload (editor->keylist);
}
key_import_results_dialog_run (editor->window, info);
}
gpgme_release (ctx);
/* update the widgets
*/
update_selection_sensitive_widgets (editor);
}
/* retrieve a key from the server */
static void
keyring_editor_import (gpointer param)
{
GPAKeyringEditor *editor = param;
gpgme_data_t data;
if (keyring_editor_import_get_source (editor, &data))
{
keyring_editor_import_do_import (editor, data);
gpgme_data_release (data);
}
}
static void
keyring_editor_export_do_export (GPAKeyringEditor *editor, gpgme_data_t *data,
gboolean armored)
{
gpg_error_t err;
GList *selection = gpa_keylist_get_selected_keys (editor->keylist);
gpgme_ctx_t ctx = gpa_gpgme_new ();
const gchar **patterns = NULL;
int i;
/* Create the data buffer */
err = gpgme_data_new (data);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
gpa_gpgme_error (err);
gpgme_set_armor (ctx, armored);
/* Create the set of keys to export */
patterns = g_malloc0 (sizeof(gchar*)*(g_list_length(selection)+1));
for (i = 0; selection; i++, selection = g_list_next (selection))
{
gpgme_key_t key = (gpgme_key_t) selection->data;
patterns[i] = key->subkeys->fpr;
}
/* Export to the gpgme_data_t */
err = gpgme_op_export_ext (ctx, patterns, 0, *data);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
gpa_gpgme_error (err);
/* Clean up */
gpgme_release (ctx);
g_free (patterns);
}
/* export the selected keys to a file
*/
static void
keyring_editor_export (gpointer param)
{
GPAKeyringEditor *editor = param;
gchar *filename, *server;
gboolean armored;
if (!gpa_keylist_has_selection (editor->keylist))
{
/* this shouldn't happen because the button should be grayed out
* in this case
*/
gpa_window_error (_("No keys selected to export."), editor->window);
return;
}
if (key_export_dialog_run (editor->window, &filename, &server, &armored))
{
gpgme_data_t data;
FILE *file = NULL;
/* First: check any preconditions to the export */
if (filename)
{
file = gpa_fopen (filename, editor->window);
if (!file)
{
gchar *message = g_strdup_printf ("%s: %s", filename,
strerror(errno));
gpa_window_error (message, editor->window);
g_free (message);
g_free (filename);
g_free (server);
return;
}
}
/* Export to a data buffer */
keyring_editor_export_do_export (editor, &data, armored);
/* Write the data somewhere */
if (filename)
{
/* Export the selected keys to the user specified file. */
if (file)
{
/* Dump the gpgme_data_t to the file */
dump_data_to_file (data, file);
fclose (file);
}
}
else if (server)
{
/* Export the selected key to the user specified server.
*/
gpgme_key_t key = keyring_editor_current_key (editor);
server_send_keys (server, gpa_gpgme_key_get_short_keyid (key, 0),
data, editor->window);
}
g_free (filename);
g_free (server);
gpgme_data_release (data);
}
}
/* backup the default keys */
static void
keyring_editor_backup (gpointer param)
{
GPAKeyringEditor *editor = param;
gpgme_key_t key = keyring_editor_current_key (editor);
key_backup_dialog_run (editor->window, key);
}
/* Run the advanced key generation dialog and if the user clicked OK,
* generate a new key pair and updat the key list
*/
static void
keyring_editor_generate_key_advanced (gpointer param)
{
GPAKeyringEditor * editor = param;
GPAKeyGenParameters * params;
gpg_error_t err;
gpgme_key_t key;
params = gpa_key_gen_run_dialog(editor->window);
if (params)
{
err = gpa_generate_key (params, &key);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
gpa_gpgme_error (err);
}
gpgme_key_unref (key);
gpa_key_gen_free_parameters (params);
/* finally, update the default key if there is none because now
* there is at least one secret key, update the key list and the
* sensitive widgets because some may depend on whether secret
* keys are available
*/
gpa_keylist_start_reload (editor->keylist);
gpa_options_update_default_key (gpa_options_get_instance ());
update_selection_sensitive_widgets (editor);
}
} /* keyring_editor_generate_key_advanced */
/* Call the key generation wizard and update the key list if necessary */
static void
keyring_editor_generate_key_simple (gpointer param)
{
GPAKeyringEditor * editor = param;
if (gpa_keygen_wizard_run (editor->window))
{
/* update the default key if there is none because now
* there is at least one secret key, update the key list and the
* sensitive widgets because some may depend on whether secret
* keys are available
*/
gpa_keylist_start_reload (editor->keylist);
gpa_options_update_default_key (gpa_options_get_instance ());
update_selection_sensitive_widgets (editor);
}
} /* keyring_editor_generate_key_simple */
/* Depending on the simple_ui flag call either
* keyring_editor_generate_key_advanced or
* keyring_editor_generate_key_simple
*/
static void
keyring_editor_generate_key (gpointer param)
{
if (gpa_options_get_simplified_ui (gpa_options_get_instance ()))
keyring_editor_generate_key_simple (param);
else
keyring_editor_generate_key_advanced (param);
} /* keyring_editor_generate_key */
/* Return the the currently selected key. NULL if no key is selected */
static gpgme_key_t
keyring_editor_current_key (GPAKeyringEditor *editor)
{
return editor->current_key;
}
/* Update everything that has to be updated when the selection in the
* key list changes.
*/
static void
keyring_selection_update_widgets (GPAKeyringEditor * editor)
{
update_selection_sensitive_widgets (editor);
keyring_update_details_notebook (editor);
}
/* Signal handler for selection changes.
*/
static void
keyring_editor_selection_changed (GtkTreeSelection *treeselection,
gpointer param)
{
GPAKeyringEditor *editor = param;
/* Update the current key */
if (editor->current_key)
{
/* Remove the previous one */
gpgme_key_unref (editor->current_key);
editor->current_key = NULL;
}
/* Load the new one */
if (gpa_keylist_has_single_selection (editor->keylist))
{
gpg_error_t err;
GList *selection = gpa_keylist_get_selected_keys (editor->keylist);
gpgme_key_t key = (gpgme_key_t) selection->data;
gpgme_ctx_t ctx = gpa_gpgme_new ();
int old_mode = gpgme_get_keylist_mode (ctx);
/* With all the signatures */
gpgme_set_keylist_mode (ctx, old_mode | GPGME_KEYLIST_MODE_SIGS);
err = gpgme_get_key (ctx, key->subkeys->fpr, &key, FALSE);
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
gpa_gpgme_warning (err);
}
gpgme_set_keylist_mode (ctx, old_mode);
g_list_free (selection);
editor->current_key = key;
gpgme_release (ctx);
}
keyring_selection_update_widgets (editor);
}
/* Signal handler for the map signal. If the simplified_ui flag is set
* and there's no private key in the key ring, ask the user whether he
* wants to generate a key. If so, call keyring_editor_generate_key()
* which runs the appropriate dialog.
* Also, if the simplified_ui flag is set, remind the user if he has
* not yet created a backup copy of his private key.
*/
static void
keyring_editor_mapped (gpointer param)
{
static gboolean asked_about_key_generation = FALSE;
static gboolean asked_about_key_backup = FALSE;
GPAKeyringEditor * editor = param;
if (gpa_options_get_simplified_ui (gpa_options_get_instance ()))
{
/* We assume that the only reason a user might not have a default key
* is because he has no private keys.
*/
if (!asked_about_key_generation
&& !gpa_options_get_default_key (gpa_options_get_instance()))
{
GtkWidget *dialog;
GtkResponseType response;
dialog = gtk_message_dialog_new (GTK_WINDOW (editor->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
_("You do not have a private key "
"yet. Do you want to generate "
"one now (recommended) or do it"
" later?"));
gtk_dialog_add_buttons (GTK_DIALOG (dialog), _("_Generate key now"),
GTK_RESPONSE_OK, _("Do it _later"),
GTK_RESPONSE_CANCEL, NULL);
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_OK)
{
keyring_editor_generate_key (param);
}
asked_about_key_generation = TRUE;
}
else if (!asked_about_key_backup
&& !gpa_options_get_backup_generated
(gpa_options_get_instance ())
&& !gpa_options_get_default_key (gpa_options_get_instance()))
{
GtkWidget *dialog;
GtkResponseType response;
dialog = gtk_message_dialog_new (GTK_WINDOW (editor->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE,
_("You do not have a backup copy of"
" your private key yet."
" Do you want to backup your key "
"now (recommended) or do it "
"later?"));
gtk_dialog_add_buttons (GTK_DIALOG (dialog), _("_Backup key now"),
GTK_RESPONSE_OK, _("Do it _later"),
GTK_RESPONSE_CANCEL, NULL);
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_OK)
{
key_backup_dialog_run (editor->window,
gpa_options_get_default_key (gpa_options_get_instance ()));
}
asked_about_key_backup = TRUE;
}
}
} /* keyring_editor_mapped */
/* close the keyring editor */
static void
keyring_editor_close (gpointer param)
{
GPAKeyringEditor * editor = param;
gtk_widget_destroy (editor->window);
} /* keyring_editor_close */
/* free the data structures associated with the keyring editor */
static void
keyring_editor_destroy (gpointer param)
{
GPAKeyringEditor * editor = param;
g_list_free (editor->selection_sensitive_widgets);
g_free (editor);
} /* keyring_editor_destroy */
/* select all keys in the keyring */
static void
keyring_editor_select_all (gpointer param)
{
GPAKeyringEditor * editor = param;
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (editor->keylist));
gtk_tree_selection_select_all (selection);
}
/* Paste the clipboard into the keyring */
static void
keyring_editor_paste (gpointer param)
{
GPAKeyringEditor * editor = param;
gpgme_data_t data;
gpg_error_t err;
gchar *text = gtk_clipboard_wait_for_text (gtk_clipboard_get
(GDK_SELECTION_CLIPBOARD));
if (text)
{
/* Fill the data from the selection clipboard.
*/
err = gpgme_data_new_from_mem (&data, text, strlen (text), FALSE);
}
else
{
/* If the keyboard was empty, create an empty data
*/
err = gpgme_data_new (&data);
}
if (gpg_err_code (err) != GPG_ERR_NO_ERROR)
{
gpa_gpgme_error (err);
}
/* Import */
keyring_editor_import_do_import (editor, data);
gpgme_data_release (data);
if (text)
{
g_free (text);
}
}
/* Copy the keys into the clipboard */
static void
keyring_editor_copy (gpointer param)
{
GPAKeyringEditor * editor = param;
gpgme_data_t data;
/* Export to a data buffer */
keyring_editor_export_do_export (editor, &data, TRUE);
/* Write the data to the clipboard.
*/
dump_data_to_clipboard (data, gtk_clipboard_get (GDK_SELECTION_CLIPBOARD));
gpgme_data_release (data);
}
/* Create and return the menu bar for the key ring editor */
static GtkWidget *
keyring_editor_menubar_new (GtkWidget * window,
GPAKeyringEditor * editor)
{
GtkAccelGroup *accel_group;
GtkItemFactory *factory;
GtkItemFactoryEntry file_menu[] = {
{_("/_File"), NULL, NULL, 0, "<Branch>"},
{_("/File/_Close"), NULL, keyring_editor_close, 0, "<StockItem>",
GTK_STOCK_CLOSE},
{_("/File/_Quit"), NULL, gtk_main_quit, 0, "<StockItem>", GTK_STOCK_QUIT},
};
GtkItemFactoryEntry edit_menu[] = {
{_("/_Edit"), NULL, NULL, 0, "<Branch>"},
{_("/Edit/_Copy"), NULL, keyring_editor_copy, 0, "<StockItem>",
GTK_STOCK_COPY},
{_("/Edit/_Paste"), NULL, keyring_editor_paste, 0, "<StockItem>",
GTK_STOCK_PASTE},
{_("/Edit/sep1"), NULL, NULL, 0, "<Separator>"},
{_("/Edit/Select _All"), "<control>A", keyring_editor_select_all, 0, NULL},
{_("/Edit/sep2"), NULL, NULL, 0, "<Separator>"},
{_("/Edit/Pr_eferences..."), NULL, gpa_open_settings_dialog, 0,
"<StockItem>", GTK_STOCK_PREFERENCES},
};
GtkItemFactoryEntry keys_menu[] = {
{_("/_Keys"), NULL, NULL, 0, "<Branch>"},
{_("/Keys/_New Key..."), NULL, keyring_editor_generate_key, 0,
"<StockItem>", GTK_STOCK_NEW},
{_("/Keys/_Delete Keys..."), NULL, keyring_editor_delete, 0,
"<StockItem>", GTK_STOCK_DELETE},
{_("/Keys/sep1"), NULL, NULL, 0, "<Separator>"},
{_("/Keys/_Sign Keys..."), NULL, keyring_editor_sign, 0, NULL},
{_("/Keys/Set _Owner Trust..."), NULL, keyring_editor_trust, 0, NULL},
{_("/Keys/_Edit Private Key..."), NULL, keyring_editor_edit, 0, NULL},
{_("/Keys/sep2"), NULL, NULL, 0, "<Separator>"},
{_("/Keys/_Import Keys..."), NULL, keyring_editor_import, 0, NULL},
{_("/Keys/E_xport Keys..."), NULL, keyring_editor_export, 0, NULL},
{_("/Keys/_Backup..."), NULL, keyring_editor_backup, 0, NULL},
};
GtkItemFactoryEntry win_menu[] = {
{_("/_Windows"), NULL, NULL, 0, "<Branch>"},
{_("/Windows/_Filemanager"), NULL, gpa_open_filemanager, 0, NULL},
{_("/Windows/_Keyring Editor"), NULL, gpa_open_keyring_editor, 0, NULL},
};
GtkWidget *item;
accel_group = gtk_accel_group_new ();
factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
gtk_item_factory_create_items (factory,
sizeof (file_menu) / sizeof (file_menu[0]),
file_menu, editor);
gtk_item_factory_create_items (factory,
sizeof (edit_menu) / sizeof (edit_menu[0]),
edit_menu, editor);
gtk_item_factory_create_items (factory,
sizeof (keys_menu) / sizeof (keys_menu[0]),
keys_menu, editor);
gtk_item_factory_create_items (factory,
sizeof (win_menu) / sizeof (win_menu[0]),
win_menu, editor);
gpa_help_menu_add_to_factory (factory, window);
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
/* The menu paths given here MUST NOT contain underscores. Tough luck for
* translators :-( */
/* Items that must only be available if a key is selected */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Keys/Export Keys..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_selection);
}
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Keys/Delete Keys..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_selection);
}
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Edit/Copy"));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_selection);
}
/* Only if there is only ONE key selected */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Keys/Set Owner Trust..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_single_selection);
}
/* If the keys can be signed... */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Keys/Sign Keys..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_can_sign);
}
/* If the selected key has a private key */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Keys/Edit Private Key..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_private_selected);
}
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Keys/Backup..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_private_selected);
}
return gtk_item_factory_get_widget (factory, "<main>");
}
/* Create the popup menu for the key list */
static GtkWidget *
keyring_editor_popup_menu_new (GtkWidget * window,
GPAKeyringEditor * editor)
{
GtkItemFactory *factory;
GtkItemFactoryEntry popup_menu[] = {
{_("/_Copy"), NULL, keyring_editor_copy, 0, "<StockItem>",
GTK_STOCK_COPY},
{_("/_Paste"), NULL, keyring_editor_paste, 0, "<StockItem>",
GTK_STOCK_PASTE},
{_("/_Delete Keys..."), NULL, keyring_editor_delete, 0,
"<StockItem>", GTK_STOCK_DELETE},
{"/sep1", NULL, NULL, 0, "<Separator>"},
{_("/_Sign Keys..."), NULL, keyring_editor_sign, 0, NULL},
{_("/Set _Owner Trust..."), NULL, keyring_editor_trust, 0, NULL},
{_("/_Edit Private Key..."), NULL, keyring_editor_edit, 0, NULL},
{"/sep2", NULL, NULL, 0, "<Separator>"},
{_("/E_xport Keys..."), NULL, keyring_editor_export, 0, NULL},
{_("/_Backup..."), NULL, keyring_editor_backup, 0, NULL},
};
GtkWidget *item;
factory = gtk_item_factory_new (GTK_TYPE_MENU, "<main>", NULL);
gtk_item_factory_create_items (factory,
sizeof (popup_menu) / sizeof (popup_menu[0]),
popup_menu, editor);
/* Only if there is only ONE key selected */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Set Owner Trust..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_single_selection);
}
/* If the keys can be signed... */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Sign Keys..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_can_sign);
}
/* If the selected key has a private key */
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Edit Private Key..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_private_selected);
}
item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
_("/Backup..."));
if (item)
{
add_selection_sensitive_widget (editor, item,
keyring_editor_has_private_selected);
}
return gtk_item_factory_get_widget (factory, "<main>");
}
/*
* The details notebook
*/
/* add a single row to the details table */
static GtkWidget *
add_details_row (GtkWidget * table, gint row, gchar *text,
gboolean selectable)
{
GtkWidget * widget;
widget = gtk_label_new (text);
gtk_table_attach (GTK_TABLE (table), widget, 0, 1, row, row + 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.0);
widget = gtk_label_new ("");
gtk_label_set_selectable (GTK_LABEL (widget), selectable);
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
gtk_table_attach (GTK_TABLE (table), widget, 1, 2, row, row + 1,
GTK_FILL | GTK_EXPAND, 0, 0, 0);
return widget;
}
/* Callback for the popdown menu on the signatures page */
static void
signatures_uid_selected (GtkOptionMenu *optionmenu, gpointer user_data)
{
GPAKeyringEditor *editor = user_data;
gpgme_key_t key = keyring_editor_current_key (editor);
gpa_siglist_set_signatures (editor->signatures_list, key,
gtk_option_menu_get_history
(GTK_OPTION_MENU (editor->signatures_uids))-1);
}
/* Create and return the Details/Signatures notebook
*/
static GtkWidget *
keyring_details_notebook (GPAKeyringEditor *editor)
{
GtkWidget * notebook;
GtkWidget * table;
GtkWidget * label;
GtkWidget * vbox;
GtkWidget * scrolled;
GtkWidget * viewport;
GtkWidget * siglist;
GtkWidget * options;
GtkWidget * hbox;
gint table_row;
notebook = gtk_notebook_new ();
/* Details Page */
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
GTK_SHADOW_NONE);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
viewport = gtk_viewport_new (NULL, NULL);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (viewport), vbox);
gtk_container_add (GTK_CONTAINER (scrolled), viewport);
label = gtk_label_new ("");
editor->details_num_label = label;
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
table = gtk_table_new (2, 6, FALSE);
editor->details_table = table;
gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
table_row = 0;
editor->detail_public_private = add_details_row (table, table_row++,
"", TRUE);
editor->detail_name = add_details_row (table, table_row++,
_("User Name:"), TRUE);
editor->detail_key_id = add_details_row (table, table_row++,
_("Key ID:"), TRUE);
editor->detail_fingerprint = add_details_row (table, table_row++,
_("Fingerprint:"), TRUE);
editor->detail_expiry = add_details_row (table, table_row++,
_("Expires at:"), FALSE);
editor->detail_owner_trust = add_details_row (table, table_row++,
_("Owner Trust:"), FALSE);
editor->detail_key_trust = add_details_row (table, table_row++,
_("Key Validity:"), FALSE);
editor->detail_key_type = add_details_row (table, table_row++,
_("Key Type:"), FALSE);
editor->detail_creation = add_details_row (table, table_row++,
_("Created at:"), FALSE);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), scrolled,
gtk_label_new (_("Details")));
/* Signatures Page */
vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
/* UID menu and label */
hbox = gtk_hbox_new (FALSE, 5);
label = gtk_label_new (_("Show signatures on user name:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
options = gtk_option_menu_new ();
gtk_box_pack_start (GTK_BOX (hbox), options, TRUE, TRUE, 0);
gtk_widget_set_sensitive (options, FALSE);
editor->signatures_uids = options;
editor->signatures_label = label;
g_signal_connect (G_OBJECT (options), "changed",
G_CALLBACK (signatures_uid_selected), editor);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
/* Signature list */
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0);
siglist = gpa_siglist_new ();
editor->signatures_list = siglist;
gtk_container_add (GTK_CONTAINER (scrolled), siglist);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox,
gtk_label_new (_("Signatures")));
editor->notebook_details = notebook;
return notebook;
}
/* Fill the details page of the details notebook with the properties of
* the publix key key */
static void
keyring_details_page_fill_key (GPAKeyringEditor * editor, gpgme_key_t key)
{
gchar * text;
gchar * uid;
gint i;
if (gpa_keytable_lookup_key (gpa_keytable_get_secret_instance(),
key->subkeys->fpr) != NULL)
{
gtk_label_set_text (GTK_LABEL (editor->detail_public_private),
_("The key has both a private and a public part"));
}
else
{
gtk_label_set_text (GTK_LABEL (editor->detail_public_private),
_("The key has only a public part"));
}
/* One user ID on each line */
text = gpa_gpgme_key_get_userid (key, 0);
for (i = 1; (uid = gpa_gpgme_key_get_userid (key, i)) != NULL; i++)
{
gchar *tmp = text;
text = g_strconcat (text, "\n", uid, NULL);
g_free (tmp);
}
gtk_label_set_text (GTK_LABEL (editor->detail_name), text);
g_free (text);
text = (gchar*) gpa_gpgme_key_get_short_keyid (key, 0);
gtk_label_set_text (GTK_LABEL (editor->detail_key_id), text);
text = gpa_gpgme_key_get_fingerprint (key, 0);
gtk_label_set_text (GTK_LABEL (editor->detail_fingerprint), text);
g_free (text);
text = gpa_expiry_date_string (
gpgme_key_get_ulong_attr (key, GPGME_ATTR_EXPIRE, NULL, 0));
gtk_label_set_text (GTK_LABEL (editor->detail_expiry), text);
g_free (text);
gtk_label_set_text (GTK_LABEL (editor->detail_key_trust),
gpa_key_validity_string (key));
text = g_strdup_printf (_("%s %li bits"),
gpgme_key_get_string_attr (key, GPGME_ATTR_ALGO,
NULL, 0),
gpgme_key_get_ulong_attr (key, GPGME_ATTR_LEN,
NULL, 0));
gtk_label_set_text (GTK_LABEL (editor->detail_key_type), text);
g_free (text);
gtk_label_set_text (GTK_LABEL (editor->detail_owner_trust),
gpa_key_ownertrust_string (key));
text = gpa_creation_date_string (gpgme_key_get_ulong_attr
(key, GPGME_ATTR_CREATED, NULL, 0));
gtk_label_set_text (GTK_LABEL (editor->detail_creation), text);
g_free (text);
gtk_widget_hide (editor->details_num_label);
gtk_widget_show (editor->details_table);
} /* keyring_details_page_fill_key */
/* Show the number of keys num_key in the details page of the details
* notebook and make sure that that page is in front */
static void
keyring_details_page_fill_num_keys (GPAKeyringEditor * editor, gint num_key)
{
if (!num_key)
{
gtk_label_set_text (GTK_LABEL (editor->details_num_label),
_("No keys selected"));
}
else
{
gchar * text = g_strdup_printf (_("%d keys selected"), num_key);
gtk_label_set_text (GTK_LABEL (editor->details_num_label), text);
g_free (text);
}
gtk_widget_show (editor->details_num_label);
gtk_widget_hide (editor->details_table);
/* Assume that the 0th page is the details page. This should be done
* better */
gtk_notebook_set_page (GTK_NOTEBOOK (editor->notebook_details), 0);
} /* keyring_details_page_fill_num_keys */
/* Fill the signatures page of the details notebook with the signatures
* of the public key key */
static void
keyring_signatures_page_fill_key (GPAKeyringEditor * editor, gpgme_key_t key)
{
GtkWidget *menu;
GtkWidget *label;
gchar *uid;
int i;
/* Create the menu for the popdown UID list, if there is more than une UID
*/
if (key->uids && key->uids->next)
{
menu = gtk_menu_new ();
label = gtk_menu_item_new_with_label (_("All signatures"));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), label);
for (i = 0; (uid = gpa_gpgme_key_get_userid (key, i)) != NULL; i++)
{
label = gtk_menu_item_new_with_label (uid);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), label);
g_free (uid);
}
gtk_option_menu_set_menu (GTK_OPTION_MENU (editor->signatures_uids),
menu);
gtk_widget_show_all (menu);
gtk_widget_show (editor->signatures_uids);
gtk_widget_show (editor->signatures_label);
gtk_widget_set_sensitive (editor->signatures_uids, TRUE);
/* Add the signatures */
gpa_siglist_set_signatures (editor->signatures_list, key, -1);
}
else
{
/* If there is just one uid, display its signatures explicitly,
* and don't show the list of uids */
gtk_widget_hide (editor->signatures_uids);
gtk_widget_hide (editor->signatures_label);
gpa_siglist_set_signatures (editor->signatures_list, key, 0);
}
} /* keyring_signatures_page_fill_key */
/* Empty the list of signatures in the details notebook */
static void
keyring_signatures_page_empty (GPAKeyringEditor * editor)
{
gtk_widget_set_sensitive (editor->signatures_uids, FALSE);
gtk_option_menu_remove_menu (GTK_OPTION_MENU (editor->signatures_uids));
gpa_siglist_set_signatures (editor->signatures_list, NULL, 0);
} /* keyring_signatures_page_empty */
/* Update the details notebook according to the current selection. This
* means that if there's exactly one key selected, display it's
* properties in the pages, otherwise show the number of currently
* selected keys */
static int
idle_update_details (gpointer param)
{
GPAKeyringEditor * editor = param;
if (gpa_keylist_has_single_selection (editor->keylist))
{
gpgme_key_t key = keyring_editor_current_key (editor);
keyring_details_page_fill_key (editor, key);
keyring_signatures_page_fill_key (editor, key);
}
else
{
GList *selection = gpa_keylist_get_selected_keys (editor->keylist);
keyring_details_page_fill_num_keys (editor, g_list_length (selection));
keyring_signatures_page_empty (editor);
g_list_free (selection);
}
/* Set the idle id to NULL to indicate that the idle handler has been
* run */
editor->details_idle_id = 0;
/* Return 0 to indicate that this function shouldn't be called again
* by GTK, only when we expicitly add it again */
return 0;
}
/* Add an idle handler to update the details notebook, but only when
* none has been set yet */
static void
keyring_update_details_notebook (GPAKeyringEditor * editor)
{
if (!editor->details_idle_id)
{
editor->details_idle_id = gtk_idle_add (idle_update_details, editor);
}
}
/* Change the keylist to brief listing */
static void
keyring_set_brief_listing (GtkWidget *widget, gpointer param)
{
GPAKeyringEditor * editor = param;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
gpa_keylist_set_brief (editor->keylist);
gpa_options_set_detailed_view (gpa_options_get_instance (), FALSE);
}
}
/* Change the keylist to detailed listing */
static void
keyring_set_detailed_listing (GtkWidget *widget, gpointer param)
{
GPAKeyringEditor * editor = param;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
gpa_keylist_set_detailed (editor->keylist);
gpa_options_set_detailed_view (gpa_options_get_instance (), TRUE);
}
}
static void
toolbar_edit_key (GtkWidget *widget, gpointer param)
{
keyring_editor_edit (param);
}
static void
toolbar_remove_key (GtkWidget *widget, gpointer param)
{
keyring_editor_delete (param);
}
static void
toolbar_sign_key (GtkWidget *widget, gpointer param)
{
keyring_editor_sign (param);
}
static void
toolbar_export_key (GtkWidget *widget, gpointer param)
{
keyring_editor_export (param);
}
static void
toolbar_import_keys (GtkWidget *widget, gpointer param)
{
keyring_editor_import (param);
}
#if 0
static void
toolbar_preferences (GtkWidget *widget, gpointer param)
{
gpa_open_settings_dialog ();
}
#endif
static GtkWidget *
keyring_toolbar_new (GtkWidget * window, GPAKeyringEditor *editor)
{
GtkWidget *toolbar;
GtkWidget *icon;
GtkWidget *item;
GtkWidget *button;
GtkWidget *view_b;
GtkWidget *view_d;
toolbar = gtk_toolbar_new ();
gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar),
GTK_ICON_SIZE_LARGE_TOOLBAR);
icon = gpa_create_icon_widget (window, "edit");
item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Edit"),
_("Edit the selected private key"),
_("edit key"), icon,
GTK_SIGNAL_FUNC (toolbar_edit_key),
editor);
add_selection_sensitive_widget (editor, item,
keyring_editor_has_private_selected);
item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_DELETE,
_("Remove the selected key"),
_("remove key"),
GTK_SIGNAL_FUNC (toolbar_remove_key),
editor, -1);
add_selection_sensitive_widget (editor, item,
keyring_editor_has_selection);
icon = gpa_create_icon_widget (window, "sign");
item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Sign"),
_("Sign the selected key"), _("sign key"),
icon, GTK_SIGNAL_FUNC (toolbar_sign_key),
editor);
add_selection_sensitive_widget (editor, item,
keyring_editor_can_sign);
icon = gpa_create_icon_widget (window, "import");
item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Import"),
_("Import Keys"), _("import keys"),
icon, GTK_SIGNAL_FUNC (toolbar_import_keys),
editor);
icon = gpa_create_icon_widget (window, "export");
item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Export"),
_("Export Keys"), _("export keys"),
icon, GTK_SIGNAL_FUNC (toolbar_export_key),
editor);
add_selection_sensitive_widget (editor, item,
keyring_editor_has_selection);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
button = gtk_radio_button_new (NULL);
icon = gpa_create_icon_widget (window, "brief");
view_b = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_RADIOBUTTON, button,
_("Brief"), _("Show Brief Keylist"),
_("brief"), icon,
GTK_SIGNAL_FUNC (keyring_set_brief_listing),
editor);
/*gtk_signal_handler_block_by_data (GTK_OBJECT (item), editor);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
gtk_signal_handler_unblock_by_data (GTK_OBJECT (item), editor);*/
button = gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (button));
icon = gpa_create_icon_widget (window, "detailed");
view_d = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_RADIOBUTTON, button,
_("Detailed"), _("Show Key Details"),
_("detailed"), icon,
GTK_SIGNAL_FUNC (keyring_set_detailed_listing),
editor);
/* Set brief or detailed button active according to option */
if (gpa_options_get_detailed_view (gpa_options_get_instance()) )
{
item = view_d;
}
else
{
item = view_b;
}
gtk_signal_handler_block_by_data (GTK_OBJECT (item), editor);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
gtk_signal_handler_unblock_by_data (GTK_OBJECT (item), editor);
#if 0
/* Disabled for now. The long label causes the toolbar to grow too much.
* See http://bugzilla.gnome.org/show_bug.cgi?id=75086
*/
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
GTK_STOCK_PREFERENCES,
_("Open the Preferences dialog"),
_("preferences"),
GTK_SIGNAL_FUNC (toolbar_preferences),
editor, -1);
#endif
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
icon = gpa_create_icon_widget (window, "openfile");
item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Files"),
_("Open the File Manager"),
_("file manager"), icon, GTK_SIGNAL_FUNC (gpa_open_filemanager),
NULL);
#if 0 /* Help is not available yet. :-( */
icon = gpa_create_icon_widget (window, "help");
item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Help"),
_("Understanding the GNU Privacy Assistant"),
_("help"), icon, GTK_SIGNAL_FUNC (help_help),
NULL);
#endif
return toolbar;
} /* keyring_toolbar_new */
static GtkWidget *
keyring_statusbar_new (GPAKeyringEditor *editor)
{
GtkWidget * hbox;
GtkWidget * label;
hbox = gtk_hbox_new (FALSE, 0);
label = gtk_label_new (_("Selected Default Key:"));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
label = gtk_label_new ("");
editor->status_key_user = label;
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
label = gtk_label_new ("");
editor->status_key_id = label;
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
return hbox;
} /* keyring_statusbar_new */
/* Update the status bar */
static void
keyring_update_status_bar (GPAKeyringEditor * editor)
{
gpgme_key_t key = gpa_options_get_default_key (gpa_options_get_instance ());
gchar *string;
if (key)
{
string = gpa_gpgme_key_get_userid (key, 0);
gtk_label_set_text (GTK_LABEL (editor->status_key_user), string);
g_free (string);
gtk_label_set_text (GTK_LABEL (editor->status_key_id),
gpa_gpgme_key_get_short_keyid (key, 0));
}
else
{
gtk_label_set_text (GTK_LABEL (editor->status_key_user), "");
gtk_label_set_text (GTK_LABEL (editor->status_key_id), "");
}
}
static gint
display_popup_menu (GtkWidget *widget, GdkEvent *event, GpaKeyList *list)
{
GtkMenu *menu;
GdkEventButton *event_button;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
/* The "widget" is the menu that was supplied when
* g_signal_connect_swapped() was called.
*/
menu = GTK_MENU (widget);
if (event->type == GDK_BUTTON_PRESS)
{
event_button = (GdkEventButton *) event;
if (event_button->button == 3)
{
GtkTreeSelection *selection =
gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
GtkTreePath *path;
GtkTreeIter iter;
/* Make sure the clicked key is selected */
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (list),
event_button->x,
event_button->y,
&path, NULL,
NULL, NULL))
{
gtk_tree_model_get_iter (gtk_tree_view_get_model
(GTK_TREE_VIEW(list)), &iter, path);
if (!gtk_tree_selection_iter_is_selected (selection, &iter))
{
gtk_tree_selection_unselect_all (selection);
gtk_tree_selection_select_path (selection, path);
}
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
event_button->button, event_button->time);
}
return TRUE;
}
}
return FALSE;
}
/* signal handler for the "changed_default_key" signal. Update the
* status bar and the selection sensitive widgets because some depend on
* the default key */
static void
keyring_default_key_changed (GpaOptions *options, gpointer param)
{
GPAKeyringEditor * editor = param;
keyring_update_status_bar (editor);
update_selection_sensitive_widgets (editor);
}
/* Create and return a new key ring editor window */
GtkWidget *
keyring_editor_new (void)
{
GPAKeyringEditor *editor;
GtkAccelGroup *accel_group;
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *scrolled;
GtkWidget *keylist;
GtkWidget *notebook;
GtkWidget *toolbar;
GtkWidget *hbox;
GtkWidget *icon;
GtkWidget *paned;
GtkWidget *statusbar;
gchar *markup;
editor = g_malloc(sizeof(GPAKeyringEditor));
editor->selection_sensitive_widgets = NULL;
editor->details_idle_id = 0;
window = editor->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window),
_("GNU Privacy Assistant - Keyring Editor"));
gtk_object_set_data_full (GTK_OBJECT (window), "user_data", editor,
keyring_editor_destroy);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 600);
accel_group = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
gtk_signal_connect_object (GTK_OBJECT (window), "map",
GTK_SIGNAL_FUNC (keyring_editor_mapped),
(gpointer)editor);
/* Realize the window so that we can create pixmaps without warnings */
gtk_widget_realize (window);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_box_pack_start (GTK_BOX (vbox),
keyring_editor_menubar_new (window, editor),
FALSE, TRUE, 0);
toolbar = keyring_toolbar_new(window, editor);
gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
icon = gpa_create_icon_widget (window, "keyring");
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, TRUE, 0);
label = gtk_label_new (NULL);
markup = g_strdup_printf ("<span font_desc=\"16\">%s</span>",
_("Keyring Editor"));
gtk_label_set_markup (GTK_LABEL (label), markup);
g_free (markup);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 10);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
paned = gtk_vpaned_new ();
gtk_box_pack_start (GTK_BOX (vbox), paned, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (paned), 5);
scrolled = gtk_scrolled_window_new (NULL, NULL);
gtk_paned_pack1 (GTK_PANED (paned), scrolled, TRUE, TRUE);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
keylist = gpa_keylist_new (window);
editor->keylist = GPA_KEYLIST (keylist);
if (gpa_options_get_detailed_view (gpa_options_get_instance()))
{
gpa_keylist_set_detailed (editor->keylist);
}
else
{
gpa_keylist_set_brief (editor->keylist);
}
gtk_container_add (GTK_CONTAINER (scrolled), keylist);
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection
(GTK_TREE_VIEW (keylist))),
"changed", G_CALLBACK (keyring_editor_selection_changed),
(gpointer) editor);
g_signal_connect_swapped (GTK_OBJECT (keylist), "button_press_event",
G_CALLBACK (display_popup_menu),
GTK_OBJECT (keyring_editor_popup_menu_new
(window, editor)));
notebook = keyring_details_notebook (editor);
gtk_paned_pack2 (GTK_PANED (paned), notebook, TRUE, TRUE);
gtk_paned_set_position (GTK_PANED (paned), 250);
statusbar = keyring_statusbar_new (editor);
gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, TRUE, 0);
g_signal_connect (G_OBJECT (gpa_options_get_instance ()),
"changed_default_key",
(GCallback)keyring_default_key_changed, editor);
keyring_update_status_bar (editor);
update_selection_sensitive_widgets (editor);
keyring_update_details_notebook (editor);
editor->current_key = NULL;
return window;
} /* keyring_editor_new */

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jul 8, 12:22 PM (1 d, 3 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a3/f5/93833668c6f23bb47eee1bccda3c

Event Timeline