BALL  1.5.0
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::WindowFlags 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 Q_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
BALL::VIEW::DownloadElectronDensity::unsupported_images_
HashSet< String > unsupported_images_
Definition: downloadElectronDensity.h:127
BALL::VIEW::DownloadElectronDensity::emdb_suffix_
String emdb_suffix_
Definition: downloadElectronDensity.h:131
BALL::VIEW::DownloadElectronDensity::error_
bool error_
Definition: downloadElectronDensity.h:122
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73
BALL::VIEW::DownloadElectronDensity::image_cache_
HashMap< String, QImage > image_cache_
Definition: downloadElectronDensity.h:124
BALL::String
Definition: string.h:56
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
BALL::VIEW::MainControl
Definition: mainControl.h:114
BALL
Definition: constants.h:12
BALL::VIEW::DownloadElectronDensity::setEMDBPrefix
void setEMDBPrefix(String s)
Definition: downloadElectronDensity.h:73
BALL::VIEW::DownloadElectronDensity::setEDSSuffix
void setEDSSuffix(String s)
Definition: downloadElectronDensity.h:68
BALL::HashSet< String >
modularWidget.h
BALL::VIEW::DownloadElectronDensity::menu_id_
QAction * menu_id_
Definition: downloadElectronDensity.h:129
BALL::VIEW::DownloadElectronDensity::current_reply_
QNetworkReply * current_reply_
Definition: downloadElectronDensity.h:134
hashSet.h
BALL::INIFile
Definition: INIFile.h:28
QWidget
BALL::VIEW::DownloadElectronDensity::setEDSPrefix
void setEDSPrefix(String s)
Definition: downloadElectronDensity.h:63
BALL::VIEW::DownloadElectronDensity::eds_suffix_
String eds_suffix_
Definition: downloadElectronDensity.h:130
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::DownloadElectronDensity
Definition: downloadElectronDensity.h:35
BALL::VIEW::DownloadElectronDensity::setEMDBSuffix
void setEMDBSuffix(String s)
Definition: downloadElectronDensity.h:78
QDialog
BALL::VIEW::DownloadElectronDensity::progress_bar_
QProgressBar * progress_bar_
Definition: downloadElectronDensity.h:137
BALL::VIEW::ModularWidget
Definition: modularWidget.h:60
BALL::VIEW::DownloadElectronDensity::aborted_
bool aborted_
Definition: downloadElectronDensity.h:121
BALL::VIEW::DownloadElectronDensity::network_manager_
QNetworkAccessManager * network_manager_
Definition: downloadElectronDensity.h:138