[pkg-otr-team] [irssi-plugin-otr] 85/167: * otr-plugin.c: Added annoying warning copies to prepare for win32 build.

Holger Levsen holger at moszumanska.debian.org
Mon Mar 3 21:55:35 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 1b773d489c2a321669111c0262234c2d0ba59ee7
Author: Rob Smits <rdfsmits at cs.uwaterloo.ca>
Date:   Fri May 11 13:13:12 2012 -0400

    	* otr-plugin.c: Added annoying warning copies to prepare
    	for win32 build.
---
 otr-plugin.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/otr-plugin.c b/otr-plugin.c
index fdfe293..9de865d 100644
--- a/otr-plugin.c
+++ b/otr-plugin.c
@@ -76,6 +76,11 @@
 #include <glib.h>
 #include "gtk-ui.h"
 #include "gtk-dialog.h"
+
+#if defined WIN32 && defined USING_GTK /* Only for win32 beta */
+#include "gtkblist.h"
+#endif
+
 #endif
 
 /* If we're using glib on Windows, we need to use g_fopen to open files.
@@ -1219,6 +1224,11 @@ static gboolean otr_plugin_load(PurplePlugin *handle)
     FILE *privf;
     FILE *storef;
     FILE *instagf;
+#if defined WIN32 && defined USING_GTK /* Only for win32 beta */
+    GtkWidget *dialog;
+    GtkWidget *dialog_text;
+    PidginBuddyList *blist;
+#endif
 
     if (!privkeyfile || !storefile || !instagfile) {
 	g_free(privkeyfile);
@@ -1227,6 +1237,52 @@ static gboolean otr_plugin_load(PurplePlugin *handle)
 	return 0;
     }
 
+#if defined WIN32 && defined USING_GTK /* Only for win32 beta */
+    blist = pidgin_blist_get_default_gtk_blist();
+
+    if (time(NULL) > 1356998400) /* 2013-01-01 */ {
+	dialog = gtk_dialog_new_with_buttons ("OTR PLUGIN V4.0 BETA",
+		GTK_WINDOW(blist->window),
+		GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+		GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+	dialog_text = gtk_label_new(NULL);
+	gtk_widget_set_size_request(dialog_text, 350, 100);
+	gtk_label_set_line_wrap(GTK_LABEL(dialog_text), TRUE);
+	gtk_label_set_text(GTK_LABEL(dialog_text), "This beta copy of the "
+		"Off-the-Record Messaging v4.0 Pidgin plugin has expired as of "
+		"2013-01-01. Please look for an updated release at "
+		"www.cypherpunks.ca/otr.");
+	gtk_widget_show(dialog_text);
+	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), dialog_text,
+		TRUE, TRUE, 0);
+	gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_widget_destroy(dialog);
+
+	g_free(privkeyfile);
+	g_free(storefile);
+	g_free(instagfile);
+	return 0;
+    }
+
+
+    dialog = gtk_dialog_new_with_buttons ("OTR PLUGIN V4.0 BETA",
+	    GTK_WINDOW(blist->window),
+	    GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+	    GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+    dialog_text = gtk_label_new(NULL);
+    gtk_widget_set_size_request(dialog_text, 350, 100);
+    gtk_label_set_line_wrap(GTK_LABEL(dialog_text), TRUE);
+    gtk_label_set_text(GTK_LABEL(dialog_text), "You have enabled a beta "
+	    "version of the Off-the-Record Messaging v4.0 Pidgin plugin. "
+	    "This version is intended for testing purposes only and is not "
+	    "for general purpose use.");
+    gtk_widget_show(dialog_text);
+    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), dialog_text,
+	    TRUE, TRUE, 0);
+    gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(dialog);
+#endif
+
     privf = g_fopen(privkeyfile, "rb");
     storef = g_fopen(storefile, "rb");
     instagf = g_fopen(instagfile, "rb");

-- 
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