Changeset 176 for smplayer/trunk/src/findsubtitles
- Timestamp:
- May 3, 2016, 5:25:45 PM (9 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 175
- Property svn:mergeinfo changed
-
smplayer/trunk/src/findsubtitles/filedownloader/filedownloader.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/filedownloader/filedownloader.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/findsubtitles.pro
r165 r176 42 42 DEFINES += DOWNLOAD_SUBS 43 43 #DEFINES += USE_QUAZIP 44 #DEFINES += FS_USE_PROXY 45 DEFINES += OS_SEARCH_WORKAROUND 44 46 45 47 contains( DEFINES, DOWNLOAD_SUBS ) { -
smplayer/trunk/src/findsubtitles/findsubtitlesconfigdialog.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 25 25 setupUi(this); 26 26 27 #ifdef FS_USE_PROXY 27 28 proxy_type_combo->addItem( tr("HTTP"), QNetworkProxy::HttpProxy); 28 29 proxy_type_combo->addItem( tr("SOCKS5"), QNetworkProxy::Socks5Proxy); … … 36 37 "as plain text in the configuration file.") ); 37 38 proxy_type_combo->setWhatsThis( tr("Select the proxy type to be used.") ); 39 #else 40 proxy_group->hide(); 41 #endif 42 43 #ifndef OS_SEARCH_WORKAROUND 44 retries_label->hide(); 45 retries_spin->hide(); 46 #endif 47 48 #ifndef DOWNLOAD_SUBS 49 misc_group->hide(); 50 #endif 38 51 39 52 layout()->setSizeConstraint(QLayout::SetFixedSize); … … 51 64 } 52 65 66 #ifdef OS_SEARCH_WORKAROUND 67 void FindSubtitlesConfigDialog::setRetries(int n) { 68 retries_spin->setValue(n); 69 } 70 71 int FindSubtitlesConfigDialog::retries() { 72 return retries_spin->value(); 73 } 74 #endif 75 76 #ifdef DOWNLOAD_SUBS 77 void FindSubtitlesConfigDialog::setAppendLang(bool b) { 78 addlang_check->setChecked(b); 79 } 80 81 bool FindSubtitlesConfigDialog::appendLang() { 82 return addlang_check->isChecked(); 83 } 84 #endif 85 86 #ifdef FS_USE_PROXY 53 87 void FindSubtitlesConfigDialog::setUseProxy(bool b) { 54 88 use_proxy_check->setChecked(b); … … 101 135 return proxy_type_combo->itemData(index).toInt(); 102 136 } 137 #endif 103 138 104 139 #include "moc_findsubtitlesconfigdialog.cpp" -
smplayer/trunk/src/findsubtitles/findsubtitlesconfigdialog.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 17 17 */ 18 18 19 #ifndef _FINDSUBTITLESCONFIGDIALOG_H_20 #define _FINDSUBTITLESCONFIGDIALOG_H_19 #ifndef FINDSUBTITLESCONFIGDIALOG_H 20 #define FINDSUBTITLESCONFIGDIALOG_H 21 21 22 22 #include "ui_findsubtitlesconfigdialog.h" … … 34 34 QString server(); 35 35 36 #ifdef OS_SEARCH_WORKAROUND 37 void setRetries(int n); 38 int retries(); 39 #endif 40 41 #ifdef DOWNLOAD_SUBS 42 void setAppendLang(bool b); 43 bool appendLang(); 44 #endif 45 46 #ifdef FS_USE_PROXY 36 47 // Proxy 37 48 void setUseProxy(bool b); … … 52 63 void setProxyType(int type); 53 64 int proxyType(); 65 #endif 54 66 }; 55 67 -
smplayer/trunk/src/findsubtitles/findsubtitlesconfigdialog.ui
r165 r176 7 7 <x>0</x> 8 8 <y>0</y> 9 <width>49 3</width>10 <height>3 35</height>9 <width>499</width> 10 <height>397</height> 11 11 </rect> 12 12 </property> 13 13 <property name="windowTitle"> 14 <string> Advanced options</string>14 <string>Options</string> 15 15 </property> 16 <layout class="QVBoxLayout" >17 <item> 18 <widget class="QGroupBox" name=" groupBox_2">16 <layout class="QVBoxLayout" name="verticalLayout_3"> 17 <item> 18 <widget class="QGroupBox" name="server_group"> 19 19 <property name="title"> 20 20 <string>Server</string> 21 21 </property> 22 <layout class="QHBoxLayout" name="horizontalLayout"> 23 <item> 24 <widget class="QLabel" name="label"> 25 <property name="text"> 26 <string>&OpenSubtitles server:</string> 27 </property> 28 <property name="buddy"> 29 <cstring>server_edit</cstring> 30 </property> 31 </widget> 32 </item> 33 <item> 34 <widget class="QLineEdit" name="server_edit"/> 22 <layout class="QVBoxLayout" name="verticalLayout"> 23 <item> 24 <layout class="QHBoxLayout" name="horizontalLayout"> 25 <item> 26 <widget class="QLabel" name="label"> 27 <property name="text"> 28 <string>&OpenSubtitles server:</string> 29 </property> 30 <property name="buddy"> 31 <cstring>server_edit</cstring> 32 </property> 33 </widget> 34 </item> 35 <item> 36 <widget class="QLineEdit" name="server_edit"/> 37 </item> 38 </layout> 39 </item> 40 <item> 41 <layout class="QHBoxLayout" name="horizontalLayout_2"> 42 <item> 43 <widget class="QLabel" name="retries_label"> 44 <property name="text"> 45 <string>Number of &retries:</string> 46 </property> 47 <property name="buddy"> 48 <cstring>retries_spin</cstring> 49 </property> 50 </widget> 51 </item> 52 <item> 53 <widget class="QSpinBox" name="retries_spin"> 54 <property name="minimum"> 55 <number>1</number> 56 </property> 57 <property name="maximum"> 58 <number>50</number> 59 </property> 60 </widget> 61 </item> 62 <item> 63 <spacer name="horizontalSpacer"> 64 <property name="orientation"> 65 <enum>Qt::Horizontal</enum> 66 </property> 67 <property name="sizeHint" stdset="0"> 68 <size> 69 <width>257</width> 70 <height>20</height> 71 </size> 72 </property> 73 </spacer> 74 </item> 75 </layout> 35 76 </item> 36 77 </layout> … … 38 79 </item> 39 80 <item> 40 <widget class="QGroupBox" name=" groupBox">81 <widget class="QGroupBox" name="proxy_group"> 41 82 <property name="title"> 42 83 <string>Proxy</string> … … 152 193 </item> 153 194 <item> 195 <widget class="QGroupBox" name="misc_group"> 196 <property name="title"> 197 <string>Misc</string> 198 </property> 199 <layout class="QVBoxLayout" name="verticalLayout_2"> 200 <item> 201 <widget class="QCheckBox" name="addlang_check"> 202 <property name="text"> 203 <string>A&ppend language code to the subtitle filename</string> 204 </property> 205 </widget> 206 </item> 207 </layout> 208 </widget> 209 </item> 210 <item> 154 211 <widget class="QDialogButtonBox" name="buttonBox"> 155 212 <property name="orientation"> … … 165 222 <tabstops> 166 223 <tabstop>server_edit</tabstop> 224 <tabstop>retries_spin</tabstop> 167 225 <tabstop>use_proxy_check</tabstop> 168 226 <tabstop>proxy_hostname_edit</tabstop> … … 171 229 <tabstop>proxy_password_edit</tabstop> 172 230 <tabstop>proxy_type_combo</tabstop> 231 <tabstop>addlang_check</tabstop> 173 232 <tabstop>buttonBox</tabstop> 174 233 </tabstops> -
smplayer/trunk/src/findsubtitles/findsubtitleswindow.cpp
r170 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 147 147 file_downloader = new FileDownloader(this); 148 148 file_downloader->setModal(false); 149 file_downloader->hide(); 150 149 151 connect( file_downloader, SIGNAL(downloadFailed(QString)), 150 152 this, SLOT(showError(QString)), Qt::QueuedConnection ); … … 177 179 osclient->setServer(os_server); 178 180 181 #ifdef FS_USE_PROXY 179 182 // Proxy 180 183 use_proxy = false; … … 186 189 187 190 setupProxy(); 191 #endif 188 192 } 189 193 … … 195 199 set = settings; 196 200 loadSettings(); 201 #ifdef FS_USE_PROXY 197 202 setupProxy(); 198 } 199 203 #endif 204 } 205 206 #ifdef FS_USE_PROXY 200 207 void FindSubtitlesWindow::setProxy(QNetworkProxy proxy) { 201 208 /* … … 212 219 proxy.hostName().toUtf8().constData(), proxy.port(), proxy.type()); 213 220 } 221 #endif 214 222 215 223 void FindSubtitlesWindow::retranslateStrings() { … … 761 769 762 770 d.setServer( os_server ); 771 #ifdef OS_SEARCH_WORKAROUND 772 d.setRetries(osclient->retries()); 773 #endif 774 #ifdef FS_USE_PROXY 763 775 d.setUseProxy( use_proxy ); 764 776 d.setProxyHostname( proxy_host ); … … 767 779 d.setProxyPassword( proxy_password ); 768 780 d.setProxyType( proxy_type ); 781 #endif 782 783 #ifdef DOWNLOAD_SUBS 784 d.setAppendLang(include_lang_on_filename); 785 #endif 769 786 770 787 if (d.exec() == QDialog::Accepted) { 771 788 os_server = d.server(); 789 #ifdef OS_SEARCH_WORKAROUND 790 osclient->setRetries( d.retries() ); 791 #endif 792 #ifdef FS_USE_PROXY 772 793 use_proxy = d.useProxy(); 773 794 proxy_host = d.proxyHostname(); … … 776 797 proxy_password = d.proxyPassword(); 777 798 proxy_type = d.proxyType(); 799 #endif 778 800 779 801 osclient->setServer(os_server); 802 #ifdef FS_USE_PROXY 780 803 setupProxy(); 781 } 782 } 783 804 #endif 805 806 #ifdef DOWNLOAD_SUBS 807 include_lang_on_filename = d.appendLang(); 808 #endif 809 } 810 } 811 812 #ifdef FS_USE_PROXY 784 813 void FindSubtitlesWindow::setupProxy() { 785 814 QNetworkProxy proxy; … … 803 832 setProxy(proxy); 804 833 } 834 #endif 805 835 806 836 void FindSubtitlesWindow::saveSettings() { … … 810 840 811 841 set->setValue("xmlrpc_server", os_server); 842 #ifdef OS_SEARCH_WORKAROUND 843 set->setValue("retries", osclient->retries()); 844 #endif 845 812 846 set->setValue("language", language()); 813 847 #ifdef DOWNLOAD_SUBS 814 848 set->setValue("include_lang_on_filename", includeLangOnFilename()); 815 849 #endif 850 851 #ifdef FS_USE_PROXY 816 852 set->setValue("proxy/use_proxy", use_proxy); 817 853 set->setValue("proxy/type", proxy_type); … … 820 856 set->setValue("proxy/username", proxy_username); 821 857 set->setValue("proxy/password", proxy_password); 858 #endif 822 859 823 860 set->endGroup(); … … 830 867 831 868 os_server = set->value("xmlrpc_server", os_server).toString(); 869 #ifdef OS_SEARCH_WORKAROUND 870 osclient->setRetries( set->value("retries", osclient->retries()).toInt() ); 871 #endif 872 832 873 setLanguage( set->value("language", language()).toString() ); 833 874 #ifdef DOWNLOAD_SUBS 834 875 setIncludeLangOnFilename( set->value("include_lang_on_filename", includeLangOnFilename()).toBool() ); 835 876 #endif 877 878 #ifdef FS_USE_PROXY 836 879 use_proxy = set->value("proxy/use_proxy", use_proxy).toBool(); 837 880 proxy_type = set->value("proxy/type", proxy_type).toInt(); … … 840 883 proxy_username = set->value("proxy/username", proxy_username).toString(); 841 884 proxy_password = set->value("proxy/password", proxy_password).toString(); 885 #endif 842 886 843 887 set->endGroup(); -
smplayer/trunk/src/findsubtitles/findsubtitleswindow.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 17 17 */ 18 18 19 #ifndef _FINDSUBTITLESWINDOW_H_20 #define _FINDSUBTITLESWINDOW_H_19 #ifndef FINDSUBTITLESWINDOW_H 20 #define FINDSUBTITLESWINDOW_H 21 21 22 22 #include "ui_findsubtitleswindow.h" 23 24 #ifdef FS_USE_PROXY 23 25 #include <QNetworkProxy> 26 #endif 24 27 25 28 class OSClient; … … 94 97 virtual void changeEvent(QEvent * event); 95 98 99 #ifdef FS_USE_PROXY 96 100 void setProxy(QNetworkProxy proxy); 97 101 void setupProxy(); 102 #endif 98 103 99 104 void saveSettings(); … … 134 139 QString os_server; 135 140 141 #ifdef FS_USE_PROXY 136 142 // Proxy 137 143 bool use_proxy; … … 141 147 QString proxy_username; 142 148 QString proxy_password; 149 #endif 143 150 144 151 QSettings * set; -
smplayer/trunk/src/findsubtitles/fixsubs.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/fixsubs.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/main.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/osclient.cpp
r170 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 26 26 #ifdef OS_SEARCH_WORKAROUND 27 27 , best_search_count(0) 28 , search_retries(8) 28 29 #endif 29 30 { … … 35 36 } 36 37 38 #ifdef FS_USE_PROXY 37 39 void OSClient::setProxy(const QNetworkProxy & proxy) { 38 40 rpc->setProxy(proxy); 39 41 } 42 #endif 40 43 41 44 void OSClient::login() { … … 59 62 search_hash = hash; 60 63 search_size = file_size; 64 65 disconnect(this, SIGNAL(loggedIn()), this, SLOT(doSearch())); 61 66 62 67 #if 0 … … 76 81 void OSClient::doSearch() { 77 82 best_search_count = -1; 78 for (int n = 1; n < 8; n++) doSearch(n);83 for (int n = 1; n <= search_retries; n++) doSearch(n); 79 84 } 80 85 -
smplayer/trunk/src/findsubtitles/osclient.h
r170 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 22 22 #include "maiaXmlRpcClient.h" 23 23 24 #define OS_SEARCH_WORKAROUND25 26 24 class OSSubtitle { 27 25 public: … … 35 33 public: 36 34 OSClient(QObject* parent = 0); 35 36 QList<OSSubtitle> subtitleList() { return s_list; }; 37 38 #ifdef FS_USE_PROXY 37 39 void setProxy(const QNetworkProxy & proxy); 40 #endif 41 42 #ifdef OS_SEARCH_WORKAROUND 43 void setRetries(int n) { search_retries = n; }; 44 int retries() { return search_retries; }; 45 #endif 38 46 39 47 public slots: 40 48 void setServer(const QString & server); 41 49 void search(const QString & hash, qint64 file_size); 42 QList<OSSubtitle> subtitleList() { return s_list; };43 50 44 51 private slots: … … 69 76 #ifdef OS_SEARCH_WORKAROUND 70 77 int best_search_count; 78 int search_retries; 71 79 #endif 72 80 QList <OSSubtitle> s_list; -
smplayer/trunk/src/findsubtitles/osparser.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/osparser.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 17 17 */ 18 18 19 #ifndef _OSPARSER_H_20 #define _OSPARSER_H_19 #ifndef OSPARSER_H 20 #define OSPARSER_H 21 21 22 22 #include <QObject> -
smplayer/trunk/src/findsubtitles/subchooserdialog.cpp
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify -
smplayer/trunk/src/findsubtitles/subchooserdialog.h
r165 r176 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 17 17 */ 18 18 19 #ifndef _SUBCHOOSERDIALOG_H_20 #define _SUBCHOOSERDIALOG_H_19 #ifndef SUBCHOOSERDIALOG_H 20 #define SUBCHOOSERDIALOG_H 21 21 22 22 #include <QDialog>
Note:
See TracChangeset
for help on using the changeset viewer.