BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
downloadElectronDensity.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 
4 #ifndef BALL_VIEW_DIALOGS_DOWNLOADELECTRONDENSITY_H
5 #define BALL_VIEW_DIALOGS_DOWNLOADELECTRONDENSITY_H
6 
7 #include <BALL/VIEW/UIC/ui_downloadElectronDensity.h>
8 
9 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
11 #endif
12 
13 #ifndef BALL_DATATYPE_HASHSET_H
14 # include <BALL/DATATYPE/hashSet.h>
15 #endif
16 
17 #include <BALL/VIEW/UIC/ui_downloadElectronDensity.h>
18 
19 #include <QtNetwork/QNetworkReply>
20 
21 class QProgressBar;
22 class QNetworkAccessManager;
23 
24 namespace BALL
25 {
26  class TCPTransfer;
27 
28  namespace VIEW
29  {
30 
36  : public QDialog,
37  public Ui_DownloadElectronDensityData,
38  public ModularWidget
39  {
40  Q_OBJECT
41  public:
43 
44 
45  DownloadElectronDensity(QWidget* parent = 0, const char* name = "DownloadElectronDensityDialog",
46  bool modal = FALSE, Qt::WFlags fl = 0 );
47 
50 
52  virtual void initializeWidget(VIEW::MainControl& main_control);
53 
55  virtual void fetchPreferences(INIFile& inifile);
56 
58  virtual void writePreferences(INIFile& inifile);
59 
63  void setEDSPrefix(String s) { eds_prefix_ = s;}
64 
68  void setEDSSuffix(String s) { eds_suffix_ = s;}
69 
73  void setEMDBPrefix(String s) { emdb_prefix_ = s;}
74 
78  void setEMDBSuffix(String s) { emdb_suffix_ = s;}
79 
81  void checkMenu(MainControl& mc);
82 
83  public slots:
84 
86  void slotDownload();
87 
89  void idChanged();
90 
92  void serverChanged();
93 
95  void typeChanged();
96 
98  void pdbDownloadChecked();
99 
101  virtual void abort();
102 
104  void downloadFinished();
105 
107  void downloadProgress(qint64 received, qint64 total);
108 
109  protected:
110 
111  //_
112  void downloadStarted_();
113 
114  //_
115  void downloadEnded_();
116 
117  bool threadedDownload_(const String& url);
118  void removeFile_(const String& filename);
119 
120 
121  bool aborted_;
122  bool error_;
123 
125 
126  // e.g. gif images if not supported
128 
129  QAction* menu_id_;
130  String eds_prefix_, eds_infix_, eds_suffix_;
131  String emdb_prefix_, emdb_infix_, emdb_suffix_;
132 
133  // the current network reply
134  QNetworkReply* current_reply_;
135 
136  // the current progress bar
137  QProgressBar* progress_bar_;
138  QNetworkAccessManager* network_manager_;
139  };
140 
141  }
142 } //namespaces
143 #endif