00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_GUI_REMOTE_LOADER_HH
00020 #define OST_GUI_REMOTE_LOADER_HH
00021
00022 #include <QPushButton>
00023 #include <QLineEdit>
00024 #include <QKeyEvent>
00025 #include <QProgressBar>
00026 #include <QActionGroup>
00027
00028 #include <ost/gfx/gfx_object.hh>
00029 #include <ost/gui/module_config.hh>
00030 #include <ost/gui/widget.hh>
00031
00032 namespace ost { namespace gui {
00033
00034
00035
00036
00038 class DLLEXPORT_OST_GUI RemoteLoader : public Widget {
00039 Q_OBJECT
00040 public:
00041 RemoteLoader(QWidget* parent=NULL);
00042
00043 virtual bool Save(const QString& prefix);
00044 virtual bool Restore(const QString& prefix);
00045 virtual ActionList GetActions();
00046 protected:
00047 virtual void keyPressEvent(QKeyEvent* event);
00048 private:
00049 void ShowProgressBar(bool visiblility);
00050 void BuildMenu(String active_loader=String());
00051 private slots:
00052 void Clicked();
00053 void UrlClick();
00054 void DownloadFinished();
00055 void UpdateProgress(qint64 read, qint64 total);
00056 void RenameButton();
00057
00058 private:
00059 QLineEdit* line_edit_;
00060 QPushButton* button_;
00061 QProgressBar* progress_bar_;
00062 ActionList action_list_;
00063 QMenu* site_loader_menu_;
00064 QActionGroup* site_actions_;
00065 String selected_site_loader_;
00066 bool img_support_;
00067 };
00068
00069 }}
00070
00071 #endif