mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:10:04 +00:00 
			
		
		
		
	Adding update notifications setting option
This commit is contained in:
		
							parent
							
								
									19f0ab9898
								
							
						
					
					
						commit
						a609f14f1f
					
				
					 6 changed files with 38 additions and 8 deletions
				
			
		|  | @ -21,6 +21,7 @@ public: | |||
|       gridWidth_.SetDefault(1); | ||||
|       gridHeight_.SetDefault(1); | ||||
|       mapboxApiKey_.SetDefault("?"); | ||||
|       updateNotificationsEnabled_.SetDefault(true); | ||||
| 
 | ||||
|       fontSizes_.SetElementMinimum(1); | ||||
|       fontSizes_.SetElementMaximum(72); | ||||
|  | @ -42,6 +43,7 @@ public: | |||
|    SettingsVariable<std::int64_t>               gridWidth_ {"grid_width"}; | ||||
|    SettingsVariable<std::int64_t>               gridHeight_ {"grid_height"}; | ||||
|    SettingsVariable<std::string> mapboxApiKey_ {"mapbox_api_key"}; | ||||
|    SettingsVariable<bool> updateNotificationsEnabled_ {"update_notifications"}; | ||||
| }; | ||||
| 
 | ||||
| GeneralSettings::GeneralSettings() : | ||||
|  | @ -52,7 +54,8 @@ GeneralSettings::GeneralSettings() : | |||
|                       &p->fontSizes_, | ||||
|                       &p->gridWidth_, | ||||
|                       &p->gridHeight_, | ||||
|                       &p->mapboxApiKey_}); | ||||
|                       &p->mapboxApiKey_, | ||||
|                       &p->updateNotificationsEnabled_}); | ||||
|    SetDefaults(); | ||||
| } | ||||
| GeneralSettings::~GeneralSettings() = default; | ||||
|  | @ -92,6 +95,11 @@ SettingsVariable<std::string>& GeneralSettings::mapbox_api_key() const | |||
|    return p->mapboxApiKey_; | ||||
| } | ||||
| 
 | ||||
| SettingsVariable<bool>& GeneralSettings::update_notifications_enabled() const | ||||
| { | ||||
|    return p->updateNotificationsEnabled_; | ||||
| } | ||||
| 
 | ||||
| bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs) | ||||
| { | ||||
|    return (lhs.p->debugEnabled_ == rhs.p->debugEnabled_ && | ||||
|  | @ -99,7 +107,9 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs) | |||
|            lhs.p->fontSizes_ == rhs.p->fontSizes_ && | ||||
|            lhs.p->gridWidth_ == rhs.p->gridWidth_ && | ||||
|            lhs.p->gridHeight_ == rhs.p->gridHeight_ && | ||||
|            lhs.p->mapboxApiKey_ == rhs.p->mapboxApiKey_); | ||||
|            lhs.p->mapboxApiKey_ == rhs.p->mapboxApiKey_ && | ||||
|            lhs.p->updateNotificationsEnabled_ == | ||||
|               rhs.p->updateNotificationsEnabled_); | ||||
| } | ||||
| 
 | ||||
| } // namespace settings
 | ||||
|  |  | |||
|  | @ -33,6 +33,7 @@ public: | |||
|    SettingsVariable<std::int64_t>&               grid_height() const; | ||||
|    SettingsVariable<std::int64_t>&               grid_width() const; | ||||
|    SettingsVariable<std::string>&                mapbox_api_key() const; | ||||
|    SettingsVariable<bool>& update_notifications_enabled() const; | ||||
| 
 | ||||
|    friend bool operator==(const GeneralSettings& lhs, | ||||
|                           const GeneralSettings& rhs); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat