From 8097b69b1fee6ecf28fb1e5f6b2b88139c53e84d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 6 Jan 2025 12:41:46 +0100 Subject: [PATCH] Kicad manager, jobset: Ensure save changes when closing kicad are made. After made changes on a jobset, when closing Kicad, the dialog asking for save changes was not honored when the save changes was accepted after a yes answer. Fix also a minor compil warning. Fixes https://gitlab.com/kicad/code/kicad/-/issues/19450 --- kicad/dialogs/panel_jobs.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kicad/dialogs/panel_jobs.cpp b/kicad/dialogs/panel_jobs.cpp index 3927c23101..67f8a43228 100644 --- a/kicad/dialogs/panel_jobs.cpp +++ b/kicad/dialogs/panel_jobs.cpp @@ -544,12 +544,13 @@ bool JOBS_GRID_TRICKS::handleDoubleClick( wxGridEvent& aEvent ) { m_grid->CancelShowEditorOnMouseUp(); - int col = aEvent.GetCol(); - int row = aEvent.GetRow(); + int curr_col = aEvent.GetCol(); + int curr_row = aEvent.GetRow(); - if( col == 1 && row >= 0 && row < (int) m_parent->GetJobsFile()->GetJobs().size() ) + if( ( curr_col == 0 || curr_col == 1 ) + && curr_row >= 0 && curr_row < (int) m_parent->GetJobsFile()->GetJobs().size() ) { - m_doubleClickRow = row; + m_doubleClickRow = curr_row; m_grid->CancelPendingChanges(); CallAfter( @@ -897,7 +898,7 @@ bool PANEL_JOBS::GetCanClose() if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ), [&]() -> bool { - return m_jobsFile->SaveToFile(); + return m_jobsFile->SaveToFile(wxEmptyString, true); } ) ) { return false;