Commit 70ef4a79 authored by cypherpunk's avatar cypherpunk
Browse files

	* tooltipmenu.[ch]: New classes to allow tooltips on menus.

	* otr-icons.h: New OTR icons from <cyrus_xiii@yahoo.com>.

	* README:
	* AUTHORS:
	* *.[ch]: Update copyright dates to 2004-2008 and add Rob Smits
	as an author. (Rob wrote the new gtk-dialog stuff to handle user
	authentication with an explicit question, inserted inline OTR
	icons into the conversation when the status changes, and moved
	the OTR button to the menu bar.)

	* gtk-ui.c: Updated variable names to reflect the (old) change
	from "OTR Options" to "OTR Settings".

	* ui.h:
	* ui.c:
	* gtk-ui.c: Added new OTR UI Options section of the
	configuration panel, which currently controls only whether the
	old OTR button will still show up.

	* dialogs.h:
	* dialogs.c:
	* gtk-dialog.c:
	* otr-plugin.h:
	* otr-plugin.c: Support starting the SMP authentication with an
	explicit question.

	* otr-plugin.c: Better handling of the case where an SMP message
	fails a verification step.

	* configure.ac:
	* Makefile.mingw: Update version number to 3.2.0.

	* gtk-dialog.c: Made new OTR menus (one master one, and one for
	each active conversation in the window) that replace the old OTR
	button.  [The old button is still available as an option, but
	the menu is always present.]

	* gtk-dialog.c: OTR icons are inserted inline into the
	conversation when the OTR status changes.

	* configure.ac:
	* po/ar.po:
	* po/de.po:
	* po/ru.po: New translations:
	Arabic (Ahmad Gharbeia ﺄﺤﻣﺩ ﻍﺮﺒﻳﺓ <gharbeia@gmail.com>),
	German (Thorsten Mühlfelder <thenktor@gmx.de>),
	Russian (Sergei Smirnov <moscow@hro.org>)

	* dialogs.h: Help URLs now have version numbers in them, so the
	appropriate help page can be served.

	* Makefile.am: Include new files in compilation and distribution
	targets.
