mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 13:10:04 +00:00 
			
		
		
		
	Disable radar site dialog OK button until a site is selected
This commit is contained in:
		
							parent
							
								
									976617d342
								
							
						
					
					
						commit
						f473a02d1d
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		|  | @ -6,6 +6,7 @@ | ||||||
| #include <scwx/common/geographic.hpp> | #include <scwx/common/geographic.hpp> | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| 
 | 
 | ||||||
|  | #include <QPushButton> | ||||||
| #include <QSortFilterProxyModel> | #include <QSortFilterProxyModel> | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
|  | @ -58,10 +59,22 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) : | ||||||
|       ui->radarSiteView->resizeColumnToContents(column); |       ui->radarSiteView->resizeColumnToContents(column); | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|  |    // Button Box
 | ||||||
|  |    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); | ||||||
|  | 
 | ||||||
|    connect(ui->radarSiteFilter, |    connect(ui->radarSiteFilter, | ||||||
|            &QLineEdit::textChanged, |            &QLineEdit::textChanged, | ||||||
|            p->proxyModel_, |            p->proxyModel_, | ||||||
|            &QSortFilterProxyModel::setFilterWildcard); |            &QSortFilterProxyModel::setFilterWildcard); | ||||||
|  |    connect(ui->radarSiteView->selectionModel(), | ||||||
|  |            &QItemSelectionModel::selectionChanged, | ||||||
|  |            this, | ||||||
|  |            [=](const QItemSelection& selected, | ||||||
|  |                const QItemSelection& /* deselected */) | ||||||
|  |            { | ||||||
|  |               ui->buttonBox->button(QDialogButtonBox::Ok) | ||||||
|  |                  ->setEnabled(selected.size() > 0); | ||||||
|  |            }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| RadarSiteDialog::~RadarSiteDialog() | RadarSiteDialog::~RadarSiteDialog() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat