summaryrefslogtreecommitdiff
path: root/src/findsubtitles
diff options
context:
space:
mode:
authorMateusz Łukasik <mati75@linuxmint.pl>2015-12-06 19:08:44 +0100
committerMateusz Łukasik <mati75@linuxmint.pl>2015-12-06 19:08:44 +0100
commitef3806d30c06fc3b5c2910ef4faebef27bbd6bad (patch)
treeeacad504d5240c2354c1801d88542efc6ceccc2c /src/findsubtitles
parentd21eb029cb664abe3893776c8345b300c084fe31 (diff)
Imported Upstream version 15.11.0~ds0
Diffstat (limited to 'src/findsubtitles')
-rw-r--r--src/findsubtitles/findsubtitlesconfigdialog.cpp15
-rw-r--r--src/findsubtitles/findsubtitlesconfigdialog.h9
-rw-r--r--src/findsubtitles/findsubtitlesconfigdialog.ui98
-rw-r--r--src/findsubtitles/findsubtitleswindow.cpp10
-rw-r--r--src/findsubtitles/findsubtitleswindow.h4
5 files changed, 91 insertions, 45 deletions
diff --git a/src/findsubtitles/findsubtitlesconfigdialog.cpp b/src/findsubtitles/findsubtitlesconfigdialog.cpp
index 6aede06..86cb170 100644
--- a/src/findsubtitles/findsubtitlesconfigdialog.cpp
+++ b/src/findsubtitles/findsubtitlesconfigdialog.cpp
@@ -41,6 +41,11 @@ FindSubtitlesConfigDialog::FindSubtitlesConfigDialog( QWidget* parent, Qt::Windo
#endif
#ifndef OS_SEARCH_WORKAROUND
+ retries_label->hide();
+ retries_spin->hide();
+#endif
+
+#ifndef DOWNLOAD_SUBS
misc_group->hide();
#endif
@@ -68,6 +73,16 @@ int FindSubtitlesConfigDialog::retries() {
}
#endif
+#ifdef DOWNLOAD_SUBS
+void FindSubtitlesConfigDialog::setAppendLang(bool b) {
+ addlang_check->setChecked(b);
+}
+
+bool FindSubtitlesConfigDialog::appendLang() {
+ return addlang_check->isChecked();
+}
+#endif
+
#ifdef FS_USE_PROXY
void FindSubtitlesConfigDialog::setUseProxy(bool b) {
use_proxy_check->setChecked(b);
diff --git a/src/findsubtitles/findsubtitlesconfigdialog.h b/src/findsubtitles/findsubtitlesconfigdialog.h
index 9a2113a..cd7e81d 100644
--- a/src/findsubtitles/findsubtitlesconfigdialog.h
+++ b/src/findsubtitles/findsubtitlesconfigdialog.h
@@ -16,8 +16,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _FINDSUBTITLESCONFIGDIALOG_H_
-#define _FINDSUBTITLESCONFIGDIALOG_H_
+#ifndef FINDSUBTITLESCONFIGDIALOG_H
+#define FINDSUBTITLESCONFIGDIALOG_H
#include "ui_findsubtitlesconfigdialog.h"
@@ -38,6 +38,11 @@ public:
int retries();
#endif
+#ifdef DOWNLOAD_SUBS
+ void setAppendLang(bool b);
+ bool appendLang();
+#endif
+
#ifdef FS_USE_PROXY
// Proxy
void setUseProxy(bool b);
diff --git a/src/findsubtitles/findsubtitlesconfigdialog.ui b/src/findsubtitles/findsubtitlesconfigdialog.ui
index eee3aa8..9fe5de7 100644
--- a/src/findsubtitles/findsubtitlesconfigdialog.ui
+++ b/src/findsubtitles/findsubtitlesconfigdialog.ui
@@ -13,25 +13,66 @@
<property name="windowTitle">
<string>Options</string>
</property>
- <layout class="QVBoxLayout">
+ <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="server_group">
<property name="title">
<string>Server</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout">
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>&amp;OpenSubtitles server:</string>
- </property>
- <property name="buddy">
- <cstring>server_edit</cstring>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>&amp;OpenSubtitles server:</string>
+ </property>
+ <property name="buddy">
+ <cstring>server_edit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="server_edit"/>
+ </item>
+ </layout>
</item>
<item>
- <widget class="QLineEdit" name="server_edit"/>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="retries_label">
+ <property name="text">
+ <string>Number of &amp;retries:</string>
+ </property>
+ <property name="buddy">
+ <cstring>retries_spin</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="retries_spin">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>50</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>257</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</item>
</layout>
</widget>
@@ -155,40 +196,14 @@
<property name="title">
<string>Misc</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
- <widget class="QLabel" name="label_7">
+ <widget class="QCheckBox" name="addlang_check">
<property name="text">
- <string>Number of &amp;retries:</string>
- </property>
- <property name="buddy">
- <cstring>retries_spin</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="retries_spin">
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>50</number>
+ <string>A&amp;ppend language code to the subtitle filename</string>
</property>
</widget>
</item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>257</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
</item>
@@ -206,13 +221,14 @@
</widget>
<tabstops>
<tabstop>server_edit</tabstop>
+ <tabstop>retries_spin</tabstop>
<tabstop>use_proxy_check</tabstop>
<tabstop>proxy_hostname_edit</tabstop>
<tabstop>proxy_port_spin</tabstop>
<tabstop>proxy_username_edit</tabstop>
<tabstop>proxy_password_edit</tabstop>
<tabstop>proxy_type_combo</tabstop>
- <tabstop>retries_spin</tabstop>
+ <tabstop>addlang_check</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
diff --git a/src/findsubtitles/findsubtitleswindow.cpp b/src/findsubtitles/findsubtitleswindow.cpp
index 670b070..855f8db 100644
--- a/src/findsubtitles/findsubtitleswindow.cpp
+++ b/src/findsubtitles/findsubtitleswindow.cpp
@@ -146,6 +146,8 @@ FindSubtitlesWindow::FindSubtitlesWindow( QWidget * parent, Qt::WindowFlags f )
file_downloader = new FileDownloader(this);
file_downloader->setModal(false);
+ file_downloader->hide();
+
connect( file_downloader, SIGNAL(downloadFailed(QString)),
this, SLOT(showError(QString)), Qt::QueuedConnection );
connect( file_downloader, SIGNAL(downloadFinished(const QByteArray &)),
@@ -778,6 +780,10 @@ void FindSubtitlesWindow::on_configure_button_clicked() {
d.setProxyType( proxy_type );
#endif
+ #ifdef DOWNLOAD_SUBS
+ d.setAppendLang(include_lang_on_filename);
+ #endif
+
if (d.exec() == QDialog::Accepted) {
os_server = d.server();
#ifdef OS_SEARCH_WORKAROUND
@@ -796,6 +802,10 @@ void FindSubtitlesWindow::on_configure_button_clicked() {
#ifdef FS_USE_PROXY
setupProxy();
#endif
+
+ #ifdef DOWNLOAD_SUBS
+ include_lang_on_filename = d.appendLang();
+ #endif
}
}
diff --git a/src/findsubtitles/findsubtitleswindow.h b/src/findsubtitles/findsubtitleswindow.h
index 7c84506..7b0dc60 100644
--- a/src/findsubtitles/findsubtitleswindow.h
+++ b/src/findsubtitles/findsubtitleswindow.h
@@ -16,8 +16,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _FINDSUBTITLESWINDOW_H_
-#define _FINDSUBTITLESWINDOW_H_
+#ifndef FINDSUBTITLESWINDOW_H
+#define FINDSUBTITLESWINDOW_H
#include "ui_findsubtitleswindow.h"