[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#954658: Info received (Bug#954658: Info received (Bug#954658 closed by Dennis Braun <d_braun@kabelmail.de> (Re: qjackctl: Frames/Period setting not always saved when it's the only setting changed.)))



Also just noticed that there's an extraneous else statement that my patch doesn't remove. (Which would have messed with the instant update feature. That's my bad - somehow managed to introduce an inconsistency in my own code when moving from OS X to linux.) Attaching a fix.
Aaron
Make sure the frames setting is saved when it's the only setting that's changed.
Restore the previous settings in the setup form when the cancel button is pressed.
Index: qjackctl-0.6.1/src/qjackctlSetupForm.cpp
===================================================================
--- qjackctl-0.6.1.orig/src/qjackctlSetupForm.cpp
+++ qjackctl-0.6.1/src/qjackctlSetupForm.cpp
@@ -1612,13 +1612,12 @@ void qjackctlSetupForm::apply (void)
 	if (pMainForm == nullptr)
 		return;
 
-	if (m_iDirtySettings > 0 || m_iDirtyPreset > 0) {
+	if (m_iDirtySettings > 0 || m_iDirtyPreset > 0 || m_iDirtyBuffSize > 0) {
 		// Save current preset selection.
 		m_pSetup->sDefPreset = m_ui.PresetComboBox->currentText();
 		// Always save current settings...
 		savePreset(m_pSetup->sDefPreset);
 	}
-	else
 	if (m_iDirtyBuffSize > 0) {
 		// Change JACK buffer size immediately...
 		if (!pMainForm->resetBuffSize(jack_nframes_t(
@@ -1908,7 +1907,7 @@ bool qjackctlSetupForm::queryClose (void
 	bool bQueryClose = true;
 
 	// Check if there's any pending changes...
-	if (m_iDirtySettings > 0 || m_iDirtyOptions > 0) {
+	if (m_iDirtySettings > 0 || m_iDirtyOptions > 0 || m_iDirtyBuffSize > 0) {
 		switch (QMessageBox::warning(isVisible() ? this : parentWidget(),
 			tr("Warning") + " - " QJACKCTL_SUBTITLE1,
 			tr("Some settings have been changed.\n\n"
@@ -1920,9 +1919,14 @@ bool qjackctlSetupForm::queryClose (void
 			accept();
 			// Fall thru...
 		case QMessageBox::Discard:
+			if (m_pSetup) {
+				setup(m_pSetup);
+				changePreset(m_pSetup->sDefPreset);
+			}
 			// Reset dirty flags...
 			m_iDirtySettings = 0;
 			m_iDirtyOptions = 0;
+			m_iDirtyBuffSize = 0;
 			break;
 		default:    // Cancel.
 			bQueryClose = false;

Reply to: