-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
95 lines (82 loc) · 2.46 KB
/
Copy pathmainwindow.h
File metadata and controls
95 lines (82 loc) · 2.46 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QString>
#include <QDir>
#include <QFileDialog>
#include <QProcess>
#include <QList>
#include <QFile>
#include <QTextStream>
#include <QMessageBox>
#include <QProgressDialog>
#ifdef _WIN32
#include <QWinTaskbarButton>
#include <QWinTaskbarProgress>
#endif
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
enum Mode{
Nothing,
Downloading,
ShowingSubtitles,
ShowingVideoFormats
};
public slots:
void openDestinationFolder();
void outputRead();
void errorRead();
void startProcess();
void processFinished(int exitCode);
void errorOccured();
void stopProcess();
void optionChecked(int checked);
void optionUnchecked(bool checked);
void listSubtitles();
void listVideoFormats();
void subsChecked(int checked);
void audioOnlyChecked(int checked);
void videoFormatChecked(int checked);
void playlistChecked(int checked);
void logChecked(int checked);
private slots:
#ifdef _WIN32
void updateFinished();
#endif
void on_actionA_Propos_de_Youtube_dl_triggered();
void on_actionMettre_jour_youtube_dl_triggered();
private:
Ui::MainWindow *ui;
int nbVideosToDownload; //Nombre de vidéos à télécharger
QString outputText; //Texte de sortie du programme
QString programPath; //Localisation du fichier youtube-dl (qui n'est autre que youtube-dl.exe mais renommé pour ne pas le confondre avec l'exécutable de ce programme)
bool receivingIdOrTitle; //Utile pour la correction des titres, car youtube-dl ajoute un ID à la fin du nom des fichiers
Mode mode;
bool gettingFileName;
QList<QWidget*> widgetsToDisableOnRun;
QStringList id;
QStringList title;
QStringList correctedTitle;
QProcess process, update;
QStringList arguments;
//Instances nécessaires pour l'affichage de la barre de progression dans l'icône de la barre des tâches
#ifdef _WIN32
QWinTaskbarButton *taskButton;
QWinTaskbarProgress *taskProgressBar;
#endif
void writeOutput(QString text);
void showMessageBox(QString, QString);
void setWidgetsEnabled(bool enabled);
void getFileNames(QString& msg);
void changeActualDownloadingVideo(QString& msg);
void setProgressValue(QString& msg);
void correctFileName(int index);
};
#endif // MAINWINDOW_H