Commit 781cc00a authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: netlist dialog: add silent mode option, and tool tip to the 2 options...

Pcbnew: netlist dialog: add silent mode option, and tool tip to the 2 options (dry run and silent mode)
dialog_display_info_HTML_base: derived now from dialog_shim.
parent 3b423cb1
......@@ -7,9 +7,9 @@
#ifndef KICAD_BUILD_VERSION
#if defined KICAD_GOST
# define KICAD_BUILD_VERSION "(2013-mar-13 GOST)"
# define KICAD_BUILD_VERSION "(2013-jun-18 GOST)"
#else
# define KICAD_BUILD_VERSION "(2013-mar-13)"
# define KICAD_BUILD_VERSION "(2013-jun-18)"
#endif
#endif
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -9,7 +9,7 @@
///////////////////////////////////////////////////////////////////////////
DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( 400,120 ), wxDefaultSize );
......@@ -23,6 +23,7 @@ DIALOG_DISPLAY_HTML_TEXT_BASE::DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent,
m_buttonClose->SetDefault();
bMainSizer->Add( m_buttonClose, 0, wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
......@@ -36,4 +37,5 @@ DIALOG_DISPLAY_HTML_TEXT_BASE::~DIALOG_DISPLAY_HTML_TEXT_BASE()
// Disconnect Events
m_htmlWindow->Disconnect( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnHTMLLinkClicked ), NULL, this );
m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DISPLAY_HTML_TEXT_BASE::OnCloseButtonClick ), NULL, this );
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_display_info_HTML_base__
#define __dialog_display_info_HTML_base__
#ifndef __DIALOG_DISPLAY_INFO_HTML_BASE_H__
#define __DIALOG_DISPLAY_INFO_HTML_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/html/htmlwin.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
......@@ -26,7 +30,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DISPLAY_HTML_TEXT_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_DISPLAY_HTML_TEXT_BASE : public wxDialog
class DIALOG_DISPLAY_HTML_TEXT_BASE : public DIALOG_SHIM
{
private:
......@@ -34,15 +38,16 @@ class DIALOG_DISPLAY_HTML_TEXT_BASE : public wxDialog
wxButton* m_buttonClose;
// Virtual event handlers, overide them in your derived class
virtual void OnHTMLLinkClicked( wxHtmlLinkEvent& event ){ event.Skip(); }
virtual void OnCloseButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnHTMLLinkClicked( wxHtmlLinkEvent& event ) { event.Skip(); }
virtual void OnCloseButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
wxHtmlWindow* m_htmlWindow;
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 431,120 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DISPLAY_HTML_TEXT_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 431,120 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_HTML_TEXT_BASE();
};
#endif //__dialog_display_info_HTML_base__
#endif //__DIALOG_DISPLAY_INFO_HTML_BASE_H__
......@@ -6,8 +6,8 @@ HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
wxPoint aPos, wxSize aSize)
: DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
{
SetFocus();
ListClear();
Center();
}
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
......
......@@ -39,7 +39,7 @@
#include <invoke_sch_dialog.h>
#include <dialog_helpers.h>
#include <dialog_bom_base.h>
#include <../common/dialogs/dialog_display_info_HTML_base.h>
#include <html_messagebox.h>
#define BOM_PLUGINS_KEY wxT("bom_plugins")
#define BOM_PLUGIN_SELECTED_KEY wxT("bom_plugin_selected")
......@@ -459,8 +459,8 @@ void DIALOG_BOM::OnEditPlugin( wxCommandEvent& event )
void DIALOG_BOM::OnHelp( wxCommandEvent& event )
{
DIALOG_DISPLAY_HTML_TEXT_BASE help_Dlg( this, wxID_ANY,
_("Bom generation Help"),wxDefaultPosition, wxSize( 750,550 ) );
HTML_MESSAGE_BOX help_Dlg( this, _("Bom Generation Help"),
wxDefaultPosition, wxSize( 750,550 ) );
wxString msg = FROM_UTF8(s_bomHelpInfo);
help_Dlg.m_htmlWindow->AppendToPage( msg );
......
......@@ -6,7 +6,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 1992-2013 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -45,6 +45,7 @@
#include <dialog_netlist.h>
#define NETLIST_SILENTMODE_KEY wxT("SilentMode")
void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC )
{
......@@ -92,12 +93,19 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,
{
m_parent = aParent;
m_dc = aDC;
m_config = wxGetApp().GetSettings();
m_silentMode = m_config->Read( NETLIST_SILENTMODE_KEY, 0l );
m_NetlistFilenameCtrl->SetValue( aNetlistFullFilename );
m_cmpNameSourceOpt->SetSelection( m_parent->GetUseCmpFileForFpNames() ? 1 : 0 );
m_checkBoxSilentMode->SetValue( m_silentMode );
GetSizer()->SetSizeHints( this );
}
DIALOG_NETLIST::~DIALOG_NETLIST()
{
m_config->Write( NETLIST_SILENTMODE_KEY, (long) m_silentMode );
}
void DIALOG_NETLIST::OnOpenNetlistClick( wxCommandEvent& event )
{
......@@ -142,7 +150,7 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
}
// Give the user a chance to bail out when making changes from a netlist.
if( !m_checkDryRun->GetValue()
if( !m_checkDryRun->GetValue() && !m_silentMode
&& !m_parent->GetBoard()->IsEmpty()
&& !IsOK( NULL, _( "The changes made by reading the netlist cannot be undone. Are you "
"sure you want to read the netlist?" ) ) )
......
......@@ -40,10 +40,12 @@ class DIALOG_NETLIST : public DIALOG_NETLIST_FBP
private:
PCB_EDIT_FRAME* m_parent;
wxDC* m_dc;
bool m_silentMode;
wxConfig* m_config;
public:
DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC* aDC, const wxString & aNetlistFullFilename );
~DIALOG_NETLIST() {};
~DIALOG_NETLIST();
// return true if the user choice is to use the .cmp file
// created by CvPcb to know footprint names associated to components
......@@ -90,6 +92,10 @@ private:
void OnCompileRatsnestClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnSaveMessagesToFile( wxCommandEvent& aEvent );
void OnClickSilentMode( wxCommandEvent& event )
{
m_silentMode = m_checkBoxSilentMode->GetValue();
}
void OnUpdateUISaveMessagesToFile( wxUpdateUIEvent& aEvent );
void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& aEvent );
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,8 +21,8 @@ class DIALOG_SHIM;
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
......@@ -51,13 +51,14 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM
wxRadioBox* m_ChangeExistingFootprintCtrl;
wxRadioBox* m_DeleteBadTracks;
wxRadioBox* m_RemoveExtraFootprintsCtrl;
wxCheckBox* m_checkDryRun;
wxCheckBox* m_checkBoxSilentMode;
wxButton* m_buttonBrowse;
wxButton* m_buttonRead;
wxButton* m_buttonClose;
wxButton* m_buttonFPTest;
wxButton* m_buttonRebild;
wxButton* m_buttonSaveMessages;
wxButton* m_buttonClose;
wxCheckBox* m_checkDryRun;
wxStaticLine* m_staticline1;
wxStaticText* m_staticTextNetfilename;
wxTextCtrl* m_NetlistFilenameCtrl;
......@@ -65,14 +66,15 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM
wxTextCtrl* m_MessageWindow;
// Virtual event handlers, overide them in your derived class
virtual void OnClickSilentMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOpenNetlistClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnReadNetlistFileClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUpdateUIValidNetlistFile( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTestFootprintsClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCompileRatsnestClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSaveMessagesToFile( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUpdateUISaveMessagesToFile( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment