Move message dialogs to KICAD_MESSAGE_DIALOG define

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22830
This commit is contained in:
Mark Roszko
2026-01-25 12:34:55 -05:00
parent f6c3627e66
commit 314735e2fc
25 changed files with 121 additions and 112 deletions
+2 -1
View File
@@ -39,6 +39,7 @@
#include <wx/dcclient.h>
#include <wx/log.h>
#include <wx/string.h>
#include <confirm.h>
#define DEFAULT_DPI 300 // the image DPI used in formats that do not define a DPI
@@ -586,7 +587,7 @@ bool DROP_FILE::OnDropFiles( wxCoord x, wxCoord y, const wxArrayString& filename
{
wxString cap = _( "Replace Loaded File?" );
wxString msg = _( "There is already a file loaded. Do you want to replace it?" );
wxMessageDialog acceptFileDlg( m_panel, msg, cap, wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
KICAD_MESSAGE_DIALOG acceptFileDlg( m_panel, msg, cap, wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
int replace = acceptFileDlg.ShowModal();
if( replace == wxID_NO )
+5 -4
View File
@@ -27,6 +27,7 @@
#include <kiplatform/app.h>
#include <project.h>
#include <common.h>
#include <confirm.h>
#include <env_vars.h>
#include <advanced_config.h>
#include <reporter.h>
@@ -783,10 +784,10 @@ bool WarnUserIfOperatingSystemUnsupported()
if( !KIPLATFORM::APP::IsOperatingSystemUnsupported() )
return false;
wxMessageDialog dialog( nullptr,
_( "This operating system is not supported "
"by KiCad and its dependencies." ),
_( "Unsupported Operating System" ), wxOK | wxICON_EXCLAMATION );
KICAD_MESSAGE_DIALOG dialog( nullptr,
_( "This operating system is not supported "
"by KiCad and its dependencies." ),
_( "Unsupported Operating System" ), wxOK | wxICON_EXCLAMATION );
dialog.SetExtendedMessage( _( "Any issues with KiCad on this system cannot "
"be reported to the official bugtracker." ) );
+3 -8
View File
@@ -271,14 +271,9 @@ bool IsOK( wxWindow* aParent, const wxString& aMessage )
int icon = wxICON_QUESTION;
#endif
#if !defined( __WXGTK__ )
KICAD_RICH_MESSAGE_DIALOG_BASE dlg( aParent, aMessage, _( "Confirmation" ),
wxOK | wxCANCEL | wxOK_DEFAULT |
wxCENTRE | icon | wxSTAY_ON_TOP );
#else
wxMessageDialog dlg( aParent, aMessage, _( "Confirmation" ),
wxOK | wxCANCEL | wxOK_DEFAULT | wxCENTRE | icon | wxSTAY_ON_TOP );
#endif
KICAD_MESSAGE_DIALOG dlg( aParent, aMessage, _( "Confirmation" ),
wxOK | wxCANCEL | wxOK_DEFAULT |
wxCENTRE | icon | wxSTAY_ON_TOP );
dlg.SetOKCancelLabels( _( "&Yes" ), _( "&No" ) );
@@ -30,6 +30,7 @@
#include <grid_tricks.h>
#include <widgets/std_bitmap_button.h>
#include <bitmaps.h>
#include <confirm.h>
#include <design_block.h>
@@ -102,7 +103,7 @@ bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromWindow()
illegalCh,
m_textName->GetValue() );
wxMessageDialog errdlg( this, msg, _( "Error" ) );
KICAD_MESSAGE_DIALOG errdlg( this, msg, _( "Error" ) );
errdlg.ShowModal();
return false;
}
+2 -2
View File
@@ -307,8 +307,8 @@ void DIALOG_GIT_REPOSITORY::OnTestClick( wxCommandEvent& event )
git_remote_disconnect( remote );
auto dlg = wxMessageDialog( this, wxEmptyString, _( "Test Connection" ),
wxOK | wxICON_INFORMATION );
auto dlg = KICAD_MESSAGE_DIALOG( this, wxEmptyString, _( "Test Connection" ),
wxOK | wxICON_INFORMATION );
if( success )
{
+4 -4
View File
@@ -1276,12 +1276,12 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type, FI
if( !wxFileName::FileExists( fn ) )
{
wxMessageDialog dlg( this, wxString::Format( _( "File '%s' was not found.\n" ), fn ), _( "Error" ),
wxYES_NO | wxYES_DEFAULT | wxICON_ERROR | wxCENTER );
KICAD_MESSAGE_DIALOG dlg( this, wxString::Format( _( "File '%s' was not found.\n" ), fn ), _( "Error" ),
wxYES_NO | wxYES_DEFAULT | wxICON_ERROR | wxCENTER );
dlg.SetExtendedMessage( _( "Do you want to remove it from list of recently opened files?" ) );
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Remove" ) ),
wxMessageDialog::ButtonLabel( _( "Keep" ) ) );
dlg.SetYesNoLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Remove" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Keep" ) ) );
if( dlg.ShowModal() == wxID_YES )
aFileHistory->RemoveFileFromHistory( i );
+2 -2
View File
@@ -483,7 +483,7 @@ bool LIB_TABLE_GRID_TRICKS::VerifyTable( WX_GRID* aGrid, std::function<void( int
aErrorHandler( r, COL_NICKNAME );
wxMessageDialog errdlg( topLevelParent, msg, _( "Library Nickname Error" ) );
KICAD_MESSAGE_DIALOG errdlg( topLevelParent, msg, _( "Library Nickname Error" ) );
errdlg.ShowModal();
return false;
}
@@ -516,7 +516,7 @@ bool LIB_TABLE_GRID_TRICKS::VerifyTable( WX_GRID* aGrid, std::function<void( int
// go to the lower of the two rows, it is technically the duplicate:
aErrorHandler( r2, 1 );
wxMessageDialog errdlg( topLevelParent, msg, _( "Library Nickname Error" ) );
KICAD_MESSAGE_DIALOG errdlg( topLevelParent, msg, _( "Library Nickname Error" ) );
errdlg.ShowModal();
return false;
}
+4 -3
View File
@@ -28,6 +28,7 @@
#include <pgm_base.h>
#include <trace_helpers.h>
#include <wildcards_and_files_ext.h>
#include <confirm.h>
#include <git2.h>
#include <wx/filename.h>
@@ -468,7 +469,7 @@ static bool commitSnapshotWithLock( git_repository* repo, git_index* index,
else if( rc != 0 )
{
wxLogTrace( traceAutoSave, wxS( "File %s status error %d " ), relPath, rc );
filesArrStr.emplace_back( relPathStr ); // Add anyway even if the file is untracked.
filesArrStr.emplace_back( relPathStr ); // Add anyway even if the file is untracked.
}
}
@@ -1501,8 +1502,8 @@ bool confirmFileDeletion( wxWindow* aParent, const std::vector<wxString>& aFiles
aFilesToDelete.size() - displayCount );
}
wxMessageDialog dlg( aParent, message, _( "Delete Files during Restore" ),
wxYES_NO | wxCANCEL | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG dlg( aParent, message, _( "Delete Files during Restore" ),
wxYES_NO | wxCANCEL | wxICON_QUESTION );
dlg.SetYesNoCancelLabels( _( "Proceed" ), _( "Keep All Files" ), _( "Abort" ) );
dlg.SetExtendedMessage(
_( "Choosing 'Keep All Files' will restore the selected commit but retain any existing "
+6 -5
View File
@@ -45,6 +45,7 @@
#include <executable_names.h>
#include <gestfich.h>
#include <tools/kicad_manager_actions.h>
#include <confirm.h>
#define URL_GET_INVOLVED wxS( "https://go.kicad.org/contribute/" )
#define URL_DONATE wxS( "https://go.kicad.org/app-donate" )
@@ -280,7 +281,7 @@ int COMMON_CONTROL::ShowProjectManager( const TOOL_EVENT& aEvent )
if( top && top->GetFrameType() == KICAD_MAIN_FRAME_T )
showFrame( top );
else
wxMessageDialog( m_frame, _( "Can not switch to project manager in stand-alone mode." ) );
KICAD_MESSAGE_DIALOG( m_frame, _( "Can not switch to project manager in stand-alone mode." ) );
return 0;
}
@@ -324,8 +325,8 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
msg = wxString::Format( _( "Help file '%s' or\n'%s' could not be found.\n"
"Do you want to access the KiCad online help?" ),
names[0], names[1] );
wxMessageDialog dlg( nullptr, msg, _( "File Not Found" ),
wxYES_NO | wxNO_DEFAULT | wxCANCEL );
KICAD_MESSAGE_DIALOG dlg( nullptr, msg, _( "File Not Found" ),
wxYES_NO | wxNO_DEFAULT | wxCANCEL );
if( dlg.ShowModal() != wxID_YES )
return -1;
@@ -344,8 +345,8 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
msg = wxString::Format( _( "Help file '%s' could not be found.\n"
"Do you want to access the KiCad online help?" ),
base_name );
wxMessageDialog dlg( nullptr, msg, _( "File Not Found" ),
wxYES_NO | wxNO_DEFAULT | wxCANCEL );
KICAD_MESSAGE_DIALOG dlg( nullptr, msg, _( "File Not Found" ),
wxYES_NO | wxNO_DEFAULT | wxCANCEL );
if( dlg.ShowModal() != wxID_YES )
return -1;
+1 -1
View File
@@ -513,7 +513,7 @@ bool WIDGET_HOTKEY_LIST::resolveKeyConflicts( TOOL_ACTION* aAction, long aKey )
conflictingAction->GetFriendlyName(),
HOTKEY_STORE::GetSectionName( conflictingAction ) );
wxMessageDialog dlg( GetParent(), msg, _( "Confirm change" ), wxYES_NO | wxNO_DEFAULT );
KICAD_MESSAGE_DIALOG dlg( GetParent(), msg, _( "Confirm change" ), wxYES_NO | wxNO_DEFAULT );
if( dlg.ShowModal() == wxID_YES )
{
+3 -2
View File
@@ -46,6 +46,7 @@
#include <dialogs/dialog_text_entry.h>
#include <string_utils.h>
#include <kiplatform/ui.h>
#include <confirm.h>
#include <wx/ffile.h>
#include <wx/filedlg.h>
@@ -410,8 +411,8 @@ void DIALOG_ERC::OnDeleteAllClick( wxCommandEvent& event )
if( numExcluded > 0 )
{
wxMessageDialog dlg( this, _( "Delete exclusions too?" ), _( "Delete All Markers" ),
wxYES_NO | wxCANCEL | wxCENTER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG dlg( this, _( "Delete exclusions too?" ), _( "Delete All Markers" ),
wxYES_NO | wxCANCEL | wxCENTER | wxICON_QUESTION );
dlg.SetYesNoLabels( _( "Errors and Warnings Only" ),
_( "Errors, Warnings and Exclusions" ) );
+7 -6
View File
@@ -32,6 +32,7 @@
#include <sch_edit_frame.h>
#include <set>
#include <symbol_preview_widget.h>
#include <confirm.h>
#include <wx/msgdlg.h>
#include <wx/dcclient.h>
@@ -279,12 +280,12 @@ bool DIALOG_RESCUE_EACH::TransferDataFromWindow()
void DIALOG_RESCUE_EACH::OnNeverShowClick( wxCommandEvent& aEvent )
{
wxMessageDialog dlg( GetParent(),
_( "Stop showing this tool?\n"
"No changes will be made.\n\n"
"This setting can be changed from the \"Preferences\" dialog,\n"
"and the tool can be activated manually from the \"Tools\" menu." ),
_( "Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG dlg( GetParent(),
_( "Stop showing this tool?\n"
"No changes will be made.\n\n"
"This setting can be changed from the \"Preferences\" dialog,\n"
"and the tool can be activated manually from the \"Tools\" menu." ),
_( "Rescue Symbols" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
int resp = dlg.ShowModal ();
if( resp == wxID_YES )
+5 -4
View File
@@ -307,14 +307,15 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow()
if( fn.IsAbsolute() && fn.MakeRelativeTo( screenFileName.GetPath() ) )
{
wxMessageDialog makeRelDlg( this, _( "Use relative path for sheet file?" ), _( "Sheet File Path" ),
wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION | wxCENTER );
KICAD_MESSAGE_DIALOG makeRelDlg( this, _( "Use relative path for sheet file?" ),
_( "Sheet File Path" ),
wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION | wxCENTER );
makeRelDlg.SetExtendedMessage( _( "Using relative hierarchical sheet file name paths improves "
"schematic portability across systems and platforms. Using "
"absolute paths can result in portability issues." ) );
makeRelDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Use Relative Path" ) ),
wxMessageDialog::ButtonLabel( _( "Use Absolute Path" ) ) );
makeRelDlg.SetYesNoLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Use Relative Path" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Use Absolute Path" ) ) );
if( makeRelDlg.ShowModal() == wxID_YES )
{
+9 -9
View File
@@ -353,10 +353,10 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
errorMsg.Printf( _( "Cannot create project remap back up folder '%s'." ),
destFileName.GetPath() );
wxMessageDialog dlg( this, errorMsg, _( "Backup Error" ),
wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
KICAD_MESSAGE_DIALOG dlg( this, errorMsg, _( "Backup Error" ),
wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
dlg.SetYesNoLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Continue with Rescue" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Abort Rescue" ) ) );
if( dlg.ShowModal() == wxID_NO )
return false;
@@ -525,13 +525,13 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
if( !errorMsg.IsEmpty() )
{
wxMessageDialog dlg( this, _( "Some of the project files could not be backed up." ),
_( "Backup Error" ),
wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG dlg( this, _( "Some of the project files could not be backed up." ),
_( "Backup Error" ),
wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
errorMsg.Trim();
dlg.SetExtendedMessage( errorMsg );
dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
dlg.SetYesNoLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Continue with Rescue" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Abort Rescue" ) ) );
if( dlg.ShowModal() == wxID_NO )
return false;
@@ -35,6 +35,7 @@
#include <bitmaps.h>
#include <richio.h>
#include <string_utils.h>
#include <confirm.h>
PANEL_TEMPLATE_FIELDNAMES::PANEL_TEMPLATE_FIELDNAMES( wxWindow* aWindow,
TEMPLATES* aProjectTemplateMgr ) :
@@ -213,7 +214,7 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow()
msg.Printf( _( "The field name '%s' contains trailing and/or leading white space." ),
field.m_Name );
wxMessageDialog dlg( this, msg, _( "Warning" ), wxOK|wxCANCEL|wxCENTER|wxICON_WARNING );
KICAD_MESSAGE_DIALOG dlg( this, msg, _( "Warning" ), wxOK | wxCANCEL | wxCENTER | wxICON_WARNING );
dlg.SetExtendedMessage( _( "This may result in what appears to be duplicate field "
"names but are actually unique names differing only by "
@@ -221,8 +222,8 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataFromWindow()
"characters will have no effect on existing symbol "
"field names." ) );
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( _( "Remove White Space" ) ),
wxMessageDialog::ButtonLabel( _( "Keep White Space" ) ) );
dlg.SetOKCancelLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Remove White Space" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Keep White Space" ) ) );
if( dlg.ShowModal() == wxID_OK )
field.m_Name = trimmedName;
+10 -11
View File
@@ -633,12 +633,11 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
"the schematic or recovery of the symbol cache library file and "
"reloading the schematic is required." );
wxMessageDialog dlgMissingCache( this, msg, _( "Warning" ),
wxOK | wxCANCEL | wxICON_EXCLAMATION | wxCENTER );
KICAD_MESSAGE_DIALOG dlgMissingCache( this, msg, _( "Warning" ),
wxOK | wxCANCEL | wxICON_EXCLAMATION | wxCENTER );
dlgMissingCache.SetExtendedMessage( extMsg );
dlgMissingCache.SetOKCancelLabels(
wxMessageDialog::ButtonLabel( _( "Load Without Cache File" ) ),
wxMessageDialog::ButtonLabel( _( "Abort" ) ) );
dlgMissingCache.SetOKCancelLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Load Without Cache File" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Abort" ) ) );
if( dlgMissingCache.ShowModal() == wxID_CANCEL )
{
@@ -1196,8 +1195,8 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
"Make sure you have write permissions and try again." ),
newFileName.GetPath() );
wxMessageDialog dlgBadPath( this, msg, _( "Error" ),
wxOK | wxICON_EXCLAMATION | wxCENTER );
KICAD_MESSAGE_DIALOG dlgBadPath( this, msg, _( "Error" ),
wxOK | wxICON_EXCLAMATION | wxCENTER );
dlgBadPath.ShowModal();
return false;
@@ -1224,8 +1223,8 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
if( !PrepareSaveAsFiles( Schematic(), screens, fn, newFileName, saveCopy,
copySubsheets, includeExternSheets, filenameMap, msg ) )
{
wxMessageDialog dlgBadFilePath( this, msg, _( "Error" ),
wxOK | wxICON_EXCLAMATION | wxCENTER );
KICAD_MESSAGE_DIALOG dlgBadFilePath( this, msg, _( "Error" ),
wxOK | wxICON_EXCLAMATION | wxCENTER );
dlgBadFilePath.ShowModal();
return false;
@@ -1314,8 +1313,8 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs )
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER |
wxICON_EXCLAMATION );
dlg.ShowDetailedText( _( "The following files will be overwritten:\n\n" ) + msg );
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( _( "Overwrite Files" ) ),
wxMessageDialog::ButtonLabel( _( "Abort Project Save" ) ) );
dlg.SetOKCancelLabels( KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Overwrite Files" ) ),
KICAD_MESSAGE_DIALOG::ButtonLabel( _( "Abort Project Save" ) ) );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
+4 -4
View File
@@ -549,8 +549,8 @@ bool RESCUER::RescueProject( wxWindow* aParent, RESCUER& aRescuer, bool aRunning
{
if( aRunningOnDemand )
{
wxMessageDialog dlg( aParent, _( "This project has nothing to rescue." ),
_( "Project Rescue Helper" ) );
KICAD_MESSAGE_DIALOG dlg( aParent, _( "This project has nothing to rescue." ),
_( "Project Rescue Helper" ) );
dlg.ShowModal();
}
@@ -564,8 +564,8 @@ bool RESCUER::RescueProject( wxWindow* aParent, RESCUER& aRescuer, bool aRunning
// have clicked cancel by mistake, and should have some indication of that.
if( !aRescuer.GetChosenCandidateCount() )
{
wxMessageDialog dlg( aParent, _( "No symbols were rescued." ),
_( "Project Rescue Helper" ) );
KICAD_MESSAGE_DIALOG dlg( aParent, _( "No symbols were rescued." ),
_( "Project Rescue Helper" ) );
dlg.ShowModal();
// Set the modified flag even on Cancel. Many users seem to instinctively want to Save at
+20 -20
View File
@@ -218,9 +218,9 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
msg = _( "The entire schematic could not be loaded. Errors occurred attempting "
"to load hierarchical sheet schematics." );
wxMessageDialog msgDlg1( this, msg, _( "Schematic Load Error" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG msgDlg1( this, msg, _( "Schematic Load Error" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
msgDlg1.SetOKLabel( wxMessageDialog::ButtonLabel( _( "Use partial schematic" ) ) );
msgDlg1.SetExtendedMessage( pi->GetError() );
@@ -307,8 +307,8 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
newScreens.GetLibNicknames( names );
wxMessageDialog::ButtonLabel okButtonLabel( _( "Continue Load" ) );
wxMessageDialog::ButtonLabel cancelButtonLabel( _( "Cancel Load" ) );
KICAD_MESSAGE_DIALOG::ButtonLabel okButtonLabel( _( "Continue Load" ) );
KICAD_MESSAGE_DIALOG::ButtonLabel cancelButtonLabel( _( "Cancel Load" ) );
// Prior to schematic file format 20221002, all symbol instance data was saved in the root
// sheet so loading a hierarchical sheet that is not the root sheet will have no symbol
@@ -324,8 +324,8 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
"Loading the project that uses this schematic file and saving to the "
"latest file version will resolve this issue.\n\n"
"Do you wish to continue?" );
wxMessageDialog msgDlg7( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG msgDlg7( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER | wxICON_QUESTION );
msgDlg7.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
if( msgDlg7.ShowModal() == wxID_CANCEL )
@@ -352,9 +352,9 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
"from the current project library table. This may result in broken "
"symbol library references for the loaded schematic.\n\n"
"Do you wish to continue?" );
wxMessageDialog msgDlg3( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG msgDlg3( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
msgDlg3.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
if( msgDlg3.ShowModal() == wxID_CANCEL )
@@ -392,8 +392,8 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
"Linking the file to this project may result in missing or "
"incorrect symbol library references.\n\n"
"Do you wish to continue?" );
wxMessageDialog msgDlg4( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER
KICAD_MESSAGE_DIALOG msgDlg4( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER
| wxICON_QUESTION );
msgDlg4.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
@@ -437,9 +437,9 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
"are missing from the selected schematic project library table. "
"This may result in broken symbol library references.\n\n"
"Do you wish to continue?" );
wxMessageDialog msgDlg5( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG msgDlg5( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
msgDlg5.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
if( msgDlg5.ShowModal() == wxID_CANCEL )
@@ -498,9 +498,9 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
"in the current library table. This conflict cannot be resolved and "
"may result in broken symbol library references.\n\n"
"Do you wish to continue?" );
wxMessageDialog msgDlg6( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG msgDlg6( this, msg, _( "Continue Load Schematic" ),
wxOK | wxCANCEL | wxCANCEL_DEFAULT |
wxCENTER | wxICON_QUESTION );
msgDlg6.SetOKCancelLabels( okButtonLabel, cancelButtonLabel );
if( msgDlg6.ShowModal() == wxID_CANCEL )
@@ -565,8 +565,8 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aCurr
projectTable->Save().map_error(
[&]( const LIBRARY_ERROR& aError )
{
wxMessageDialog dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
KICAD_MESSAGE_DIALOG dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
dlg.SetExtendedMessage( aError.message );
dlg.ShowModal();
} );
+8 -8
View File
@@ -1196,8 +1196,8 @@ wxString SYMBOL_EDIT_FRAME::AddLibraryFile( bool aCreateNew )
table->Save().map_error(
[&]( const LIBRARY_ERROR& aError )
{
wxMessageDialog dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
KICAD_MESSAGE_DIALOG dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
dlg.SetExtendedMessage( aError.message );
dlg.ShowModal();
@@ -1247,8 +1247,8 @@ void SYMBOL_EDIT_FRAME::DdAddLibrary( wxString aLibFile )
table->Save().map_error(
[&]( const LIBRARY_ERROR& aError )
{
wxMessageDialog dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
KICAD_MESSAGE_DIALOG dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
dlg.SetExtendedMessage( aError.message );
dlg.ShowModal();
@@ -1987,8 +1987,8 @@ bool SYMBOL_EDIT_FRAME::addLibTableEntry( const wxString& aLibFile, LIBRARY_TABL
table->Save().map_error(
[&]( const LIBRARY_ERROR& aError )
{
wxMessageDialog dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
KICAD_MESSAGE_DIALOG dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
dlg.SetExtendedMessage( aError.message );
dlg.ShowModal();
@@ -2056,8 +2056,8 @@ bool SYMBOL_EDIT_FRAME::replaceLibTableEntry( const wxString& aLibNickname, cons
table->Save().map_error(
[&]( const LIBRARY_ERROR& aError )
{
wxMessageDialog dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
KICAD_MESSAGE_DIALOG dlg( this, _( "Error saving library table." ), _( "File Save Error" ),
wxOK | wxICON_ERROR );
dlg.SetExtendedMessage( aError.message );
dlg.ShowModal();
+1 -1
View File
@@ -1268,7 +1268,7 @@ void SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary()
for( const wxString& name : derived )
msg += name + wxT( "\n" );
KICAD_MESSAGE_DIALOG_BASE dlg( this, msg, _( "Warning" ), wxYES_NO | wxICON_WARNING | wxCENTER );
KICAD_MESSAGE_DIALOG dlg( this, msg, _( "Warning" ), wxYES_NO | wxICON_WARNING | wxCENTER );
dlg.SetExtendedMessage( wxT( " " ) );
dlg.SetYesNoLabels( _( "Delete All Listed Symbols" ), _( "Cancel" ) );
@@ -31,6 +31,7 @@
#include <kiface_base.h>
#include <layer_ids.h>
#include <lset.h>
#include <confirm.h>
#include <dialogs/dialog_map_gerber_layers_to_pcb.h>
@@ -210,13 +211,12 @@ void DIALOG_MAP_GERBER_LAYERS_TO_PCB::initDialog()
if( numMappedGerbers > 0 )
{
// See if the user wants to map the Altium Gerbers to known KiCad PCB layers
int returnVal = wxMessageBox( wxString::Format( _( "Gerbers with known layers: %d" ), numMappedGerbers )
KICAD_MESSAGE_DIALOG dlg ( this,
wxString::Format( _( "Gerbers with known layers: %d" ), numMappedGerbers )
+ wxT( "\n\n" ) + _( "Assign to matching PCB layers?" ),
_( "Automatic Layer Assignment" ),
wxOK | wxCANCEL | wxOK_DEFAULT );
_( "Automatic Layer Assignment" ), wxOK | wxCANCEL | wxOK_DEFAULT );
if( returnVal == wxOK )
if( dlg.ShowModal() == wxOK )
{
int total_copper = 0;
+5
View File
@@ -39,12 +39,17 @@
class wxWindow;
// On Windows, to have the best dark mode experience we need to sub in the generic dialogs
// as wx can't retheme the native dialogs
#if defined( _WIN32 ) && wxCHECK_VERSION( 3, 3, 0 )
#define KICAD_MESSAGE_DIALOG_BASE wxGenericMessageDialog
#define KICAD_RICH_MESSAGE_DIALOG_BASE wxGenericRichMessageDialog
// incase we in the future declare our own message dialog class
#define KICAD_MESSAGE_DIALOG KICAD_MESSAGE_DIALOG_BASE
#else
#define KICAD_MESSAGE_DIALOG_BASE wxMessageDialog
#define KICAD_RICH_MESSAGE_DIALOG_BASE wxRichMessageDialog
#define KICAD_MESSAGE_DIALOG KICAD_MESSAGE_DIALOG_BASE
#endif
+2 -2
View File
@@ -120,8 +120,8 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( const wxString& aWindowTitle,
msg = _( "Error creating new directory. Please try a different path. The "
"project cannot be imported." );
wxMessageDialog dirErrorDlg( this, msg, _( "Error" ),
wxOK_DEFAULT | wxICON_ERROR );
KICAD_MESSAGE_DIALOG dirErrorDlg( this, msg, _( "Error" ),
wxOK_DEFAULT | wxICON_ERROR );
dirErrorDlg.ShowModal();
return;
}
+5 -5
View File
@@ -134,9 +134,9 @@ bool PROJECT_TREE_ITEM::Rename( const wxString& name, bool check )
if( check && !ext.IsEmpty() && !newFile.Lower().EndsWith( full_ext ) )
{
wxMessageDialog dialog( m_parent, _( "Changing file extension will change file type.\n"
"Do you want to continue ?" ),
_( "Rename File" ), wxYES_NO | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG dialog( m_parent, _( "Changing file extension will change file type.\n"
"Do you want to continue ?" ),
_( "Rename File" ), wxYES_NO | wxICON_QUESTION );
if( wxID_YES != dialog.ShowModal() )
return false;
@@ -144,8 +144,8 @@ bool PROJECT_TREE_ITEM::Rename( const wxString& name, bool check )
if( !wxRenameFile( GetFileName(), newFile, false ) )
{
wxMessageDialog( m_parent, _( "Unable to rename file ... " ), _( "Permission denied" ),
wxICON_ERROR | wxOK );
KICAD_MESSAGE_DIALOG( m_parent, _( "Unable to rename file ... " ), _( "Permission denied" ),
wxICON_ERROR | wxOK );
return false;
}
@@ -40,6 +40,7 @@
#include <string_utils.h>
#include <tools/pcb_actions.h>
#include <launch_ext.h>
#include <confirm.h>
#ifdef KICAD_IPC_API
#include <api/api_plugin_manager.h>
@@ -225,7 +226,7 @@ void SCRIPTING_TOOL::ShowPluginFolder()
wxString msg = wxString::Format( _( "The plugin directory '%s' does not exist. Create it?" ), pluginpath );
wxMessageDialog dlg( nullptr, msg, _( "Plugin Directory" ), wxYES_NO | wxICON_QUESTION );
KICAD_MESSAGE_DIALOG dlg( nullptr, msg, _( "Plugin Directory" ), wxYES_NO | wxICON_QUESTION );
if( dlg.ShowModal() == wxID_YES )
{