mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 03:30:06 +00:00 
			
		
		
		
	Add map API key test button to initial dialog
This commit is contained in:
		
							parent
							
								
									8dfb2fe69c
								
							
						
					
					
						commit
						50006ada37
					
				
					 6 changed files with 178 additions and 24 deletions
				
			
		
							
								
								
									
										40
									
								
								scwx-qt/source/scwx/qt/ui/api_key_edit_widget.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								scwx-qt/source/scwx/qt/ui/api_key_edit_widget.hpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,40 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <scwx/qt/map/map_provider.hpp> | ||||
| #include <QNetworkReply> | ||||
| #include <QLineEdit> | ||||
| 
 | ||||
| class QNetworkAccessManager; | ||||
| 
 | ||||
| namespace scwx::qt::ui | ||||
| { | ||||
| 
 | ||||
| class QApiKeyEdit : public QLineEdit | ||||
| { | ||||
|    Q_OBJECT | ||||
| 
 | ||||
| public: | ||||
|    QApiKeyEdit(QWidget* parent = nullptr); | ||||
| 
 | ||||
|    map::MapProvider getMapProvider() const { return provider_; } | ||||
| 
 | ||||
|    void setMapProvider(const map::MapProvider provider) | ||||
|    { | ||||
|       provider_ = provider; | ||||
|    } | ||||
| 
 | ||||
| signals: | ||||
|    void apiTestSucceeded(); | ||||
|    void apiTestFailed(QNetworkReply::NetworkError error); | ||||
| 
 | ||||
| private slots: | ||||
|    void apiTest(); | ||||
|    void apiTestFinished(QNetworkReply* reply); | ||||
| 
 | ||||
| protected: | ||||
|    map::MapProvider       provider_ {map::MapProvider::Unknown}; | ||||
|    QNetworkAccessManager* networkAccessManager_ {}; | ||||
|    QAction*               testAction_ {}; | ||||
| }; | ||||
| 
 | ||||
| } // namespace scwx::qt::ui
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 aware70
						aware70