mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	QML UI: create completion list for cylinders as well
We already have that for the other three fields where we offer auto completion (buddy, divemaster, suit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									e42bf2cfa5
								
							
						
					
					
						commit
						6a50efd80a
					
				
					 2 changed files with 18 additions and 1 deletions
				
			
		|  | @ -1484,6 +1484,22 @@ QStringList QMLManager::divemasterInit() const | ||||||
| 	return divemasters; | 	return divemasters; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | QStringList QMLManager::cylinderInit() const | ||||||
|  | { | ||||||
|  | 	QStringList cylinders; | ||||||
|  | 	struct dive *d; | ||||||
|  | 	int i = 0; | ||||||
|  | 	for_each_dive (i, d) { | ||||||
|  | 		for (int j = 0; j < MAX_CYLINDERS; j++) { | ||||||
|  | 			if (! same_string(d->cylinder[j].type.description, "")) | ||||||
|  | 				cylinders << d->cylinder[j].type.description; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	cylinders.removeDuplicates(); | ||||||
|  | 	cylinders.sort(); | ||||||
|  | 	return cylinders; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| bool QMLManager::showPin() const | bool QMLManager::showPin() const | ||||||
| { | { | ||||||
| 	return m_showPin; | 	return m_showPin; | ||||||
|  |  | ||||||
|  | @ -33,6 +33,7 @@ class QMLManager : public QObject { | ||||||
| 	Q_PROPERTY(QStringList suitInit READ suitInit CONSTANT) | 	Q_PROPERTY(QStringList suitInit READ suitInit CONSTANT) | ||||||
| 	Q_PROPERTY(QStringList buddyInit READ buddyInit CONSTANT) | 	Q_PROPERTY(QStringList buddyInit READ buddyInit CONSTANT) | ||||||
| 	Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT) | 	Q_PROPERTY(QStringList divemasterInit READ divemasterInit CONSTANT) | ||||||
|  | 	Q_PROPERTY(QStringList cylinderInit READ cylinderInit CONSTANT) | ||||||
| 	Q_PROPERTY(bool showPin READ showPin WRITE setShowPin NOTIFY showPinChanged) | 	Q_PROPERTY(bool showPin READ showPin WRITE setShowPin NOTIFY showPinChanged) | ||||||
| 
 | 
 | ||||||
| public: | public: | ||||||
|  | @ -108,7 +109,7 @@ public: | ||||||
| 	QStringList suitInit() const; | 	QStringList suitInit() const; | ||||||
| 	QStringList buddyInit() const; | 	QStringList buddyInit() const; | ||||||
| 	QStringList divemasterInit() const; | 	QStringList divemasterInit() const; | ||||||
| 
 | 	QStringList cylinderInit() const; | ||||||
| 	bool showPin() const; | 	bool showPin() const; | ||||||
| 	void setShowPin(bool enable); | 	void setShowPin(bool enable); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue