~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/findsubtitles/findsubtitleswindow.h

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-03-31 23:05:43 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20090331230543-0h2hfwpwlu9opbv2
* New upstream release. (Closes: #523791)
  - Reworked subtitle font preferences. (Closes: #503295)
  - No longer installs qt_fr.qm. (Closes: #486314)
* debian/control:
  - Bumped Standards-Version to 3.8.1.
  - Changed maintainer name (still the same person and GPG key).
  - Changed section to video.
  - Build-depend on zlib1g-dev for findsubtitles.
  - Require Qt >= 4.3 per readme.
  - Added ${misc:Depends}.
  - Make smplayer-translations depend on smplayer and smplayer recommend
    smplayer-translations, not the other way round. (Closes: #489375)
* debian/copyright:
  - Significantly expanded per-file with new upstream authors.
* debian/rules:
  - Make make use correct uic in install.
  - Clean svn_revision.
  - Removed get-orig-source - not needed with uscan --repack.
* debian/patches/01_gl_translation.patch:
  - Added patch to fix lrelease error on smplayer_gl.ts.
* Added debian/README.source for simple-patchsys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  smplayer, GUI front-end for mplayer.
 
2
    Copyright (C) 2006-2009 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
#ifndef _FINDSUBTITLESWINDOW_H_
 
20
#define _FINDSUBTITLESWINDOW_H_
 
21
 
 
22
#include "ui_findsubtitleswindow.h"
 
23
#include <QNetworkProxy>
 
24
 
 
25
class SimpleHttp;
 
26
class QStandardItemModel;
 
27
class QSortFilterProxyModel;
 
28
class QModelIndex;
 
29
class QMenu;
 
30
class QAction;
 
31
class QSettings;
 
32
 
 
33
#ifdef DOWNLOAD_SUBS
 
34
class FileDownloader;
 
35
class QBuffer;
 
36
class QuaZip;
 
37
#endif
 
38
 
 
39
class FindSubtitlesWindow : public QDialog, public Ui::FindSubtitlesWindow
 
40
{
 
41
        Q_OBJECT
 
42
 
 
43
public:
 
44
        FindSubtitlesWindow( QWidget * parent = 0, Qt::WindowFlags f = 0 );
 
45
        ~FindSubtitlesWindow();
 
46
 
 
47
        QString language();
 
48
#ifdef DOWNLOAD_SUBS
 
49
        bool includeLangOnFilename() { return include_lang_on_filename; };
 
50
#endif
 
51
 
 
52
        void setSettings(QSettings * settings);
 
53
        QSettings * settings() { return set; };
 
54
 
 
55
public slots:
 
56
        void setMovie(QString filename);
 
57
        void setLanguage(const QString & lang);
 
58
        void refresh();
 
59
        void download();
 
60
        void copyLink();
 
61
#ifdef DOWNLOAD_SUBS
 
62
        void setIncludeLangOnFilename(bool b) { include_lang_on_filename = b; };
 
63
#endif
 
64
 
 
65
protected slots:
 
66
        void applyFilter(const QString & filter);
 
67
        void applyCurrentFilter();
 
68
 
 
69
        void showError(QString error);
 
70
        void connecting(QString host);
 
71
        void updateDataReadProgress(int done, int total);
 
72
        void downloadFinished();
 
73
 
 
74
        void updateRefreshButton();
 
75
 
 
76
        void parseInfo(QByteArray xml_text);
 
77
 
 
78
        void itemActivated(const QModelIndex & index );
 
79
        void currentItemChanged(const QModelIndex & current, const QModelIndex & previous);
 
80
 
 
81
        void showContextMenu(const QPoint & pos);
 
82
 
 
83
#ifdef DOWNLOAD_SUBS
 
84
        void archiveDownloaded(const QByteArray & buffer);
 
85
#endif
 
86
 
 
87
        void on_configure_button_clicked();
 
88
 
 
89
protected:
 
90
        virtual void retranslateStrings();
 
91
        virtual void changeEvent(QEvent * event);
 
92
 
 
93
        void setProxy(QNetworkProxy proxy);
 
94
        void setupProxy();
 
95
 
 
96
        void saveSettings();
 
97
        void loadSettings();
 
98
 
 
99
#ifdef DOWNLOAD_SUBS
 
100
signals:
 
101
        void subtitleDownloaded(const QString & filename);
 
102
 
 
103
protected:
 
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);
 
106
#endif
 
107
 
 
108
protected:
 
109
        SimpleHttp * downloader;
 
110
        QStandardItemModel * table;
 
111
        QSortFilterProxyModel * proxy_model;
 
112
        QString last_file;
 
113
 
 
114
        QMenu * context_menu;
 
115
        QAction * downloadAct;
 
116
        QAction * copyLinkAct;
 
117
 
 
118
#ifdef DOWNLOAD_SUBS
 
119
        FileDownloader * file_downloader;
 
120
        bool include_lang_on_filename;
 
121
#endif
 
122
 
 
123
        // Proxy
 
124
        bool use_proxy;
 
125
        int proxy_type;
 
126
        QString proxy_host;
 
127
        int proxy_port;
 
128
        QString proxy_username;
 
129
        QString proxy_password;
 
130
 
 
131
        QSettings * set;
 
132
};
 
133
 
 
134
#endif
 
135