forked from thelineva/tvkaistagui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
159 lines (150 loc) · 4.91 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDate>
#include <QMainWindow>
#include <QSettings>
#include "channel.h"
#include "programme.h"
namespace Ui {
class MainWindow;
}
class QComboBox;
class QLabel;
class QToolButton;
class QSignalMapper;
class Cache;
class DownloadTableModel;
class ProgrammeFeedParser;
class ProgrammeTableModel;
class ScreenshotWindow;
class SettingsDialog;
class TvkaistaClient;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
static QString encodePassword(const QString &password);
static QString decodePassword(const QString &password);
static QString defaultStreamPlayerCommand();
static QString defaultFilePlayerCommand();
static QString defaultDownloadDirectory();
static QString defaultFilenameFormat();
static QStringList videoFormats();
protected:
void closeEvent(QCloseEvent *e);
private slots:
void dateClicked(const QDate &date);
void channelClicked(int index);
void programmeDoubleClicked();
void programmeSelectionChanged();
void downloadSelectionChanged();
void formatChanged();
void programmeMenuRequested(const QPoint &point);
void refreshProgrammes();
void goToCurrentDay();
void goToPreviousDay();
void goToNextDay();
void watchProgramme();
void downloadProgramme();
void openScreenshotWindow();
void openSettingsDialog();
void settingsAccepted();
void openAboutDialog();
void openHelp();
void abortDownload();
void removeDownload();
void refreshChannels();
void playDownloadedFile();
void openDirectory();
void search();
void clearSearchHistory();
void sortByTimeAsc();
void sortByTimeDesc();
void sortByTitleAsc();
void sortByTitleDesc();
void showProgrammeList();
void showSearchResults();
void showSeasonPasses();
bool setCurrentView(int view);
void toggleDownloadsDockWidget();
void toggleShortcutsDockWidget();
void selectChannel(int index);
void setFocusToCalendar();
void setFocusToChannelList();
void addToSeasonPass();
void setCurrentServer(int index);
void channelsFetched(const QList<Channel> &channels);
void programmesFetched(int channelId, const QDate &date, const QList<Programme> &programmes);
void posterFetched(const Programme &programme, const QImage &poster);
void streamUrlFetched(const Programme &programme, int format, const QUrl &url);
void searchResultsFetched(const QList<Programme> &programmes);
void seasonPassListFetched(const QList<Programme> &programmes);
void addedToSeasonPass(bool ok);
void removedFromSeasonPass(bool ok);
void posterTimeout();
void downloadFinished();
void networkError();
void loginError();
void streamNotFound();
private:
void fetchChannels(bool refresh);
void fetchProgrammes(int channelId, const QDate &date, bool refresh);
void fetchSearchResults(const QString &phrase);
void fetchSeasonPasses(bool refresh);
bool fetchPoster();
void loadClientSettings();
void addServer(const QString &name, const QString &serverId);
void updateFontSize();
void updateColumnSizes();
void updateChannelList();
void updateDescription();
void updateWindowTitle();
void updateCalendar();
void setFormat(int format);
void scrollProgrammes();
void startLoadingAnimation();
void stopLoadingAnimation();
void addBorderToPoster();
void setSortKeyToModel(const QString &sortKey, ProgrammeTableModel *model);
QString sortKeyFromModel(ProgrammeTableModel *model);
void startFlashStream(const QUrl &url);
void startMediaPlayer(const QString &command, const QString &filename, int format);
QStringList splitCommandLine(const QString &command);
static QString addDefaultOptionsToVlcCommand(const QString &command);
Ui::MainWindow *ui;
QComboBox *m_formatComboBox;
QComboBox *m_searchComboBox;
QLabel *m_loadLabel;
QMovie *m_loadMovie;
QTimer *m_posterTimer;
QToolButton *m_searchToolButton;
QSettings m_settings;
TvkaistaClient *m_client;
DownloadTableModel *m_downloadTableModel;
ProgrammeTableModel *m_programmeListTableModel;
ProgrammeTableModel *m_searchResultsTableModel;
ProgrammeTableModel *m_seasonPassesTableModel;
ProgrammeTableModel *m_currentTableModel;
Cache *m_cache;
SettingsDialog *m_settingsDialog;
ScreenshotWindow *m_screenshotWindow;
QList<Channel> m_channels;
QList<QAction*> m_serverActions;
QSignalMapper *m_serverSignalMapper;
QMap<int, QString> m_channelMap;
QStringList m_searchHistory;
QString m_searchPhrase;
QDateTime m_lastRefreshTime;
int m_currentChannelId;
QDate m_currentDate;
Programme m_currentProgramme;
QImage m_posterImage;
QImage m_noPosterImage;
QIcon m_searchIcon;
QDate m_formattedDate;
bool m_downloading;
int m_currentView;
};
#endif // MAINWINDOW_H