mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 16:40:04 +00:00 
			
		
		
		
	Add generic progress dialog, and derived download dialog
This commit is contained in:
		
							parent
							
								
									4ac2626b65
								
							
						
					
					
						commit
						2f397106f9
					
				
					 6 changed files with 374 additions and 0 deletions
				
			
		
							
								
								
									
										38
									
								
								scwx-qt/source/scwx/qt/ui/download_dialog.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								scwx-qt/source/scwx/qt/ui/download_dialog.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/ui/progress_dialog.hpp> | ||||
| 
 | ||||
| #include <cstddef> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
| { | ||||
| namespace ui | ||||
| { | ||||
| class DownloadDialog : public ProgressDialog | ||||
| { | ||||
|    Q_OBJECT | ||||
|    Q_DISABLE_COPY_MOVE(DownloadDialog) | ||||
| 
 | ||||
| public: | ||||
|    explicit DownloadDialog(QWidget* parent = nullptr); | ||||
|    ~DownloadDialog(); | ||||
| 
 | ||||
|    void set_filename(const std::string& filename); | ||||
| 
 | ||||
| public slots: | ||||
|    void StartDownload(); | ||||
|    void UpdateProgress(std::ptrdiff_t downloadedBytes, | ||||
|                        std::ptrdiff_t totalBytes); | ||||
|    void FinishDownload(); | ||||
|    void CancelDownload(); | ||||
| 
 | ||||
| private: | ||||
|    class Impl; | ||||
|    std::unique_ptr<Impl> p; | ||||
| }; | ||||
| 
 | ||||
| } // namespace ui
 | ||||
| } // namespace qt
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat