2007-09-27 20:57:58 +00:00
|
|
|
/*
|
2011-01-19 13:48:47 +00:00
|
|
|
* This file Copyright (C) Mnemosyne LLC
|
2007-02-19 22:09:05 +00:00
|
|
|
*
|
2010-12-27 19:18:17 +00:00
|
|
|
* This file is licensed by the GPL version 2. Works owned by the
|
2012-12-05 17:29:46 +00:00
|
|
|
* 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 */
|
2009-04-07 20:13:08 +00:00
|
|
|
#include <limits.h> /* USHRT_MAX */
|
2012-12-05 17:29:46 +00:00
|
|
|
#include <string.h> /* strcmp () */
|
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>
|
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
|
2012-12-05 17:29:46 +00:00
|
|
|
response_cb (GtkDialog * dialog,
|
2008-09-23 19:11:04 +00:00
|
|
|
int response,
|
2012-12-05 17:29:46 +00:00
|
|
|
gpointer unused UNUSED)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
if (response == GTK_RESPONSE_HELP)
|
2008-09-23 19:11:04 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
char * uri = g_strconcat (gtr_get_help_uri (), "/html/preferences.html", NULL);
|
|
|
|
gtr_open_uri (uri);
|
|
|
|
g_free (uri);
|
#963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: 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
|
|
|
}
|
2008-05-09 03:20:34 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
if (response == GTK_RESPONSE_CLOSE)
|
|
|
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
toggled_cb (GtkToggleButton * w,
|
|
|
|
gpointer core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
const tr_quark key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), PREF_KEY));
|
2012-12-05 17:29:46 +00:00
|
|
|
const gboolean flag = gtk_toggle_button_get_active (w);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
gtr_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*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_check_button (const char * mnemonic,
|
|
|
|
const tr_quark key,
|
|
|
|
gpointer core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkWidget * w = gtk_check_button_new_with_mnemonic (mnemonic);
|
2012-12-22 20:35:19 +00:00
|
|
|
g_object_set_data (G_OBJECT(w), PREF_KEY, GINT_TO_POINTER(key));
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
|
|
|
|
gtr_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
|
2012-12-05 17:29:46 +00:00
|
|
|
spin_idle_data_free (gpointer gdata)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
|
|
|
struct spin_idle_data * data = gdata;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
g_timer_destroy (data->last_change);
|
|
|
|
g_free (data);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2012-12-05 17:29:46 +00:00
|
|
|
spun_cb_idle (gpointer spin)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2010-07-03 00:25:22 +00:00
|
|
|
gboolean keep_waiting = TRUE;
|
2012-12-05 17:29:46 +00:00
|
|
|
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? */
|
2012-12-05 17:29:46 +00:00
|
|
|
if (g_timer_elapsed (data->last_change, NULL) > 0.33f)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
|
|
|
/* update the core */
|
2012-12-22 20:35:19 +00:00
|
|
|
const tr_quark key = GPOINTER_TO_INT (g_object_get_data (o, PREF_KEY));
|
2010-07-03 00:25:22 +00:00
|
|
|
|
2009-02-13 18:23:56 +00:00
|
|
|
if (data->isDouble)
|
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
const double value = gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin));
|
|
|
|
gtr_core_set_pref_double (TR_CORE (data->core), key, value);
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
const int value = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin));
|
|
|
|
gtr_core_set_pref_int (TR_CORE (data->core), key, value);
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
2008-09-03 16:29:59 +00:00
|
|
|
|
|
|
|
/* cleanup */
|
2012-12-05 17:29:46 +00:00
|
|
|
g_object_set_data (o, IDLE_DATA, NULL);
|
2008-09-03 16:29:59 +00:00
|
|
|
keep_waiting = FALSE;
|
2012-12-05 17:29:46 +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
|
2012-12-05 17:29:46 +00:00
|
|
|
spun_cb (GtkSpinButton * w, 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 */
|
2012-12-05 17:29:46 +00:00
|
|
|
GObject * o = G_OBJECT (w);
|
|
|
|
struct spin_idle_data * data = g_object_get_data (o, IDLE_DATA);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
if (data == NULL)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
data = g_new (struct spin_idle_data, 1);
|
2008-09-03 16:29:59 +00:00
|
|
|
data->core = core;
|
2012-12-05 17:29:46 +00:00
|
|
|
data->last_change = g_timer_new ();
|
2009-02-13 18:23:56 +00:00
|
|
|
data->isDouble = isDouble;
|
2012-12-05 17:29:46 +00:00
|
|
|
g_object_set_data_full (o, IDLE_DATA, data, spin_idle_data_free);
|
|
|
|
g_object_ref (G_OBJECT (o));
|
|
|
|
gdk_threads_add_timeout_seconds (1, spun_cb_idle, w);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
2012-12-05 17:29:46 +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
|
2012-12-05 17:29:46 +00:00
|
|
|
spun_cb_int (GtkSpinButton * w, gpointer core)
|
2009-02-13 18:23:56 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
spun_cb (w, core, FALSE);
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
spun_cb_double (GtkSpinButton * w, gpointer core)
|
2009-02-13 18:23:56 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
spun_cb (w, core, TRUE);
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_spin_button (const tr_quark key,
|
|
|
|
gpointer core,
|
|
|
|
int low,
|
|
|
|
int high,
|
|
|
|
int step)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkWidget * w = gtk_spin_button_new_with_range (low, high, step);
|
2012-12-22 20:35:19 +00:00
|
|
|
g_object_set_data (G_OBJECT(w), PREF_KEY, GINT_TO_POINTER(key));
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (w), 0);
|
|
|
|
gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), gtr_pref_int_get (key));
|
|
|
|
g_signal_connect (w, "value-changed", G_CALLBACK (spun_cb_int), core);
|
2009-02-13 18:23:56 +00:00
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_spin_button_double (const tr_quark key,
|
|
|
|
gpointer core,
|
|
|
|
double low,
|
|
|
|
double high,
|
|
|
|
double step)
|
2009-02-13 18:23:56 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkWidget * w = gtk_spin_button_new_with_range (low, high, step);
|
2012-12-22 20:35:19 +00:00
|
|
|
g_object_set_data (G_OBJECT(w), PREF_KEY, GINT_TO_POINTER(key));
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (w), 2);
|
|
|
|
gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), gtr_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
|
2012-12-22 20:35:19 +00:00
|
|
|
entry_changed_cb (GtkEntry * w, gpointer core)
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
const tr_quark key = GPOINTER_TO_INT (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
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
gtr_core_set_pref (TR_CORE(core), key, value);
|
2008-06-02 21:02:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_entry (const tr_quark key,
|
|
|
|
gpointer core)
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GtkWidget * w = gtk_entry_new ();
|
|
|
|
const char * value = gtr_pref_string_get (key);
|
|
|
|
|
|
|
|
if (value)
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (w), value);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (w), PREF_KEY, GINT_TO_POINTER(key));
|
|
|
|
g_signal_connect (w, "changed", G_CALLBACK (entry_changed_cb), core);
|
|
|
|
return w;
|
2008-06-02 21:02:38 +00:00
|
|
|
}
|
|
|
|
|
2007-02-19 22:09:05 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
chosen_cb (GtkFileChooser * w, gpointer core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
const tr_quark key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), PREF_KEY));
|
|
|
|
char * value = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w));
|
|
|
|
gtr_core_set_pref (TR_CORE (core), key, value);
|
|
|
|
g_free (value);
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_path_chooser_button (const tr_quark key, gpointer core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GtkWidget * w = gtk_file_chooser_button_new (NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
|
|
|
|
const char * path = gtr_pref_string_get (key);
|
|
|
|
g_object_set_data (G_OBJECT (w), PREF_KEY, GINT_TO_POINTER(key));
|
|
|
|
g_signal_connect (w, "selection-changed", G_CALLBACK (chosen_cb), core);
|
|
|
|
|
|
|
|
if (path != NULL)
|
|
|
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (w), path);
|
|
|
|
|
|
|
|
return w;
|
2010-05-08 22:42:28 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2010-05-08 22:42:28 +00:00
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_file_chooser_button (const tr_quark key, gpointer core)
|
2010-05-08 22:42:28 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GtkWidget * w = gtk_file_chooser_button_new (NULL, GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
const char * path = gtr_pref_string_get (key);
|
|
|
|
g_object_set_data (G_OBJECT(w), PREF_KEY, GINT_TO_POINTER(key));
|
|
|
|
if (path != NULL)
|
|
|
|
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (w), path);
|
|
|
|
g_signal_connect (w, "selection-changed", G_CALLBACK (chosen_cb), core);
|
|
|
|
return w;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2007-12-13 20:46:19 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
target_cb (GtkWidget * tb, gpointer target)
|
2007-12-13 20:46:19 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
const gboolean b = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tb));
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (target), b);
|
2007-12-13 20:46:19 +00:00
|
|
|
}
|
|
|
|
|
2011-08-01 22:24:24 +00:00
|
|
|
/****
|
|
|
|
***** Download Tab
|
|
|
|
****/
|
|
|
|
|
|
|
|
static GtkWidget*
|
2013-01-16 21:42:03 +00:00
|
|
|
downloadingPage (GObject * core)
|
2011-08-01 22:24:24 +00:00
|
|
|
{
|
2013-01-16 21:42:03 +00:00
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * l;
|
|
|
|
const char * s;
|
|
|
|
guint row = 0;
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
t = hig_workarea_create ();
|
|
|
|
hig_workarea_add_section_title (t, &row, C_("Gerund", "Adding"));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Automatically add .torrent files _from:");
|
|
|
|
l = new_check_button (s, TR_KEY_watch_dir_enabled, core);
|
|
|
|
w = new_path_chooser_button (TR_KEY_watch_dir, core);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w), gtr_pref_flag_get (TR_KEY_watch_dir_enabled));
|
|
|
|
g_signal_connect (l, "toggled", G_CALLBACK (target_cb), w);
|
|
|
|
hig_workarea_add_row_w (t, &row, l, w, NULL);
|
|
|
|
|
|
|
|
s = _("Show the Torrent Options _dialog");
|
|
|
|
w = new_check_button (s, TR_KEY_show_options_window, core);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
s = _("_Start added torrents");
|
|
|
|
w = new_check_button (s, TR_KEY_start_added_torrents, core);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
s = _("Mo_ve .torrent file to the trash");
|
|
|
|
w = new_check_button (s, TR_KEY_trash_original_torrent_files, core);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_path_chooser_button (TR_KEY_download_dir, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, _("Save to _Location:"), w, NULL);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Download Queue"));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Ma_ximum active downloads:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_download_queue_size, core, 0, INT_MAX, 1);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, s, w, NULL);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Downloads sharing data in the last _N minutes are active:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_queue_stalled_minutes, core, 1, INT_MAX, 15);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, s, w, NULL);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Incomplete"));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Append \"._part\" to incomplete files' names");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_rename_partial_files, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Keep _incomplete torrents in:");
|
2012-12-22 20:35:19 +00:00
|
|
|
l = new_check_button (s, TR_KEY_incomplete_dir_enabled, core);
|
|
|
|
w = new_path_chooser_button (TR_KEY_incomplete_dir, core);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w), gtr_pref_flag_get (TR_KEY_incomplete_dir_enabled));
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (l, "toggled", G_CALLBACK (target_cb), w);
|
|
|
|
hig_workarea_add_row_w (t, &row, l, w, NULL);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Call scrip_t when torrent is completed:");
|
2012-12-22 20:35:19 +00:00
|
|
|
l = new_check_button (s, TR_KEY_script_torrent_done_enabled, core);
|
|
|
|
w = new_file_chooser_button (TR_KEY_script_torrent_done_filename, core);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w), gtr_pref_flag_get (TR_KEY_script_torrent_done_enabled));
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (l, "toggled", G_CALLBACK (target_cb), w);
|
|
|
|
hig_workarea_add_row_w (t, &row, l, w, NULL);
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
return t;
|
2011-08-01 22:24:24 +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*
|
2013-01-16 21:42:03 +00:00
|
|
|
seedingPage (GObject * core)
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2013-01-16 21:42:03 +00:00
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * w2;
|
|
|
|
const char * s;
|
|
|
|
guint row = 0;
|
2012-12-05 17:29:46 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
t = hig_workarea_create ();
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Limits"));
|
2012-12-05 17:29:46 +00:00
|
|
|
|
|
|
|
s = _("Stop seeding at _ratio:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_ratio_limit_enabled, core);
|
|
|
|
w2 = new_spin_button_double (TR_KEY_ratio_limit, core, 0, 1000, .05);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w2), gtr_pref_flag_get (TR_KEY_ratio_limit_enabled));
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (w, "toggled", G_CALLBACK (target_cb), w2);
|
|
|
|
hig_workarea_add_row_w (t, &row, w, w2, NULL);
|
|
|
|
|
|
|
|
s = _("Stop seeding if idle for _N minutes:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_idle_seeding_limit_enabled, core);
|
|
|
|
w2 = new_spin_button (TR_KEY_idle_seeding_limit, core, 1, 9999, 5);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w2), gtr_pref_flag_get (TR_KEY_idle_seeding_limit_enabled));
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (w, "toggled", G_CALLBACK (target_cb), w2);
|
|
|
|
hig_workarea_add_row_w (t, &row, w, w2, NULL);
|
2009-03-28 16:47:01 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
return t;
|
2008-02-13 03:00:21 +00:00
|
|
|
}
|
|
|
|
|
2008-10-08 18:26:55 +00:00
|
|
|
/****
|
|
|
|
***** Desktop Tab
|
|
|
|
****/
|
|
|
|
|
|
|
|
static GtkWidget*
|
2012-12-05 17:29:46 +00:00
|
|
|
desktopPage (GObject * core)
|
2008-10-08 18:26:55 +00:00
|
|
|
{
|
2011-07-23 17:23:12 +00:00
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
2008-10-08 18:26:55 +00:00
|
|
|
const char * s;
|
2011-08-13 21:08:53 +00:00
|
|
|
guint row = 0;
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
t = hig_workarea_create ();
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Desktop"));
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("_Inhibit hibernation when torrents are active");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_inhibit_desktop_hibernation, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Show Transmission icon in the _notification area");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_show_notification_area_icon, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Notification"));
|
2011-07-23 17:23:12 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Show a notification when torrents are a_dded");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_torrent_added_notification_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2011-07-23 17:23:12 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Show a notification when torrents _finish");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_torrent_complete_notification_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2009-01-12 18:48:20 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Play a _sound when torrents finish");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_torrent_complete_sound_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2009-11-22 18:55:24 +00:00
|
|
|
|
2008-10-08 18:26:55 +00:00
|
|
|
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;
|
2010-10-31 17:16:12 +00:00
|
|
|
GtkWidget * label;
|
2009-04-07 20:13:08 +00:00
|
|
|
GtkWidget * check;
|
|
|
|
TrCore * core;
|
2008-03-30 00:21:46 +00:00
|
|
|
};
|
|
|
|
|
2008-04-01 16:57:48 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
updateBlocklistText (GtkWidget * w, TrCore * core)
|
2008-04-01 16:57:48 +00:00
|
|
|
{
|
2010-10-31 17:16:12 +00:00
|
|
|
char buf1[512];
|
|
|
|
char buf2[512];
|
2012-12-05 17:29:46 +00:00
|
|
|
const int n = tr_blocklistGetRuleCount (gtr_core_session (core));
|
|
|
|
g_snprintf (buf1, sizeof (buf1),
|
|
|
|
ngettext ("Blocklist contains %'d rule",
|
|
|
|
"Blocklist contains %'d rules", n), n);
|
|
|
|
g_snprintf (buf2, sizeof (buf2), "<i>%s</i>", buf1);
|
|
|
|
gtk_label_set_markup (GTK_LABEL (w), buf2);
|
2008-04-01 16:57:48 +00:00
|
|
|
}
|
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
|
2012-12-05 17:29:46 +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;
|
2012-12-05 17:29:46 +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
|
2012-12-05 17:29:46 +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;
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
|
|
|
gtk_widget_set_sensitive (data->updateBlocklistButton, TRUE);
|
2009-04-07 20:13:08 +00:00
|
|
|
data->updateBlocklistDialog = NULL;
|
2012-12-05 17:29:46 +00:00
|
|
|
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
|
2012-12-05 17:29:46 +00:00
|
|
|
onBlocklistUpdated (TrCore * core, int n, gpointer gdata)
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2011-03-22 15:19:54 +00:00
|
|
|
const bool success = n >= 0;
|
2012-12-05 17:29:46 +00:00
|
|
|
const int count = n >=0 ? n : tr_blocklistGetRuleCount (gtr_core_session (core));
|
|
|
|
const char * s = ngettext ("Blocklist has %'d rule.", "Blocklist has %'d rules.", count);
|
2008-04-01 16:57:48 +00:00
|
|
|
struct blocklist_data * data = gdata;
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkMessageDialog * d = GTK_MESSAGE_DIALOG (data->updateBlocklistDialog);
|
|
|
|
gtk_widget_set_sensitive (data->updateBlocklistButton, TRUE);
|
|
|
|
gtk_message_dialog_set_markup (d, success ? _("<b>Update succeeded!</b>") : _("<b>Unable to update.</b>"));
|
|
|
|
gtk_message_dialog_format_secondary_text (d, s, count);
|
|
|
|
updateBlocklistText (data->label, core);
|
2009-04-07 20:13:08 +00:00
|
|
|
}
|
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
|
2012-12-05 17:29:46 +00:00
|
|
|
onBlocklistUpdate (GtkButton * w, gpointer gdata)
|
2009-04-07 20:13:08 +00:00
|
|
|
{
|
|
|
|
GtkWidget * d;
|
|
|
|
struct blocklist_data * data = gdata;
|
2012-12-05 17:29:46 +00:00
|
|
|
d = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (w))),
|
2009-04-07 20:13:08 +00:00
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
GTK_MESSAGE_INFO,
|
|
|
|
GTK_BUTTONS_CLOSE,
|
2012-12-05 17:29:46 +00:00
|
|
|
"%s", _("Update Blocklist"));
|
|
|
|
gtk_widget_set_sensitive (data->updateBlocklistButton, FALSE);
|
|
|
|
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;
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (d, "response", G_CALLBACK (onBlocklistUpdateResponse), data);
|
|
|
|
gtk_widget_show (d);
|
|
|
|
gtr_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
|
|
|
}
|
|
|
|
|
2011-02-19 09:02:39 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
on_blocklist_url_changed (GtkEditable * e, gpointer gbutton)
|
2011-02-19 09:02:39 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
gchar * url = gtk_editable_get_chars (e, 0, -1);
|
|
|
|
const gboolean err = tr_urlParse (url, -1, NULL, NULL, NULL, NULL);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (gbutton), !err);
|
|
|
|
g_free (url);
|
2011-02-19 09:02:39 +00:00
|
|
|
}
|
|
|
|
|
2008-06-12 16:25:36 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onIntComboChanged (GtkComboBox * combo_box, gpointer core)
|
2008-06-12 16:25:36 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
const int val = gtr_combo_box_get_active_enum (combo_box);
|
|
|
|
const tr_quark key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(combo_box), PREF_KEY));
|
|
|
|
gtr_core_set_pref_int (TR_CORE (core), key, val);
|
2009-04-18 23:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_encryption_combo (GObject * core, const tr_quark key)
|
2009-04-18 23:14:57 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GtkWidget * w = gtr_combo_box_new_enum (_("Allow encryption"), TR_CLEAR_PREFERRED,
|
|
|
|
_("Prefer encryption"), TR_ENCRYPTION_PREFERRED,
|
|
|
|
_("Require encryption"), TR_ENCRYPTION_REQUIRED,
|
|
|
|
NULL);
|
|
|
|
gtr_combo_box_set_active_enum (GTK_COMBO_BOX (w), gtr_pref_int_get (key));
|
|
|
|
g_object_set_data (G_OBJECT (w), PREF_KEY, GINT_TO_POINTER(key));
|
|
|
|
g_signal_connect (w, "changed", G_CALLBACK (onIntComboChanged), core);
|
|
|
|
return w;
|
2008-06-12 16:25:36 +00:00
|
|
|
}
|
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
static GtkWidget*
|
2012-12-05 17:29:46 +00:00
|
|
|
privacyPage (GObject * core)
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2013-01-16 21:42:03 +00:00
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * b;
|
|
|
|
GtkWidget * h;
|
|
|
|
GtkWidget * e;
|
|
|
|
struct blocklist_data * data;
|
|
|
|
guint row = 0;
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
data = g_new0 (struct blocklist_data, 1);
|
|
|
|
data->core = TR_CORE (core);
|
2008-09-02 20:59:00 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
t = hig_workarea_create ();
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Privacy"));
|
|
|
|
|
|
|
|
s = _("_Encryption mode:");
|
|
|
|
w = new_encryption_combo (core, TR_KEY_encryption);
|
|
|
|
hig_workarea_add_row (t, &row, s, w, NULL);
|
|
|
|
|
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Blocklist"));
|
2008-09-02 20:59:00 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
b = new_check_button (_("Enable _blocklist:"), TR_KEY_blocklist_enabled, core);
|
|
|
|
e = new_entry (TR_KEY_blocklist_url, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_widget_set_size_request (e, 300, -1);
|
|
|
|
hig_workarea_add_row_w (t, &row, b, e, NULL);
|
2010-10-31 17:16:12 +00:00
|
|
|
data->check = b;
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (b, "toggled", G_CALLBACK (target_cb), e);
|
|
|
|
target_cb (b, e);
|
2010-10-31 17:16:12 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
w = gtk_label_new ("");
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (w), 0.0f, 0.5f);
|
|
|
|
updateBlocklistText (w, TR_CORE (core));
|
2010-10-31 17:16:12 +00:00
|
|
|
data->label = w;
|
2012-12-05 17:29:46 +00:00
|
|
|
h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, GUI_PAD_BIG);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w, TRUE, TRUE, 0);
|
|
|
|
b = data->updateBlocklistButton = gtk_button_new_with_mnemonic (_("_Update"));
|
|
|
|
g_object_set_data (G_OBJECT (b), "session", gtr_core_session (TR_CORE (core)));
|
|
|
|
g_signal_connect (b, "clicked", G_CALLBACK (onBlocklistUpdate), data);
|
|
|
|
g_signal_connect (data->check, "toggled", G_CALLBACK (target_cb), b); target_cb (data->check, b);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), b, FALSE, FALSE, 0);
|
|
|
|
g_signal_connect (data->check, "toggled", G_CALLBACK (target_cb), w); target_cb (data->check, w);
|
|
|
|
hig_workarea_add_wide_control (t, &row, h);
|
|
|
|
g_signal_connect (e, "changed", G_CALLBACK (on_blocklist_url_changed), data->updateBlocklistButton);
|
|
|
|
on_blocklist_url_changed (GTK_EDITABLE (e), data->updateBlocklistButton);
|
|
|
|
|
|
|
|
s = _("Enable _automatic updates");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_blocklist_updates_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
g_signal_connect (data->check, "toggled", G_CALLBACK (target_cb), w); target_cb (data->check, w);
|
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
g_object_weak_ref (G_OBJECT (t), privacyPageDestroyed, data);
|
|
|
|
return t;
|
2008-02-13 03:00:21 +00:00
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
2013-01-16 21:42:03 +00:00
|
|
|
***** Remote Tab
|
2008-09-03 16:29:59 +00:00
|
|
|
****/
|
|
|
|
|
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*
|
2012-12-05 17:29:46 +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;
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkListStore * store = gtk_list_store_new (N_COLS,
|
2008-06-03 20:59:57 +00:00
|
|
|
G_TYPE_STRING,
|
2012-12-05 17:29:46 +00:00
|
|
|
G_TYPE_STRING);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
rules = g_strsplit (whitelist, ",", 0);
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-05 17:29:46 +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];
|
2012-12-05 17:29:46 +00:00
|
|
|
while (isspace (*s)) ++s;
|
|
|
|
gtk_list_store_append (store, &iter);
|
|
|
|
gtk_list_store_set (store, &iter, COL_ADDRESS, s, -1);
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
g_strfreev (rules);
|
|
|
|
return GTK_TREE_MODEL (store);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshWhitelist (struct remote_page * page)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2011-04-13 22:16:50 +00:00
|
|
|
GtkTreeIter iter;
|
2012-12-05 17:29:46 +00:00
|
|
|
GString * gstr = g_string_new (NULL);
|
|
|
|
GtkTreeModel * model = GTK_TREE_MODEL (page->store);
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
if (gtk_tree_model_iter_nth_child (model, &iter, NULL, 0)) do
|
2011-04-13 22:16:50 +00:00
|
|
|
{
|
|
|
|
char * address;
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_tree_model_get (model, &iter, COL_ADDRESS, &address, -1);
|
|
|
|
g_string_append (gstr, address);
|
|
|
|
g_string_append (gstr, ",");
|
|
|
|
g_free (address);
|
2011-04-13 22:16:50 +00:00
|
|
|
}
|
2012-12-05 17:29:46 +00:00
|
|
|
while (gtk_tree_model_iter_next (model, &iter));
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
g_string_truncate (gstr, gstr->len - 1); /* remove the trailing comma */
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
gtr_core_set_pref (page->core, TR_KEY_rpc_whitelist, gstr->str);
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
g_string_free (gstr, TRUE);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +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,
|
2012-12-05 17:29:46 +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;
|
2012-12-05 17:29:46 +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
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
if (gtk_tree_model_get_iter (model, &iter, path))
|
|
|
|
gtk_list_store_set (page->store, &iter, COL_ADDRESS, address, -1);
|
2008-06-03 20:59:57 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_tree_path_free (path);
|
|
|
|
refreshWhitelist (page);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onAddWhitelistClicked (GtkButton * b UNUSED,
|
|
|
|
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
|
|
|
|
2012-12-05 17:29:46 +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",
|
2012-12-05 17:29:46 +00:00
|
|
|
-1);
|
2008-06-03 20:59:57 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
path = gtk_tree_model_get_path (GTK_TREE_MODEL (page->store), &iter);
|
|
|
|
gtk_tree_view_set_cursor (
|
2008-06-04 19:46:37 +00:00
|
|
|
page->view, path,
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_tree_view_get_column (page->view, COL_ADDRESS),
|
|
|
|
TRUE);
|
|
|
|
gtk_tree_path_free (path);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onRemoveWhitelistClicked (GtkButton * b UNUSED,
|
|
|
|
gpointer gpage)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
|
|
|
struct remote_page * page = gpage;
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkTreeSelection * sel = gtk_tree_view_get_selection (page->view);
|
2008-09-23 19:11:04 +00:00
|
|
|
GtkTreeIter iter;
|
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
if (gtk_tree_selection_get_selected (sel, NULL, &iter))
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_list_store_remove (page->store, &iter);
|
|
|
|
refreshWhitelist (page);
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshRPCSensitivity (struct remote_page * page)
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
GSList * l;
|
2012-12-05 17:29:46 +00:00
|
|
|
const int rpc_active = gtk_toggle_button_get_active (
|
|
|
|
page->rpc_tb);
|
|
|
|
const int auth_active = gtk_toggle_button_get_active (
|
|
|
|
page->auth_tb);
|
|
|
|
const int whitelist_active = gtk_toggle_button_get_active (
|
|
|
|
page->whitelist_tb);
|
|
|
|
GtkTreeSelection * sel = gtk_tree_view_get_selection (page->view);
|
2008-09-23 19:11:04 +00:00
|
|
|
const int have_addr =
|
2012-12-05 17:29:46 +00:00
|
|
|
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
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
for (l = page->widgets; l != NULL; l = l->next)
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (l->data), rpc_active);
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-05 17:29:46 +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
|
|
|
|
2012-12-05 17:29:46 +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-10-01 22:59:29 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_widget_set_sensitive (page->remove_button,
|
|
|
|
rpc_active && have_addr && n_rules > 1);
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onRPCToggled (GtkToggleButton * tb UNUSED,
|
|
|
|
gpointer page)
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshRPCSensitivity (page);
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onWhitelistSelectionChanged (GtkTreeSelection * sel UNUSED,
|
|
|
|
gpointer page)
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshRPCSensitivity (page);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
2008-07-16 02:31:08 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onLaunchClutchCB (GtkButton * w UNUSED, gpointer data UNUSED)
|
2008-07-16 02:31:08 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
char * uri;
|
|
|
|
const int port = gtr_pref_int_get (TR_KEY_rpc_port);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
uri = g_strdup_printf ("http://localhost:%d/", port);
|
|
|
|
gtr_open_uri (uri);
|
|
|
|
g_free (uri);
|
2008-07-16 02:31:08 +00:00
|
|
|
}
|
|
|
|
|
2010-01-11 21:54:54 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
remotePageFree (gpointer gpage)
|
2010-01-11 21:54:54 +00:00
|
|
|
{
|
|
|
|
struct remote_page * page = gpage;
|
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
g_slist_free (page->widgets);
|
|
|
|
g_slist_free (page->auth_widgets);
|
|
|
|
g_slist_free (page->whitelist_widgets);
|
|
|
|
g_free (page);
|
2010-01-11 21:54:54 +00:00
|
|
|
}
|
|
|
|
|
2008-06-02 21:02:38 +00:00
|
|
|
static GtkWidget*
|
2013-01-16 21:42:03 +00:00
|
|
|
remotePage (GObject * core)
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2011-08-13 21:08:53 +00:00
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * h;
|
|
|
|
const char * s;
|
|
|
|
guint row = 0;
|
2012-12-05 17:29:46 +00:00
|
|
|
struct remote_page * page = g_new0 (struct remote_page, 1);
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
page->core = TR_CORE (core);
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
t = hig_workarea_create ();
|
|
|
|
g_object_set_data_full (G_OBJECT (t), "page", page, remotePageFree);
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
hig_workarea_add_section_title (t, &row, _("Remote Control"));
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
/* "enabled" checkbutton */
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Allow _remote access");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_rpc_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
page->rpc_tb = GTK_TOGGLE_BUTTON (w);
|
|
|
|
g_signal_connect (w, "clicked", G_CALLBACK (onRPCToggled), page);
|
|
|
|
h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, GUI_PAD_BIG);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w, TRUE, TRUE, 0);
|
|
|
|
w = gtk_button_new_with_mnemonic (_("_Open web client"));
|
|
|
|
page->widgets = g_slist_prepend (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-09-23 19:11:04 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
/* port */
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_rpc_port, core, 0, USHRT_MAX, 1);
|
2012-12-05 17:29:46 +00:00
|
|
|
page->widgets = g_slist_prepend (page->widgets, w);
|
|
|
|
w = hig_workarea_add_row (t, &row, _("HTTP _port:"), w, NULL);
|
|
|
|
page->widgets = g_slist_prepend (page->widgets, w);
|
2008-10-01 22:59:29 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
/* require authentication */
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Use _authentication");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_rpc_authentication_required, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
page->auth_tb = GTK_TOGGLE_BUTTON (w);
|
|
|
|
page->widgets = g_slist_prepend (page->widgets, w);
|
|
|
|
g_signal_connect (w, "clicked", G_CALLBACK (onRPCToggled), page);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* username */
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("_Username:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_entry (TR_KEY_rpc_username, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
page->auth_widgets = g_slist_prepend (page->auth_widgets, w);
|
|
|
|
w = hig_workarea_add_row (t, &row, s, w, NULL);
|
|
|
|
page->auth_widgets = g_slist_prepend (page->auth_widgets, w);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* password */
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Pass_word:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_entry (TR_KEY_rpc_password, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_entry_set_visibility (GTK_ENTRY (w), FALSE);
|
|
|
|
page->auth_widgets = g_slist_prepend (page->auth_widgets, w);
|
|
|
|
w = hig_workarea_add_row (t, &row, s, w, NULL);
|
|
|
|
page->auth_widgets = g_slist_prepend (page->auth_widgets, w);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
/* require authentication */
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Only allow these IP a_ddresses:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_rpc_whitelist_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
page->whitelist_tb = GTK_TOGGLE_BUTTON (w);
|
|
|
|
page->widgets = g_slist_prepend (page->widgets, w);
|
|
|
|
g_signal_connect (w, "clicked", G_CALLBACK (onRPCToggled), page);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* access control list */
|
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
const char * val = gtr_pref_string_get (TR_KEY_rpc_whitelist);
|
2012-12-05 17:29:46 +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
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
page->store = GTK_LIST_STORE (m);
|
|
|
|
w = gtk_tree_view_new_with_model (m);
|
|
|
|
g_signal_connect (w, "button-release-event",
|
|
|
|
G_CALLBACK (on_tree_view_button_released), NULL);
|
|
|
|
|
|
|
|
page->whitelist_widgets = g_slist_prepend (page->whitelist_widgets, w);
|
|
|
|
v = page->view = GTK_TREE_VIEW (w);
|
|
|
|
gtk_widget_set_tooltip_text (w, _("IP addresses may use wildcards, such as 192.168.*.*"));
|
|
|
|
sel = gtk_tree_view_get_selection (v);
|
|
|
|
g_signal_connect (sel, "changed",
|
|
|
|
G_CALLBACK (onWhitelistSelectionChanged), page);
|
|
|
|
g_object_unref (G_OBJECT (m));
|
|
|
|
gtk_tree_view_set_headers_visible (v, TRUE);
|
|
|
|
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-03 20:59:57 +00:00
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
/* ip address column */
|
2012-12-05 17:29:46 +00:00
|
|
|
r = gtk_cell_renderer_text_new ();
|
|
|
|
g_signal_connect (r, "edited",
|
|
|
|
G_CALLBACK (onAddressEdited), page);
|
|
|
|
g_object_set (G_OBJECT (r), "editable", TRUE, NULL);
|
|
|
|
c = gtk_tree_view_column_new_with_attributes (NULL, r,
|
2008-09-23 19:11:04 +00:00
|
|
|
"text", COL_ADDRESS,
|
2012-12-05 17:29:46 +00:00
|
|
|
NULL);
|
|
|
|
gtk_tree_view_column_set_expand (c, TRUE);
|
|
|
|
gtk_tree_view_append_column (v, c);
|
|
|
|
gtk_tree_view_set_headers_visible (v, FALSE);
|
|
|
|
|
|
|
|
s = _("Addresses:");
|
|
|
|
w = hig_workarea_add_row (t, &row, s, w, NULL);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (w), 0.0f, 0.0f);
|
|
|
|
gtk_misc_set_padding (GTK_MISC (w), 0, GUI_PAD);
|
|
|
|
page->whitelist_widgets = g_slist_prepend (page->whitelist_widgets, w);
|
|
|
|
|
|
|
|
h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, GUI_PAD);
|
|
|
|
w = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
|
|
|
|
g_signal_connect (w, "clicked", G_CALLBACK (
|
|
|
|
onRemoveWhitelistClicked), page);
|
2008-06-03 20:59:57 +00:00
|
|
|
page->remove_button = w;
|
2012-12-05 17:29:46 +00:00
|
|
|
onWhitelistSelectionChanged (sel, page);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w, TRUE, TRUE, 0);
|
|
|
|
w = gtk_button_new_from_stock (GTK_STOCK_ADD);
|
|
|
|
page->whitelist_widgets = g_slist_prepend (page->whitelist_widgets, w);
|
|
|
|
g_signal_connect (w, "clicked", G_CALLBACK (onAddWhitelistClicked), page);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w, TRUE, TRUE, 0);
|
|
|
|
w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (w), gtk_alignment_new (0, 0, 0, 0),
|
|
|
|
TRUE, TRUE, 0);
|
|
|
|
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
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshRPCSensitivity (page);
|
2008-06-02 21:02:38 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Bandwidth Tab
|
|
|
|
****/
|
|
|
|
|
|
|
|
struct BandwidthPage
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
TrCore * core;
|
|
|
|
GSList * sched_widgets;
|
2008-09-01 04:47:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshSchedSensitivity (struct BandwidthPage * p)
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GSList * l;
|
|
|
|
const gboolean sched_enabled = gtr_pref_flag_get (TR_KEY_alt_speed_time_enabled);
|
2008-09-01 04:47:02 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
for (l=p->sched_widgets; l!=NULL; l=l->next)
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (l->data), sched_enabled);
|
2008-09-01 04:47:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onSchedToggled (GtkToggleButton * tb UNUSED,
|
|
|
|
gpointer user_data)
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
refreshSchedSensitivity (user_data);
|
2008-09-01 04:47:02 +00:00
|
|
|
}
|
|
|
|
|
2008-09-02 18:22:23 +00:00
|
|
|
static void
|
2012-12-22 20:35:19 +00:00
|
|
|
onTimeComboChanged (GtkComboBox * w, gpointer core)
|
2008-09-02 18:22:23 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GtkTreeIter iter;
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
if (gtk_combo_box_get_active_iter (w, &iter))
|
2008-09-02 18:22:23 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
int val = 0;
|
|
|
|
const tr_quark key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(w), PREF_KEY));
|
|
|
|
gtk_tree_model_get (gtk_combo_box_get_model(w), &iter, 0, &val, -1);
|
|
|
|
gtr_core_set_pref_int (TR_CORE(core), key, val);
|
2008-09-02 18:22:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_time_combo (GObject * core, const tr_quark key)
|
2008-09-02 18:22:23 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
int val;
|
|
|
|
int i;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkCellRenderer * r;
|
|
|
|
GtkListStore * store;
|
|
|
|
|
|
|
|
/* build a store at 15 minute intervals */
|
|
|
|
store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING);
|
|
|
|
for (i=0; i<60*24; i+=15)
|
2008-09-23 19:11:04 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
char buf[128];
|
|
|
|
GtkTreeIter iter;
|
|
|
|
struct tm tm;
|
|
|
|
tm.tm_hour = i / 60;
|
|
|
|
tm.tm_min = i % 60;
|
|
|
|
tm.tm_sec = 0;
|
|
|
|
strftime (buf, sizeof (buf), "%H:%M", &tm);
|
|
|
|
gtk_list_store_append (store, &iter);
|
|
|
|
gtk_list_store_set (store, &iter, 0, i, 1, buf, -1);
|
2008-09-02 18:22:23 +00:00
|
|
|
}
|
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
/* 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);
|
|
|
|
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (w), r, "text", 1, NULL);
|
|
|
|
g_object_set_data (G_OBJECT(w), PREF_KEY, GINT_TO_POINTER(key));
|
|
|
|
val = gtr_pref_int_get (key);
|
|
|
|
gtk_combo_box_set_active (GTK_COMBO_BOX (w), val / (15));
|
|
|
|
g_signal_connect (w, "changed", G_CALLBACK (onTimeComboChanged), core);
|
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
g_object_unref (G_OBJECT (store));
|
|
|
|
return w;
|
2008-09-02 18:22:23 +00:00
|
|
|
}
|
|
|
|
|
2009-04-05 14:53:22 +00:00
|
|
|
static GtkWidget*
|
2012-12-22 20:35:19 +00:00
|
|
|
new_week_combo (GObject * core, const tr_quark key)
|
2009-04-05 14:53:22 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
GtkWidget * w = gtr_combo_box_new_enum (_("Every Day"), TR_SCHED_ALL,
|
|
|
|
_("Weekdays"), TR_SCHED_WEEKDAY,
|
|
|
|
_("Weekends"), TR_SCHED_WEEKEND,
|
|
|
|
_("Sunday"), TR_SCHED_SUN,
|
|
|
|
_("Monday"), TR_SCHED_MON,
|
|
|
|
_("Tuesday"), TR_SCHED_TUES,
|
|
|
|
_("Wednesday"), TR_SCHED_WED,
|
|
|
|
_("Thursday"), TR_SCHED_THURS,
|
|
|
|
_("Friday"), TR_SCHED_FRI,
|
|
|
|
_("Saturday"), TR_SCHED_SAT,
|
|
|
|
NULL);
|
|
|
|
gtr_combo_box_set_active_enum (GTK_COMBO_BOX (w), gtr_pref_int_get (key));
|
|
|
|
g_object_set_data (G_OBJECT(w), PREF_KEY, GINT_TO_POINTER(key));
|
|
|
|
g_signal_connect (w, "changed", G_CALLBACK (onIntComboChanged), core);
|
|
|
|
return w;
|
2009-04-05 14:53:22 +00:00
|
|
|
}
|
|
|
|
|
2008-09-01 04:47:02 +00:00
|
|
|
static void
|
2013-01-16 21:42:03 +00:00
|
|
|
speedPageFree (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
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
g_slist_free (page->sched_widgets);
|
|
|
|
g_free (page);
|
2008-09-01 04:47:02 +00:00
|
|
|
}
|
|
|
|
|
2008-07-15 01:03:03 +00:00
|
|
|
static GtkWidget*
|
2013-01-16 21:42:03 +00:00
|
|
|
speedPage (GObject * core)
|
2008-07-15 01:03:03 +00:00
|
|
|
{
|
2009-06-23 03:40:32 +00:00
|
|
|
const char * s;
|
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * l;
|
|
|
|
GtkWidget * w, * w2, * h;
|
2009-03-28 16:47:01 +00:00
|
|
|
char buf[512];
|
2011-08-13 21:08:53 +00:00
|
|
|
guint row = 0;
|
2012-12-05 17:29:46 +00:00
|
|
|
struct BandwidthPage * page = tr_new0 (struct BandwidthPage, 1);
|
|
|
|
|
|
|
|
page->core = TR_CORE (core);
|
|
|
|
|
|
|
|
t = hig_workarea_create ();
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Speed Limits"));
|
|
|
|
|
|
|
|
g_snprintf (buf, sizeof (buf), _("_Upload (%s):"), _ (speed_K_str));
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (buf, TR_KEY_speed_limit_up_enabled, core);
|
|
|
|
w2 = new_spin_button (TR_KEY_speed_limit_up, core, 0, INT_MAX, 5);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w2), gtr_pref_flag_get (TR_KEY_speed_limit_up_enabled));
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (w, "toggled", G_CALLBACK (target_cb), w2);
|
|
|
|
hig_workarea_add_row_w (t, &row, w, w2, NULL);
|
|
|
|
|
|
|
|
g_snprintf (buf, sizeof (buf), _("_Download (%s):"), _ (speed_K_str));
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (buf, TR_KEY_speed_limit_down_enabled, core);
|
|
|
|
w2 = new_spin_button (TR_KEY_speed_limit_down, core, 0, INT_MAX, 5);
|
|
|
|
gtk_widget_set_sensitive (GTK_WIDGET (w2), gtr_pref_flag_get (TR_KEY_speed_limit_down_enabled));
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (w, "toggled", G_CALLBACK (target_cb), w2);
|
|
|
|
hig_workarea_add_row_w (t, &row, w, w2, NULL);
|
|
|
|
|
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, GUI_PAD);
|
|
|
|
g_snprintf (buf, sizeof (buf), "<b>%s</b>", _("Alternative Speed Limits"));
|
|
|
|
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);
|
2013-01-16 21:42:03 +00:00
|
|
|
w = gtk_image_new_from_stock ("alt-speed-on", -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w, FALSE, FALSE, 0);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_section_title_widget (t, &row, h);
|
|
|
|
|
|
|
|
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);
|
2013-01-16 21:42:03 +00:00
|
|
|
gtk_misc_set_alignment (GTK_MISC (w), 0.0f, 0.5f);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
g_snprintf (buf, sizeof (buf), _("U_pload (%s):"), _ (speed_K_str));
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_alt_speed_up, core, 0, INT_MAX, 5);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, buf, w, NULL);
|
|
|
|
|
|
|
|
g_snprintf (buf, sizeof (buf), _("Do_wnload (%s):"), _ (speed_K_str));
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_alt_speed_down, core, 0, INT_MAX, 5);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, buf, w, NULL);
|
|
|
|
|
|
|
|
s = _("_Scheduled times:");
|
|
|
|
h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
2012-12-22 20:35:19 +00:00
|
|
|
w2 = new_time_combo (core, TR_KEY_alt_speed_time_begin);
|
2012-12-05 17:29:46 +00:00
|
|
|
page->sched_widgets = g_slist_prepend (page->sched_widgets, w2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w2, TRUE, TRUE, 0);
|
|
|
|
w2 = l = gtk_label_new_with_mnemonic (_(" _to "));
|
|
|
|
page->sched_widgets = g_slist_prepend (page->sched_widgets, w2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w2, FALSE, FALSE, 0);
|
2012-12-22 20:35:19 +00:00
|
|
|
w2 = new_time_combo (core, TR_KEY_alt_speed_time_end);
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_label_set_mnemonic_widget (GTK_LABEL (l), w2);
|
|
|
|
page->sched_widgets = g_slist_prepend (page->sched_widgets, w2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), w2, TRUE, TRUE, 0);
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_alt_speed_time_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
g_signal_connect (w, "toggled", G_CALLBACK (onSchedToggled), page);
|
|
|
|
hig_workarea_add_row_w (t, &row, w, h, NULL);
|
|
|
|
|
|
|
|
s = _("_On days:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_week_combo (core, TR_KEY_alt_speed_time_day);
|
2012-12-05 17:29:46 +00:00
|
|
|
page->sched_widgets = g_slist_prepend (page->sched_widgets, w);
|
|
|
|
w = hig_workarea_add_row (t, &row, s, w, NULL);
|
|
|
|
page->sched_widgets = g_slist_prepend (page->sched_widgets, w);
|
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
g_object_set_data_full (G_OBJECT (t), "page", page, speedPageFree);
|
2012-12-05 17:29:46 +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
|
2012-12-22 20:35:19 +00:00
|
|
|
onCorePrefsChanged (TrCore * core UNUSED, const tr_quark key, gpointer gdata)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-22 20:35:19 +00:00
|
|
|
if (key == TR_KEY_peer_port)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
struct network_page_data * data = gdata;
|
|
|
|
gtr_label_set_text (GTK_LABEL (data->portLabel), _("Status unknown"));
|
|
|
|
gtk_widget_set_sensitive (data->portButton, TRUE);
|
|
|
|
gtk_widget_set_sensitive (data->portSpin, TRUE);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
networkPageDestroyed (gpointer gdata, GObject * dead UNUSED)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +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
|
2012-12-05 17:29:46 +00:00
|
|
|
onPortTested (TrCore * core UNUSED, gboolean isOpen, gpointer vdata)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
struct network_page_data * data = vdata;
|
|
|
|
const char * markup = isOpen ? _("Port is <b>open</b>") : _("Port is <b>closed</b>");
|
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
//gdk_threads_enter ();
|
2012-12-05 17:29:46 +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);
|
2012-12-22 20:35:19 +00:00
|
|
|
//gdk_threads_leave ();
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 17:29:46 +00:00
|
|
|
onPortTest (GtkButton * button UNUSED, gpointer vdata)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +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 TCP port…</i>"));
|
|
|
|
if (!data->portTag)
|
|
|
|
data->portTag = g_signal_connect (data->core, "port-tested", G_CALLBACK (onPortTested), data);
|
|
|
|
gtr_core_port_test (data->core);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
2012-12-05 17:29:46 +00:00
|
|
|
networkPage (GObject * core)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkWidget * t;
|
|
|
|
GtkWidget * w;
|
|
|
|
GtkWidget * h;
|
|
|
|
GtkWidget * l;
|
|
|
|
const char * s;
|
|
|
|
struct network_page_data * data;
|
|
|
|
guint row = 0;
|
|
|
|
|
|
|
|
/* register to stop listening to core prefs changes when the page is destroyed */
|
|
|
|
data = g_new0 (struct network_page_data, 1);
|
|
|
|
data->core = TR_CORE (core);
|
|
|
|
|
|
|
|
/* build the page */
|
|
|
|
t = hig_workarea_create ();
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Listening Port"));
|
|
|
|
|
|
|
|
s = _("_Port used for incoming connections:");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = data->portSpin = new_spin_button (TR_KEY_peer_port, core, 1, USHRT_MAX, 1);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, s, w, NULL);
|
|
|
|
|
|
|
|
h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, GUI_PAD_BIG);
|
|
|
|
l = data->portLabel = gtk_label_new (_("Status unknown"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (l), 0.0f, 0.5f);
|
|
|
|
gtk_box_pack_start (GTK_BOX (h), l, TRUE, TRUE, 0);
|
|
|
|
w = data->portButton = gtk_button_new_with_mnemonic (_("Te_st Port"));
|
|
|
|
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);
|
|
|
|
g_object_weak_ref (G_OBJECT (t), networkPageDestroyed, data);
|
|
|
|
|
|
|
|
s = _("Pick a _random port every time Transmission is started");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_peer_port_random_on_start, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
s = _("Use UPnP or NAT-PMP port _forwarding from my router");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_port_forwarding_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Peer Limits"));
|
|
|
|
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_peer_limit_per_torrent, core, 1, FD_SETSIZE, 5);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, _("Maximum peers per _torrent:"), w, NULL);
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_spin_button (TR_KEY_peer_limit_global, core, 1, FD_SETSIZE, 5);
|
2012-12-05 17:29:46 +00:00
|
|
|
hig_workarea_add_row (t, &row, _("Maximum peers _overall:"), w, NULL);
|
|
|
|
|
|
|
|
hig_workarea_add_section_divider (t, &row);
|
|
|
|
hig_workarea_add_section_title (t, &row, _("Options"));
|
2010-12-10 18:51:05 +00:00
|
|
|
|
2011-02-19 09:30:06 +00:00
|
|
|
#ifdef WITH_UTP
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("Enable _uTP for peer communication");
|
2012-12-22 20:35:19 +00:00
|
|
|
w = new_check_button (s, TR_KEY_utp_enabled, core);
|
2012-12-05 17:29:46 +00:00
|
|
|
s = _("uTP is a tool for reducing network congestion.");
|
|
|
|
gtk_widget_set_tooltip_text (w, s);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
2011-02-18 22:22:02 +00:00
|
|
|
#endif
|
2011-02-18 00:33:29 +00:00
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
s = _("Use PE_X to find more peers");
|
|
|
|
w = new_check_button (s, TR_KEY_pex_enabled, core);
|
|
|
|
s = _("PEX is a tool for exchanging peer lists with the peers you're connected to.");
|
|
|
|
gtk_widget_set_tooltip_text (w, s);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
s = _("Use _DHT to find more peers");
|
|
|
|
w = new_check_button (s, TR_KEY_dht_enabled, core);
|
|
|
|
s = _("DHT is a tool for finding peers without a tracker.");
|
|
|
|
gtk_widget_set_tooltip_text (w, s);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
|
|
|
s = _("Use _Local Peer Discovery to find more peers");
|
|
|
|
w = new_check_button (s, TR_KEY_lpd_enabled, core);
|
|
|
|
s = _("LPD is a tool for finding peers on your local network.");
|
|
|
|
gtk_widget_set_tooltip_text (w, s);
|
|
|
|
hig_workarea_add_wide_control (t, &row, w);
|
|
|
|
|
2012-12-05 17:29:46 +00:00
|
|
|
return t;
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/****
|
|
|
|
*****
|
|
|
|
****/
|
|
|
|
|
2008-02-13 03:00:21 +00:00
|
|
|
GtkWidget *
|
2012-12-05 17:29:46 +00:00
|
|
|
gtr_prefs_dialog_new (GtkWindow * parent, GObject * core)
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2012-12-05 17:29:46 +00:00
|
|
|
GtkWidget * d;
|
|
|
|
GtkWidget * n;
|
|
|
|
|
|
|
|
d = gtk_dialog_new_with_buttons (_("Transmission Preferences"),
|
|
|
|
parent,
|
|
|
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
|
|
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
|
|
|
|
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
|
|
|
NULL);
|
|
|
|
gtk_window_set_role (GTK_WINDOW (d), "transmission-preferences-dialog");
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (d), GUI_PAD);
|
|
|
|
|
|
|
|
n = gtk_notebook_new ();
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (n), GUI_PAD);
|
|
|
|
|
2013-01-16 21:42:03 +00:00
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), speedPage (core),
|
|
|
|
gtk_label_new (_("Speed")));
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), downloadingPage (core),
|
2012-12-05 17:29:46 +00:00
|
|
|
gtk_label_new (C_("Gerund", "Downloading")));
|
2013-01-16 21:42:03 +00:00
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), seedingPage (core),
|
|
|
|
gtk_label_new (C_("Gerund", "Seeding")));
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), privacyPage (core),
|
|
|
|
gtk_label_new (_("Privacy")));
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), networkPage (core),
|
|
|
|
gtk_label_new (_("Network")));
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), desktopPage (core),
|
|
|
|
gtk_label_new (_("Desktop")));
|
|
|
|
gtk_notebook_append_page (GTK_NOTEBOOK (n), remotePage (core),
|
|
|
|
gtk_label_new (_("Remote")));
|
|
|
|
|
|
|
|
g_signal_connect (d, "response", G_CALLBACK (response_cb), core);
|
|
|
|
gtr_dialog_set_content (GTK_DIALOG (d), n);
|
|
|
|
return d;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|