From 484cc924a8c75f935fa72e6dda447ba1bc6fd185 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Sat, 27 Mar 2021 19:44:55 +0000 Subject: [PATCH] Clarify Locked Items Query dialog Explain better what the dialog does when each option is selected. --- common/dialogs/dialog_locked_items_query.cpp | 6 +- .../dialog_locked_items_query_base.cpp | 17 ++-- .../dialog_locked_items_query_base.fbp | 82 +++++++++++++++++-- .../dialogs/dialog_locked_items_query_base.h | 4 +- 4 files changed, 94 insertions(+), 15 deletions(-) diff --git a/common/dialogs/dialog_locked_items_query.cpp b/common/dialogs/dialog_locked_items_query.cpp index f4cc2da22c..f3a0a9ff36 100644 --- a/common/dialogs/dialog_locked_items_query.cpp +++ b/common/dialogs/dialog_locked_items_query.cpp @@ -31,8 +31,8 @@ DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent, int aLo m_messageLine1->SetLabel( wxString::Format( m_messageLine1->GetLabel(), aLockedItemCount ) ); - m_sdbSizerOK->SetDefault(); - + m_removeBtn->SetDefault(); + m_removeBtn->SetFocus(); Layout(); // Now all widgets have the size fixed, call FinishDialogSettings @@ -67,7 +67,7 @@ int DIALOG_LOCKED_ITEMS_QUERY::ShowModal() int ret = DIALOG_SHIM::ShowModal(); - // Has the user asked not to show the dialog again + // Has the user asked not to show the dialog again this session? if( m_doNotShowBtn->IsChecked() && ret != wxID_CANCEL ) doNotShowValue = ret; diff --git a/common/dialogs/dialog_locked_items_query_base.cpp b/common/dialogs/dialog_locked_items_query_base.cpp index 22b3813823..c846cde7d2 100644 --- a/common/dialogs/dialog_locked_items_query_base.cpp +++ b/common/dialogs/dialog_locked_items_query_base.cpp @@ -41,7 +41,9 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); - m_doNotShowBtn = new wxCheckBox( this, wxID_ANY, _("Do not show again."), wxDefaultPosition, wxDefaultSize, 0 ); + m_doNotShowBtn = new wxCheckBox( this, wxID_ANY, _("Remember decision for this session."), wxDefaultPosition, wxDefaultSize, 0 ); + m_doNotShowBtn->SetToolTip( _("Remember the option selected for the remainder of this session.\nThis dialog will not be shown again until KiCad is restarted.") ); + fgSizer4->Add( m_doNotShowBtn, 0, wxALL, 5 ); @@ -51,14 +53,19 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent bButtonSizer = new wxBoxSizer( wxHORIZONTAL ); m_overrideBtn = new wxButton( this, wxID_ANY, _("Override Locks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_overrideBtn->SetToolTip( _("Override locks and apply the operation on the locked items.\nThe locked items will remain locked after the operation is complete.") ); + bButtonSizer->Add( m_overrideBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_removeBtn = new wxButton( this, wxID_ANY, _("Remove Locked Items"), wxDefaultPosition, wxDefaultSize, 0 ); + m_removeBtn->SetToolTip( _("Remove locked items from the selection and only apply the operation to the unlocked items (if any).") ); + + bButtonSizer->Add( m_removeBtn, 0, wxALL, 5 ); + bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 ); m_sdbSizer = new wxStdDialogButtonSizer(); - m_sdbSizerOK = new wxButton( this, wxID_OK ); - m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); @@ -76,8 +83,8 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent // Connect Events this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) ); m_overrideBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this ); + m_removeBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this ); - m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); } DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE() @@ -85,7 +92,7 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE() // Disconnect Events this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) ); m_overrideBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this ); + m_removeBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this ); - m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); } diff --git a/common/dialogs/dialog_locked_items_query_base.fbp b/common/dialogs/dialog_locked_items_query_base.fbp index 03d704dcc7..a58ef2415b 100644 --- a/common/dialogs/dialog_locked_items_query_base.fbp +++ b/common/dialogs/dialog_locked_items_query_base.fbp @@ -309,7 +309,7 @@ 0 0 wxID_ANY - Do not show again. + Remember decision for this session. 0 @@ -330,7 +330,7 @@ ; ; forward_declare 0 - + Remember the option selected for the remainder of this session. This dialog will not be shown again until KiCad is restarted. wxFILTER_NONE wxDefaultValidator @@ -413,7 +413,7 @@ 0 - + Override locks and apply the operation on all the items selected. Any locked items will remain locked after the operation is complete. wxFILTER_NONE wxDefaultValidator @@ -424,6 +424,79 @@ onOverrideLocks + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 1 + + 1 + + + 0 + 0 + wxID_ANY + Remove Locked Items + + 0 + + 0 + + + 0 + + 1 + m_removeBtn + 1 + + + protected + 1 + + + + Resizable + 1 + + + + 0 + Remove locked items from the selection and only apply the operation to the unlocked items (if any). + + wxFILTER_NONE + wxDefaultValidator + + + + + onOkClick + + 5 wxEXPAND @@ -444,14 +517,13 @@ 0 0 0 - 1 + 0 0 0 m_sdbSizer protected onCancelClick - onOkClick diff --git a/common/dialogs/dialog_locked_items_query_base.h b/common/dialogs/dialog_locked_items_query_base.h index 8efe844d39..8f531455cb 100644 --- a/common/dialogs/dialog_locked_items_query_base.h +++ b/common/dialogs/dialog_locked_items_query_base.h @@ -42,15 +42,15 @@ class DIALOG_LOCKED_ITEMS_QUERY_BASE : public DIALOG_SHIM wxStaticText* m_messageLine2; wxCheckBox* m_doNotShowBtn; wxButton* m_overrideBtn; + wxButton* m_removeBtn; wxStdDialogButtonSizer* m_sdbSizer; - wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); } virtual void onOverrideLocks( wxCommandEvent& event ) { event.Skip(); } - virtual void onCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void onOkClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onCancelClick( wxCommandEvent& event ) { event.Skip(); } public: