source: smplayer/trunk/src/findsubtitles/findsubtitlesconfigdialog.cpp@ 119

Last change on this file since 119 was 119, checked in by Silvan Scherrer, 14 years ago

SMPlayer: latest svn update

  • Property svn:eol-style set to LF
File size: 3.1 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2011 Ricardo Villalba <rvm@escomposlinux.org>
3
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.
8
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.
13
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
17*/
18
19#include "findsubtitlesconfigdialog.h"
20#include <QNetworkProxy>
21
22FindSubtitlesConfigDialog::FindSubtitlesConfigDialog( QWidget* parent, Qt::WindowFlags f )
23 : QDialog(parent, f)
24{
25 setupUi(this);
26
27 proxy_type_combo->addItem( tr("Http"), QNetworkProxy::HttpProxy);
28 proxy_type_combo->addItem( tr("Socks5"), QNetworkProxy::Socks5Proxy);
29
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.") );
38
39 layout()->setSizeConstraint(QLayout::SetFixedSize);
40}
41
42FindSubtitlesConfigDialog::~FindSubtitlesConfigDialog() {
43}
44
45void FindSubtitlesConfigDialog::setUseProxy(bool b) {
46 use_proxy_check->setChecked(b);
47}
48
49bool FindSubtitlesConfigDialog::useProxy() {
50 return use_proxy_check->isChecked();
51}
52
53void FindSubtitlesConfigDialog::setProxyHostname(QString host) {
54 proxy_hostname_edit->setText(host);
55}
56
57QString FindSubtitlesConfigDialog::proxyHostname() {
58 return proxy_hostname_edit->text();
59}
60
61void FindSubtitlesConfigDialog::setProxyPort(int port) {
62 proxy_port_spin->setValue(port);
63}
64
65int FindSubtitlesConfigDialog::proxyPort() {
66 return proxy_port_spin->value();
67}
68
69void FindSubtitlesConfigDialog::setProxyUsername(QString username) {
70 proxy_username_edit->setText(username);
71}
72
73QString FindSubtitlesConfigDialog::proxyUsername() {
74 return proxy_username_edit->text();
75}
76
77void FindSubtitlesConfigDialog::setProxyPassword(QString password) {
78 proxy_password_edit->setText(password);
79}
80
81QString FindSubtitlesConfigDialog::proxyPassword() {
82 return proxy_password_edit->text();
83}
84
85void FindSubtitlesConfigDialog::setProxyType(int type) {
86 int index = proxy_type_combo->findData(type);
87 if (index == -1) index = 0;
88 proxy_type_combo->setCurrentIndex(index);
89}
90
91int FindSubtitlesConfigDialog::proxyType() {
92 int index = proxy_type_combo->currentIndex();
93 return proxy_type_combo->itemData(index).toInt();
94}
95
96#include "moc_findsubtitlesconfigdialog.cpp"
Note: See TracBrowser for help on using the repository browser.