2007-09-27 20:57:58 +00:00
|
|
|
/*
|
2009-01-10 23:09:07 +00:00
|
|
|
* This file Copyright (C) 2007-2009 Charles Kerr <charles@transmissionbt.com>
|
2007-02-19 22:09:05 +00:00
|
|
|
*
|
2007-09-27 20:57:58 +00:00
|
|
|
* This file is licensed by the GPL version 2. Works owned by the
|
|
|
|
* Transmission project are granted a special exemption to clause 2(b)
|
2008-09-23 19:11:04 +00:00
|
|
|
* so that the bulk of its code can remain under the MIT license.
|
2007-09-27 20:57:58 +00:00
|
|
|
* This exemption does not extend to derived works not owned by
|
|
|
|
* the Transmission project.
|
2008-09-23 19:11:04 +00:00
|
|
|
*
|
2007-09-28 00:46:22 +00:00
|
|
|
* $Id$
|
2007-09-27 20:57:58 +00:00
|
|
|
*/
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
#include <ctype.h> /* isspace */
|
2008-06-03 20:59:57 +00:00
|
|
|
#include <errno.h>
|
2008-06-04 19:46:37 +00:00
|
|
|
#include <stdarg.h>
|
2009-04-07 20:13:08 +00:00
|
|
|
#include <limits.h> /* USHRT_MAX */
|
2008-03-18 01:22:11 +00:00
|
|
|
#include <stdlib.h> /* free() */
|
2008-03-30 00:21:46 +00:00
|
|
|
#include <unistd.h>
|
2007-02-19 22:09:05 +00:00
|
|
|
#include <glib/gi18n.h>
|
2007-09-27 20:57:58 +00:00
|
|
|
#include <gtk/gtk.h>
|
2007-07-18 23:04:26 +00:00
|
|
|
#include <libtransmission/transmission.h>
|
2008-03-30 03:20:18 +00:00
|
|
|
#include <libtransmission/utils.h>
|
2008-05-09 03:20:34 +00:00
|
|
|
#include <libtransmission/version.h>
|
2008-04-25 18:35:48 +00:00
|
|
|
#include <libtransmission/web.h>
|
2007-02-19 22:09:05 +00:00
|
|
|
#include "conf.h"
|
2007-09-27 20:57:58 +00:00
|
|
|
#include "hig.h"
|
2008-02-26 19:58:03 +00:00
|
|
|
#include "tr-core.h"
|
|
|
|
#include "tr-prefs.h"
|
2007-02-19 22:09:05 +00:00
|
|
|
#include "util.h"
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
/**
|
|
|
|
***
|
|
|
|
**/
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
#define PREF_KEY "pref-key"
|
2007-02-19 22:09:05 +00:00
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
response_cb( GtkDialog * dialog,
|
|
|
|
int response,
|
|
|
|
gpointer unused UNUSED )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
if( response == GTK_RESPONSE_HELP )
|
|
|
|
{
|
#963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of
#963 (gtk) for online help URLs, use branch names (1.2x) instead of specific version names (1.21) so that we don't have to add a URL for every release.
2008-05-22 17:39:20 +00:00
|
|
|
char * base = gtr_get_help_url( );
|
|
|
|
char * url = g_strdup_printf( "%s/html/preferences.html", base );
|
|
|
|
gtr_open_file( url );
|
|
|
|
g_free( url );
|
|
|
|
g_free( base );
|
|
|
|
}
|
2008-05-09 03:20:34 +00:00
|
|
|
|
|
|
|
if( response == GTK_RESPONSE_CLOSE )
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_widget_destroy( GTK_WIDGET( dialog ) );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
toggled_cb( GtkToggleButton * w,
|
|
|
|
gpointer core )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
const char * key = g_object_get_data( G_OBJECT( w ), PREF_KEY );
|
2007-09-27 20:57:58 +00:00
|
|
|
const gboolean flag = gtk_toggle_button_get_active( w );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
tr_core_set_pref_bool( TR_CORE( core ), key, flag );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
static GtkWidget*
|
2008-09-23 19:11:04 +00:00
|
|
|
new_check_button( const char * mnemonic,
|
|
|
|
const char * key,
|
|
|
|
gpointer core )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2007-09-27 20:57:58 +00:00
|
|
|
GtkWidget * w = gtk_check_button_new_with_mnemonic( mnemonic );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, g_strdup(
|
|
|
|
key ), g_free );
|
|
|
|
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ),
|
|
|
|
pref_flag_get( key ) );
|
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( toggled_cb ), core );
|
2007-09-27 20:57:58 +00:00
|
|
|
return w;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
#define IDLE_DATA "idle-data"
|
|
|
|
|
|
|
|
struct spin_idle_data
|
|
|
|
{
|
2008-10-07 00:34:21 +00:00
|
|
|
gpointer core;
|
|
|
|
GTimer * last_change;
|
2009-02-13 18:23:56 +00:00
|
|
|
gboolean isDouble;
|
2008-09-03 16:29:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
spin_idle_data_free( gpointer gdata )
|
|
|
|
{
|
|
|
|
struct spin_idle_data * data = gdata;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
g_timer_destroy( data->last_change );
|
|
|
|
g_free( data );
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2008-10-07 00:34:21 +00:00
|
|
|
spun_cb_idle( gpointer spin )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2008-10-07 00:34:21 +00:00
|
|
|
gboolean keep_waiting = TRUE;
|
|
|
|
GObject * o = G_OBJECT( spin );
|
|
|
|
struct spin_idle_data * data = g_object_get_data( o, IDLE_DATA );
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2008-09-03 20:00:27 +00:00
|
|
|
/* has the user stopped making changes? */
|
|
|
|
if( g_timer_elapsed( data->last_change, NULL ) > 0.33f )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
|
|
|
/* update the core */
|
2008-10-07 00:34:21 +00:00
|
|
|
const char * key = g_object_get_data( o, PREF_KEY );
|
2009-02-13 18:23:56 +00:00
|
|
|
if (data->isDouble)
|
|
|
|
{
|
|
|
|
const double value = gtk_spin_button_get_value( GTK_SPIN_BUTTON( spin ) );
|
|
|
|
tr_core_set_pref_double( TR_CORE( data->core ), key, value );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const int value = gtk_spin_button_get_value_as_int(
|
|
|
|
GTK_SPIN_BUTTON( spin ) );
|
|
|
|
tr_core_set_pref_int( TR_CORE( data->core ), key, value );
|
|
|
|
}
|
2008-09-03 16:29:59 +00:00
|
|
|
|
|
|
|
/* cleanup */
|
2008-10-07 00:34:21 +00:00
|
|
|
g_object_set_data( o, IDLE_DATA, NULL );
|
2008-09-03 16:29:59 +00:00
|
|
|
keep_waiting = FALSE;
|
2008-10-07 00:34:21 +00:00
|
|
|
g_object_unref( G_OBJECT( o ) );
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return keep_waiting;
|
|
|
|
}
|
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
spun_cb( GtkSpinButton * w,
|
2009-02-13 18:23:56 +00:00
|
|
|
gpointer core,
|
|
|
|
gboolean isDouble )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-03 16:29:59 +00:00
|
|
|
/* user may be spinning through many values, so let's hold off
|
|
|
|
for a moment to keep from flooding the core with changes */
|
2008-10-07 00:34:21 +00:00
|
|
|
GObject * o = G_OBJECT( w );
|
2008-09-03 16:29:59 +00:00
|
|
|
struct spin_idle_data * data = g_object_get_data( o, IDLE_DATA );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
if( data == NULL )
|
|
|
|
{
|
|
|
|
data = g_new( struct spin_idle_data, 1 );
|
|
|
|
data->core = core;
|
|
|
|
data->last_change = g_timer_new( );
|
2009-02-13 18:23:56 +00:00
|
|
|
data->isDouble = isDouble;
|
2008-10-07 00:34:21 +00:00
|
|
|
g_object_set_data_full( o, IDLE_DATA, data, spin_idle_data_free );
|
|
|
|
g_object_ref( G_OBJECT( o ) );
|
2009-06-29 17:22:35 +00:00
|
|
|
gtr_timeout_add_seconds( 1, spun_cb_idle, w );
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
g_timer_start( data->last_change );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2009-02-13 18:23:56 +00:00
|
|
|
static void
|
|
|
|
spun_cb_int( GtkSpinButton * w,
|
|
|
|
gpointer core )
|
|
|
|
{
|
|
|
|
spun_cb( w, core, FALSE );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
spun_cb_double( GtkSpinButton * w,
|
|
|
|
gpointer core )
|
|
|
|
{
|
|
|
|
spun_cb( w, core, TRUE );
|
|
|
|
}
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
static GtkWidget*
|
2008-09-23 19:11:04 +00:00
|
|
|
new_spin_button( const char * key,
|
|
|
|
gpointer core,
|
|
|
|
int low,
|
|
|
|
int high,
|
|
|
|
int step )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2007-12-26 10:39:10 +00:00
|
|
|
GtkWidget * w = gtk_spin_button_new_with_range( low, high, step );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, g_strdup(
|
|
|
|
key ), g_free );
|
|
|
|
gtk_spin_button_set_digits( GTK_SPIN_BUTTON( w ), 0 );
|
|
|
|
gtk_spin_button_set_value( GTK_SPIN_BUTTON( w ), pref_int_get( key ) );
|
2009-02-13 18:23:56 +00:00
|
|
|
g_signal_connect( w, "value-changed", G_CALLBACK( spun_cb_int ), core );
|
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
new_spin_button_double( const char * key,
|
|
|
|
gpointer core,
|
|
|
|
double low,
|
|
|
|
double high,
|
|
|
|
double step )
|
|
|
|
{
|
|
|
|
GtkWidget * w = gtk_spin_button_new_with_range( low, high, step );
|
|
|
|
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, g_strdup(
|
|
|
|
key ), g_free );
|
|
|
|
gtk_spin_button_set_digits( GTK_SPIN_BUTTON( w ), 2 );
|
|
|
|
gtk_spin_button_set_value( GTK_SPIN_BUTTON( w ), pref_double_get( key ) );
|
|
|
|
g_signal_connect( w, "value-changed", G_CALLBACK( spun_cb_double ), core );
|
2007-09-27 20:57:58 +00:00
|
|
|
return w;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2008-06-02 21:02:38 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
entry_changed_cb( GtkEntry * w,
|
|
|
|
gpointer core )
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
|
|
|
const char * key = g_object_get_data( G_OBJECT( w ), PREF_KEY );
|
|
|
|
const char * value = gtk_entry_get_text( w );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-02 21:02:38 +00:00
|
|
|
tr_core_set_pref( TR_CORE( core ), key, value );
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2008-09-23 19:11:04 +00:00
|
|
|
new_entry( const char * key,
|
|
|
|
gpointer core )
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkWidget * w = gtk_entry_new( );
|
2008-06-12 16:25:36 +00:00
|
|
|
const char * value = pref_string_get( key );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-06 20:03:19 +00:00
|
|
|
if( value )
|
|
|
|
gtk_entry_set_text( GTK_ENTRY( w ), value );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, g_strdup(
|
|
|
|
key ), g_free );
|
|
|
|
g_signal_connect( w, "changed", G_CALLBACK( entry_changed_cb ), core );
|
2008-06-02 21:02:38 +00:00
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
chosen_cb( GtkFileChooser * w,
|
|
|
|
gpointer core )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
const char * key = g_object_get_data( G_OBJECT( w ), PREF_KEY );
|
|
|
|
char * value = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( w ) );
|
|
|
|
|
|
|
|
tr_core_set_pref( TR_CORE( core ), key, value );
|
2007-09-27 20:57:58 +00:00
|
|
|
g_free( value );
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
static GtkWidget*
|
2008-09-23 19:11:04 +00:00
|
|
|
new_path_chooser_button( const char * key,
|
|
|
|
gpointer core )
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkWidget * w = gtk_file_chooser_button_new(
|
|
|
|
NULL,
|
|
|
|
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER );
|
2008-06-12 16:25:36 +00:00
|
|
|
const char * path = pref_string_get( key );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, g_strdup(
|
|
|
|
key ), g_free );
|
|
|
|
g_signal_connect( w, "selection-changed", G_CALLBACK( chosen_cb ), core );
|
|
|
|
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( w ), path );
|
2007-09-27 20:57:58 +00:00
|
|
|
return w;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2007-12-13 20:46:19 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
target_cb( GtkWidget * tb,
|
|
|
|
gpointer target )
|
2007-12-13 20:46:19 +00:00
|
|
|
{
|
2008-02-14 17:18:00 +00:00
|
|
|
const gboolean b = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( tb ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( target ), b );
|
2007-12-13 20:46:19 +00:00
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Torrent Tab
|
|
|
|
****/
|
2007-12-15 22:24:16 +00:00
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
static GtkWidget*
|
|
|
|
torrentPage( GObject * core )
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int row = 0;
|
2008-02-13 03:00:21 +00:00
|
|
|
const char * s;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
2009-03-28 16:47:01 +00:00
|
|
|
GtkWidget * w2;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-03-18 19:14:21 +00:00
|
|
|
#ifdef HAVE_GIO
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkWidget * l;
|
2008-03-18 19:14:21 +00:00
|
|
|
#endif
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
t = hig_workarea_create( );
|
2008-04-03 02:11:15 +00:00
|
|
|
hig_workarea_add_section_title( t, &row, _( "Adding Torrents" ) );
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-03-09 15:27:08 +00:00
|
|
|
#ifdef HAVE_GIO
|
2008-09-23 19:11:04 +00:00
|
|
|
s = _( "Automatically _add torrents from:" );
|
|
|
|
l = new_check_button( s, PREF_KEY_DIR_WATCH_ENABLED, core );
|
|
|
|
w = new_path_chooser_button( PREF_KEY_DIR_WATCH, core );
|
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( w ),
|
|
|
|
pref_flag_get( PREF_KEY_DIR_WATCH_ENABLED ) );
|
|
|
|
g_signal_connect( l, "toggled", G_CALLBACK( target_cb ), w );
|
|
|
|
hig_workarea_add_row_w( t, &row, l, w, NULL );
|
2008-03-09 15:27:08 +00:00
|
|
|
#endif
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
s = _( "Display _options dialog" );
|
|
|
|
w = new_check_button( s, PREF_KEY_OPTIONS_PROMPT, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
s = _( "_Start when added" );
|
|
|
|
w = new_check_button( s, PREF_KEY_START, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
s = _( "Mo_ve source files to Trash" );
|
|
|
|
w = new_check_button( s, PREF_KEY_TRASH_ORIGINAL, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2008-03-09 15:27:08 +00:00
|
|
|
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_path_chooser_button( TR_PREFS_KEY_DOWNLOAD_DIR, core );
|
2009-06-23 03:40:32 +00:00
|
|
|
hig_workarea_add_row( t, &row, _( "Save to _Location:" ), w, NULL );
|
2008-03-09 15:27:08 +00:00
|
|
|
|
2009-03-28 16:47:01 +00:00
|
|
|
hig_workarea_add_section_divider( t, &row );
|
|
|
|
hig_workarea_add_section_title( t, &row, _( "Limits" ) );
|
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "_Seed torrent until its ratio reaches:" );
|
2009-03-28 16:47:01 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_RATIO_ENABLED, core );
|
2009-04-10 19:16:12 +00:00
|
|
|
w2 = new_spin_button_double( TR_PREFS_KEY_RATIO, core, 0, INT_MAX, .05 );
|
2009-03-28 16:47:01 +00:00
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( w2 ), pref_flag_get( TR_PREFS_KEY_RATIO_ENABLED ) );
|
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( target_cb ), w2 );
|
|
|
|
hig_workarea_add_row_w( t, &row, w, w2, NULL );
|
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
2008-02-13 03:00:21 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-10-08 18:26:55 +00:00
|
|
|
/****
|
|
|
|
***** Desktop Tab
|
|
|
|
****/
|
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
desktopPage( GObject * core )
|
|
|
|
{
|
|
|
|
int row = 0;
|
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
|
|
|
|
t = hig_workarea_create( );
|
2009-06-23 00:24:37 +00:00
|
|
|
hig_workarea_add_section_title( t, &row, _( "Desktop" ) );
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Inhibit _hibernation when torrents are active" );
|
2008-10-08 18:26:55 +00:00
|
|
|
w = new_check_button( s, PREF_KEY_INHIBIT_HIBERNATION, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Show Transmission in the system _tray" );
|
2008-10-08 18:26:55 +00:00
|
|
|
w = new_check_button( s, PREF_KEY_SHOW_TRAY_ICON, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Show popup _notifications" );
|
2009-01-12 18:48:20 +00:00
|
|
|
w = new_check_button( s, PREF_KEY_SHOW_DESKTOP_NOTIFICATION, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
|
2008-10-08 18:26:55 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Peer Tab
|
|
|
|
****/
|
2008-03-30 00:21:46 +00:00
|
|
|
|
|
|
|
struct blocklist_data
|
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
gulong updateBlocklistTag;
|
|
|
|
GtkWidget * updateBlocklistButton;
|
|
|
|
GtkWidget * updateBlocklistDialog;
|
|
|
|
GtkWidget * check;
|
|
|
|
TrCore * core;
|
2008-03-30 00:21:46 +00:00
|
|
|
};
|
|
|
|
|
2008-04-01 16:57:48 +00:00
|
|
|
static void
|
2009-04-07 20:13:08 +00:00
|
|
|
updateBlocklistText( GtkWidget * w, TrCore * core )
|
2008-04-01 16:57:48 +00:00
|
|
|
{
|
2008-10-28 19:49:33 +00:00
|
|
|
const int n = tr_blocklistGetRuleCount( tr_core_session( core ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
char buf[512];
|
2008-04-01 16:57:48 +00:00
|
|
|
g_snprintf( buf, sizeof( buf ),
|
2008-09-03 16:29:59 +00:00
|
|
|
ngettext( "Enable _blocklist (contains %'d rule)",
|
|
|
|
"Enable _blocklist (contains %'d rules)", n ), n );
|
2008-04-01 16:57:48 +00:00
|
|
|
gtk_button_set_label( GTK_BUTTON( w ), buf );
|
|
|
|
}
|
2008-03-30 00:21:46 +00:00
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* prefs dialog is being destroyed, so stop listening to blocklist updates */
|
2008-04-25 18:35:48 +00:00
|
|
|
static void
|
2009-06-27 05:23:13 +00:00
|
|
|
privacyPageDestroyed( gpointer gdata, GObject * dead UNUSED )
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2008-04-25 18:35:48 +00:00
|
|
|
struct blocklist_data * data = gdata;
|
2009-04-07 20:13:08 +00:00
|
|
|
if( data->updateBlocklistTag > 0 )
|
|
|
|
g_signal_handler_disconnect( data->core, data->updateBlocklistTag );
|
|
|
|
g_free( data );
|
2008-03-30 00:21:46 +00:00
|
|
|
}
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* user hit "close" in the blocklist-update dialog */
|
2008-03-30 00:21:46 +00:00
|
|
|
static void
|
2009-04-07 20:13:08 +00:00
|
|
|
onBlocklistUpdateResponse( GtkDialog * dialog, gint response UNUSED, gpointer gdata )
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2008-09-02 20:59:00 +00:00
|
|
|
struct blocklist_data * data = gdata;
|
2009-04-07 20:13:08 +00:00
|
|
|
gtk_widget_destroy( GTK_WIDGET( dialog ) );
|
|
|
|
gtk_widget_set_sensitive( data->updateBlocklistButton, TRUE );
|
|
|
|
data->updateBlocklistDialog = NULL;
|
|
|
|
g_signal_handler_disconnect( data->core, data->updateBlocklistTag );
|
2008-03-30 00:21:46 +00:00
|
|
|
}
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* core says the blocklist was updated */
|
2008-03-30 00:21:46 +00:00
|
|
|
static void
|
2009-04-07 20:13:08 +00:00
|
|
|
onBlocklistUpdated( TrCore * core, int n, gpointer gdata )
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
const char * s = ngettext( "Blocklist now has %'d rule.", "Blocklist now has %'d rules.", n );
|
2008-04-01 16:57:48 +00:00
|
|
|
struct blocklist_data * data = gdata;
|
2009-04-07 20:13:08 +00:00
|
|
|
GtkMessageDialog * d = GTK_MESSAGE_DIALOG( data->updateBlocklistDialog );
|
|
|
|
gtk_widget_set_sensitive( data->updateBlocklistButton, TRUE );
|
|
|
|
gtk_message_dialog_set_markup( d, _( "<b>Update succeeded!</b>" ) );
|
|
|
|
gtk_message_dialog_format_secondary_text( d, s, n );
|
|
|
|
updateBlocklistText( data->check, core );
|
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* user pushed a button to update the blocklist */
|
|
|
|
static void
|
|
|
|
onBlocklistUpdate( GtkButton * w, gpointer gdata )
|
|
|
|
{
|
|
|
|
GtkWidget * d;
|
|
|
|
struct blocklist_data * data = gdata;
|
|
|
|
d = gtk_message_dialog_new( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( w ) ) ),
|
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
GTK_MESSAGE_INFO,
|
|
|
|
GTK_BUTTONS_CLOSE,
|
2009-06-23 14:15:23 +00:00
|
|
|
"%s", _( "Update Blocklist" ) );
|
2009-04-07 20:13:08 +00:00
|
|
|
gtk_widget_set_sensitive( data->updateBlocklistButton, FALSE );
|
2009-06-23 14:15:23 +00:00
|
|
|
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( d ), "%s", _( "Getting new blocklist..." ) );
|
2009-04-07 20:13:08 +00:00
|
|
|
data->updateBlocklistDialog = d;
|
|
|
|
g_signal_connect( d, "response", G_CALLBACK(onBlocklistUpdateResponse), data );
|
2008-03-30 00:21:46 +00:00
|
|
|
gtk_widget_show( d );
|
2009-04-07 20:13:08 +00:00
|
|
|
tr_core_blocklist_update( data->core );
|
|
|
|
data->updateBlocklistTag = g_signal_connect( data->core, "blocklist-updated", G_CALLBACK( onBlocklistUpdated ), data );
|
2008-03-30 00:21:46 +00:00
|
|
|
}
|
|
|
|
|
2008-06-12 16:25:36 +00:00
|
|
|
static void
|
2009-04-18 23:14:57 +00:00
|
|
|
onIntComboChanged( GtkComboBox * w, gpointer core )
|
2008-06-12 16:25:36 +00:00
|
|
|
{
|
2009-04-18 23:14:57 +00:00
|
|
|
GtkTreeIter iter;
|
|
|
|
|
|
|
|
if( gtk_combo_box_get_active_iter( w, &iter ) )
|
|
|
|
{
|
|
|
|
int val = 0;
|
|
|
|
const char * key = g_object_get_data( G_OBJECT( w ), PREF_KEY );
|
|
|
|
gtk_tree_model_get( gtk_combo_box_get_model( w ), &iter, 0, &val, -1 );
|
|
|
|
tr_core_set_pref_int( TR_CORE( core ), key, val );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
new_encryption_combo( GObject * core, const char * key )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int selIndex;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkCellRenderer * r;
|
|
|
|
GtkListStore * store;
|
|
|
|
const int currentValue = pref_int_get( key );
|
|
|
|
const struct {
|
|
|
|
int value;
|
|
|
|
const char * text;
|
|
|
|
} items[] = {
|
2009-06-30 18:08:50 +00:00
|
|
|
{ TR_CLEAR_PREFERRED, N_( "Allow encryption" ) },
|
|
|
|
{ TR_ENCRYPTION_PREFERRED, N_( "Prefer encryption" ) },
|
|
|
|
{ TR_ENCRYPTION_REQUIRED, N_( "Require encryption" ) }
|
2009-04-18 23:14:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* build a store for encryption */
|
|
|
|
selIndex = -1;
|
|
|
|
store = gtk_list_store_new( 2, G_TYPE_INT, G_TYPE_STRING );
|
|
|
|
for( i=0; i<(int)G_N_ELEMENTS(items); ++i ) {
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gtk_list_store_append( store, &iter );
|
|
|
|
gtk_list_store_set( store, &iter, 0, items[i].value, 1, _( items[i].text ), -1 );
|
|
|
|
if( items[i].value == currentValue )
|
|
|
|
selIndex = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* build the widget */
|
|
|
|
w = gtk_combo_box_new_with_model( GTK_TREE_MODEL( store ) );
|
|
|
|
r = gtk_cell_renderer_text_new( );
|
|
|
|
gtk_cell_layout_pack_start( GTK_CELL_LAYOUT( w ), r, TRUE );
|
|
|
|
gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT( w ), r, "text", 1, NULL );
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, tr_strdup( key ), g_free );
|
|
|
|
if( selIndex >= 0 )
|
|
|
|
gtk_combo_box_set_active( GTK_COMBO_BOX( w ), selIndex );
|
|
|
|
g_signal_connect( w, "changed", G_CALLBACK( onIntComboChanged ), core );
|
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
g_object_unref( G_OBJECT( store ) );
|
|
|
|
return w;
|
2008-06-12 16:25:36 +00:00
|
|
|
}
|
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
static GtkWidget*
|
2009-06-27 05:23:13 +00:00
|
|
|
privacyPage( GObject * core )
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int row = 0;
|
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * b;
|
|
|
|
GtkWidget * h;
|
2008-04-01 16:57:48 +00:00
|
|
|
struct blocklist_data * data;
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-09-02 20:59:00 +00:00
|
|
|
data = g_new0( struct blocklist_data, 1 );
|
|
|
|
data->core = TR_CORE( core );
|
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
t = hig_workarea_create( );
|
2008-09-02 20:59:00 +00:00
|
|
|
hig_workarea_add_section_title( t, &row, _( "Blocklist" ) );
|
|
|
|
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( "", TR_PREFS_KEY_BLOCKLIST_ENABLED, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
updateBlocklistText( w, TR_CORE( core ) );
|
|
|
|
h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
|
2008-10-31 18:25:21 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
|
2009-04-07 20:13:08 +00:00
|
|
|
b = data->updateBlocklistButton = gtr_button_new_from_stock( GTK_STOCK_REFRESH, _( "_Update" ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
data->check = w;
|
2008-10-28 19:49:33 +00:00
|
|
|
g_object_set_data( G_OBJECT( b ), "session",
|
|
|
|
tr_core_session( TR_CORE( core ) ) );
|
2009-04-07 20:13:08 +00:00
|
|
|
g_signal_connect( b, "clicked", G_CALLBACK( onBlocklistUpdate ), data );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), b, FALSE, FALSE, 0 );
|
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( target_cb ), b );
|
|
|
|
target_cb( w, b );
|
|
|
|
hig_workarea_add_wide_control( t, &row, h );
|
|
|
|
|
|
|
|
s = _( "Enable _automatic updates" );
|
|
|
|
w = new_check_button( s, PREF_KEY_BLOCKLIST_UPDATES_ENABLED, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
g_signal_connect( data->check, "toggled", G_CALLBACK( target_cb ), w );
|
|
|
|
target_cb( data->check, w );
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
hig_workarea_add_section_divider( t, &row );
|
2009-04-09 18:46:16 +00:00
|
|
|
hig_workarea_add_section_title ( t, &row, _( "Privacy" ) );
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2009-06-23 03:40:32 +00:00
|
|
|
s = _( "_Encryption mode:" );
|
2009-04-18 23:14:57 +00:00
|
|
|
w = new_encryption_combo( core, "encryption" );
|
|
|
|
hig_workarea_add_row( t, &row, s, w, NULL );
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2009-06-11 16:17:48 +00:00
|
|
|
s = _( "Use PE_X to find more peers" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_PEX_ENABLED, core );
|
2009-06-11 16:17:48 +00:00
|
|
|
s = _( "PEX is a tool for exchanging peer lists with the peers you're connected to." );
|
|
|
|
gtr_widget_set_tooltip_text( w, s );
|
2008-09-23 19:11:04 +00:00
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2009-06-21 08:57:26 +00:00
|
|
|
#ifndef WITHOUT_DHT
|
2009-06-11 16:17:48 +00:00
|
|
|
s = _( "Use _DHT to find more peers" );
|
2009-05-21 00:15:54 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_DHT_ENABLED, core );
|
2009-06-11 16:17:48 +00:00
|
|
|
s = _( "DHT is a tool for finding peers without a tracker." );
|
|
|
|
gtr_widget_set_tooltip_text( w, s );
|
2009-05-21 00:15:54 +00:00
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2009-06-21 08:57:26 +00:00
|
|
|
#endif
|
2009-05-21 00:15:54 +00:00
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
2009-06-27 05:23:13 +00:00
|
|
|
g_object_weak_ref( G_OBJECT( t ), privacyPageDestroyed, data );
|
2008-02-13 03:00:21 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Web Tab
|
|
|
|
****/
|
|
|
|
|
2008-06-03 20:59:57 +00:00
|
|
|
enum
|
|
|
|
{
|
2008-06-04 19:46:37 +00:00
|
|
|
COL_ADDRESS,
|
|
|
|
N_COLS
|
2008-06-03 20:59:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static GtkTreeModel*
|
2008-10-01 20:23:57 +00:00
|
|
|
whitelist_tree_model_new( const char * whitelist )
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int i;
|
|
|
|
char ** rules;
|
2008-06-03 20:59:57 +00:00
|
|
|
GtkListStore * store = gtk_list_store_new( N_COLS,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-10-01 20:23:57 +00:00
|
|
|
rules = g_strsplit( whitelist, ",", 0 );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( i = 0; rules && rules[i]; ++i )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2008-10-01 20:23:57 +00:00
|
|
|
GtkTreeIter iter;
|
2008-06-04 19:46:37 +00:00
|
|
|
const char * s = rules[i];
|
|
|
|
while( isspace( *s ) ) ++s;
|
2008-10-01 20:23:57 +00:00
|
|
|
gtk_list_store_append( store, &iter );
|
|
|
|
gtk_list_store_set( store, &iter, COL_ADDRESS, s, -1 );
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_strfreev( rules );
|
2008-06-03 20:59:57 +00:00
|
|
|
return GTK_TREE_MODEL( store );
|
|
|
|
}
|
|
|
|
|
|
|
|
struct remote_page
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
TrCore * core;
|
|
|
|
GtkTreeView * view;
|
|
|
|
GtkListStore * store;
|
|
|
|
GtkWidget * remove_button;
|
|
|
|
GSList * widgets;
|
|
|
|
GSList * auth_widgets;
|
2008-10-01 22:59:29 +00:00
|
|
|
GSList * whitelist_widgets;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkToggleButton * rpc_tb;
|
|
|
|
GtkToggleButton * auth_tb;
|
2008-10-01 22:59:29 +00:00
|
|
|
GtkToggleButton * whitelist_tb;
|
2008-06-03 20:59:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2008-10-01 20:23:57 +00:00
|
|
|
refreshWhitelist( struct remote_page * page )
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter iter;
|
2008-06-04 19:46:37 +00:00
|
|
|
GtkTreeModel * model = GTK_TREE_MODEL( page->store );
|
2008-09-23 19:11:04 +00:00
|
|
|
GString * gstr = g_string_new( NULL );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
|
|
|
if( gtk_tree_model_get_iter_first( model, &iter ) ) do
|
2008-09-23 19:11:04 +00:00
|
|
|
{
|
|
|
|
char * address;
|
2008-10-01 20:23:57 +00:00
|
|
|
gtk_tree_model_get( model, &iter,
|
2008-09-23 19:11:04 +00:00
|
|
|
COL_ADDRESS, &address,
|
|
|
|
-1 );
|
|
|
|
g_string_append( gstr, address );
|
2008-10-01 20:23:57 +00:00
|
|
|
g_string_append( gstr, "," );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_free( address );
|
|
|
|
}
|
|
|
|
while( gtk_tree_model_iter_next( model, &iter ) );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-10-01 20:23:57 +00:00
|
|
|
g_string_truncate( gstr, gstr->len - 1 ); /* remove the trailing comma */
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-12-13 23:17:36 +00:00
|
|
|
tr_core_set_pref( page->core, TR_PREFS_KEY_RPC_WHITELIST, gstr->str );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
|
|
|
g_string_free( gstr, TRUE );
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-06-04 19:46:37 +00:00
|
|
|
onAddressEdited( GtkCellRendererText * r UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
gchar * path_string,
|
2008-10-01 20:23:57 +00:00
|
|
|
gchar * address,
|
2008-09-23 19:11:04 +00:00
|
|
|
gpointer gpage )
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter iter;
|
2008-06-03 20:59:57 +00:00
|
|
|
struct remote_page * page = gpage;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeModel * model = GTK_TREE_MODEL( page->store );
|
|
|
|
GtkTreePath * path = gtk_tree_path_new_from_string( path_string );
|
2008-06-03 20:59:57 +00:00
|
|
|
|
2008-09-25 18:48:09 +00:00
|
|
|
if( gtk_tree_model_get_iter( model, &iter, path ) )
|
2008-10-01 20:23:57 +00:00
|
|
|
gtk_list_store_set( page->store, &iter, COL_ADDRESS, address, -1 );
|
2008-06-03 20:59:57 +00:00
|
|
|
|
|
|
|
gtk_tree_path_free( path );
|
2008-10-01 20:23:57 +00:00
|
|
|
refreshWhitelist( page );
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-10-01 20:23:57 +00:00
|
|
|
onAddWhitelistClicked( GtkButton * b UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
gpointer gpage )
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreePath * path;
|
2008-06-03 20:59:57 +00:00
|
|
|
struct remote_page * page = gpage;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-03 20:59:57 +00:00
|
|
|
gtk_list_store_append( page->store, &iter );
|
|
|
|
gtk_list_store_set( page->store, &iter,
|
2008-07-11 17:09:53 +00:00
|
|
|
COL_ADDRESS, "0.0.0.0",
|
2008-06-03 20:59:57 +00:00
|
|
|
-1 );
|
|
|
|
|
|
|
|
path = gtk_tree_model_get_path( GTK_TREE_MODEL( page->store ), &iter );
|
2008-06-04 19:46:37 +00:00
|
|
|
gtk_tree_view_set_cursor(
|
|
|
|
page->view, path,
|
|
|
|
gtk_tree_view_get_column( page->view, COL_ADDRESS ),
|
|
|
|
TRUE );
|
2008-06-03 20:59:57 +00:00
|
|
|
gtk_tree_path_free( path );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-10-01 20:23:57 +00:00
|
|
|
onRemoveWhitelistClicked( GtkButton * b UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
gpointer gpage )
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
|
|
|
struct remote_page * page = gpage;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeSelection * sel = gtk_tree_view_get_selection( page->view );
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
2008-06-03 20:59:57 +00:00
|
|
|
if( gtk_tree_selection_get_selected( sel, NULL, &iter ) )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2008-06-03 20:59:57 +00:00
|
|
|
gtk_list_store_remove( page->store, &iter );
|
2008-10-01 20:23:57 +00:00
|
|
|
refreshWhitelist( page );
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
refreshRPCSensitivity( struct remote_page * page )
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList * l;
|
|
|
|
const int rpc_active = gtk_toggle_button_get_active(
|
|
|
|
page->rpc_tb );
|
|
|
|
const int auth_active = gtk_toggle_button_get_active(
|
|
|
|
page->auth_tb );
|
2008-10-01 22:59:29 +00:00
|
|
|
const int whitelist_active = gtk_toggle_button_get_active(
|
|
|
|
page->whitelist_tb );
|
2008-06-04 19:46:37 +00:00
|
|
|
GtkTreeSelection * sel = gtk_tree_view_get_selection( page->view );
|
2008-09-23 19:11:04 +00:00
|
|
|
const int have_addr =
|
|
|
|
gtk_tree_selection_get_selected( sel, NULL,
|
|
|
|
NULL );
|
|
|
|
const int n_rules = gtk_tree_model_iter_n_children(
|
|
|
|
GTK_TREE_MODEL( page->store ), NULL );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( l = page->widgets; l != NULL; l = l->next )
|
2008-06-04 19:46:37 +00:00
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( l->data ), rpc_active );
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( l = page->auth_widgets; l != NULL; l = l->next )
|
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET(
|
|
|
|
l->data ), rpc_active && auth_active );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
for( l = page->whitelist_widgets; l != NULL; l = l->next )
|
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( l->data ),
|
|
|
|
rpc_active && whitelist_active );
|
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
gtk_widget_set_sensitive( page->remove_button,
|
2008-09-23 19:11:04 +00:00
|
|
|
rpc_active && have_addr && n_rules > 1 );
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onRPCToggled( GtkToggleButton * tb UNUSED,
|
|
|
|
gpointer page )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
|
|
|
refreshRPCSensitivity( page );
|
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
static void
|
2008-10-01 20:23:57 +00:00
|
|
|
onWhitelistSelectionChanged( GtkTreeSelection * sel UNUSED,
|
2008-09-23 19:11:04 +00:00
|
|
|
gpointer page )
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
|
|
|
refreshRPCSensitivity( page );
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
2008-07-16 02:31:08 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onLaunchClutchCB( GtkButton * w UNUSED,
|
|
|
|
gpointer data UNUSED )
|
2008-07-16 02:31:08 +00:00
|
|
|
{
|
2008-12-13 23:17:36 +00:00
|
|
|
int port = pref_int_get( TR_PREFS_KEY_RPC_PORT );
|
2008-09-23 19:11:04 +00:00
|
|
|
char * url = g_strdup_printf( "http://localhost:%d/transmission/web",
|
|
|
|
port );
|
|
|
|
|
2008-07-16 02:31:08 +00:00
|
|
|
gtr_open_file( url );
|
|
|
|
g_free( url );
|
|
|
|
}
|
|
|
|
|
2008-06-02 21:02:38 +00:00
|
|
|
static GtkWidget*
|
2008-07-11 17:09:53 +00:00
|
|
|
webPage( GObject * core )
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
const char * s;
|
|
|
|
int row = 0;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * h;
|
2008-06-03 20:59:57 +00:00
|
|
|
struct remote_page * page = g_new0( struct remote_page, 1 );
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
page->core = TR_CORE( core );
|
|
|
|
|
2008-06-02 21:02:38 +00:00
|
|
|
t = hig_workarea_create( );
|
2008-06-03 20:59:57 +00:00
|
|
|
g_object_set_data_full( G_OBJECT( t ), "page", page, g_free );
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2009-06-23 14:52:19 +00:00
|
|
|
hig_workarea_add_section_title( t, &row, _( "Web Client" ) );
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
/* "enabled" checkbutton */
|
2009-06-23 14:52:19 +00:00
|
|
|
s = _( "_Enable web client" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_RPC_ENABLED, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->rpc_tb = GTK_TOGGLE_BUTTON( w );
|
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK( onRPCToggled ), page );
|
|
|
|
h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
|
2008-10-31 18:25:21 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
|
2009-06-23 14:52:19 +00:00
|
|
|
w = gtr_button_new_from_stock( GTK_STOCK_OPEN, _( "_Open web client" ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->widgets = g_slist_append( page->widgets, w );
|
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK( onLaunchClutchCB ), NULL );
|
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, FALSE, FALSE, 0 );
|
|
|
|
hig_workarea_add_wide_control( t, &row, h );
|
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
/* port */
|
2009-04-07 20:13:08 +00:00
|
|
|
w = new_spin_button( TR_PREFS_KEY_RPC_PORT, core, 0, USHRT_MAX, 1 );
|
2008-10-01 22:59:29 +00:00
|
|
|
page->widgets = g_slist_append( page->widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, _( "Listening _port:" ), w, NULL );
|
|
|
|
page->widgets = g_slist_append( page->widgets, w );
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
/* require authentication */
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Use _authentication" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_RPC_AUTH_REQUIRED, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
page->auth_tb = GTK_TOGGLE_BUTTON( w );
|
|
|
|
page->widgets = g_slist_append( page->widgets, w );
|
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK( onRPCToggled ), page );
|
|
|
|
|
|
|
|
/* username */
|
|
|
|
s = _( "_Username:" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_entry( TR_PREFS_KEY_RPC_USERNAME, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->auth_widgets = g_slist_append( page->auth_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->auth_widgets = g_slist_append( page->auth_widgets, w );
|
|
|
|
|
|
|
|
/* password */
|
|
|
|
s = _( "Pass_word:" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_entry( TR_PREFS_KEY_RPC_PASSWORD, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_entry_set_visibility( GTK_ENTRY( w ), FALSE );
|
|
|
|
page->auth_widgets = g_slist_append( page->auth_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->auth_widgets = g_slist_append( page->auth_widgets, w );
|
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
/* require authentication */
|
2009-06-23 14:52:19 +00:00
|
|
|
s = _( "Only allow these IP a_ddresses to connect:" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_RPC_WHITELIST_ENABLED, core );
|
2008-10-01 22:59:29 +00:00
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
page->whitelist_tb = GTK_TOGGLE_BUTTON( w );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->widgets = g_slist_append( page->widgets, w );
|
2008-10-01 22:59:29 +00:00
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK( onRPCToggled ), page );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* access control list */
|
|
|
|
{
|
2008-12-13 23:17:36 +00:00
|
|
|
const char * val = pref_string_get( TR_PREFS_KEY_RPC_WHITELIST );
|
2008-10-01 20:23:57 +00:00
|
|
|
GtkTreeModel * m = whitelist_tree_model_new( val );
|
2008-06-03 20:59:57 +00:00
|
|
|
GtkTreeViewColumn * c;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkCellRenderer * r;
|
|
|
|
GtkTreeSelection * sel;
|
|
|
|
GtkTreeView * v;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * h;
|
2008-06-03 20:59:57 +00:00
|
|
|
|
|
|
|
page->store = GTK_LIST_STORE( m );
|
|
|
|
w = gtk_tree_view_new_with_model( m );
|
2008-09-27 18:01:31 +00:00
|
|
|
g_signal_connect( w, "button-release-event",
|
|
|
|
G_CALLBACK( on_tree_view_button_released ), NULL );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
page->whitelist_widgets = g_slist_append( page->whitelist_widgets, w );
|
2008-06-03 20:59:57 +00:00
|
|
|
v = page->view = GTK_TREE_VIEW( w );
|
2009-03-28 16:47:01 +00:00
|
|
|
gtr_widget_set_tooltip_text( w, _( "IP addresses may use wildcards, such as 192.168.*.*" ) );
|
2008-06-03 20:59:57 +00:00
|
|
|
sel = gtk_tree_view_get_selection( v );
|
|
|
|
g_signal_connect( sel, "changed",
|
2008-10-01 20:23:57 +00:00
|
|
|
G_CALLBACK( onWhitelistSelectionChanged ), page );
|
2008-06-03 20:59:57 +00:00
|
|
|
g_object_unref( G_OBJECT( m ) );
|
2008-06-04 19:46:37 +00:00
|
|
|
gtk_tree_view_set_headers_visible( v, TRUE );
|
2008-06-03 20:59:57 +00:00
|
|
|
w = gtk_frame_new( NULL );
|
|
|
|
gtk_frame_set_shadow_type( GTK_FRAME( w ), GTK_SHADOW_IN );
|
|
|
|
gtk_container_add( GTK_CONTAINER( w ), GTK_WIDGET( v ) );
|
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
/* ip address column */
|
|
|
|
r = gtk_cell_renderer_text_new( );
|
|
|
|
g_signal_connect( r, "edited",
|
|
|
|
G_CALLBACK( onAddressEdited ), page );
|
|
|
|
g_object_set( G_OBJECT( r ), "editable", TRUE, NULL );
|
2008-10-01 20:23:57 +00:00
|
|
|
c = gtk_tree_view_column_new_with_attributes( NULL, r,
|
2008-09-23 19:11:04 +00:00
|
|
|
"text", COL_ADDRESS,
|
|
|
|
NULL );
|
2008-06-04 19:46:37 +00:00
|
|
|
gtk_tree_view_column_set_expand( c, TRUE );
|
|
|
|
gtk_tree_view_append_column( v, c );
|
2008-10-01 20:23:57 +00:00
|
|
|
gtk_tree_view_set_headers_visible( v, FALSE );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
s = _( "Addresses:" );
|
2008-06-04 19:46:37 +00:00
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
2008-10-01 20:23:57 +00:00
|
|
|
gtk_misc_set_alignment( GTK_MISC( w ), 0.0f, 0.0f );
|
|
|
|
gtk_misc_set_padding( GTK_MISC( w ), 0, GUI_PAD );
|
2008-10-01 22:59:29 +00:00
|
|
|
page->whitelist_widgets = g_slist_append( page->whitelist_widgets, w );
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2008-06-03 20:59:57 +00:00
|
|
|
h = gtk_hbox_new( TRUE, GUI_PAD );
|
|
|
|
w = gtk_button_new_from_stock( GTK_STOCK_REMOVE );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK(
|
2008-10-01 20:23:57 +00:00
|
|
|
onRemoveWhitelistClicked ), page );
|
2008-06-03 20:59:57 +00:00
|
|
|
page->remove_button = w;
|
2008-10-01 20:23:57 +00:00
|
|
|
onWhitelistSelectionChanged( sel, page );
|
2008-10-31 18:25:21 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
|
2008-06-03 20:59:57 +00:00
|
|
|
w = gtk_button_new_from_stock( GTK_STOCK_ADD );
|
2008-10-01 22:59:29 +00:00
|
|
|
page->whitelist_widgets = g_slist_append( page->whitelist_widgets, w );
|
2008-10-01 20:23:57 +00:00
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK( onAddWhitelistClicked ), page );
|
2008-10-31 18:25:21 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, TRUE, TRUE, 0 );
|
2008-06-03 20:59:57 +00:00
|
|
|
w = gtk_hbox_new( FALSE, 0 );
|
2008-10-31 18:25:21 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( w ), gtk_alignment_new( 0, 0, 0, 0 ),
|
|
|
|
TRUE, TRUE, 0 );
|
2008-06-03 20:59:57 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( w ), h, FALSE, FALSE, 0 );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2008-09-23 19:11:04 +00:00
|
|
|
}
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2008-06-05 16:23:03 +00:00
|
|
|
refreshRPCSensitivity( page );
|
2008-06-02 21:02:38 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Proxy Tab
|
|
|
|
****/
|
|
|
|
|
2008-06-06 23:48:17 +00:00
|
|
|
struct ProxyPage
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
TrCore * core;
|
|
|
|
GSList * proxy_widgets;
|
|
|
|
GSList * proxy_auth_widgets;
|
2008-06-06 23:48:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
refreshProxySensitivity( struct ProxyPage * p )
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList * l;
|
2008-12-13 23:17:36 +00:00
|
|
|
const gboolean proxy_enabled = pref_flag_get( TR_PREFS_KEY_PROXY_ENABLED );
|
|
|
|
const gboolean proxy_auth_enabled = pref_flag_get( TR_PREFS_KEY_PROXY_AUTH_ENABLED );
|
2008-06-06 23:48:17 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( l = p->proxy_widgets; l != NULL; l = l->next )
|
2008-06-06 23:48:17 +00:00
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( l->data ), proxy_enabled );
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( l = p->proxy_auth_widgets; l != NULL; l = l->next )
|
2008-06-06 23:48:17 +00:00
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( l->data ),
|
2008-09-23 19:11:04 +00:00
|
|
|
proxy_enabled && proxy_auth_enabled );
|
2008-06-06 23:48:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onProxyToggled( GtkToggleButton * tb UNUSED,
|
|
|
|
gpointer user_data )
|
2008-06-06 23:48:17 +00:00
|
|
|
{
|
|
|
|
refreshProxySensitivity( user_data );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
proxyPageFree( gpointer gpage )
|
|
|
|
{
|
|
|
|
struct ProxyPage * page = gpage;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-06 23:48:17 +00:00
|
|
|
g_slist_free( page->proxy_widgets );
|
|
|
|
g_slist_free( page->proxy_auth_widgets );
|
|
|
|
g_free( page );
|
|
|
|
}
|
|
|
|
|
2008-06-11 21:05:13 +00:00
|
|
|
static GtkTreeModel*
|
|
|
|
proxyTypeModelNew( void )
|
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter iter;
|
2008-06-11 21:05:13 +00:00
|
|
|
GtkListStore * store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_INT );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-11 21:05:13 +00:00
|
|
|
gtk_list_store_append( store, &iter );
|
2008-08-12 00:52:34 +00:00
|
|
|
gtk_list_store_set( store, &iter, 0, "HTTP", 1, TR_PROXY_HTTP, -1 );
|
2008-06-11 21:05:13 +00:00
|
|
|
gtk_list_store_append( store, &iter );
|
2008-08-12 00:52:34 +00:00
|
|
|
gtk_list_store_set( store, &iter, 0, "SOCKS4", 1, TR_PROXY_SOCKS4, -1 );
|
2008-06-11 21:05:13 +00:00
|
|
|
gtk_list_store_append( store, &iter );
|
2008-08-12 00:52:34 +00:00
|
|
|
gtk_list_store_set( store, &iter, 0, "SOCKS5", 1, TR_PROXY_SOCKS5, -1 );
|
2008-06-11 21:05:13 +00:00
|
|
|
return GTK_TREE_MODEL( store );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onProxyTypeChanged( GtkComboBox * w,
|
|
|
|
gpointer gpage )
|
2008-06-11 21:05:13 +00:00
|
|
|
{
|
|
|
|
GtkTreeIter iter;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-11 21:05:13 +00:00
|
|
|
if( gtk_combo_box_get_active_iter( w, &iter ) )
|
|
|
|
{
|
|
|
|
struct ProxyPage * page = gpage;
|
2008-12-13 23:17:36 +00:00
|
|
|
int type = TR_PROXY_HTTP;
|
|
|
|
gtk_tree_model_get( gtk_combo_box_get_model( w ), &iter, 1, &type, -1 );
|
|
|
|
tr_core_set_pref_int( TR_CORE( page->core ), TR_PREFS_KEY_PROXY_TYPE, type );
|
2008-06-11 21:05:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
static GtkWidget*
|
2008-07-15 01:03:03 +00:00
|
|
|
trackerPage( GObject * core )
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int row = 0;
|
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkTreeModel * m;
|
|
|
|
GtkCellRenderer * r;
|
2008-06-06 23:48:17 +00:00
|
|
|
struct ProxyPage * page = tr_new0( struct ProxyPage, 1 );
|
2007-09-27 20:57:58 +00:00
|
|
|
|
2008-06-11 21:05:13 +00:00
|
|
|
page->core = TR_CORE( core );
|
2007-09-27 20:57:58 +00:00
|
|
|
|
2008-06-11 21:05:13 +00:00
|
|
|
t = hig_workarea_create( );
|
2009-06-23 00:24:37 +00:00
|
|
|
hig_workarea_add_section_title ( t, &row, _( "Tracker" ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
s = _( "Connect to tracker via a pro_xy" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_PROXY_ENABLED, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( onProxyToggled ), page );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
|
|
|
|
s = _( "Proxy _server:" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_entry( TR_PREFS_KEY_PROXY, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
w = new_spin_button( TR_PREFS_KEY_PROXY_PORT, core, 0, USHRT_MAX, 1 );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, _( "Proxy _port:" ), w, NULL );
|
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
|
|
|
|
s = _( "Proxy _type:" );
|
|
|
|
m = proxyTypeModelNew( );
|
|
|
|
w = gtk_combo_box_new_with_model( m );
|
|
|
|
r = gtk_cell_renderer_text_new( );
|
|
|
|
gtk_cell_layout_pack_start( GTK_CELL_LAYOUT( w ), r, TRUE );
|
2008-12-13 23:17:36 +00:00
|
|
|
gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT( w ), r, "text", 0, NULL );
|
|
|
|
gtk_combo_box_set_active( GTK_COMBO_BOX( w ), pref_int_get( TR_PREFS_KEY_PROXY_TYPE ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( w, "changed", G_CALLBACK( onProxyTypeChanged ), page );
|
|
|
|
g_object_unref( G_OBJECT( m ) );
|
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Use _authentication" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_PROXY_AUTH_ENABLED, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( onProxyToggled ), page );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
page->proxy_widgets = g_slist_append( page->proxy_widgets, w );
|
|
|
|
|
|
|
|
s = _( "_Username:" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_entry( TR_PREFS_KEY_PROXY_USERNAME, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
page->proxy_auth_widgets = g_slist_append( page->proxy_auth_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->proxy_auth_widgets = g_slist_append( page->proxy_auth_widgets, w );
|
|
|
|
|
|
|
|
s = _( "Pass_word:" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_entry( TR_PREFS_KEY_RPC_PASSWORD, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_entry_set_visibility( GTK_ENTRY( w ), FALSE );
|
|
|
|
page->proxy_auth_widgets = g_slist_append( page->proxy_auth_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->proxy_auth_widgets = g_slist_append( page->proxy_auth_widgets, w );
|
2008-05-18 16:44:30 +00:00
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
2008-06-06 23:48:17 +00:00
|
|
|
g_object_set_data_full( G_OBJECT( t ), "page", page, proxyPageFree );
|
|
|
|
|
|
|
|
refreshProxySensitivity( page );
|
2008-02-13 03:00:21 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Bandwidth Tab
|
|
|
|
****/
|
|
|
|
|
|
|
|
struct BandwidthPage
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
TrCore * core;
|
|
|
|
GSList * sched_widgets;
|
2008-09-01 04:47:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2008-09-03 16:29:59 +00:00
|
|
|
refreshSchedSensitivity( struct BandwidthPage * p )
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList * l;
|
2009-03-28 16:47:01 +00:00
|
|
|
const gboolean sched_enabled = pref_flag_get( TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED );
|
2008-09-01 04:47:02 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
for( l = p->sched_widgets; l != NULL; l = l->next )
|
2008-09-01 04:47:02 +00:00
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( l->data ), sched_enabled );
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onSchedToggled( GtkToggleButton * tb UNUSED,
|
|
|
|
gpointer user_data )
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2008-09-03 16:29:59 +00:00
|
|
|
refreshSchedSensitivity( user_data );
|
2008-09-01 04:47:02 +00:00
|
|
|
}
|
|
|
|
|
2008-09-02 18:22:23 +00:00
|
|
|
static void
|
2008-09-23 19:11:04 +00:00
|
|
|
onTimeComboChanged( GtkComboBox * w,
|
|
|
|
gpointer core )
|
2008-09-02 18:22:23 +00:00
|
|
|
{
|
|
|
|
GtkTreeIter iter;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-09-02 18:22:23 +00:00
|
|
|
if( gtk_combo_box_get_active_iter( w, &iter ) )
|
|
|
|
{
|
|
|
|
const char * key = g_object_get_data( G_OBJECT( w ), PREF_KEY );
|
2008-09-23 19:11:04 +00:00
|
|
|
int val = 0;
|
|
|
|
gtk_tree_model_get( gtk_combo_box_get_model(
|
|
|
|
w ), &iter, 0, &val, -1 );
|
2008-09-02 18:22:23 +00:00
|
|
|
tr_core_set_pref_int( TR_CORE( core ), key, val );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2008-09-23 19:11:04 +00:00
|
|
|
new_time_combo( GObject * core,
|
|
|
|
const char * key )
|
2008-09-02 18:22:23 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int val;
|
|
|
|
int i;
|
|
|
|
GtkWidget * w;
|
2008-09-02 18:22:23 +00:00
|
|
|
GtkCellRenderer * r;
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkListStore * store;
|
2008-09-02 18:22:23 +00:00
|
|
|
|
|
|
|
/* build a store at 15 minute intervals */
|
|
|
|
store = gtk_list_store_new( 2, G_TYPE_INT, G_TYPE_STRING );
|
2008-09-23 19:11:04 +00:00
|
|
|
for( i = 0; i < 60 * 24; i += 15 )
|
|
|
|
{
|
|
|
|
char buf[128];
|
2008-09-02 18:22:23 +00:00
|
|
|
GtkTreeIter iter;
|
2008-09-23 19:11:04 +00:00
|
|
|
struct tm tm;
|
|
|
|
tm.tm_hour = i / 60;
|
|
|
|
tm.tm_min = i % 60;
|
2008-12-11 16:35:19 +00:00
|
|
|
tm.tm_sec = 0;
|
2008-12-23 20:42:26 +00:00
|
|
|
strftime( buf, sizeof( buf ), "%H:%M", &tm );
|
2008-09-02 18:22:23 +00:00
|
|
|
gtk_list_store_append( store, &iter );
|
|
|
|
gtk_list_store_set( store, &iter, 0, i, 1, buf, -1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* build the widget */
|
|
|
|
w = gtk_combo_box_new_with_model( GTK_TREE_MODEL( store ) );
|
|
|
|
gtk_combo_box_set_wrap_width( GTK_COMBO_BOX( w ), 4 );
|
|
|
|
r = gtk_cell_renderer_text_new( );
|
|
|
|
gtk_cell_layout_pack_start( GTK_CELL_LAYOUT( w ), r, TRUE );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT(
|
|
|
|
w ), r, "text", 1, NULL );
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, tr_strdup(
|
|
|
|
key ), g_free );
|
2008-09-02 18:22:23 +00:00
|
|
|
val = pref_int_get( key );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_combo_box_set_active( GTK_COMBO_BOX( w ), val / ( 15 ) );
|
2008-09-02 18:22:23 +00:00
|
|
|
g_signal_connect( w, "changed", G_CALLBACK( onTimeComboChanged ), core );
|
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
g_object_unref( G_OBJECT( store ) );
|
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
2009-04-05 14:53:22 +00:00
|
|
|
static GtkWidget*
|
|
|
|
new_week_combo( GObject * core, const char * key )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int selIndex;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkCellRenderer * r;
|
|
|
|
GtkListStore * store;
|
|
|
|
const int currentValue = pref_int_get( key );
|
|
|
|
const struct {
|
|
|
|
int value;
|
|
|
|
const char * text;
|
|
|
|
} items[] = {
|
|
|
|
{ TR_SCHED_ALL, N_( "Every Day" ) },
|
|
|
|
{ TR_SCHED_WEEKDAY, N_( "Weekdays" ) },
|
|
|
|
{ TR_SCHED_WEEKEND, N_( "Weekends" ) },
|
|
|
|
{ TR_SCHED_SUN, N_( "Sunday" ) },
|
|
|
|
{ TR_SCHED_MON, N_( "Monday" ) },
|
|
|
|
{ TR_SCHED_TUES, N_( "Tuesday" ) },
|
|
|
|
{ TR_SCHED_WED, N_( "Wednesday" ) },
|
|
|
|
{ TR_SCHED_THURS, N_( "Thursday" ) },
|
|
|
|
{ TR_SCHED_FRI, N_( "Friday" ) },
|
|
|
|
{ TR_SCHED_SAT, N_( "Saturday" ) }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* build a store for the days of the week */
|
|
|
|
selIndex = -1;
|
|
|
|
store = gtk_list_store_new( 2, G_TYPE_INT, G_TYPE_STRING );
|
|
|
|
for( i=0; i<(int)G_N_ELEMENTS(items); ++i ) {
|
|
|
|
GtkTreeIter iter;
|
|
|
|
gtk_list_store_append( store, &iter );
|
|
|
|
gtk_list_store_set( store, &iter, 0, items[i].value, 1, _( items[i].text ), -1 );
|
|
|
|
if( items[i].value == currentValue )
|
|
|
|
selIndex = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* build the widget */
|
|
|
|
w = gtk_combo_box_new_with_model( GTK_TREE_MODEL( store ) );
|
|
|
|
r = gtk_cell_renderer_text_new( );
|
|
|
|
gtk_cell_layout_pack_start( GTK_CELL_LAYOUT( w ), r, TRUE );
|
|
|
|
gtk_cell_layout_set_attributes( GTK_CELL_LAYOUT( w ), r, "text", 1, NULL );
|
|
|
|
g_object_set_data_full( G_OBJECT( w ), PREF_KEY, tr_strdup( key ), g_free );
|
|
|
|
if( selIndex >= 0 )
|
|
|
|
gtk_combo_box_set_active( GTK_COMBO_BOX( w ), selIndex );
|
2009-04-18 23:14:57 +00:00
|
|
|
g_signal_connect( w, "changed", G_CALLBACK( onIntComboChanged ), core );
|
2009-04-05 14:53:22 +00:00
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
g_object_unref( G_OBJECT( store ) );
|
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
2008-09-01 04:47:02 +00:00
|
|
|
static void
|
2008-09-03 16:29:59 +00:00
|
|
|
bandwidthPageFree( gpointer gpage )
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2008-09-03 16:29:59 +00:00
|
|
|
struct BandwidthPage * page = gpage;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-09-01 04:47:02 +00:00
|
|
|
g_slist_free( page->sched_widgets );
|
|
|
|
g_free( page );
|
|
|
|
}
|
|
|
|
|
2008-07-15 01:03:03 +00:00
|
|
|
static GtkWidget*
|
2008-09-03 16:29:59 +00:00
|
|
|
bandwidthPage( GObject * core )
|
2008-07-15 01:03:03 +00:00
|
|
|
{
|
2009-06-23 03:40:32 +00:00
|
|
|
int row = 0;
|
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * l;
|
|
|
|
GtkWidget * w, * w2, * h;
|
2009-03-28 16:47:01 +00:00
|
|
|
char buf[512];
|
2008-09-03 16:29:59 +00:00
|
|
|
struct BandwidthPage * page = tr_new0( struct BandwidthPage, 1 );
|
2008-09-01 04:47:02 +00:00
|
|
|
|
|
|
|
page->core = TR_CORE( core );
|
2008-07-15 01:03:03 +00:00
|
|
|
|
|
|
|
t = hig_workarea_create( );
|
2009-06-23 00:24:37 +00:00
|
|
|
hig_workarea_add_section_title( t, &row, _( "Speed Limits" ) );
|
2009-03-28 16:47:01 +00:00
|
|
|
|
|
|
|
s = _( "Limit _download speed (KB/s):" );
|
|
|
|
w = new_check_button( s, TR_PREFS_KEY_DSPEED_ENABLED, core );
|
|
|
|
w2 = new_spin_button( TR_PREFS_KEY_DSPEED, core, 0, INT_MAX, 5 );
|
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( w2 ), pref_flag_get( TR_PREFS_KEY_DSPEED_ENABLED ) );
|
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( target_cb ), w2 );
|
|
|
|
hig_workarea_add_row_w( t, &row, w, w2, NULL );
|
|
|
|
|
|
|
|
s = _( "Limit _upload speed (KB/s):" );
|
|
|
|
w = new_check_button( s, TR_PREFS_KEY_USPEED_ENABLED, core );
|
|
|
|
w2 = new_spin_button( TR_PREFS_KEY_USPEED, core, 0, INT_MAX, 5 );
|
|
|
|
gtk_widget_set_sensitive( GTK_WIDGET( w2 ), pref_flag_get( TR_PREFS_KEY_USPEED_ENABLED ) );
|
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( target_cb ), w2 );
|
|
|
|
hig_workarea_add_row_w( t, &row, w, w2, NULL );
|
2009-02-13 18:23:56 +00:00
|
|
|
|
2008-09-01 04:47:02 +00:00
|
|
|
hig_workarea_add_section_divider( t, &row );
|
2009-03-28 16:47:01 +00:00
|
|
|
h = gtk_hbox_new( FALSE, GUI_PAD );
|
2009-04-07 04:42:50 +00:00
|
|
|
w = gtk_image_new_from_stock( "alt-speed-off", -1 );
|
2009-03-28 16:47:01 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, FALSE, FALSE, 0 );
|
2009-06-23 00:24:37 +00:00
|
|
|
g_snprintf( buf, sizeof( buf ), "<b>%s</b>", _( "Temporary Speed Limits" ) );
|
2009-03-28 16:47:01 +00:00
|
|
|
w = gtk_label_new( buf );
|
|
|
|
gtk_misc_set_alignment( GTK_MISC( w ), 0.0f, 0.5f );
|
|
|
|
gtk_label_set_use_markup( GTK_LABEL( w ), TRUE );
|
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w, FALSE, FALSE, 0 );
|
|
|
|
hig_workarea_add_section_title_widget( t, &row, h );
|
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Override normal speed limits manually or at scheduled times" );
|
|
|
|
g_snprintf( buf, sizeof( buf ), "<small>%s</small>", s );
|
|
|
|
w = gtk_label_new( buf );
|
|
|
|
gtk_label_set_use_markup( GTK_LABEL( w ), TRUE );
|
|
|
|
gtk_misc_set_alignment( GTK_MISC( w ), 0.5f, 0.5f );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
|
2009-03-28 16:47:01 +00:00
|
|
|
s = _( "Limit do_wnload speed (KB/s):" );
|
|
|
|
w = new_spin_button( TR_PREFS_KEY_ALT_SPEED_DOWN, core, 0, INT_MAX, 5 );
|
|
|
|
hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
|
|
|
|
s = _( "Limit u_pload speed (KB/s):" );
|
|
|
|
w = new_spin_button( TR_PREFS_KEY_ALT_SPEED_UP, core, 0, INT_MAX, 5 );
|
|
|
|
hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
|
2009-08-10 20:04:08 +00:00
|
|
|
s = _( "_Scheduled times:" );
|
2009-03-28 16:47:01 +00:00
|
|
|
h = gtk_hbox_new( FALSE, 0 );
|
|
|
|
w2 = new_time_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN );
|
|
|
|
page->sched_widgets = g_slist_append( page->sched_widgets, w2 );
|
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w2, TRUE, TRUE, 0 );
|
2009-06-23 14:52:19 +00:00
|
|
|
w2 = l = gtk_label_new_with_mnemonic ( _( " _to " ) );
|
2009-03-28 16:47:01 +00:00
|
|
|
page->sched_widgets = g_slist_append( page->sched_widgets, w2 );
|
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w2, FALSE, FALSE, 0 );
|
|
|
|
w2 = new_time_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_END );
|
2009-06-23 03:40:32 +00:00
|
|
|
gtk_label_set_mnemonic_widget( GTK_LABEL( l ), w2 );
|
2009-03-28 16:47:01 +00:00
|
|
|
page->sched_widgets = g_slist_append( page->sched_widgets, w2 );
|
|
|
|
gtk_box_pack_start( GTK_BOX( h ), w2, TRUE, TRUE, 0 );
|
|
|
|
w = new_check_button( s, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, core );
|
|
|
|
g_signal_connect( w, "toggled", G_CALLBACK( onSchedToggled ), page );
|
|
|
|
hig_workarea_add_row_w( t, &row, w, h, NULL );
|
|
|
|
|
2009-04-05 14:53:22 +00:00
|
|
|
s = _( "_On days:" );
|
|
|
|
w = new_week_combo( core, TR_PREFS_KEY_ALT_SPEED_TIME_DAY );
|
|
|
|
page->sched_widgets = g_slist_append( page->sched_widgets, w );
|
|
|
|
w = hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
page->sched_widgets = g_slist_append( page->sched_widgets, w );
|
2008-09-01 04:47:02 +00:00
|
|
|
|
2008-07-15 01:03:03 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
2008-09-03 16:29:59 +00:00
|
|
|
g_object_set_data_full( G_OBJECT( t ), "page", page, bandwidthPageFree );
|
2008-09-01 04:47:02 +00:00
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
refreshSchedSensitivity( page );
|
2008-07-15 01:03:03 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Network Tab
|
|
|
|
****/
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
struct network_page_data
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
TrCore * core;
|
|
|
|
GtkWidget * portLabel;
|
|
|
|
GtkWidget * portButton;
|
|
|
|
GtkWidget * portSpin;
|
|
|
|
gulong portTag;
|
|
|
|
gulong prefsTag;
|
2008-09-03 16:29:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2009-04-07 20:13:08 +00:00
|
|
|
onCorePrefsChanged( TrCore * core UNUSED, const char * key, gpointer gdata )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
if( !strcmp( key, TR_PREFS_KEY_PEER_PORT ) )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
struct network_page_data * data = gdata;
|
2009-06-29 06:21:59 +00:00
|
|
|
gdk_threads_enter();
|
2009-04-07 20:13:08 +00:00
|
|
|
gtk_label_set_text( GTK_LABEL( data->portLabel ), _( "Status unknown" ) );
|
|
|
|
gtk_widget_set_sensitive( data->portButton, TRUE );
|
|
|
|
gtk_widget_set_sensitive( data->portSpin, TRUE );
|
2009-06-29 06:21:59 +00:00
|
|
|
gdk_threads_leave();
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
static void
|
2009-06-27 05:23:13 +00:00
|
|
|
peerPageDestroyed( gpointer gdata, GObject * dead UNUSED )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
struct network_page_data * data = gdata;
|
|
|
|
if( data->prefsTag > 0 )
|
|
|
|
g_signal_handler_disconnect( data->core, data->prefsTag );
|
|
|
|
if( data->portTag > 0 )
|
|
|
|
g_signal_handler_disconnect( data->core, data->portTag );
|
|
|
|
g_free( data );
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-04-07 20:13:08 +00:00
|
|
|
onPortTested( TrCore * core UNUSED, gboolean isOpen, gpointer vdata )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
struct network_page_data * data = vdata;
|
|
|
|
const char * markup = isOpen ? _( "Port is <b>open</b>" ) : _( "Port is <b>closed</b>" );
|
2009-06-29 06:21:59 +00:00
|
|
|
gdk_threads_enter();
|
2009-04-07 20:13:08 +00:00
|
|
|
gtk_label_set_markup( GTK_LABEL( data->portLabel ), markup );
|
|
|
|
gtk_widget_set_sensitive( data->portButton, TRUE );
|
|
|
|
gtk_widget_set_sensitive( data->portSpin, TRUE );
|
2009-06-29 06:21:59 +00:00
|
|
|
gdk_threads_leave();
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-04-07 20:13:08 +00:00
|
|
|
onPortTest( GtkButton * button UNUSED, gpointer vdata )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2009-04-07 20:13:08 +00:00
|
|
|
struct network_page_data * data = vdata;
|
|
|
|
gtk_widget_set_sensitive( data->portButton, FALSE );
|
|
|
|
gtk_widget_set_sensitive( data->portSpin, FALSE );
|
|
|
|
gtk_label_set_markup( GTK_LABEL( data->portLabel ), _( "<i>Testing...</i>" ) );
|
|
|
|
data->portTag = g_signal_connect( data->core, "port-tested", G_CALLBACK(onPortTested), data );
|
|
|
|
tr_core_port_test( data->core );
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2009-06-27 05:23:13 +00:00
|
|
|
peerPage( GObject * core )
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
int row = 0;
|
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * h;
|
|
|
|
GtkWidget * l;
|
2008-09-03 17:50:31 +00:00
|
|
|
struct network_page_data * data;
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* register to stop listening to core prefs changes when the page is destroyed */
|
2008-09-03 17:50:31 +00:00
|
|
|
data = g_new0( struct network_page_data, 1 );
|
2008-09-03 16:29:59 +00:00
|
|
|
data->core = TR_CORE( core );
|
|
|
|
|
2008-09-03 17:50:31 +00:00
|
|
|
/* build the page */
|
2008-09-03 16:29:59 +00:00
|
|
|
t = hig_workarea_create( );
|
|
|
|
hig_workarea_add_section_title( t, &row, _( "Incoming Peers" ) );
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
s = _( "_Port for incoming connections:" );
|
|
|
|
w = data->portSpin = new_spin_button( TR_PREFS_KEY_PEER_PORT, core, 1, USHRT_MAX, 1 );
|
|
|
|
hig_workarea_add_row( t, &row, s, w, NULL );
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
h = gtk_hbox_new( FALSE, GUI_PAD_BIG );
|
2009-04-07 20:13:08 +00:00
|
|
|
l = data->portLabel = gtk_label_new( _( "Status unknown" ) );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_misc_set_alignment( GTK_MISC( l ), 0.0f, 0.5f );
|
2009-04-09 11:53:11 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( h ), l, TRUE, TRUE, 0 );
|
2009-06-27 05:23:13 +00:00
|
|
|
w = data->portButton = gtk_button_new_with_mnemonic( _( "Te_st Port" ) );
|
2009-04-07 20:13:08 +00:00
|
|
|
gtk_box_pack_end( GTK_BOX( h ), w, FALSE, FALSE, 0 );
|
|
|
|
g_signal_connect( w, "clicked", G_CALLBACK(onPortTest), data );
|
|
|
|
hig_workarea_add_row( t, &row, NULL, h, NULL );
|
|
|
|
data->prefsTag = g_signal_connect( TR_CORE( core ), "prefs-changed", G_CALLBACK( onCorePrefsChanged ), data );
|
2009-06-27 05:23:13 +00:00
|
|
|
g_object_weak_ref( G_OBJECT( t ), peerPageDestroyed, data );
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
s = _( "Use UPnP or NAT-PMP port _forwarding from my router" );
|
2008-12-13 23:17:36 +00:00
|
|
|
w = new_check_button( s, TR_PREFS_KEY_PORT_FORWARDING, core );
|
2008-09-23 19:11:04 +00:00
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
s = _( "Pick a _random port every time Transmission is started" );
|
|
|
|
w = new_check_button( s, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, core );
|
|
|
|
hig_workarea_add_wide_control( t, &row, w );
|
|
|
|
|
2009-06-27 05:23:13 +00:00
|
|
|
hig_workarea_add_section_divider( t, &row );
|
|
|
|
hig_workarea_add_section_title( t, &row, _( "Limits" ) );
|
|
|
|
|
|
|
|
w = new_spin_button( TR_PREFS_KEY_PEER_LIMIT_TORRENT, core, 1, 300, 5 );
|
|
|
|
hig_workarea_add_row( t, &row, _( "Maximum peers per _torrent:" ), w, NULL );
|
|
|
|
w = new_spin_button( TR_PREFS_KEY_PEER_LIMIT_GLOBAL, core, 1, 3000, 5 );
|
|
|
|
hig_workarea_add_row( t, &row, _( "Maximum peers _overall:" ), w, NULL );
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
hig_workarea_finish( t, &row );
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****
|
|
|
|
*****
|
|
|
|
****/
|
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
GtkWidget *
|
2008-09-23 19:11:04 +00:00
|
|
|
tr_prefs_dialog_new( GObject * core,
|
|
|
|
GtkWindow * parent )
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
|
|
|
GtkWidget * d;
|
|
|
|
GtkWidget * n;
|
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
d = gtk_dialog_new_with_buttons( _(
|
|
|
|
"Transmission Preferences" ),
|
|
|
|
parent,
|
2008-02-13 03:00:21 +00:00
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
2008-05-09 03:20:34 +00:00
|
|
|
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
|
2008-02-13 03:00:21 +00:00
|
|
|
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
|
|
|
NULL );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_window_set_role( GTK_WINDOW( d ), "transmission-preferences-dialog" );
|
2008-02-13 03:00:21 +00:00
|
|
|
gtk_dialog_set_has_separator( GTK_DIALOG( d ), FALSE );
|
|
|
|
gtk_container_set_border_width( GTK_CONTAINER( d ), GUI_PAD );
|
|
|
|
|
|
|
|
n = gtk_notebook_new( );
|
2008-04-12 14:40:13 +00:00
|
|
|
gtk_container_set_border_width ( GTK_CONTAINER ( n ), GUI_PAD );
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-02-14 17:18:00 +00:00
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
2008-10-08 18:26:55 +00:00
|
|
|
torrentPage( core ),
|
|
|
|
gtk_label_new ( _( "Torrents" ) ) );
|
2009-03-30 01:47:07 +00:00
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
|
|
|
bandwidthPage( core ),
|
|
|
|
gtk_label_new ( _( "Speed" ) ) );
|
2009-04-07 20:13:08 +00:00
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
2009-06-27 05:23:13 +00:00
|
|
|
privacyPage( core ),
|
|
|
|
gtk_label_new ( _( "Privacy" ) ) );
|
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
|
|
|
peerPage( core ),
|
2009-06-30 18:08:50 +00:00
|
|
|
gtk_label_new ( _( "Network" ) ) );
|
2008-09-04 14:42:32 +00:00
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
2008-10-08 18:26:55 +00:00
|
|
|
desktopPage( core ),
|
|
|
|
gtk_label_new ( _( "Desktop" ) ) );
|
2008-02-14 17:18:00 +00:00
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
2008-10-08 18:26:55 +00:00
|
|
|
webPage( core ),
|
|
|
|
gtk_label_new ( _( "Web" ) ) );
|
2008-06-02 21:02:38 +00:00
|
|
|
gtk_notebook_append_page( GTK_NOTEBOOK( n ),
|
2008-10-08 18:26:55 +00:00
|
|
|
trackerPage( core ),
|
2009-06-23 00:24:37 +00:00
|
|
|
gtk_label_new ( _( "Proxy" ) ) );
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
g_signal_connect( d, "response", G_CALLBACK( response_cb ), core );
|
2008-10-31 18:25:21 +00:00
|
|
|
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), n, TRUE, TRUE, 0 );
|
2008-09-23 19:11:04 +00:00
|
|
|
gtk_widget_show_all( GTK_DIALOG( d )->vbox );
|
2007-09-28 00:46:22 +00:00
|
|
|
return d;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|