← Back to team overview

kicad-developers team mailing list archive

BOM component table dialog (quasi-)modality in osx

 

Hi,  
I’ve lurked this list for quite some time, and finally applied to join, so thank you for approving me. I hope I can make some contributions to this excellent project.

I use KiCAD in OSX 10.12 and noticed an issue with the recent BOM component table feature.
When closing the dialog box, the main KiCAD windows and menus still behave as if a modal dialog box is still open: all menu items are greyed-out, and the windows don't respond to clicks or other events, and I have to kill the process from the OS.

After reading some explanations in the comments, I can’t say I fully grasp the issue, but when I try invoking and closing the dialog as QuasiModal, it seems to work. I don’t know if this breaks it for other OS’s or if it violates a UI policy, so please let me know if there’s a better way!

Attached is the simple hack I made.

thanks!

From 2253bec68af9b0b4ffc177bccc1325b4702ee084 Mon Sep 17 00:00:00 2001  
From: danngreen <danngreen1@xxxxxxxxx>
Date: Thu, 1 Jun 2017 13:08:17 -0700
Subject: [PATCH] Made BOM editor dialog quasi modal

---  
 eeschema/dialogs/dialog_bom_editor.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eeschema/dialogs/dialog_bom_editor.cpp b/eeschema/dialogs/dialog_bom_editor.cpp  
index e5114e533..f1d9a9aee 100644
--- a/eeschema/dialogs/dialog_bom_editor.cpp
+++ b/eeschema/dialogs/dialog_bom_editor.cpp
@@ -44,7 +44,7 @@
 int InvokeDialogCreateBOMEditor( SCH_EDIT_FRAME* aCaller )
 {
     DIALOG_BOM_EDITOR dlg( aCaller );
-    return dlg.ShowModal();
+    return dlg.ShowQuasiModal();
 }
  
 DIALOG_BOM_EDITOR::DIALOG_BOM_EDITOR( SCH_EDIT_FRAME* parent ) :
@@ -129,6 +129,7 @@ bool DIALOG_BOM_EDITOR::CloseDialog()
 {
     if( !m_bom->HaveFieldsChanged() )
     {
+        EndQuasiModal( wxID_CANCEL );
         Destroy();
         return true;
     }
@@ -146,6 +147,7 @@ bool DIALOG_BOM_EDITOR::CloseDialog()
        break;
     }
  
+    EndQuasiModal( wxID_CANCEL );
     Destroy();
     return true;
 }
--  
2.11.0



Follow ups