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
#ifndef _FINDSUBTITLESWINDOW_H_
20
#define _FINDSUBTITLESWINDOW_H_
22
#include "ui_findsubtitleswindow.h"
23
#include <QNetworkProxy>
26
class QStandardItemModel;
27
class QSortFilterProxyModel;
39
class FindSubtitlesWindow : public QDialog, public Ui::FindSubtitlesWindow
44
FindSubtitlesWindow( QWidget * parent = 0, Qt::WindowFlags f = 0 );
45
~FindSubtitlesWindow();
49
bool includeLangOnFilename() { return include_lang_on_filename; };
52
void setSettings(QSettings * settings);
53
QSettings * settings() { return set; };
56
void setMovie(QString filename);
57
void setLanguage(const QString & lang);
62
void setIncludeLangOnFilename(bool b) { include_lang_on_filename = b; };
66
void applyFilter(const QString & filter);
67
void applyCurrentFilter();
69
void showError(QString error);
70
void connecting(QString host);
71
void updateDataReadProgress(int done, int total);
72
void downloadFinished();
74
void updateRefreshButton();
76
void parseInfo(QByteArray xml_text);
78
void itemActivated(const QModelIndex & index );
79
void currentItemChanged(const QModelIndex & current, const QModelIndex & previous);
81
void showContextMenu(const QPoint & pos);
84
void archiveDownloaded(const QByteArray & buffer);
87
void on_configure_button_clicked();
90
virtual void retranslateStrings();
91
virtual void changeEvent(QEvent * event);
93
void setProxy(QNetworkProxy proxy);
101
void subtitleDownloaded(const QString & filename);
104
bool uncompressZip(const QString & filename, const QString & output_path, const QString & preferred_output_name);
105
bool extractFile(QuaZip & zip, const QString & filename, const QString & output_name);
109
SimpleHttp * downloader;
110
QStandardItemModel * table;
111
QSortFilterProxyModel * proxy_model;
114
QMenu * context_menu;
115
QAction * downloadAct;
116
QAction * copyLinkAct;
119
FileDownloader * file_downloader;
120
bool include_lang_on_filename;
128
QString proxy_username;
129
QString proxy_password;