Allow for reduced nagging with wider use of KIDIALOG.
(cherry picked from commit c2dd5df)
This commit is contained in:
parent
a52605957e
commit
99db5cb543
|
@ -152,9 +152,12 @@ void LIB_EDIT_FRAME::OnExportPart( wxCommandEvent& event )
|
||||||
|
|
||||||
if( old_part )
|
if( old_part )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Symbol \"%s\" already exists. Overwrite it?" ), part->GetName() );
|
msg.Printf( _( "Symbol \"%s\" already exists." ), part->GetName() );
|
||||||
|
KIDIALOG errorDlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
errorDlg.SetOKLabel( _( "Overwrite" ) );
|
||||||
|
errorDlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
if( !IsOK( this, msg ) )
|
if( errorDlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,9 +92,16 @@ void LIB_EDIT_FRAME::SelectActiveLibrary( const wxString& aLibrary )
|
||||||
|
|
||||||
bool LIB_EDIT_FRAME::LoadComponentAndSelectLib( const LIB_ID& aLibId )
|
bool LIB_EDIT_FRAME::LoadComponentAndSelectLib( const LIB_ID& aLibId )
|
||||||
{
|
{
|
||||||
if( GetScreen()->IsModify()
|
if( GetScreen()->IsModify() )
|
||||||
&& !IsOK( this, _( "The current symbol is not saved.\n\nDiscard current changes?" ) ) )
|
{
|
||||||
return false;
|
KIDIALOG dlg( this, _( "The current symbol contains unsaved changes." ),
|
||||||
|
_( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Discard Changes" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SelectActiveLibrary( aLibId.GetLibNickname() );
|
SelectActiveLibrary( aLibId.GetLibNickname() );
|
||||||
return LoadComponentFromCurrentLib( aLibId.GetLibItemName() );
|
return LoadComponentFromCurrentLib( aLibId.GetLibItemName() );
|
||||||
|
|
|
@ -205,10 +205,14 @@ void LIB_EDIT_FRAME::PlacePin()
|
||||||
{
|
{
|
||||||
m_canvas->SetIgnoreMouseEvents( true );
|
m_canvas->SetIgnoreMouseEvents( true );
|
||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf( _( "This position is already occupied by another pin, in unit %d.\n"
|
msg.Printf( _( "This position is already occupied by another pin, in unit %d." ),
|
||||||
"Continue?" ), pin->GetUnit() );
|
pin->GetUnit() );
|
||||||
|
|
||||||
bool status = IsOK( this, msg );
|
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Create Pin Anyway" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
bool status = dlg.ShowModal() == wxID_OK;
|
||||||
|
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
m_canvas->SetIgnoreMouseEvents( false );
|
m_canvas->SetIgnoreMouseEvents( false );
|
||||||
|
|
|
@ -98,7 +98,10 @@ void KICAD_MANAGER_FRAME::OnImportEagleFiles( wxCommandEvent& event )
|
||||||
"create projects in their own clean directory.\n\nDo you "
|
"create projects in their own clean directory.\n\nDo you "
|
||||||
"want to create a new empty directory for the project?" );
|
"want to create a new empty directory for the project?" );
|
||||||
|
|
||||||
if( IsOK( this, msg ) )
|
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxYES_NO | wxICON_WARNING );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_YES )
|
||||||
{
|
{
|
||||||
// Append a new directory with the same name of the project file
|
// Append a new directory with the same name of the project file
|
||||||
// and try to create it
|
// and try to create it
|
||||||
|
|
|
@ -359,19 +359,15 @@ void KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate( wxCommandEvent& event )
|
||||||
wxString extendedMsg = _( "Overwriting files:" ) + "\n";
|
wxString extendedMsg = _( "Overwriting files:" ) + "\n";
|
||||||
|
|
||||||
for( const auto& file : overwrittenFiles )
|
for( const auto& file : overwrittenFiles )
|
||||||
{
|
|
||||||
extendedMsg += "\n" + file.GetFullName();
|
extendedMsg += "\n" + file.GetFullName();
|
||||||
}
|
|
||||||
|
|
||||||
wxMessageDialog owDlg( this,
|
KIDIALOG msgDlg( this, _( "Similar files already exist in the destination folder." ),
|
||||||
_( "Are you sure you want to overwrite files in "
|
_( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
"the destination folder?" ),
|
msgDlg.SetExtendedMessage( extendedMsg );
|
||||||
_( "Warning!" ),
|
msgDlg.SetOKLabel( _( "Overwrite" ) );
|
||||||
wxYES_NO | wxICON_QUESTION | wxCENTER );
|
msgDlg.DoNotShowCheckbox();
|
||||||
owDlg.SetExtendedMessage( extendedMsg );
|
|
||||||
owDlg.SetYesNoLabels( _( "Overwrite" ), _( "Do Not Overwrite" ) );
|
|
||||||
|
|
||||||
if( owDlg.ShowModal() == wxID_NO )
|
if( msgDlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
// IDF export header generated by wxFormBuilder
|
// IDF export header generated by wxFormBuilder
|
||||||
#include <dialog_export_idf_base.h>
|
#include <dialog_export_idf_base.h>
|
||||||
#include <pcb_edit_frame.h>
|
#include <pcb_edit_frame.h>
|
||||||
|
#include <confirm.h>
|
||||||
|
|
||||||
#define OPTKEY_IDF_THOU wxT( "IDFExportThou" )
|
#define OPTKEY_IDF_THOU wxT( "IDFExportThou" )
|
||||||
#define OPTKEY_IDF_REF_AUTOADJ wxT( "IDFRefAutoAdj" )
|
#define OPTKEY_IDF_REF_AUTOADJ wxT( "IDFRefAutoAdj" )
|
||||||
|
@ -166,9 +167,12 @@ bool DIALOG_EXPORT_IDF3::TransferDataFromWindow()
|
||||||
|
|
||||||
if( fn.FileExists() )
|
if( fn.FileExists() )
|
||||||
{
|
{
|
||||||
if( wxMessageBox( _( "Are you sure you want to overwrite the existing file?" ),
|
wxString msg = wxString::Format( _( "File %s already exists." ), fn.GetPath() );
|
||||||
_( "Warning" ), wxYES_NO | wxCENTER | wxICON_QUESTION, this ) == wxNO )
|
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
return false;
|
dlg.SetOKLabel( _( "Overwrite" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
return ( dlg.ShowModal() == wxID_OK );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -121,7 +121,14 @@ bool DIALOG_GENCAD_EXPORT_OPTIONS::TransferDataFromWindow()
|
||||||
wxString fn = GetFileName();
|
wxString fn = GetFileName();
|
||||||
|
|
||||||
if( wxFile::Exists( fn ) )
|
if( wxFile::Exists( fn ) )
|
||||||
return IsOK( this, wxString::Format( _( "File %s already exists. Overwrite?" ), fn ) );
|
{
|
||||||
|
wxString msg = wxString::Format( _( "File %s already exists." ), fn );
|
||||||
|
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Overwrite" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
return ( dlg.ShowModal() == wxID_OK );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,9 +215,9 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
|
||||||
if( IsCopperLayer( layer ) )
|
if( IsCopperLayer( layer ) )
|
||||||
{
|
{
|
||||||
// An graphic item is put on a copper layer.
|
// An graphic item is put on a copper layer.
|
||||||
// This is sometimes useful, for instance for microwave applications ans net tees.
|
// This is sometimes useful, for instance for microwave applications and net tees.
|
||||||
// Because the DRC does not handle graphic items, it can break boards.
|
// However, because the DRC does not handle graphic items, it can break boards.
|
||||||
// Therefore a confirmation is requested
|
// Therefore a confirmation is required.
|
||||||
if( !IsOK( this, _( "The graphic item will be on a copper layer.\n"
|
if( !IsOK( this, _( "The graphic item will be on a copper layer.\n"
|
||||||
"This is very dangerous because DRC does not handle it.\n"
|
"This is very dangerous because DRC does not handle it.\n"
|
||||||
"Are you sure?" ) ) )
|
"Are you sure?" ) ) )
|
||||||
|
|
|
@ -298,7 +298,12 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
||||||
{
|
{
|
||||||
if( !IsOK( this, _( "Current Footprint will be lost and this operation cannot be undone. Continue ?" ) ) )
|
KIDIALOG dlg( this, _( "The current footprint contains unsaved changes." ),
|
||||||
|
_( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Discard Changes" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,7 +529,12 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
if( GetScreen()->IsModify() && !GetBoard()->IsEmpty() )
|
||||||
{
|
{
|
||||||
if( !IsOK( this, _( "Current Footprint will be lost and this operation cannot be undone. Continue ?" ) ) )
|
KIDIALOG dlg( this, _( "The current footprint contains unsaved changes." ),
|
||||||
|
_( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Discard Changes" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,15 +58,11 @@
|
||||||
|
|
||||||
// unique, "file local" translations:
|
// unique, "file local" translations:
|
||||||
|
|
||||||
#define FMT_OK_OVERWRITE _( "Library \"%s\" exists, OK to replace ?" )
|
|
||||||
#define FMT_CREATE_LIB _( "Create New Library Folder (the .pretty folder is the library)" )
|
|
||||||
#define FMT_OK_DELETE _( "OK to delete footprint \"%s\" in library \"%s\"" )
|
#define FMT_OK_DELETE _( "OK to delete footprint \"%s\" in library \"%s\"" )
|
||||||
#define FMT_IMPORT_MODULE _( "Import Footprint" )
|
#define FMT_IMPORT_MODULE _( "Import Footprint" )
|
||||||
#define FMT_FILE_NOT_FOUND _( "File \"%s\" not found" )
|
#define FMT_FILE_NOT_FOUND _( "File \"%s\" not found" )
|
||||||
#define FMT_NOT_MODULE _( "Not a footprint file" )
|
#define FMT_NOT_MODULE _( "Not a footprint file" )
|
||||||
#define FMT_MOD_NOT_FOUND _( "Unable to find or load footprint \"%s\" from lib path \"%s\"" )
|
#define FMT_MOD_NOT_FOUND _( "Unable to find or load footprint \"%s\" from lib path \"%s\"" )
|
||||||
#define FMT_BAD_PATH _( "Unable to find or load footprint from path \"%s\"" )
|
|
||||||
#define FMT_BAD_PATHS _( "The footprint library \"%s\" could not be found in any of the search paths." )
|
|
||||||
#define FMT_LIB_READ_ONLY _( "Library \"%s\" is read only, not writable" )
|
#define FMT_LIB_READ_ONLY _( "Library \"%s\" is read only, not writable" )
|
||||||
|
|
||||||
#define FMT_EXPORT_MODULE _( "Export Footprint" )
|
#define FMT_EXPORT_MODULE _( "Export Footprint" )
|
||||||
|
@ -76,7 +72,6 @@
|
||||||
#define FMT_MOD_DELETED _( "Footprint \"%s\" deleted from library \"%s\"" )
|
#define FMT_MOD_DELETED _( "Footprint \"%s\" deleted from library \"%s\"" )
|
||||||
#define FMT_MOD_CREATE _( "New Footprint" )
|
#define FMT_MOD_CREATE _( "New Footprint" )
|
||||||
|
|
||||||
#define FMT_MOD_EXISTS _( "Footprint \"%s\" already exists in library \"%s\"" )
|
|
||||||
#define FMT_NO_REF_ABORTED _( "No footprint name defined." )
|
#define FMT_NO_REF_ABORTED _( "No footprint name defined." )
|
||||||
#define FMT_SELECT_LIB _( "Select Library" )
|
#define FMT_SELECT_LIB _( "Select Library" )
|
||||||
|
|
||||||
|
@ -514,9 +509,12 @@ wxString PCB_BASE_EDIT_FRAME::CreateNewLibrary(const wxString& aLibName )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( FMT_OK_OVERWRITE, GetChars( libPath ) );
|
wxString msg = wxString::Format( _( "Library %s already exists." ), libPath );
|
||||||
|
KIDIALOG dlg( this, msg, _( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Overwrite" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
if( !IsOK( this, msg ) )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
|
|
||||||
pi->FootprintLibDelete( libPath );
|
pi->FootprintLibDelete( libPath );
|
||||||
|
|
|
@ -997,7 +997,12 @@ void ROUTER_TOOL::performDragging( int aMode )
|
||||||
|
|
||||||
if( m_startItem && m_startItem->IsLocked() )
|
if( m_startItem && m_startItem->IsLocked() )
|
||||||
{
|
{
|
||||||
if( !IsOK( frame(), _( "The item is locked. Do you want to continue?" ) ) )
|
KIDIALOG dlg( frame(), _( "The selected item is locked." ), _( "Confirmation" ),
|
||||||
|
wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Drag Anyway" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1146,8 +1151,13 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
if( m_startItem && m_startItem->IsLocked() )
|
if( m_startItem && m_startItem->IsLocked() )
|
||||||
{
|
{
|
||||||
if( !IsOK( frame(), _( "The item is locked. Do you want to continue?" ) ) )
|
KIDIALOG dlg( frame(), _( "The selected item is locked." ), _( "Confirmation" ),
|
||||||
return false;
|
wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Drag Anyway" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VECTOR2I p0 = controls()->GetCursorPosition();
|
VECTOR2I p0 = controls()->GetCursorPosition();
|
||||||
|
|
|
@ -237,11 +237,14 @@ int ALIGN_DISTRIBUTE_TOOL::checkLockedStatus( const SELECTION &selection ) const
|
||||||
|
|
||||||
if( containsLocked )
|
if( containsLocked )
|
||||||
{
|
{
|
||||||
if( IsOK( getEditFrame< PCB_EDIT_FRAME >(),
|
KIDIALOG dlg( getEditFrame< PCB_EDIT_FRAME >(),
|
||||||
_( "Selection contains locked items. Do you want to continue?" ) ) )
|
_( "Selection contains locked items. Do you want to continue?" ),
|
||||||
{
|
_( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
|
dlg.SetOKLabel( _( "Continue" ) );
|
||||||
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
if( dlg.ShowModal() == wxID_OK )
|
||||||
return SELECTION_LOCK_OVERRIDE;
|
return SELECTION_LOCK_OVERRIDE;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return SELECTION_LOCKED;
|
return SELECTION_LOCKED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,17 +185,19 @@ bool ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck )
|
||||||
|
|
||||||
if( aCheck )
|
if( aCheck )
|
||||||
{
|
{
|
||||||
bool cancel = !outOfDate || !IsOK( nullptr, _( "Zone fills are out-of-date. Re-fill?" ) );
|
bool refill = false;
|
||||||
|
|
||||||
if( m_progressReporter )
|
if( outOfDate )
|
||||||
{
|
{
|
||||||
// Sigh. Patch another case of "fall behind" dialogs on Mac.
|
KIDIALOG dlg( m_progressReporter, _( "Zone fills are out-of-date. Refill?" ),
|
||||||
if( m_progressReporter->GetParent() )
|
_( "Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
|
||||||
m_progressReporter->GetParent()->Raise();
|
dlg.SetOKCancelLabels( _( "Refill" ), _( "Continue without Refill" ) );
|
||||||
m_progressReporter->Raise();
|
dlg.DoNotShowCheckbox();
|
||||||
|
|
||||||
|
refill = ( dlg.ShowModal() == wxID_OK );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cancel )
|
if( !refill )
|
||||||
{
|
{
|
||||||
if( m_commit )
|
if( m_commit )
|
||||||
m_commit->Revert();
|
m_commit->Revert();
|
||||||
|
|
Loading…
Reference in New Issue