00001
00002
00003
00004
00005
00006
00007 #ifndef SCYTHIA_H
00008 #define SCYTHIA_H
00009
00010 #include <QtCore>
00011 #include <QtGui>
00012 #include <QtNetwork>
00013 #include "liste_signet.h"
00014 #include "MyFtp/myftp.h"
00015 #include "MyFtp/myftptransfercontrol.h"
00016 #include "ui_scythia.h"
00017
00018 class TransferListItem : public QTreeWidgetItem
00019 {
00020 public:
00021 const MyTransfer &transfer;
00022
00023 TransferListItem(const MyTransfer &Transfer, QTreeWidget *widget) : QTreeWidgetItem(widget), transfer(Transfer)
00024 {
00025 setText(0, transfer.fileName());
00026 setText(1, transfer.transferType());
00027 }
00028 };
00029
00030
00032
00035
00036 class scythia:public QMainWindow, public Ui::scythia
00037 {
00038 Q_OBJECT
00039 public:
00041 scythia(QWidget * parent = 0);
00043 ~scythia();
00044
00051 MyFtp *ftp;
00053 ListeSignet list;
00055 QString listProgs;
00057 QString currentFtpDir;
00059 QString Host;
00061 QString UserName;
00063 QString Password;
00065 int Port;
00067 int itemSelected;
00069 bool changeState;
00071 bool manualDisconnect;
00073 enum ListSelected
00074 { Nothing, LocalList, FtpList };
00076 ListSelected listSelected;
00078 QLabel *stateLabel;
00080 QLabel *waitLabel;
00082 QLabel *connectLabel;
00084 QSystemTrayIcon *trayIcon;
00086 QMenu *menu;
00088 bool systemTray;
00090 QProcess progs;
00091
00092 public slots:
00093
00094
00095
00098 void slotConnect();
00101 void slotDisconnect();
00111 void slotStateChanged(int state);
00120 void slotDetailledError(const QString & error);
00121
00122
00123
00124
00126 void slotReloadFtpList();
00128 void slotReloadLocalList();
00130 void slotLocalPathChanged();
00132 void slotFtpPathChanged();
00135 void slotChangeLocalPath(QTreeWidgetItem *);
00141 void slotChangeLocalPath(const QString &);
00144 void slotChangeFtpPath(QTreeWidgetItem *);
00146 void slotHiddenFiles();
00147
00148
00149
00150
00152 void slotOpenFile();
00155 void slotRemoveFile();
00158 void slotNewFolder();
00161 void slotRenameFile();
00164 void slotDownload(const QString & destDir = NULL);
00165 inline void slot_download()
00166 {
00167 slotDownload();
00168 }
00171 void slotUpload(const QString & destDir = NULL);
00172 inline void slot_upload()
00173 {
00174 slotUpload();
00175 }
00177 void slotStopTransfer();
00179 void slotStopAllTransfer();
00182
00184 void slotDownloadFinished(int id, bool error);
00186 void slotUploadFinished(int id, bool error);
00188 void slotTransferUp();
00190 void slotTransferDown();
00192 void slotExecProg();
00193
00194
00195
00196
00198 void slotCommand();
00200 void slotAddSignet();
00202 void slotSelectLang();
00203
00204
00205
00206
00208 void slotAffichToolbarFile();
00210 void slotAffichToolbarConnect();
00212 void slotAffichToolbarTransfert();
00214 void slotHideToolbarFile();
00216 void slotHideToolbarConnect();
00218 void slotHideToolbarTransfert();
00221 void slotLocalSelection(QTreeWidgetItem * = NULL);
00224 void slotFtpSelection(QTreeWidgetItem * = NULL);
00226 void slotPopupLocal(QTreeWidgetItem * item, const QPoint pos);
00228 void slotPopupFtp(QTreeWidgetItem * item, const QPoint pos);
00230 void slotPopupTransfer(QTreeWidgetItem * item, const QPoint & pos);
00232 void slotTransferListModified (const QList<MyTransfer> &transfersList);
00234 void slotHelp();
00236 void slotCurrentActionChanged(MyFtp::FtpCurrentAction action);
00238 void showOrHide();
00240 void closeEvent (QCloseEvent*);
00242 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
00243
00244 void slotTransferRapidityAndRemainTime(int vitesseInKoSec, int remainMin, int remainSec, float pourcentage);
00245 };
00246
00247 #endif