1
/* smplayer, GUI front-end for mplayer.
2
Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
#include "findsubtitlesconfigdialog.h"
20
#include <QNetworkProxy>
22
FindSubtitlesConfigDialog::FindSubtitlesConfigDialog( QWidget* parent, Qt::WindowFlags f )
27
proxy_type_combo->addItem( tr("Http"), QNetworkProxy::HttpProxy);
28
proxy_type_combo->addItem( tr("Socks5"), QNetworkProxy::Socks5Proxy);
30
use_proxy_check->setWhatsThis( tr("Enable/disable the use of the proxy.") );
31
proxy_hostname_edit->setWhatsThis( tr("The host name of the proxy.") );
32
proxy_port_spin->setWhatsThis( tr("The port of the proxy.") );
33
proxy_username_edit->setWhatsThis( tr("If the proxy requires authentication, this sets the username.") );
34
proxy_password_edit->setWhatsThis(
35
tr("The password for the proxy. <b>Warning:</b> the password will be saved "
36
"as plain text in the configuration file.") );
37
proxy_type_combo->setWhatsThis( tr("Select the proxy type to be used.") );
39
layout()->setSizeConstraint(QLayout::SetFixedSize);
42
FindSubtitlesConfigDialog::~FindSubtitlesConfigDialog() {
45
void FindSubtitlesConfigDialog::setUseProxy(bool b) {
46
use_proxy_check->setChecked(b);
49
bool FindSubtitlesConfigDialog::useProxy() {
50
return use_proxy_check->isChecked();
53
void FindSubtitlesConfigDialog::setProxyHostname(QString host) {
54
proxy_hostname_edit->setText(host);
57
QString FindSubtitlesConfigDialog::proxyHostname() {
58
return proxy_hostname_edit->text();
61
void FindSubtitlesConfigDialog::setProxyPort(int port) {
62
proxy_port_spin->setValue(port);
65
int FindSubtitlesConfigDialog::proxyPort() {
66
return proxy_port_spin->value();
69
void FindSubtitlesConfigDialog::setProxyUsername(QString username) {
70
proxy_username_edit->setText(username);
73
QString FindSubtitlesConfigDialog::proxyUsername() {
74
return proxy_username_edit->text();
77
void FindSubtitlesConfigDialog::setProxyPassword(QString password) {
78
proxy_password_edit->setText(password);
81
QString FindSubtitlesConfigDialog::proxyPassword() {
82
return proxy_password_edit->text();
85
void FindSubtitlesConfigDialog::setProxyType(int type) {
86
int index = proxy_type_combo->findData(type);
87
if (index == -1) index = 0;
88
proxy_type_combo->setCurrentIndex(index);
91
int FindSubtitlesConfigDialog::proxyType() {
92
int index = proxy_type_combo->currentIndex();
93
return proxy_type_combo->itemData(index).toInt();
96
#include "moc_findsubtitlesconfigdialog.cpp"