← Back to team overview

kicad-developers team mailing list archive

pcbnew patch: store user selection "single page" in print dialog

 


This path saves "single page" user choice in pcbnew printing dialog in the same way as all other controls in this dialog stored.


--
Regards,
  Sergey A. Borshch            mailto: sb-sf@xxxxxxxxxxxxxxx
    SB ELDI ltd. Riga, Latvia
=== modified file 'pcbnew/pcbplot.h'
--- pcbnew/pcbplot.h	2012-11-19 16:19:38 +0000
+++ pcbnew/pcbplot.h	2013-03-11 00:16:19 +0000
@@ -29,6 +29,7 @@
 #define OPTKEY_PRINT_PAGE_FRAME      wxT( "PrintPageFrame" )
 #define OPTKEY_PRINT_MONOCHROME_MODE wxT( "PrintMonochrome" )
 #define OPTKEY_PRINT_PADS_DRILL      wxT( "PrintPadsDrillOpt" )
+#define OPTKEY_PRINT_PAGE_PER_LAYER  wxT( "PrintSinglePage" )
 #define OPTKEY_PLOT_X_FINESCALE_ADJ  wxT( "PlotXFineScaleAdj" )
 #define OPTKEY_PLOT_Y_FINESCALE_ADJ  wxT( "PlotYFineScaleAdj" )
 #define CONFIG_PS_FINEWIDTH_ADJ      wxT( "PSPlotFineWidthAdj" )

=== modified file 'pcbnew/dialogs/dialog_print_using_printer.cpp'
--- pcbnew/dialogs/dialog_print_using_printer.cpp	2012-11-29 01:50:58 +0000
+++ pcbnew/dialogs/dialog_print_using_printer.cpp	2013-03-11 00:32:29 +0000
@@ -215,6 +215,7 @@
         m_config->Read( OPTKEY_PRINT_PADS_DRILL,  &tmp, PRINT_PARAMETERS::SMALL_DRILL_SHAPE );
         s_Parameters.m_DrillShapeOpt = (PRINT_PARAMETERS::DrillShapeOptT) tmp;
 
+        m_config->Read( OPTKEY_PRINT_PAGE_PER_LAYER, &s_Parameters.m_OptionPrintPage, 1);
         // Test for a reasonnable scale value. Set to 1 if problem
         if( s_Parameters.m_XScaleAdjust < MIN_SCALE ||
             s_Parameters.m_YScaleAdjust < MIN_SCALE ||
@@ -275,6 +276,8 @@
         m_FineAdjustXscaleOpt->Enable(enable);
     if( m_FineAdjustYscaleOpt )
         m_FineAdjustYscaleOpt->Enable(enable);
+        
+    m_PagesOption->SetSelection(s_Parameters.m_OptionPrintPage);
 }
 
 
@@ -321,6 +324,7 @@
         m_config->Write( OPTKEY_PRINT_PAGE_FRAME, s_Parameters.m_Print_Sheet_Ref);
         m_config->Write( OPTKEY_PRINT_MONOCHROME_MODE, s_Parameters.m_Print_Black_and_White);
         m_config->Write( OPTKEY_PRINT_PADS_DRILL, (long) s_Parameters.m_DrillShapeOpt );
+        m_config->Write( OPTKEY_PRINT_PAGE_PER_LAYER, s_Parameters.m_OptionPrintPage );
         wxString layerKey;
         for( int layer = 0; layer < NB_LAYERS;  ++layer )
         {


Follow ups