Validate form fields and accept it valid.
| 242 | |
| 243 | // Validate form fields and accept it valid. |
| 244 | void PatchesDialog::accept() |
| 245 | { |
| 246 | if( validateForm() ) |
| 247 | { |
| 248 | // Unload from current selected dialog items. |
| 249 | int iBank = ( m_bankListView->currentItem() )->text( 0 ).toInt(); |
| 250 | int iProg = ( m_progListView->currentItem() )->text( 0 ).toInt(); |
| 251 | |
| 252 | // And set it right away... |
| 253 | setBankProg( iBank, iProg ); |
| 254 | |
| 255 | if( m_dirty > 0 ) |
| 256 | { |
| 257 | m_bankModel->setValue( iBank ); |
| 258 | m_progModel->setValue( iProg ); |
| 259 | m_patchLabel->setText( m_progListView-> |
| 260 | currentItem()->text( 1 ) ); |
| 261 | } |
| 262 | |
| 263 | // We got it. |
| 264 | QDialog::accept(); |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | |
| 269 |