1ère version fonctionnelle
This commit is contained in:
+59
-28
@@ -7,55 +7,86 @@
|
||||
#include <QListWidgetItem>
|
||||
#include "downloadfile.h"
|
||||
#include <QProgressDialog>
|
||||
#include <QSettings>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class Connexion
|
||||
{
|
||||
public:
|
||||
std::string bandwidthLimit = "1M";
|
||||
std::string server;
|
||||
int port = 873;
|
||||
};
|
||||
|
||||
class Downloading
|
||||
{
|
||||
public:
|
||||
std::string service;
|
||||
std::string path;
|
||||
std::string defaultSavePath;
|
||||
std::string savePath;
|
||||
QString dirPath;
|
||||
int pid = 0;
|
||||
};
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Ui::MainWindow *ui;
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
QProgressDialog *progress;
|
||||
void displayTree();
|
||||
void populateTree();
|
||||
void populateList();
|
||||
void listServices(std::string server, int portN);
|
||||
bool validateServer(std::string server);
|
||||
bool isIpAddress(std::string server);
|
||||
QTreeWidgetItem * addTreeRoot(QString name, QString description);
|
||||
QTreeWidgetItem * addTreeChild(QTreeWidgetItem *parent, QString name, QString size);
|
||||
void scanDir(std::string server, int portN, QTreeWidgetItem *parent = NULL, std::string path = "" );
|
||||
public:
|
||||
Ui::MainWindow *ui;
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
QProgressDialog *progress;
|
||||
void displayTree();
|
||||
void populateTree();
|
||||
void populateList();
|
||||
void listServices();
|
||||
bool validateServer(std::string server);
|
||||
bool isIpAddress(std::string server);
|
||||
QTreeWidgetItem * addTreeRoot(QString name, QString description);
|
||||
QTreeWidgetItem * addTreeChild(QTreeWidgetItem *parent, QString name, QString size);
|
||||
void scanDir(std::string server, int portN, QTreeWidgetItem *parent = NULL, std::string path = "" );
|
||||
void startDownloading();
|
||||
void loadSettings();
|
||||
void saveSettings();
|
||||
|
||||
private slots:
|
||||
void on_khistorycombobox_returnPressed();
|
||||
Connexion connexion;
|
||||
Downloading downloading;
|
||||
downloadFile downloadO;
|
||||
QSettings settings;
|
||||
|
||||
//void on_portEdit_userTextChanged();
|
||||
private slots:
|
||||
void on_khistorycombobox_returnPressed();
|
||||
|
||||
void on_portEdit_returnPressed();
|
||||
//void on_portEdit_userTextChanged();
|
||||
|
||||
void on_khistorycombobox_textActivated();
|
||||
void on_portEdit_returnPressed();
|
||||
|
||||
void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
|
||||
void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
|
||||
|
||||
void on_treeWidget_customContextMenuRequested();
|
||||
void on_treeWidget_customContextMenuRequested();
|
||||
|
||||
void on_actionDownload_triggered();
|
||||
void on_actionDownload_triggered();
|
||||
|
||||
void on_listWidget_clicked(const QModelIndex &index);
|
||||
void on_listWidget_clicked(const QModelIndex &index);
|
||||
|
||||
void on_listDownload_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||
|
||||
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||
void downloadFinished();
|
||||
|
||||
public slots:
|
||||
void stoppingDownload();
|
||||
|
||||
void on_listDownload_itemClicked(QListWidgetItem *item);
|
||||
|
||||
signals:
|
||||
void stopDownloading(int);
|
||||
|
||||
private:
|
||||
downloadFile MyObject;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user