1
/***************************************************************************
2
* Copyright (C) 2009 by Joris Guisson *
3
* joris.guisson@gmail.com *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19
***************************************************************************/
20
#include <kdeversion.h>
27
BTPref::BTPref(QWidget* parent): PrefPageInterface(Settings::self(),i18n("BitTorrent"),"application-x-bittorrent",parent)
30
#if KDE_IS_VERSION(4, 2, 80)
31
kcfg_maxCorruptedBeforeRecheck->setSuffix(ki18np(" corrupted chunk", " corrupted chunks"));
33
kcfg_maxCorruptedBeforeRecheck->setSuffix(i18n(" corrupted chunks"));
35
connect(kcfg_doUploadDataCheck,SIGNAL(toggled(bool)),this,SLOT(onUploadDataCheckToggled(bool)));
42
void BTPref::loadSettings()
44
kcfg_allowUnencryptedConnections->setEnabled(Settings::useEncryption());
45
#ifdef ENABLE_DHT_SUPPORT
46
kcfg_dhtPort->setEnabled(Settings::dhtSupport());
48
kcfg_dhtPort->setEnabled(false);
49
kcfg_dhtSupport->setEnabled(false);
51
kcfg_customIP->setEnabled(Settings::useCustomIP());
53
kcfg_maxCorruptedBeforeRecheck->setEnabled(Settings::autoRecheck());
54
kcfg_useMaxSizeForUploadDataCheck->setEnabled(Settings::doUploadDataCheck());
55
kcfg_maxSizeForUploadDataCheck->setEnabled(Settings::doUploadDataCheck() && Settings::useMaxSizeForUploadDataCheck());
57
void BTPref::onUploadDataCheckToggled(bool on)
59
kcfg_useMaxSizeForUploadDataCheck->setEnabled(on);
60
kcfg_maxSizeForUploadDataCheck->setEnabled(on&&kcfg_useMaxSizeForUploadDataCheck->isChecked());