Eeschema: improve annotation dialog checkbox labeling

* Change 'Silent mode' -> 'Always ask for confirmation'.  Default on
 (Same behavior as before, though arguably, it is very annoying and
  should probably be default off)
* 'Automatically close dialog' -> 'Keep this dialog open'.  Also changed
  the default to _not_ keep the dialog open (what is keeping it open even
  useful for ?)
This commit is contained in:
Henner Zeller 2015-06-22 11:53:27 -04:00 committed by Wayne Stambaugh
parent 80eb5460f9
commit e1b3a2d410
4 changed files with 38 additions and 34 deletions

View File

@ -36,10 +36,10 @@
#include <dialog_annotate_base.h>
#include <kiface_i.h>
#define KEY_ANNOTATE_SORT_OPTION wxT( "AnnotateSortOption" )
#define KEY_ANNOTATE_ALGO_OPTION wxT( "AnnotateAlgoOption" )
#define KEY_ANNOTATE_AUTOCLOSE_OPTION wxT( "AnnotateAutoCloseOption" )
#define KEY_ANNOTATE_USE_SILENTMODE wxT( "AnnotateSilentMode" )
#define KEY_ANNOTATE_SORT_OPTION wxT( "AnnotateSortOption" )
#define KEY_ANNOTATE_ALGO_OPTION wxT( "AnnotateAlgoOption" )
#define KEY_ANNOTATE_KEEP_OPEN_OPTION wxT( "AnnotateKeepOpenOption" )
#define KEY_ANNOTATE_ASK_FOR_CONFIRMATION wxT( "AnnotateRequestConfirmation" )
class wxConfigBase;
@ -85,14 +85,14 @@ private:
*/
int GetAnnotateAlgo();
bool GetAnnotateAutoCloseOpt()
bool GetAnnotateKeepOpen()
{
return m_cbAutoCloseDlg->GetValue();
return m_cbKeepDlgOpen->GetValue();
}
bool GetAnnotateSilentMode()
bool GetAnnotateAskForConfirmation()
{
return m_cbUseSilentMode->GetValue();
return m_cbAskForConfirmation->GetValue();
}
};
@ -118,7 +118,7 @@ void DIALOG_ANNOTATE::InitValues()
{
long option;
m_Config->Read( KEY_ANNOTATE_SORT_OPTION, &option, 0l );
m_Config->Read( KEY_ANNOTATE_SORT_OPTION, &option, 0L );
switch( option )
{
default:
@ -135,7 +135,7 @@ void DIALOG_ANNOTATE::InitValues()
break;
}
m_Config->Read( KEY_ANNOTATE_ALGO_OPTION, &option, 0l );
m_Config->Read( KEY_ANNOTATE_ALGO_OPTION, &option, 0L );
switch( option )
{
default:
@ -152,13 +152,13 @@ void DIALOG_ANNOTATE::InitValues()
break;
}
m_Config->Read( KEY_ANNOTATE_AUTOCLOSE_OPTION, &option, 0l );
if( option )
m_cbAutoCloseDlg->SetValue( 1 );
m_Config->Read( KEY_ANNOTATE_USE_SILENTMODE, &option, 0l );
if( option )
m_cbUseSilentMode->SetValue( 1 );
m_Config->Read( KEY_ANNOTATE_KEEP_OPEN_OPTION, &option, 0L );
m_cbKeepDlgOpen->SetValue( option );
m_Config->Read( KEY_ANNOTATE_ASK_FOR_CONFIRMATION, &option, 1L );
m_cbAskForConfirmation->SetValue( option );
}
annotate_down_right_bitmap->SetBitmap( KiBitmap( annotate_down_right_xpm ) );
@ -177,13 +177,13 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
{
m_Config->Write( KEY_ANNOTATE_SORT_OPTION, GetSortOrder() );
m_Config->Write( KEY_ANNOTATE_ALGO_OPTION, GetAnnotateAlgo() );
m_Config->Write( KEY_ANNOTATE_AUTOCLOSE_OPTION, GetAnnotateAutoCloseOpt() );
m_Config->Write( KEY_ANNOTATE_USE_SILENTMODE, GetAnnotateSilentMode() );
m_Config->Write( KEY_ANNOTATE_KEEP_OPEN_OPTION, GetAnnotateKeepOpen() );
m_Config->Write( KEY_ANNOTATE_ASK_FOR_CONFIRMATION, GetAnnotateAskForConfirmation() );
}
// Display a message info in verbose mode,
// Display a message info if we always ask for confirmation
// or if a reset of the previous annotation is asked.
bool promptUser = ! GetAnnotateSilentMode();
bool promptUser = GetAnnotateAskForConfirmation();
if( GetResetItems() )
{
@ -205,6 +205,10 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
if( promptUser )
{
// TODO(hzeller): ideally, this would be a wxMessageDialog that contains
// a checkbox asking the 'ask for confirmation' flag for better
// discoverability (and it should only show in the 'benign' case, so if
// !GetResetItems())
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if( response == wxCANCEL )
@ -218,7 +222,7 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
m_btnClear->Enable();
if( GetAnnotateAutoCloseOpt() )
if( !GetAnnotateKeepOpen() )
{
if( IsModal() )
EndModal( wxID_OK );
@ -312,4 +316,3 @@ int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller )
return dlg.ShowModal();
}

View File

@ -169,8 +169,8 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
wxBoxSizer* bSizerChoiceClose;
bSizerChoiceClose = new wxBoxSizer( wxHORIZONTAL );
m_cbAutoCloseDlg = new wxCheckBox( this, wxID_ANY, _("Automatically close this dialog"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChoiceClose->Add( m_cbAutoCloseDlg, 0, wxALL, 5 );
m_cbKeepDlgOpen = new wxCheckBox( this, wxID_ANY, _("Keep this dialog open"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChoiceClose->Add( m_cbKeepDlgOpen, 0, wxALL, 5 );
bSizerChoiceClose->Add( 0, 0, 1, wxEXPAND, 5 );
@ -181,8 +181,9 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
wxBoxSizer* bSizerChoiceSilentMode;
bSizerChoiceSilentMode = new wxBoxSizer( wxHORIZONTAL );
m_cbUseSilentMode = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChoiceSilentMode->Add( m_cbUseSilentMode, 0, wxALL, 5 );
m_cbAskForConfirmation = new wxCheckBox( this, wxID_ANY, _("Always ask for confirmation"), wxDefaultPosition, wxDefaultSize, 0 );
m_cbAskForConfirmation->SetValue(true);
bSizerChoiceSilentMode->Add( m_cbAskForConfirmation, 0, wxALL, 5 );
bSizerChoiceSilentMode->Add( 0, 0, 1, wxEXPAND, 5 );

View File

@ -2009,7 +2009,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Automatically close this dialog</property>
<property name="label">Keep this dialog open</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2017,7 +2017,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cbAutoCloseDlg</property>
<property name="name">m_cbKeepDlgOpen</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2103,7 +2103,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -2118,7 +2118,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Silent mode</property>
<property name="label">Always ask for confirmation</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -2126,7 +2126,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cbUseSilentMode</property>
<property name="name">m_cbAskForConfirmation</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 9 2015)
// C++ code generated with wxFormBuilder (version Jun 20 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -70,8 +70,8 @@ class DIALOG_ANNOTATE_BASE : public DIALOG_SHIM
wxRadioButton* m_rbStartSheetNumLarge;
wxStaticLine* m_staticline4;
wxStaticText* m_staticTextDlgOpts;
wxCheckBox* m_cbAutoCloseDlg;
wxCheckBox* m_cbUseSilentMode;
wxCheckBox* m_cbKeepDlgOpen;
wxCheckBox* m_cbAskForConfirmation;
wxStaticLine* m_staticline41;
wxButton* m_btnClose;
wxButton* m_btnClear;