2007-09-27 20:57:58 +00:00
|
|
|
/*
|
2021-10-18 20:22:31 +00:00
|
|
|
* This file Copyright (C) 2007-2021 Mnemosyne LLC
|
2007-02-19 22:09:05 +00:00
|
|
|
*
|
2014-01-21 03:10:30 +00:00
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
2014-01-19 01:09:44 +00:00
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
2008-09-23 19:11:04 +00:00
|
|
|
*
|
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 */
|
2013-08-24 17:53:45 +00:00
|
|
|
#include <limits.h> /* USHRT_MAX, INT_MAX */
|
2021-10-18 20:22:31 +00:00
|
|
|
#include <sstream>
|
2008-03-30 00:21:46 +00:00
|
|
|
#include <unistd.h>
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
#include <glibmm.h>
|
|
|
|
#include <glibmm/i18n.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>
|
2021-11-09 03:30:03 +00:00
|
|
|
#include <libtransmission/web-utils.h>
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
#include "FreeSpaceLabel.h"
|
|
|
|
#include "HigWorkarea.h"
|
|
|
|
#include "Prefs.h"
|
|
|
|
#include "PrefsDialog.h"
|
|
|
|
#include "Session.h"
|
|
|
|
#include "Utils.h"
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2013-02-09 04:05:03 +00:00
|
|
|
/**
|
|
|
|
***
|
|
|
|
**/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
class PrefsDialog::Impl
|
2013-02-09 04:05:03 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
public:
|
2021-11-01 00:11:23 +00:00
|
|
|
Impl(PrefsDialog& dialog, Glib::RefPtr<Session> const& core);
|
2021-10-18 20:22:31 +00:00
|
|
|
~Impl();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Gtk::Widget* speedPage();
|
|
|
|
Gtk::Widget* downloadingPage();
|
|
|
|
Gtk::Widget* seedingPage();
|
|
|
|
Gtk::Widget* privacyPage();
|
|
|
|
Gtk::Widget* networkPage();
|
|
|
|
Gtk::Widget* desktopPage();
|
|
|
|
Gtk::Widget* remotePage();
|
|
|
|
|
|
|
|
void on_core_prefs_changed(tr_quark const key);
|
2013-02-09 04:05:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void response_cb(int response);
|
2013-02-09 04:05:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
private:
|
|
|
|
PrefsDialog& dialog_;
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Glib::RefPtr<Session> const core_;
|
2021-10-18 20:22:31 +00:00
|
|
|
sigc::connection core_prefs_tag_;
|
|
|
|
|
|
|
|
FreeSpaceLabel* freespace_label_ = nullptr;
|
|
|
|
|
2021-10-24 15:55:51 +00:00
|
|
|
#if 0
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Label* port_label_ = nullptr;
|
|
|
|
Gtk::Button* port_button_ = nullptr;
|
|
|
|
Gtk::SpinButton* port_spin_ = nullptr;
|
2021-10-24 15:55:51 +00:00
|
|
|
#endif
|
2013-02-09 04:05:03 +00:00
|
|
|
};
|
|
|
|
|
2007-09-27 20:57:58 +00:00
|
|
|
/**
|
|
|
|
***
|
|
|
|
**/
|
2007-02-19 22:09:05 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void PrefsDialog::Impl::response_cb(int response)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
if (response == Gtk::RESPONSE_HELP)
|
2008-09-23 19:11:04 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
gtr_open_uri(gtr_get_help_uri() + "/html/preferences.html");
|
#963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: use branch numbers for help, such as 1.2x, instead of #963: 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
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (response == Gtk::RESPONSE_CLOSE)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
dialog_.hide();
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::CheckButton* new_check_button(Glib::ustring const& mnemonic, tr_quark const key, Glib::RefPtr<Session> const& core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::CheckButton>(mnemonic, true);
|
|
|
|
w->set_active(gtr_pref_flag_get(key));
|
|
|
|
w->signal_toggled().connect([w, key, core]() { core->set_pref(key, w->get_active()); });
|
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"
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
bool spun_cb_idle(Gtk::SpinButton* spin, tr_quark const key, Glib::RefPtr<Session> const& core, bool isDouble)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
bool keep_waiting = true;
|
|
|
|
auto* last_change = static_cast<Glib::Timer*>(spin->get_data(IDLE_DATA));
|
2008-09-03 16:29:59 +00:00
|
|
|
|
2008-09-03 20:00:27 +00:00
|
|
|
/* has the user stopped making changes? */
|
2021-10-18 20:22:31 +00:00
|
|
|
if (last_change->elapsed() > 0.33)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
|
|
|
/* update the core */
|
2021-10-18 20:22:31 +00:00
|
|
|
if (isDouble)
|
2009-02-13 18:23:56 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
double const value = spin->get_value();
|
|
|
|
core->set_pref(key, value);
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
int const value = spin->get_value_as_int();
|
|
|
|
core->set_pref(key, value);
|
2009-02-13 18:23:56 +00:00
|
|
|
}
|
2008-09-03 16:29:59 +00:00
|
|
|
|
|
|
|
/* cleanup */
|
2021-10-18 20:22:31 +00:00
|
|
|
spin->set_data(IDLE_DATA, nullptr);
|
|
|
|
keep_waiting = false;
|
|
|
|
spin->unreference();
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return keep_waiting;
|
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
void spun_cb(Gtk::SpinButton* w, tr_quark const key, Glib::RefPtr<Session> const& core, bool 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 */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* last_change = static_cast<Glib::Timer*>(w->get_data(IDLE_DATA));
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (last_change == nullptr)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
last_change = new Glib::Timer();
|
|
|
|
w->set_data(IDLE_DATA, last_change, [](void* p) { delete static_cast<Glib::Timer*>(p); });
|
|
|
|
w->reference();
|
|
|
|
Glib::signal_timeout().connect_seconds([w, key, core, isDouble]() { return spun_cb_idle(w, key, core, isDouble); }, 1);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
last_change->start();
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::SpinButton* new_spin_button(tr_quark const key, Glib::RefPtr<Session> const& core, int low, int high, int step)
|
2009-02-13 18:23:56 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::SpinButton>(Gtk::Adjustment::create(gtr_pref_int_get(key), low, high, step));
|
|
|
|
w->set_digits(0);
|
|
|
|
w->signal_value_changed().connect([w, key, core]() { spun_cb(w, key, core, false); });
|
2009-02-13 18:23:56 +00:00
|
|
|
return w;
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::SpinButton* new_spin_button_double(
|
|
|
|
tr_quark const key,
|
2021-11-01 00:11:23 +00:00
|
|
|
Glib::RefPtr<Session> const& core,
|
2021-10-18 20:22:31 +00:00
|
|
|
double low,
|
|
|
|
double high,
|
|
|
|
double step)
|
2009-02-13 18:23:56 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::SpinButton>(Gtk::Adjustment::create(gtr_pref_double_get(key), low, high, step));
|
|
|
|
w->set_digits(2);
|
|
|
|
w->signal_value_changed().connect([w, key, core]() { spun_cb(w, key, core, true); });
|
2007-09-27 20:57:58 +00:00
|
|
|
return w;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
void entry_changed_cb(Gtk::Entry* w, tr_quark const key, Glib::RefPtr<Session> const& core)
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
core->set_pref(key, w->get_text());
|
2008-06-02 21:02:38 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::Entry* new_entry(tr_quark const key, Glib::RefPtr<Session> const& core)
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::Entry>();
|
2012-12-22 20:35:19 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (auto const value = gtr_pref_string_get(key); !value.empty())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
w->set_text(value);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2012-12-22 20:35:19 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
w->signal_changed().connect([w, key, core]() { entry_changed_cb(w, key, core); });
|
2017-04-19 12:04:45 +00:00
|
|
|
return w;
|
2008-06-02 21:02:38 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
void chosen_cb(Gtk::FileChooser* w, tr_quark const key, Glib::RefPtr<Session> const& core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
core->set_pref(key, w->get_filename());
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::FileChooserButton* new_path_chooser_button(tr_quark const key, Glib::RefPtr<Session> const& core)
|
2007-02-19 22:09:05 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::FileChooserButton>(Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (auto const path = gtr_pref_string_get(key); !path.empty())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
w->set_filename(path);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
w->signal_selection_changed().connect([w, key, core]() { chosen_cb(w, key, core); });
|
2017-04-19 12:04:45 +00:00
|
|
|
return w;
|
2010-05-08 22:42:28 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::FileChooserButton* new_file_chooser_button(tr_quark const key, Glib::RefPtr<Session> const& core)
|
2010-05-08 22:42:28 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::FileChooserButton>(Gtk::FILE_CHOOSER_ACTION_OPEN);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (auto const path = gtr_pref_string_get(key); !path.empty())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
w->set_filename(path);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
w->signal_selection_changed().connect([w, key, core]() { chosen_cb(w, key, core); });
|
2017-04-19 12:04:45 +00:00
|
|
|
return w;
|
2007-02-19 22:09:05 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void target_cb(Gtk::ToggleButton* tb, Gtk::Widget* target)
|
2007-12-13 20:46:19 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
target->set_sensitive(tb->get_active());
|
2007-12-13 20:46:19 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
|
|
|
|
2011-08-01 22:24:24 +00:00
|
|
|
/****
|
|
|
|
***** Download Tab
|
|
|
|
****/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget* PrefsDialog::Impl::downloadingPage()
|
2011-08-01 22:24:24 +00:00
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
guint row = 0;
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
|
|
|
t->add_section_title(row, C_("Gerund", "Adding"));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
|
|
|
auto* l = new_check_button(_("Automatically add .torrent files _from:"), TR_KEY_watch_dir_enabled, core_);
|
|
|
|
auto* w = new_path_chooser_button(TR_KEY_watch_dir, core_);
|
|
|
|
w->set_sensitive(gtr_pref_flag_get(TR_KEY_watch_dir_enabled));
|
|
|
|
l->signal_toggled().connect([l, w]() { target_cb(l, w); });
|
|
|
|
t->add_row_w(row, *l, *w);
|
|
|
|
}
|
2013-01-16 21:42:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(row, *new_check_button(_("Show the Torrent Options _dialog"), TR_KEY_show_options_window, core_));
|
2013-01-16 21:42:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(row, *new_check_button(_("_Start added torrents"), TR_KEY_start_added_torrents, core_));
|
2013-01-16 21:42:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Mo_ve .torrent file to the trash"), TR_KEY_trash_original_torrent_files, core_));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_row(row, _("Save to _Location:"), *new_path_chooser_button(TR_KEY_download_dir, core_));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
freespace_label_ = Gtk::make_managed<FreeSpaceLabel>(core_);
|
|
|
|
freespace_label_->set_halign(Gtk::ALIGN_END);
|
|
|
|
freespace_label_->set_valign(Gtk::ALIGN_CENTER);
|
|
|
|
t->add_wide_control(row, *freespace_label_);
|
2013-02-09 04:05:03 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_section_divider(row);
|
|
|
|
t->add_section_title(row, _("Download Queue"));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_row(row, _("Ma_ximum active downloads:"), *new_spin_button(TR_KEY_download_queue_size, core_, 0, INT_MAX, 1));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_row(
|
|
|
|
row,
|
|
|
|
_("Downloads sharing data in the last _N minutes are active:"),
|
|
|
|
*new_spin_button(TR_KEY_queue_stalled_minutes, core_, 1, INT_MAX, 15));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_section_divider(row);
|
|
|
|
t->add_section_title(row, _("Incomplete"));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Append \"._part\" to incomplete files' names"), TR_KEY_rename_partial_files, core_));
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
|
|
|
auto* l = new_check_button(_("Keep _incomplete torrents in:"), TR_KEY_incomplete_dir_enabled, core_);
|
|
|
|
auto* w = new_path_chooser_button(TR_KEY_incomplete_dir, core_);
|
|
|
|
w->set_sensitive(gtr_pref_flag_get(TR_KEY_incomplete_dir_enabled));
|
|
|
|
l->signal_toggled().connect([l, w]() { target_cb(l, w); });
|
|
|
|
t->add_row_w(row, *l, *w);
|
|
|
|
}
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
|
|
|
auto* l = new_check_button(_("Call scrip_t when torrent is completed:"), TR_KEY_script_torrent_done_enabled, core_);
|
|
|
|
auto* w = new_file_chooser_button(TR_KEY_script_torrent_done_filename, core_);
|
|
|
|
w->set_sensitive(gtr_pref_flag_get(TR_KEY_script_torrent_done_enabled));
|
|
|
|
l->signal_toggled().connect([l, w]() { target_cb(l, w); });
|
|
|
|
t->add_row_w(row, *l, *w);
|
|
|
|
}
|
2011-08-01 22:24:24 +00:00
|
|
|
|
2017-04-19 12:04:45 +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
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget* PrefsDialog::Impl::seedingPage()
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
guint row = 0;
|
2012-12-05 17:29:46 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
|
|
|
t->add_section_title(row, _("Limits"));
|
2012-12-05 17:29:46 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
|
|
|
auto* w = new_check_button(_("Stop seeding at _ratio:"), TR_KEY_ratio_limit_enabled, core_);
|
|
|
|
auto* w2 = new_spin_button_double(TR_KEY_ratio_limit, core_, 0, 1000, .05);
|
|
|
|
w2->set_sensitive(gtr_pref_flag_get(TR_KEY_ratio_limit_enabled));
|
|
|
|
w->signal_toggled().connect([w, w2]() { target_cb(w, w2); });
|
|
|
|
t->add_row_w(row, *w, *w2);
|
|
|
|
}
|
2012-12-05 17:29:46 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
|
|
|
auto* w = new_check_button(_("Stop seeding if idle for _N minutes:"), TR_KEY_idle_seeding_limit_enabled, core_);
|
|
|
|
auto* w2 = new_spin_button(TR_KEY_idle_seeding_limit, core_, 1, 40320, 5);
|
|
|
|
w2->set_sensitive(gtr_pref_flag_get(TR_KEY_idle_seeding_limit_enabled));
|
|
|
|
w->signal_toggled().connect([w, w2]() { target_cb(w, w2); });
|
|
|
|
t->add_row_w(row, *w, *w2);
|
|
|
|
}
|
2009-03-28 16:47:01 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
return t;
|
2008-02-13 03:00:21 +00:00
|
|
|
}
|
|
|
|
|
2008-10-08 18:26:55 +00:00
|
|
|
/****
|
|
|
|
***** Desktop Tab
|
|
|
|
****/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget* PrefsDialog::Impl::desktopPage()
|
2008-10-08 18:26:55 +00:00
|
|
|
{
|
2011-08-13 21:08:53 +00:00
|
|
|
guint row = 0;
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
|
|
|
t->add_section_title(row, _("Desktop"));
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("_Inhibit hibernation when torrents are active"), TR_KEY_inhibit_desktop_hibernation, core_));
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Show Transmission icon in the _notification area"), TR_KEY_show_notification_area_icon, core_));
|
2008-10-08 18:26:55 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_section_divider(row);
|
|
|
|
t->add_section_title(row, _("Notification"));
|
2011-07-23 17:23:12 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Show a notification when torrents are a_dded"), TR_KEY_torrent_added_notification_enabled, core_));
|
2011-07-23 17:23:12 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Show a notification when torrents _finish"), TR_KEY_torrent_complete_notification_enabled, core_));
|
2009-01-12 18:48:20 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Play a _sound when torrents finish"), TR_KEY_torrent_complete_sound_enabled, core_));
|
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
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2008-03-30 00:21:46 +00:00
|
|
|
struct blocklist_data
|
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
~blocklist_data();
|
|
|
|
|
|
|
|
sigc::connection updateBlocklistTag;
|
|
|
|
Gtk::Button* updateBlocklistButton = nullptr;
|
|
|
|
std::unique_ptr<Gtk::MessageDialog> updateBlocklistDialog;
|
|
|
|
Gtk::Label* label = nullptr;
|
|
|
|
Gtk::CheckButton* check = nullptr;
|
2021-11-01 00:11:23 +00:00
|
|
|
Glib::RefPtr<Session> core;
|
2008-03-30 00:21:46 +00:00
|
|
|
};
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
void updateBlocklistText(Gtk::Label* w, Glib::RefPtr<Session> const& core)
|
2008-04-01 16:57:48 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
int const n = tr_blocklistGetRuleCount(core->get_session());
|
|
|
|
w->set_markup(
|
|
|
|
gtr_sprintf("<i>%s</i>", gtr_sprintf(ngettext("Blocklist contains %'d rule", "Blocklist contains %'d rules", n), n)));
|
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 */
|
2021-10-18 20:22:31 +00:00
|
|
|
blocklist_data::~blocklist_data()
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
if (updateBlocklistTag.connected())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
updateBlocklistTag.disconnect();
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-03-30 00:21:46 +00:00
|
|
|
}
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* user hit "close" in the blocklist-update dialog */
|
2021-10-18 20:22:31 +00:00
|
|
|
void onBlocklistUpdateResponse(std::shared_ptr<blocklist_data> const& data)
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
data->updateBlocklistButton->set_sensitive(true);
|
|
|
|
data->updateBlocklistDialog.reset();
|
|
|
|
data->updateBlocklistTag.disconnect();
|
2008-03-30 00:21:46 +00:00
|
|
|
}
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
/* core says the blocklist was updated */
|
2021-11-01 00:11:23 +00:00
|
|
|
void onBlocklistUpdated(Glib::RefPtr<Session> const& core, int n, blocklist_data* data)
|
2008-03-30 00:21:46 +00:00
|
|
|
{
|
2017-04-20 16:02:19 +00:00
|
|
|
bool const success = n >= 0;
|
2021-10-18 20:22:31 +00:00
|
|
|
int const count = n >= 0 ? n : tr_blocklistGetRuleCount(core->get_session());
|
|
|
|
data->updateBlocklistButton->set_sensitive(true);
|
|
|
|
data->updateBlocklistDialog->set_message(success ? _("<b>Update succeeded!</b>") : _("<b>Unable to update.</b>"), true);
|
|
|
|
data->updateBlocklistDialog->set_secondary_text(
|
|
|
|
gtr_sprintf(ngettext("Blocklist has %'d rule.", "Blocklist has %'d rules.", count), count));
|
2017-04-19 12:04:45 +00:00
|
|
|
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 */
|
2021-10-18 20:22:31 +00:00
|
|
|
void onBlocklistUpdate(Gtk::Button* w, std::shared_ptr<blocklist_data> const& data)
|
2009-04-07 20:13:08 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
data->updateBlocklistDialog = std::make_unique<Gtk::MessageDialog>(
|
|
|
|
*static_cast<Gtk::Window*>(w->get_toplevel()),
|
|
|
|
_("Update Blocklist"),
|
|
|
|
false,
|
|
|
|
Gtk::MESSAGE_INFO,
|
|
|
|
Gtk::BUTTONS_CLOSE);
|
|
|
|
data->updateBlocklistButton->set_sensitive(false);
|
|
|
|
data->updateBlocklistDialog->set_secondary_text(_("Getting new blocklist…"));
|
|
|
|
data->updateBlocklistDialog->signal_response().connect([data](int /*response*/) { onBlocklistUpdateResponse(data); });
|
|
|
|
data->updateBlocklistDialog->show();
|
|
|
|
data->core->blocklist_update();
|
|
|
|
data->updateBlocklistTag = data->core->signal_blocklist_updated().connect(
|
|
|
|
[data](auto n) { onBlocklistUpdated(data->core, n, data.get()); });
|
2008-03-30 00:21:46 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void on_blocklist_url_changed(Gtk::Editable* e, Gtk::Button* button)
|
2011-02-19 09:02:39 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const url = e->get_chars(0, -1);
|
2021-11-09 03:30:03 +00:00
|
|
|
button->set_sensitive(tr_urlIsValid(url.c_str()));
|
2011-02-19 09:02:39 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
void onIntComboChanged(Gtk::ComboBox* combo_box, tr_quark const key, Glib::RefPtr<Session> const& core)
|
2008-06-12 16:25:36 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
core->set_pref(key, gtr_combo_box_get_active_enum(*combo_box));
|
2009-04-18 23:14:57 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::ComboBox* new_encryption_combo(Glib::RefPtr<Session> const& core, tr_quark const key)
|
2009-04-18 23:14:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = gtr_combo_box_new_enum({
|
|
|
|
{ _("Allow encryption"), TR_CLEAR_PREFERRED },
|
|
|
|
{ _("Prefer encryption"), TR_ENCRYPTION_PREFERRED },
|
|
|
|
{ _("Require encryption"), TR_ENCRYPTION_REQUIRED },
|
|
|
|
});
|
|
|
|
gtr_combo_box_set_active_enum(*w, gtr_pref_int_get(key));
|
|
|
|
w->signal_changed().connect([w, key, core]() { onIntComboChanged(w, key, core); });
|
2017-04-19 12:04:45 +00:00
|
|
|
return w;
|
2008-06-12 16:25:36 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
Gtk::Widget* PrefsDialog::Impl::privacyPage()
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
guint row = 0;
|
2008-02-13 03:00:21 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const data = std::make_shared<blocklist_data>();
|
|
|
|
data->core = core_;
|
|
|
|
|
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
|
|
|
t->add_section_title(row, _("Privacy"));
|
|
|
|
|
|
|
|
t->add_row(row, _("_Encryption mode:"), *new_encryption_combo(core_, TR_KEY_encryption));
|
|
|
|
|
|
|
|
t->add_section_divider(row);
|
|
|
|
t->add_section_title(row, _("Blocklist"));
|
|
|
|
|
|
|
|
data->check = new_check_button(_("Enable _blocklist:"), TR_KEY_blocklist_enabled, core_);
|
|
|
|
auto* e = new_entry(TR_KEY_blocklist_url, core_);
|
|
|
|
e->set_size_request(300, -1);
|
|
|
|
t->add_row_w(row, *data->check, *e);
|
|
|
|
data->check->signal_toggled().connect([data, e]() { target_cb(data->check, e); });
|
|
|
|
target_cb(data->check, e);
|
|
|
|
|
|
|
|
data->label = Gtk::make_managed<Gtk::Label>();
|
|
|
|
data->label->set_halign(Gtk::ALIGN_START);
|
|
|
|
data->label->set_valign(Gtk::ALIGN_CENTER);
|
|
|
|
updateBlocklistText(data->label, core_);
|
|
|
|
auto* h = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL, GUI_PAD_BIG);
|
|
|
|
h->pack_start(*data->label, true, true, 0);
|
|
|
|
data->updateBlocklistButton = Gtk::make_managed<Gtk::Button>(_("_Update"), true);
|
|
|
|
data->updateBlocklistButton->set_data("session", core_->get_session());
|
|
|
|
data->updateBlocklistButton->signal_clicked().connect([data]() { onBlocklistUpdate(data->updateBlocklistButton, data); });
|
|
|
|
target_cb(data->check, data->updateBlocklistButton);
|
|
|
|
h->pack_start(*data->updateBlocklistButton, false, false, 0);
|
|
|
|
data->check->signal_toggled().connect([data]() { target_cb(data->check, data->label); });
|
|
|
|
target_cb(data->check, data->label);
|
|
|
|
t->add_wide_control(row, *h);
|
|
|
|
e->signal_changed().connect([data, e]() { on_blocklist_url_changed(e, data->updateBlocklistButton); });
|
|
|
|
on_blocklist_url_changed(e, data->updateBlocklistButton);
|
|
|
|
|
|
|
|
auto* update_check = new_check_button(_("Enable _automatic updates"), TR_KEY_blocklist_updates_enabled, core_);
|
|
|
|
t->add_wide_control(row, *update_check);
|
|
|
|
data->check->signal_toggled().connect([data, update_check]() { target_cb(data->check, update_check); });
|
|
|
|
target_cb(data->check, update_check);
|
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
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
|
|
|
****/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
class WhitelistModelColumns : public Gtk::TreeModelColumnRecord
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WhitelistModelColumns()
|
|
|
|
{
|
|
|
|
add(address);
|
|
|
|
}
|
|
|
|
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> address;
|
2008-06-03 20:59:57 +00:00
|
|
|
};
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
WhitelistModelColumns const whitelist_cols;
|
|
|
|
|
|
|
|
Glib::RefPtr<Gtk::ListStore> whitelist_tree_model_new(std::string const& whitelist)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const store = Gtk::ListStore::create(whitelist_cols);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
std::istringstream stream(whitelist);
|
|
|
|
std::string s;
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
while (std::getline(stream, s, ','))
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
s = gtr_str_strip(s);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (s.empty())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
continue;
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const iter = store->append();
|
|
|
|
(*iter)[whitelist_cols.address] = s;
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
return store;
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct remote_page
|
|
|
|
{
|
2021-11-01 00:11:23 +00:00
|
|
|
Glib::RefPtr<Session> core;
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::TreeView* view;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> store;
|
|
|
|
Gtk::Button* remove_button;
|
|
|
|
std::vector<Gtk::Widget*> widgets;
|
|
|
|
std::vector<Gtk::Widget*> auth_widgets;
|
|
|
|
std::vector<Gtk::Widget*> whitelist_widgets;
|
|
|
|
Gtk::ToggleButton* rpc_tb;
|
|
|
|
Gtk::ToggleButton* auth_tb;
|
|
|
|
Gtk::ToggleButton* whitelist_tb;
|
2008-06-03 20:59:57 +00:00
|
|
|
};
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void refreshWhitelist(std::shared_ptr<remote_page> const& page)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
std::ostringstream gstr;
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
for (auto const& row : page->store->children())
|
2011-04-13 22:16:50 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
gstr << row.get_value(whitelist_cols.address) << ",";
|
2011-04-13 22:16:50 +00:00
|
|
|
}
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto str = gstr.str();
|
|
|
|
if (!str.empty())
|
|
|
|
{
|
|
|
|
str.resize(str.size() - 1); /* remove the trailing comma */
|
|
|
|
}
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
page->core->set_pref(TR_KEY_rpc_whitelist, str);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onAddressEdited(Glib::ustring const& path, Glib::ustring const& address, std::shared_ptr<remote_page> const& page)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
if (auto const iter = page->store->get_iter(path); iter)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
(*iter)[whitelist_cols.address] = address;
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-06-03 20:59:57 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
refreshWhitelist(page);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onAddWhitelistClicked(std::shared_ptr<remote_page> const& page)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const iter = page->store->append();
|
|
|
|
(*iter)[whitelist_cols.address] = "0.0.0.0";
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
page->view->set_cursor(page->store->get_path(iter), *page->view->get_column(0), true);
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onRemoveWhitelistClicked(std::shared_ptr<remote_page> const& page)
|
2008-06-03 20:59:57 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const sel = page->view->get_selection();
|
2020-08-18 10:36:10 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (auto const iter = sel->get_selected(); iter)
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
page->store->erase(iter);
|
2017-04-19 12:04:45 +00:00
|
|
|
refreshWhitelist(page);
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void refreshRPCSensitivity(std::shared_ptr<remote_page> const& page)
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
bool const rpc_active = page->rpc_tb->get_active();
|
|
|
|
bool const auth_active = page->auth_tb->get_active();
|
|
|
|
bool const whitelist_active = page->whitelist_tb->get_active();
|
|
|
|
auto const sel = page->view->get_selection();
|
|
|
|
auto const have_addr = sel->get_selected();
|
|
|
|
auto const n_rules = page->store->children().size();
|
|
|
|
|
|
|
|
for (auto* const widget : page->widgets)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
widget->set_sensitive(rpc_active);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
for (auto* const widget : page->auth_widgets)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
widget->set_sensitive(rpc_active && auth_active);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
for (auto* const widget : page->whitelist_widgets)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
widget->set_sensitive(rpc_active && whitelist_active);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-10-01 22:59:29 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
page->remove_button->set_sensitive(rpc_active && whitelist_active && have_addr && n_rules > 1);
|
2008-06-04 19:46:37 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onLaunchClutchCB()
|
2008-06-04 19:46:37 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
gtr_open_uri(gtr_sprintf("http://localhost:%d/", (int)gtr_pref_int_get(TR_KEY_rpc_port)));
|
2008-06-03 20:59:57 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
2010-01-11 21:54:54 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget* PrefsDialog::Impl::remotePage()
|
2008-06-02 21:02:38 +00:00
|
|
|
{
|
2011-08-13 21:08:53 +00:00
|
|
|
guint row = 0;
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const page = std::make_shared<remote_page>();
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
page->core = core_;
|
2008-06-04 19:46:37 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
t->add_section_title(row, _("Remote Control"));
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
/* "enabled" checkbutton */
|
2021-10-18 20:22:31 +00:00
|
|
|
page->rpc_tb = new_check_button(_("Allow _remote access"), TR_KEY_rpc_enabled, core_);
|
|
|
|
page->rpc_tb->signal_clicked().connect([page]() { refreshRPCSensitivity(page); });
|
|
|
|
auto* h1 = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL, GUI_PAD_BIG);
|
|
|
|
h1->pack_start(*page->rpc_tb, true, true, 0);
|
|
|
|
auto* open_button = Gtk::make_managed<Gtk::Button>(_("_Open web client"), true);
|
|
|
|
page->widgets.push_back(open_button);
|
|
|
|
open_button->signal_clicked().connect(&onLaunchClutchCB);
|
|
|
|
h1->pack_start(*open_button, false, false, 0);
|
|
|
|
t->add_wide_control(row, *h1);
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
/* port */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* port_spin = new_spin_button(TR_KEY_rpc_port, core_, 0, USHRT_MAX, 1);
|
|
|
|
page->widgets.push_back(port_spin);
|
|
|
|
page->widgets.push_back(t->add_row(row, _("HTTP _port:"), *port_spin));
|
2008-10-01 22:59:29 +00:00
|
|
|
|
2008-09-23 19:11:04 +00:00
|
|
|
/* require authentication */
|
2021-10-18 20:22:31 +00:00
|
|
|
page->auth_tb = new_check_button(_("Use _authentication"), TR_KEY_rpc_authentication_required, core_);
|
|
|
|
t->add_wide_control(row, *page->auth_tb);
|
|
|
|
page->widgets.push_back(page->auth_tb);
|
|
|
|
page->auth_tb->signal_clicked().connect([page]() { refreshRPCSensitivity(page); });
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* username */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* username_entry = new_entry(TR_KEY_rpc_username, core_);
|
|
|
|
page->auth_widgets.push_back(username_entry);
|
|
|
|
page->auth_widgets.push_back(t->add_row(row, _("_Username:"), *username_entry));
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* password */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* password_entry = new_entry(TR_KEY_rpc_password, core_);
|
|
|
|
password_entry->set_visibility(false);
|
|
|
|
page->auth_widgets.push_back(password_entry);
|
|
|
|
page->auth_widgets.push_back(t->add_row(row, _("Pass_word:"), *password_entry));
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2008-10-01 22:59:29 +00:00
|
|
|
/* require authentication */
|
2021-10-18 20:22:31 +00:00
|
|
|
page->whitelist_tb = new_check_button(_("Only allow these IP a_ddresses:"), TR_KEY_rpc_whitelist_enabled, core_);
|
|
|
|
t->add_wide_control(row, *page->whitelist_tb);
|
|
|
|
page->widgets.push_back(page->whitelist_tb);
|
|
|
|
page->whitelist_tb->signal_clicked().connect([page]() { refreshRPCSensitivity(page); });
|
2008-09-23 19:11:04 +00:00
|
|
|
|
|
|
|
/* access control list */
|
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
page->store = whitelist_tree_model_new(gtr_pref_string_get(TR_KEY_rpc_whitelist));
|
|
|
|
|
|
|
|
page->view = Gtk::make_managed<Gtk::TreeView>(page->store);
|
|
|
|
page->view->signal_button_release_event().connect([page](GdkEventButton* event)
|
|
|
|
{ return on_tree_view_button_released(page->view, event); });
|
|
|
|
|
|
|
|
page->whitelist_widgets.push_back(page->view);
|
|
|
|
page->view->set_tooltip_text(_("IP addresses may use wildcards, such as 192.168.*.*"));
|
|
|
|
auto const sel = page->view->get_selection();
|
|
|
|
sel->signal_changed().connect([page]() { refreshRPCSensitivity(page); });
|
|
|
|
page->view->set_headers_visible(true);
|
|
|
|
auto* view_frame = Gtk::make_managed<Gtk::Frame>();
|
|
|
|
view_frame->set_shadow_type(Gtk::SHADOW_IN);
|
|
|
|
view_frame->add(*page->view);
|
2008-06-03 20:59:57 +00:00
|
|
|
|
2008-06-04 19:46:37 +00:00
|
|
|
/* ip address column */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* r = Gtk::make_managed<Gtk::CellRendererText>();
|
|
|
|
r->signal_edited().connect([page](auto const& path, auto const& new_text) { onAddressEdited(path, new_text, page); });
|
|
|
|
r->property_editable() = true;
|
|
|
|
auto* c = Gtk::make_managed<Gtk::TreeViewColumn>("", *r);
|
|
|
|
c->add_attribute(r->property_text(), whitelist_cols.address);
|
|
|
|
c->set_expand(true);
|
|
|
|
page->view->append_column(*c);
|
|
|
|
page->view->set_headers_visible(false);
|
|
|
|
|
|
|
|
auto* w = t->add_row(row, _("Addresses:"), *view_frame);
|
|
|
|
w->set_halign(Gtk::ALIGN_START);
|
|
|
|
w->set_valign(Gtk::ALIGN_START);
|
|
|
|
w->set_margin_top(GUI_PAD);
|
|
|
|
w->set_margin_bottom(GUI_PAD);
|
|
|
|
page->whitelist_widgets.push_back(w);
|
|
|
|
|
|
|
|
auto* h2 = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL, GUI_PAD);
|
|
|
|
page->remove_button = Gtk::make_managed<Gtk::Button>(_("_Remove"), true);
|
|
|
|
page->remove_button->signal_clicked().connect([page]() { onRemoveWhitelistClicked(page); });
|
|
|
|
refreshRPCSensitivity(page);
|
|
|
|
h2->pack_start(*page->remove_button, true, true, 0);
|
|
|
|
auto* add_button = Gtk::make_managed<Gtk::Button>(_("_Add"), true);
|
|
|
|
page->whitelist_widgets.push_back(add_button);
|
|
|
|
add_button->signal_clicked().connect([page]() { onAddWhitelistClicked(page); });
|
|
|
|
h2->set_halign(Gtk::ALIGN_END);
|
|
|
|
h2->set_valign(Gtk::ALIGN_CENTER);
|
|
|
|
h2->pack_start(*add_button, true, true, 0);
|
|
|
|
t->add_wide_control(row, *h2);
|
2008-09-23 19:11:04 +00:00
|
|
|
}
|
2008-06-02 21:02:38 +00:00
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
refreshRPCSensitivity(page);
|
2008-06-02 21:02:38 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Bandwidth Tab
|
|
|
|
****/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
struct BandwidthPage
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
std::vector<Gtk::Widget*> sched_widgets;
|
2008-09-01 04:47:02 +00:00
|
|
|
};
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void refreshSchedSensitivity(std::shared_ptr<BandwidthPage> const& p)
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
bool const sched_enabled = gtr_pref_flag_get(TR_KEY_alt_speed_time_enabled);
|
2008-09-01 04:47:02 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
for (auto* const w : p->sched_widgets)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
w->set_sensitive(sched_enabled);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-09-01 04:47:02 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::ComboBox* new_time_combo(Glib::RefPtr<Session> const& core, tr_quark const key)
|
2008-09-01 04:47:02 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
class TimeModelColumns : public Gtk::TreeModelColumnRecord
|
2008-09-02 18:22:23 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
public:
|
|
|
|
TimeModelColumns()
|
|
|
|
{
|
|
|
|
add(offset);
|
|
|
|
add(title);
|
|
|
|
}
|
2008-09-02 18:22:23 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::TreeModelColumn<int> offset;
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> title;
|
|
|
|
};
|
|
|
|
|
|
|
|
static TimeModelColumns const time_cols;
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
/* build a store at 15 minute intervals */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto store = Gtk::ListStore::create(time_cols);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2017-05-13 22:38:31 +00:00
|
|
|
for (int i = 0; i < 60 * 24; i += 15)
|
2008-09-23 19:11:04 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const iter = store->append();
|
|
|
|
(*iter)[time_cols.offset] = i;
|
|
|
|
(*iter)[time_cols.title] = gtr_sprintf("%02d:%02d", i / 60, i % 60);
|
2008-09-02 18:22:23 +00:00
|
|
|
}
|
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
/* build the widget */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* w = Gtk::make_managed<Gtk::ComboBox>(static_cast<Glib::RefPtr<Gtk::TreeModel> const&>(store));
|
|
|
|
w->set_wrap_width(4);
|
|
|
|
auto* r = Gtk::make_managed<Gtk::CellRendererText>();
|
|
|
|
w->pack_start(*r, true);
|
|
|
|
w->add_attribute(r->property_text(), time_cols.title);
|
|
|
|
w->set_active(gtr_pref_int_get(key) / 15);
|
|
|
|
w->signal_changed().connect(
|
|
|
|
[w, key, core]()
|
|
|
|
{
|
|
|
|
if (auto const iter = w->get_active(); iter)
|
|
|
|
{
|
|
|
|
core->set_pref(key, iter->get_value(time_cols.offset));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
return w;
|
2008-09-02 18:22:23 +00:00
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Gtk::ComboBox* new_week_combo(Glib::RefPtr<Session> const& core, tr_quark const key)
|
2009-04-05 14:53:22 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* 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 },
|
|
|
|
});
|
|
|
|
gtr_combo_box_set_active_enum(*w, gtr_pref_int_get(key));
|
|
|
|
w->signal_changed().connect([w, key, core]() { onIntComboChanged(w, key, core); });
|
2017-04-19 12:04:45 +00:00
|
|
|
return w;
|
2009-04-05 14:53:22 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Widget* PrefsDialog::Impl::speedPage()
|
2008-07-15 01:03:03 +00:00
|
|
|
{
|
2011-08-13 21:08:53 +00:00
|
|
|
guint row = 0;
|
2021-10-18 20:22:31 +00:00
|
|
|
auto page = std::make_shared<BandwidthPage>();
|
|
|
|
|
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
|
|
|
t->add_section_title(row, _("Speed Limits"));
|
|
|
|
|
|
|
|
{
|
|
|
|
auto* w = new_check_button(gtr_sprintf(_("_Upload (%s):"), _(speed_K_str)), TR_KEY_speed_limit_up_enabled, core_);
|
|
|
|
auto* w2 = new_spin_button(TR_KEY_speed_limit_up, core_, 0, INT_MAX, 5);
|
|
|
|
w2->set_sensitive(gtr_pref_flag_get(TR_KEY_speed_limit_up_enabled));
|
|
|
|
w->signal_toggled().connect([w, w2]() { target_cb(w, w2); });
|
|
|
|
t->add_row_w(row, *w, *w2);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto* w = new_check_button(gtr_sprintf(_("_Download (%s):"), _(speed_K_str)), TR_KEY_speed_limit_down_enabled, core_);
|
|
|
|
auto* w2 = new_spin_button(TR_KEY_speed_limit_down, core_, 0, INT_MAX, 5);
|
|
|
|
w2->set_sensitive(gtr_pref_flag_get(TR_KEY_speed_limit_down_enabled));
|
|
|
|
w->signal_toggled().connect([w, w2]() { target_cb(w, w2); });
|
|
|
|
t->add_row_w(row, *w, *w2);
|
|
|
|
}
|
|
|
|
|
|
|
|
t->add_section_divider(row);
|
|
|
|
|
|
|
|
{
|
|
|
|
auto* h = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL, GUI_PAD);
|
|
|
|
auto* w = Gtk::make_managed<Gtk::Label>(gtr_sprintf("<b>%s</b>", _("Alternative Speed Limits")));
|
|
|
|
w->set_halign(Gtk::ALIGN_START);
|
|
|
|
w->set_valign(Gtk::ALIGN_CENTER);
|
|
|
|
w->set_use_markup(true);
|
|
|
|
h->pack_start(*w, false, false, 0);
|
|
|
|
h->pack_start(*Gtk::make_managed<Gtk::Image>("alt-speed-on", Gtk::ICON_SIZE_MENU), false, false, 0);
|
|
|
|
t->add_section_title_widget(row, *h);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto* w = Gtk::make_managed<Gtk::Label>(
|
|
|
|
gtr_sprintf("<small>%s</small>", _("Override normal speed limits manually or at scheduled times")));
|
|
|
|
w->set_use_markup(true);
|
|
|
|
w->set_halign(Gtk::ALIGN_START);
|
|
|
|
w->set_valign(Gtk::ALIGN_CENTER);
|
|
|
|
t->add_wide_control(row, *w);
|
|
|
|
}
|
|
|
|
|
|
|
|
t->add_row(
|
|
|
|
row,
|
|
|
|
gtr_sprintf(_("U_pload (%s):"), _(speed_K_str)),
|
|
|
|
*new_spin_button(TR_KEY_alt_speed_up, core_, 0, INT_MAX, 5));
|
|
|
|
|
|
|
|
t->add_row(
|
|
|
|
row,
|
|
|
|
gtr_sprintf(_("Do_wnload (%s):"), _(speed_K_str)),
|
|
|
|
*new_spin_button(TR_KEY_alt_speed_down, core_, 0, INT_MAX, 5));
|
|
|
|
|
|
|
|
{
|
|
|
|
auto* h = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL, 0);
|
|
|
|
auto* start_combo = new_time_combo(core_, TR_KEY_alt_speed_time_begin);
|
|
|
|
page->sched_widgets.push_back(start_combo);
|
|
|
|
h->pack_start(*start_combo, true, true, 0);
|
|
|
|
auto* to_label = Gtk::make_managed<Gtk::Label>(_(" _to "), true);
|
|
|
|
page->sched_widgets.push_back(to_label);
|
|
|
|
h->pack_start(*to_label, false, false, 0);
|
|
|
|
auto* end_combo = new_time_combo(core_, TR_KEY_alt_speed_time_end);
|
|
|
|
to_label->set_mnemonic_widget(*end_combo);
|
|
|
|
page->sched_widgets.push_back(end_combo);
|
|
|
|
h->pack_start(*end_combo, true, true, 0);
|
|
|
|
auto* w = new_check_button(_("_Scheduled times:"), TR_KEY_alt_speed_time_enabled, core_);
|
|
|
|
w->signal_toggled().connect([page]() { refreshSchedSensitivity(page); });
|
|
|
|
t->add_row_w(row, *w, *h);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* week_combo = new_week_combo(core_, TR_KEY_alt_speed_time_day);
|
|
|
|
page->sched_widgets.push_back(week_combo);
|
|
|
|
page->sched_widgets.push_back(t->add_row(row, _("_On days:"), *week_combo));
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
refreshSchedSensitivity(page);
|
2008-07-15 01:03:03 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2008-09-03 16:29:59 +00:00
|
|
|
/****
|
|
|
|
***** Network Tab
|
|
|
|
****/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
2009-04-07 20:13:08 +00:00
|
|
|
struct network_page_data
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
~network_page_data();
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
Glib::RefPtr<Session> core;
|
2021-10-18 20:22:31 +00:00
|
|
|
Gtk::Label* portLabel = nullptr;
|
|
|
|
Gtk::Button* portButton = nullptr;
|
|
|
|
Gtk::SpinButton* portSpin = nullptr;
|
|
|
|
sigc::connection portTag;
|
|
|
|
sigc::connection prefsTag;
|
2008-09-03 16:29:59 +00:00
|
|
|
};
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onCorePrefsChanged(tr_quark const key, network_page_data* data)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
if (key == TR_KEY_peer_port)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
gtr_label_set_text(*data->portLabel, _("Status unknown"));
|
|
|
|
data->portButton->set_sensitive(true);
|
|
|
|
data->portSpin->set_sensitive(true);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
network_page_data::~network_page_data()
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
if (prefsTag.connected())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
prefsTag.disconnect();
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (portTag.connected())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
portTag.disconnect();
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onPortTested(bool isOpen, network_page_data* data)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
data->portLabel->set_markup(isOpen ? _("Port is <b>open</b>") : _("Port is <b>closed</b>"));
|
|
|
|
data->portButton->set_sensitive(true);
|
|
|
|
data->portSpin->set_sensitive(true);
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void onPortTest(std::shared_ptr<network_page_data> const& data)
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
data->portButton->set_sensitive(false);
|
|
|
|
data->portSpin->set_sensitive(false);
|
|
|
|
data->portLabel->set_markup(_("<i>Testing TCP port…</i>"));
|
2020-08-18 10:36:10 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
if (!data->portTag.connected())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
data->portTag = data->core->signal_port_tested().connect([data](bool is_open) { onPortTested(is_open, data.get()); });
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
data->core->port_test();
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
Gtk::Widget* PrefsDialog::Impl::networkPage()
|
2008-09-03 16:29:59 +00:00
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
guint row = 0;
|
|
|
|
|
|
|
|
/* register to stop listening to core prefs changes when the page is destroyed */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto const data = std::make_shared<network_page_data>();
|
|
|
|
data->core = core_;
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
/* build the page */
|
2021-10-18 20:22:31 +00:00
|
|
|
auto* t = Gtk::make_managed<HigWorkarea>();
|
|
|
|
t->add_section_title(row, _("Listening Port"));
|
|
|
|
|
|
|
|
data->portSpin = new_spin_button(TR_KEY_peer_port, core_, 1, USHRT_MAX, 1);
|
|
|
|
t->add_row(row, _("_Port used for incoming connections:"), *data->portSpin);
|
|
|
|
|
|
|
|
auto* h = Gtk::make_managed<Gtk::Box>(Gtk::ORIENTATION_HORIZONTAL, GUI_PAD_BIG);
|
|
|
|
data->portLabel = Gtk::make_managed<Gtk::Label>(_("Status unknown"));
|
|
|
|
data->portLabel->set_halign(Gtk::ALIGN_START);
|
|
|
|
data->portLabel->set_valign(Gtk::ALIGN_CENTER);
|
|
|
|
h->pack_start(*data->portLabel, true, true, 0);
|
|
|
|
data->portButton = Gtk::make_managed<Gtk::Button>(_("Te_st Port"), true);
|
|
|
|
h->pack_end(*data->portButton, false, false, 0);
|
|
|
|
data->portButton->signal_clicked().connect([data]() { onPortTest(data); });
|
|
|
|
t->add_row(row, {}, *h);
|
|
|
|
data->prefsTag = core_->signal_prefs_changed().connect([data](auto key) { onCorePrefsChanged(key, data.get()); });
|
|
|
|
|
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(
|
|
|
|
_("Pick a _random port every time Transmission is started"),
|
|
|
|
TR_KEY_peer_port_random_on_start,
|
|
|
|
core_));
|
|
|
|
|
|
|
|
t->add_wide_control(
|
|
|
|
row,
|
|
|
|
*new_check_button(_("Use UPnP or NAT-PMP port _forwarding from my router"), TR_KEY_port_forwarding_enabled, core_));
|
|
|
|
|
|
|
|
t->add_section_divider(row);
|
|
|
|
t->add_section_title(row, _("Peer Limits"));
|
|
|
|
|
|
|
|
t->add_row(row, _("Maximum peers per _torrent:"), *new_spin_button(TR_KEY_peer_limit_per_torrent, core_, 1, FD_SETSIZE, 5));
|
|
|
|
t->add_row(row, _("Maximum peers _overall:"), *new_spin_button(TR_KEY_peer_limit_global, core_, 1, FD_SETSIZE, 5));
|
|
|
|
|
|
|
|
t->add_section_divider(row);
|
|
|
|
t->add_section_title(row, _("Options"));
|
|
|
|
|
|
|
|
Gtk::CheckButton* w;
|
2010-12-10 18:51:05 +00:00
|
|
|
|
2011-02-19 09:30:06 +00:00
|
|
|
#ifdef WITH_UTP
|
2021-10-18 20:22:31 +00:00
|
|
|
w = new_check_button(_("Enable _uTP for peer communication"), TR_KEY_utp_enabled, core_);
|
|
|
|
w->set_tooltip_text(_("uTP is a tool for reducing network congestion."));
|
|
|
|
t->add_wide_control(row, *w);
|
2011-02-18 22:22:02 +00:00
|
|
|
#endif
|
2011-02-18 00:33:29 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
w = new_check_button(_("Use PE_X to find more peers"), TR_KEY_pex_enabled, core_);
|
|
|
|
w->set_tooltip_text(_("PEX is a tool for exchanging peer lists with the peers you're connected to."));
|
|
|
|
t->add_wide_control(row, *w);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
w = new_check_button(_("Use _DHT to find more peers"), TR_KEY_dht_enabled, core_);
|
|
|
|
w->set_tooltip_text(_("DHT is a tool for finding peers without a tracker."));
|
|
|
|
t->add_wide_control(row, *w);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
w = new_check_button(_("Use _Local Peer Discovery to find more peers"), TR_KEY_lpd_enabled, core_);
|
|
|
|
w->set_tooltip_text(_("LPD is a tool for finding peers on your local network."));
|
|
|
|
t->add_wide_control(row, *w);
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
return t;
|
2008-09-03 16:29:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/****
|
|
|
|
*****
|
|
|
|
****/
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
PrefsDialog::Impl::~Impl()
|
2013-02-09 04:05:03 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
if (core_prefs_tag_.connected())
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
core_prefs_tag_.disconnect();
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2013-02-09 04:05:03 +00:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
void PrefsDialog::Impl::on_core_prefs_changed(tr_quark const key)
|
2013-02-09 04:05:03 +00:00
|
|
|
{
|
|
|
|
#if 0
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
if (key == TR_KEY_peer_port)
|
2013-02-09 04:05:03 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
port_label_->set_text(_("Status unknown"));
|
|
|
|
port_button_->set_sensitive(true);
|
|
|
|
port_spin_->set_sensitive(true);
|
2013-02-09 04:05:03 +00:00
|
|
|
}
|
2017-04-19 12:04:45 +00:00
|
|
|
|
2013-02-09 04:05:03 +00:00
|
|
|
#endif
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
if (key == TR_KEY_download_dir)
|
2013-02-09 04:05:03 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
char const* downloadDir = tr_sessionGetDownloadDir(core_->get_session());
|
|
|
|
freespace_label_->set_dir(downloadDir);
|
2013-02-09 04:05:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
std::unique_ptr<PrefsDialog> PrefsDialog::create(Gtk::Window& parent, Glib::RefPtr<Session> const& core)
|
2021-10-18 20:22:31 +00:00
|
|
|
{
|
|
|
|
return std::unique_ptr<PrefsDialog>(new PrefsDialog(parent, core));
|
|
|
|
}
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
PrefsDialog::PrefsDialog(Gtk::Window& parent, Glib::RefPtr<Session> const& core)
|
2021-10-18 20:22:31 +00:00
|
|
|
: Gtk::Dialog(_("Transmission Preferences"), parent)
|
|
|
|
, impl_(std::make_unique<Impl>(*this, core))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PrefsDialog::~PrefsDialog() = default;
|
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
PrefsDialog::Impl::Impl(PrefsDialog& dialog, Glib::RefPtr<Session> const& core)
|
2021-10-18 20:22:31 +00:00
|
|
|
: dialog_(dialog)
|
|
|
|
, core_(core)
|
2008-02-13 03:00:21 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
static tr_quark const prefs_quarks[] = { TR_KEY_peer_port, TR_KEY_download_dir };
|
|
|
|
|
2021-11-12 09:12:50 +00:00
|
|
|
core_prefs_tag_ = core_->signal_prefs_changed().connect(sigc::mem_fun(*this, &Impl::on_core_prefs_changed));
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
dialog_.add_button(_("_Help"), Gtk::RESPONSE_HELP);
|
|
|
|
dialog_.add_button(_("_Close"), Gtk::RESPONSE_CLOSE);
|
|
|
|
dialog_.set_role("transmission-preferences-dialog");
|
|
|
|
dialog_.set_border_width(GUI_PAD);
|
|
|
|
|
|
|
|
auto* n = Gtk::make_managed<Gtk::Notebook>();
|
|
|
|
n->set_border_width(GUI_PAD);
|
|
|
|
|
|
|
|
n->append_page(*speedPage(), _("Speed"));
|
|
|
|
n->append_page(*downloadingPage(), C_("Gerund", "Downloading"));
|
|
|
|
n->append_page(*seedingPage(), C_("Gerund", "Seeding"));
|
|
|
|
n->append_page(*privacyPage(), _("Privacy"));
|
|
|
|
n->append_page(*networkPage(), _("Network"));
|
|
|
|
n->append_page(*desktopPage(), _("Desktop"));
|
|
|
|
n->append_page(*remotePage(), _("Remote"));
|
2017-04-19 12:04:45 +00:00
|
|
|
|
|
|
|
/* init from prefs keys */
|
2021-10-18 20:22:31 +00:00
|
|
|
for (auto const key : prefs_quarks)
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
2021-10-18 20:22:31 +00:00
|
|
|
on_core_prefs_changed(key);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|
2008-09-23 19:11:04 +00:00
|
|
|
|
2021-11-12 09:12:50 +00:00
|
|
|
dialog_.signal_response().connect(sigc::mem_fun(*this, &Impl::response_cb));
|
2021-10-18 20:22:31 +00:00
|
|
|
gtr_dialog_set_content(dialog_, *n);
|
2017-04-19 12:04:45 +00:00
|
|
|
}
|