NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
XnatDownloadManager.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef XnatDownloadManager_h
16 #define XnatDownloadManager_h
17 
18 #include <QObject>
19 #include <QScopedPointer>
20 
21 class ctkXnatSettings;
22 class QString;
23 class QWidget;
24 class XnatDownloadDialog;
26 class XnatTreeView;
27 
28 class XnatDownloadManager : public QObject
29 {
30  Q_OBJECT
31 
32 public:
33  XnatDownloadManager(XnatTreeView* xnatTreeView);
34  virtual ~XnatDownloadManager();
35 
36  void setSettings(ctkXnatSettings* settings);
37 
38  void silentlyDownloadFile(const QString& fname, const QString& dir);
39  void silentlyDownloadAllFiles(const QString& dir);
40 
41 signals:
42  void done();
43 
44 public slots:
45  void downloadFile();
46  void downloadAllFiles();
47 
48 private slots:
49  bool startFileDownload(const QString& zipFilename);
50  void startDownload();
51  void startGroupDownload();
52  void downloadData();
53  void downloadDataAndUnzip();
54  void unzipData();
55  void finishDownload();
56  void downloadDataBlocking(bool unzip = false);
57 
58 private:
59 
60  void ExtractFile(QString zipFileName, QString directory);
61 
62 protected:
63  QScopedPointer<XnatDownloadManagerPrivate> d_ptr;
64 
65 private:
66  Q_DECLARE_PRIVATE(XnatDownloadManager);
67  Q_DISABLE_COPY(XnatDownloadManager);
68 };
69 
70 #endif
void setSettings(ctkXnatSettings *settings)
Definition: XnatDownloadManager.cxx:64
Definition: XnatTreeView.h:28
Definition: XnatDownloadManager.h:28
Note: This is needed for miniz.
Definition: XnatDownloadManager.cxx:33
void downloadAllFiles()
Definition: XnatDownloadManager.cxx:223
void downloadFile()
Definition: XnatDownloadManager.cxx:70
Definition: XnatDownloadDialog.h:23
void silentlyDownloadFile(const QString &fname, const QString &dir)
Definition: XnatDownloadManager.cxx:132
QScopedPointer< XnatDownloadManagerPrivate > d_ptr
Definition: XnatDownloadManager.h:63
void silentlyDownloadAllFiles(const QString &dir)
Definition: XnatDownloadManager.cxx:260
virtual ~XnatDownloadManager()
Definition: XnatDownloadManager.cxx:60
XnatDownloadManager(XnatTreeView *xnatTreeView)
Definition: XnatDownloadManager.cxx:51