parent 318f755e
......@@ -2,6 +2,7 @@ Off-the-Record Messaging plugin for pidgin
Authors:
Ian Goldberg, Chris Alexander, Nikita Borisov <otr@cypherpunks.ca>
Ian Goldberg, Rob Smits, Chris Alexander, Nikita Borisov
<otr@cypherpunks.ca>
See the README file for mailing list information
2008-05-28
* tooltipmenu.[ch]: New classes to allow tooltips on menus.
* otr-icons.h: New OTR icons from <cyrus_xiii@yahoo.com>.
* README:
* AUTHORS:
* *.[ch]: Update copyright dates to 2004-2008 and add Rob Smits
as an author. (Rob wrote the new gtk-dialog stuff to handle user
authentication with an explicit question, inserted inline OTR
icons into the conversation when the status changes, and moved
the OTR button to the menu bar.)
* gtk-ui.c: Updated variable names to reflect the (old) change
from "OTR Options" to "OTR Settings".
* ui.h:
* ui.c:
* gtk-ui.c: Added new OTR UI Options section of the
configuration panel, which currently controls only whether the
old OTR button will still show up.
* dialogs.h:
* dialogs.c:
* gtk-dialog.c:
* otr-plugin.h:
* otr-plugin.c: Support starting the SMP authentication with an
explicit question.
* otr-plugin.c: Better handling of the case where an SMP message
fails a verification step.
* configure.ac:
* Makefile.mingw: Update version number to 3.2.0.
* gtk-dialog.c: Made new OTR menus (one master one, and one for
each active conversation in the window) that replace the old OTR
button. [The old button is still available as an option, but
the menu is always present.]
* gtk-dialog.c: OTR icons are inserted inline into the
conversation when the OTR status changes.
* configure.ac:
* po/ar.po:
* po/de.po:
* po/ru.po: New translations:
Arabic (Ahmad Gharbeia ﺄﺤﻣﺩ ﻍﺮﺒﻳﺓ <gharbeia@gmail.com>),
German (Thorsten Mühlfelder <thenktor@gmx.de>),
Russian (Sergei Smirnov <moscow@hro.org>)
* dialogs.h: Help URLs now have version numbers in them, so the
appropriate help page can be served.
* Makefile.am: Include new files in compilation and distribution
targets.
2007-07-28
* configure.ac: Fix PKG_CHECK_MODULES so that it gives a
......
......@@ -9,11 +9,13 @@ plugindir= ${libdir}/pidgin
plugin_LTLIBRARIES= pidgin-otr.la
pidgin_otr_la_SOURCES= otr-plugin.c ui.c dialogs.c gtk-ui.c gtk-dialog.c
pidgin_otr_la_SOURCES= otr-plugin.c ui.c dialogs.c gtk-ui.c gtk-dialog.c \
tooltipmenu.c
pidgin_otr_la_LDFLAGS= -module -avoid-version
pidgin_otr_la_LDFLAGS+= @LIBGCRYPT_LIBS@ @LIBOTR_LIBS@
EXTRA_DIST= dialogs.h gtk-dialog.h gtk-ui.h otr-plugin.h ui.h \
otr-icons.h tooltipmenu.h \
Makefile.mingw packaging/windows/pidgin-otr.nsi \
packaging/fedora/pidgin-otr.spec po/Makefile.mingw \
po/README intltool-extract.in intltool-merge.in \
......
WIN32=1
# The version number to put in the plugin info
PIDGIN_OTR_VERSION = 3.1.0
PIDGIN_OTR_VERSION = 3.2.0
# Name of the gettext domain
GETTEXT_PACKAGE = pidgin-otr
......
28 May 2008:
- The functionality of the OTR button has now moved to a menu. There's
an "OTR" menu, as well as an icon showing the current OTR state of
each active conversation in the window.
- New OTR icons from <cyrus_xiii@yahoo.com>
- OTR icons show up inline in the conversation window when the OTR
status changes.
- Buddy authentication has been revamped, based on the user study
published in SOUPS 2008. The default is now to choose a question and
an answer only you and the buddy should know. The question is
displayed to the buddy, who is prompted for the answer. The "shared
secret" and "fingerprint" authentication methods are still available.
- Translations for Arabic, German, Russian
1 Aug 2007:
- Released 3.1.0
......
Off-the-Record Messaging plugin for pidgin
v3.1.0, 1 Aug 2007
v3.2.0, 27 May 2008
This is a pidgin plugin which implements Off-the-Record (OTR) Messaging.
It is known to work (at least) under the Linux and Windows versions of
......@@ -32,7 +32,7 @@ checkbox next to it. Click "Configure Plugin" to bring up the OTR UI.
The UI has two "pages": "Config" and "Known fingerprints".
The "Config" page allows you generate private keys, and to set OTR
options.
settings and options.
Private keys are used to authenticate you to your buddies. Choose
one of your accounts from the menu, click "Generate" and wait until
......@@ -43,12 +43,12 @@ options.
Note that if you don't generate keys in this way, they will be
generated automatically, when they are needed.
The OTR options determine when private messaging is enabled. The
The OTR settings determine when private messaging is enabled. The
checkboxes on this page control the default settings; you can edit
the per-buddy settings by right-clicking on your buddy in the buddy
list, and choosing "OTR Options" from the menu.
list, and choosing "OTR Settings" from the menu.
The options are:
The settings are:
[X] Enable private messaging
[X] Automatically initiate private messaging
[ ] Require private messaging
......@@ -93,7 +93,7 @@ instead.]
If your buddy does have the OTR plugin (and it's enabled), a private
conversation will be initiated.
If both you and your buddy have OTR software, and your OTR options set
If both you and your buddy have OTR software, and your OTR settings set
to automatically initiate private messaging, your clients may recognize
each other and automatically start a private conversation.
......@@ -260,7 +260,8 @@ CONTACT
To report problems, comments, suggestions, patches, etc., you can email
the authors:
Ian Goldberg, Chris Alexander, and Nikita Borisov <otr@cypherpunks.ca>
Ian Goldberg, Rob Smits, Chris Alexander, and Nikita Borisov
<otr@cypherpunks.ca>
For more information on Off-the-Record Messaging, visit
http://otr.cypherpunks.ca/
dnl Process this file with autoconf to produce configure.
AC_INIT(pidgin-otr, 3.1.0)
AC_INIT(pidgin-otr, 3.2.0)
AM_CONFIG_HEADER(config.h)
......@@ -14,7 +14,7 @@ AM_PROG_LIBTOOL
AM_PATH_LIBGCRYPT(1:1.2.0,,AC_MSG_ERROR(libgcrypt 1.2.0 or newer is required.))
AM_PATH_LIBOTR(3.1.0,,AC_MSG_ERROR(libotr 3.1.0 or newer is required.))
AM_PATH_LIBOTR(3.2.0,,AC_MSG_ERROR(libotr 3.2.0 or newer is required.))
PKG_CHECK_MODULES([EXTRA], [glib-2.0 >= 2.6 gtk+-2.0 >= 2.6 pidgin >= 2.0 purple >= 2.0])
......@@ -24,7 +24,7 @@ GETTEXT_PACKAGE=pidgin-otr
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
ALL_LINGUAS="es fr nl sk"
ALL_LINGUAS="ar de es fr nl ru sk"
AM_GLIB_GNU_GETTEXT
AC_OUTPUT([Makefile po/Makefile.in])
/*
* Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov
* Copyright (C) 2004-2008 Ian Goldberg, Rob Smits,
* Chris Alexander, Nikita Borisov
* <otr@cypherpunks.ca>
*
* This program is free software; you can redistribute it and/or modify
......@@ -140,7 +141,15 @@ void otrg_dialog_verify_fingerprint(Fingerprint *fprint)
/* Show a dialog asking the user to give an SMP secret. */
void otrg_dialog_socialist_millionaires(ConnContext *context)
{
ui_ops->socialist_millionaires(context, TRUE);
ui_ops->socialist_millionaires(context, NULL, TRUE);
}
/* Show a dialog asking the user to give an SMP secret, prompting with a
* question. */
void otrg_dialog_socialist_millionaires_q(ConnContext *context,
char *question)
{
ui_ops->socialist_millionaires(context, question, TRUE);
}
/* Update the status of an ongoing socialist millionaires protocol. */
......
/*
* Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov
* Copyright (C) 2004-2008 Ian Goldberg, Rob Smits,
* Chris Alexander, Nikita Borisov
* <otr@cypherpunks.ca>
*
* This program is free software; you can redistribute it and/or modify
......@@ -28,12 +29,12 @@
#include <libotr/message.h>
/* The various help URLs */
#define BASE_HELPURL "http://otr-help.cypherpunks.ca/"
#define BASE_HELPURL "http://otr-help.cypherpunks.ca/" PIDGIN_OTR_VERSION "/"
#define AUTHENTICATE_HELPURL BASE_HELPURL "authenticate.php"
#define FINGERPRINT_HELPURL BASE_HELPURL "fingerprint.php"
#define SESSIONID_HELPURL BASE_HELPURL "sessionid.php"
#define UNVERIFIED_HELPURL BASE_HELPURL "unverified.php"
#define BUTTON_HELPURL BASE_HELPURL "buttonhelp.php"
#define LEVELS_HELPURL BASE_HELPURL "levels.php"
typedef struct s_OtrgDialogWait *OtrgDialogWaitHandle;
......@@ -59,7 +60,8 @@ typedef struct {
void (*verify_fingerprint)(Fingerprint *fprint);
void (*socialist_millionaires)(ConnContext *context, gboolean responder);
void (*socialist_millionaires)(ConnContext *context, char *question,
gboolean responder);
void (*update_smp)(ConnContext *context, double progress_level);
......@@ -139,6 +141,11 @@ void otrg_dialog_verify_fingerprint(Fingerprint *fprint);
/* Show a dialog asking the user to give an SMP secret. */
void otrg_dialog_socialist_millionaires(ConnContext *context);
/* Show a dialog asking the user to give an SMP secret, prompting with a
* question. */
void otrg_dialog_socialist_millionaires_q(ConnContext *context,
char *question);
/* Update the status of an ongoing socialist millionaires protocol. */
void otrg_dialog_update_smp(ConnContext *context, double progress_level);
......
This diff is collapsed.
/*
* Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov
* Copyright (C) 2004-2008 Ian Goldberg, Rob Smits,
* Chris Alexander, Nikita Borisov
* <otr@cypherpunks.ca>
*
* This program is free software; you can redistribute it and/or modify
......
/*
* Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov
* Copyright (C) 2004-2008 Ian Goldberg, Rob Smits,
* Chris Alexander, Nikita Borisov
* <otr@cypherpunks.ca>
*
* This program is free software; you can redistribute it and/or modify
......@@ -47,13 +48,17 @@
#include "ui.h"
#include "otr-plugin.h"
struct otroptionsdata {
struct otrsettingsdata {
GtkWidget *enablebox;
GtkWidget *automaticbox;
GtkWidget *onlyprivatebox;
GtkWidget *avoidloggingotrbox;
};
struct otroptionsdata {
GtkWidget *showotrbutton;
};
static struct {
GtkWidget *accountmenu;
GtkWidget *fprint_label;
......@@ -66,6 +71,7 @@ static struct {
GtkWidget *disconnect_button;
GtkWidget *forget_button;
GtkWidget *verify_button;
struct otrsettingsdata os;
struct otroptionsdata oo;
} ui_layout;
......@@ -222,9 +228,9 @@ static void ui_destroyed(GtkObject *object)
ui_layout.disconnect_button = NULL;
ui_layout.forget_button = NULL;
ui_layout.verify_button = NULL;
ui_layout.oo.enablebox = NULL;
ui_layout.oo.automaticbox = NULL;
ui_layout.oo.onlyprivatebox = NULL;
ui_layout.os.enablebox = NULL;
ui_layout.os.automaticbox = NULL;
ui_layout.os.onlyprivatebox = NULL;
}
static void clist_selected(GtkWidget *widget, gint row, gint column,
......@@ -368,41 +374,42 @@ static void verify_fingerprint(GtkWidget *widget, gpointer data)
otrg_dialog_verify_fingerprint(fingerprint);
}
static void otroptions_clicked_cb(GtkButton *button, struct otroptionsdata *oo)
static void otrsettings_clicked_cb(GtkButton *button,
struct otrsettingsdata *os)
{
gtk_widget_set_sensitive(oo->enablebox, TRUE);
gtk_widget_set_sensitive(os->enablebox, TRUE);
if (gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->enablebox))) {
gtk_widget_set_sensitive(oo->automaticbox, TRUE);
GTK_TOGGLE_BUTTON(os->enablebox))) {
gtk_widget_set_sensitive(os->automaticbox, TRUE);
if (gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->automaticbox))) {
gtk_widget_set_sensitive(oo->onlyprivatebox, TRUE);
GTK_TOGGLE_BUTTON(os->automaticbox))) {
gtk_widget_set_sensitive(os->onlyprivatebox, TRUE);
} else {
gtk_widget_set_sensitive(oo->onlyprivatebox, FALSE);
gtk_widget_set_sensitive(os->onlyprivatebox, FALSE);
}
gtk_widget_set_sensitive(oo->avoidloggingotrbox, TRUE);
gtk_widget_set_sensitive(os->avoidloggingotrbox, TRUE);
} else {
gtk_widget_set_sensitive(oo->automaticbox, FALSE);
gtk_widget_set_sensitive(oo->onlyprivatebox, FALSE);
gtk_widget_set_sensitive(oo->avoidloggingotrbox, FALSE);
gtk_widget_set_sensitive(os->automaticbox, FALSE);
gtk_widget_set_sensitive(os->onlyprivatebox, FALSE);
gtk_widget_set_sensitive(os->avoidloggingotrbox, FALSE);
}
}
static void create_otroption_buttons(struct otroptionsdata *oo,
static void create_otrsettings_buttons(struct otrsettingsdata *os,
GtkWidget *vbox)
{
GtkWidget *tempbox1, *tempbox2;
oo->enablebox = gtk_check_button_new_with_label(_("Enable private "
os->enablebox = gtk_check_button_new_with_label(_("Enable private "
"messaging"));
oo->automaticbox = gtk_check_button_new_with_label(_("Automatically "
os->automaticbox = gtk_check_button_new_with_label(_("Automatically "
"initiate private messaging"));
oo->onlyprivatebox = gtk_check_button_new_with_label(_("Require private "
os->onlyprivatebox = gtk_check_button_new_with_label(_("Require private "
"messaging"));
oo->avoidloggingotrbox = gtk_check_button_new_with_label(
os->avoidloggingotrbox = gtk_check_button_new_with_label(
_("Don't log OTR conversations"));
gtk_box_pack_start(GTK_BOX(vbox), oo->enablebox,
gtk_box_pack_start(GTK_BOX(vbox), os->enablebox,
FALSE, FALSE, 0);
tempbox1 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), tempbox1,
......@@ -410,25 +417,44 @@ static void create_otroption_buttons(struct otroptionsdata *oo,
tempbox2 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(tempbox1), tempbox2, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(tempbox2), oo->automaticbox,
gtk_box_pack_start(GTK_BOX(tempbox2), os->automaticbox,
FALSE, FALSE, 0);
tempbox1 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(tempbox2), tempbox1, FALSE, FALSE, 0);
tempbox2 = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(tempbox1), tempbox2, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(tempbox2), oo->onlyprivatebox,
gtk_box_pack_start(GTK_BOX(tempbox2), os->onlyprivatebox,
FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), oo->avoidloggingotrbox, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), os->avoidloggingotrbox, FALSE, FALSE, 5);
g_signal_connect(G_OBJECT(oo->enablebox), "clicked",
G_CALLBACK(otroptions_clicked_cb), oo);
g_signal_connect(G_OBJECT(oo->automaticbox), "clicked",
G_CALLBACK(otroptions_clicked_cb), oo);
g_signal_connect(G_OBJECT(oo->onlyprivatebox), "clicked",
G_CALLBACK(otroptions_clicked_cb), oo);
g_signal_connect(G_OBJECT(oo->avoidloggingotrbox), "clicked",
g_signal_connect(G_OBJECT(os->enablebox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os);
g_signal_connect(G_OBJECT(os->automaticbox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os);
g_signal_connect(G_OBJECT(os->onlyprivatebox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os);
g_signal_connect(G_OBJECT(os->avoidloggingotrbox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os);
}
static void otroptions_clicked_cb(GtkButton *button,
struct otroptionsdata *oo)
{
/* This doesn't really do anything useful right now, but is here for
* future expansion purposes. */
gtk_widget_set_sensitive(oo->showotrbutton, TRUE);
}
static void create_otroptions_buttons(struct otroptionsdata *oo,
GtkWidget *vbox)
{
oo->showotrbutton = gtk_check_button_new_with_label(_("Show OTR button"));
gtk_box_pack_start(GTK_BOX(vbox), oo->showotrbutton, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(oo->showotrbutton), "clicked",
G_CALLBACK(otroptions_clicked_cb), oo);
}
......@@ -498,7 +524,7 @@ static void otrg_gtk_ui_buddy_prefs_save(PurpleBuddy *buddy,
purple_blist_node_set_bool(node, "OTR/avoidloggingotr", avoidloggingotr);
}
static void load_otroptions(struct otroptionsdata *oo)
static void load_otrsettings(struct otrsettingsdata *os)
{
gboolean otrenabled;
gboolean otrautomatic;
......@@ -508,16 +534,51 @@ static void load_otroptions(struct otroptionsdata *oo)
otrg_gtk_ui_global_prefs_load(&otrenabled, &otrautomatic, &otronlyprivate,
&otravoidloggingotr);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->enablebox),
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->enablebox),
otrenabled);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->automaticbox),
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->automaticbox),
otrautomatic);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->onlyprivatebox),
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->onlyprivatebox),
otronlyprivate);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->avoidloggingotrbox),
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->avoidloggingotrbox),
otravoidloggingotr);
otroptions_clicked_cb(GTK_BUTTON(oo->enablebox), oo);
otrsettings_clicked_cb(GTK_BUTTON(os->enablebox), os);
}
/* Load the global OTR UI options */
static void otrg_gtk_ui_global_options_load(gboolean *showotrbuttonp)
{
if (purple_prefs_exists("/OTR/showotrbutton")) {
*showotrbuttonp = purple_prefs_get_bool("/OTR/showotrbutton");
} else {
*showotrbuttonp = FALSE;
}
}
/* Save the global OTR UI options */
static void otrg_gtk_ui_global_options_save(gboolean showotrbutton)
{
if (! purple_prefs_exists("/OTR")) {
purple_prefs_add_none("/OTR");
}
if (! purple_prefs_exists("/OTR/showotrbutton")) {
purple_prefs_add_bool("/OTR/showotrbutton", showotrbutton);
}
purple_prefs_set_bool("/OTR/showotrbutton", showotrbutton);
}
static void load_otroptions(struct otroptionsdata *oo)
{
gboolean showotrbutton;
otrg_gtk_ui_global_options_load(&showotrbutton);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->showotrbutton),
showotrbutton);
otroptions_clicked_cb(GTK_BUTTON(oo->showotrbutton), oo);
}
/* Create the privkeys UI, and pack it into the vbox */
......@@ -571,46 +632,77 @@ static void make_privkeys_ui(GtkWidget *vbox)
FALSE, FALSE, 0);
}
/* Save the global OTR options whenever they're clicked */
static void otroptions_save_cb(GtkButton *button, struct otroptionsdata *oo)
/* Save the global OTR settings whenever they're clicked */
static void otrsettings_save_cb(GtkButton *button, struct otrsettingsdata *os)
{
otrg_gtk_ui_global_prefs_save(
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->enablebox)),
GTK_TOGGLE_BUTTON(os->enablebox)),
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->automaticbox)),
GTK_TOGGLE_BUTTON(os->automaticbox)),
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->onlyprivatebox)),
GTK_TOGGLE_BUTTON(os->onlyprivatebox)),
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->avoidloggingotrbox)));
GTK_TOGGLE_BUTTON(os->avoidloggingotrbox)));
otrg_dialog_resensitize_all();
}
/* Save the global OTR UI options whenever they're clicked */
static void otroptions_save_cb(GtkButton *button, struct otroptionsdata *oo)
{
otrg_gtk_ui_global_options_save(
gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(oo->showotrbutton)));
otrg_dialog_resensitize_all();
}
/* Make the settings UI, and pack it into the vbox */
static void make_settings_ui(GtkWidget *vbox)
{
GtkWidget *fbox;
GtkWidget *frame;
frame = gtk_frame_new(_("Default OTR Settings"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
fbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(fbox), 10);
gtk_container_add(GTK_CONTAINER(frame), fbox);
create_otrsettings_buttons(&(ui_layout.os), fbox);
load_otrsettings(&(ui_layout.os));
g_signal_connect(G_OBJECT(ui_layout.os.enablebox), "clicked",
G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
g_signal_connect(G_OBJECT(ui_layout.os.automaticbox), "clicked",
G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
g_signal_connect(G_OBJECT(ui_layout.os.onlyprivatebox), "clicked",
G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
g_signal_connect(G_OBJECT(ui_layout.os.avoidloggingotrbox), "clicked",
G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
}
/* Make the options UI, and pack it into the vbox */
static void make_options_ui(GtkWidget *vbox)
{
GtkWidget *fbox;
GtkWidget *frame;
frame = gtk_frame_new(_("Default OTR Settings"));
frame = gtk_frame_new(_("OTR UI Options"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
fbox = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(fbox), 10);
gtk_container_add(GTK_CONTAINER(frame), fbox);
create_otroption_buttons(&(ui_layout.oo), fbox);
create_otroptions_buttons(&(ui_layout.oo), fbox);
load_otroptions(&(ui_layout.oo));
g_signal_connect(G_OBJECT(ui_layout.oo.enablebox), "clicked",
G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
g_signal_connect(G_OBJECT(ui_layout.oo.automaticbox), "clicked",
G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
g_signal_connect(G_OBJECT(ui_layout.oo.onlyprivatebox), "clicked",
G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
g_signal_connect(G_OBJECT(ui_layout.oo.avoidloggingotrbox), "clicked",
g_signal_connect(G_OBJECT(ui_layout.oo.showotrbutton), "clicked",
G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
}
......@@ -725,6 +817,8 @@ GtkWidget* otrg_gtk_ui_make_widget(PurplePlugin *plugin)
make_privkeys_ui(configbox);
make_settings_ui(configbox);
make_options_ui(configbox);
/*
......@@ -748,7 +842,7 @@ struct cbdata {
GtkWidget *dialog;
PurpleBuddy *buddy;
GtkWidget *defaultbox;
struct otroptionsdata oo;
struct otrsettingsdata os;
};
static void default_clicked_cb(GtkButton *button, struct cbdata *data)
......@@ -756,12 +850,12 @@ static void default_clicked_cb(GtkButton *button, struct cbdata *data)
gboolean defaultset =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->defaultbox));
if (defaultset) {
gtk_widget_set_sensitive(data->oo.enablebox, FALSE);
gtk_widget_set_sensitive(data->oo.automaticbox, FALSE);
gtk_widget_set_sensitive(data->oo.onlyprivatebox, FALSE);
gtk_widget_set_sensitive(data->oo.avoidloggingotrbox, FALSE);
gtk_widget_set_sensitive(data->os.enablebox, FALSE);
gtk_widget_set_sensitive(data->os.automaticbox, FALSE);
gtk_widget_set_sensitive(data->os.onlyprivatebox, FALSE);
gtk_widget_set_sensitive(data->os.avoidloggingotrbox, FALSE);
} else {
otroptions_clicked_cb(button, &(data->oo));
otrsettings_clicked_cb(button, &(data->os));
}
}
......@@ -777,17 +871,17 @@ static void load_buddyprefs(struct cbdata *data)
if (usedefault) {
/* Load the global defaults */
load_otroptions(&(data->oo));
load_otrsettings(&(data->os));
} else {
/* We've got buddy-specific prefs */
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(data->oo.enablebox), enabled);
GTK_TOGGLE_BUTTON(data->os.enablebox), enabled);
gtk_toggle_button_set_active(