[pkg-otr-team] [irssi-plugin-otr] 58/167: * gtk-dialog.c: Added a context-sensitive Help button to the Authenticate Buddy dialog.

Holger Levsen holger at moszumanska.debian.org
Mon Mar 3 21:55:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to tag 4.0.0
in repository irssi-plugin-otr.

commit 2bf7b1070dc87a2aecaa90e7599fd40718919f65
Author: cypherpunk <cypherpunk>
Date:   Thu May 29 15:28:00 2008 +0000

    	* gtk-dialog.c: Added a context-sensitive Help button to the
    	Authenticate Buddy dialog.
---
 ChangeLog    |  3 +++
 gtk-dialog.c | 22 +++++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 026595a..d93340b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@
 	* gtk-ui.c: Specify that the OTR button shows up in the toolbar
 	now.
 
+	* gtk-dialog.c: Added a context-sensitive Help button to the
+	Authenticate Buddy dialog.
+
 2008-05-29
 
 	* gtk-ui.c:
diff --git a/gtk-dialog.c b/gtk-dialog.c
index ff828cd..2cd2e66 100644
--- a/gtk-dialog.c
+++ b/gtk-dialog.c
@@ -297,11 +297,30 @@ static void smp_secret_response_cb(GtkDialog *dialog, gint response,
 		  return;
 
         verify_fingerprint(GTK_WINDOW(dialog), context->active_fingerprint);
+    } else if (response == GTK_RESPONSE_HELP) {
+	char *helpurl = g_strdup_printf("%s%s&context=%s",
+		AUTHENTICATE_HELPURL, _("?lang=en"),
+		auth_opt_data->smppair->smp_type == 0 ?
+		    ( /* Question and Answer */
+		      auth_opt_data->smppair->responder ?
+		      "answer" : "question" ) :
+		auth_opt_data->smppair->smp_type == 1 ?
+		    ( /* Shared secret */
+		      auth_opt_data->smppair->responder ?
+		      "secretresp" : "secret" ) :
+		    /* Fingerprint */
+		    "fingerprint"
+		);
+	purple_notify_uri(otrg_plugin_handle, helpurl);
+	g_free(helpurl);
+
+	/* Don't destroy the window */
+	return;
     } else {
         otrg_plugin_abort_smp(context);
     }
     
-    /* In all cases, destroy the current window */
+    /* In all cases except HELP, destroy the current window */
     gtk_widget_destroy(GTK_WIDGET(dialog));
     
     /* Clean up references to this window */
@@ -824,6 +843,7 @@ static GtkWidget *create_smp_dialog(const char *title,
     
         dialog = gtk_dialog_new_with_buttons(title ? title :
 		PIDGIN_ALERT_TITLE, NULL, 0,
+                         GTK_STOCK_HELP, GTK_RESPONSE_HELP,
                          GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
                          GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
         gtk_dialog_set_default_response(GTK_DIALOG(dialog),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-otr/packages/irssi-plugin-otr.git



More information about the Pkg-otr-team mailing list