From cc040df42ac05047f2d0cf020555ae1243e7aa74 Mon Sep 17 00:00:00 2001
From: Henrik Brix Andersen <henrik@brixandersen.dk>
Date: Sun, 5 Feb 2012 14:23:15 +0100
Subject: [PATCH 1/5] Do not display the progress dialog as an application-wide
 modal dialog; modal to the parent window is enough. #189

---
 lib/Slic3r/GUI/SkeinPanel.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm
index 2dadfd9b8..bb00af96e 100644
--- a/lib/Slic3r/GUI/SkeinPanel.pm
+++ b/lib/Slic3r/GUI/SkeinPanel.pm
@@ -183,7 +183,7 @@ sub do_slice {
         
         # show processbar dialog
         $process_dialog = Wx::ProgressDialog->new('Slicing...', "Processing $input_file_basename...", 
-            100, $self, wxPD_APP_MODAL);
+            100, $self, 0);
         $process_dialog->Pulse;
         
         {

From 4dd33c6b05cf8a1c3264406a473b9c47968b9744 Mon Sep 17 00:00:00 2001
From: Henrik Brix Andersen <henrik@brixandersen.dk>
Date: Sun, 5 Feb 2012 16:43:44 +0100
Subject: [PATCH 2/5] Ask for confirmation when slicing more than one copy.
 #165

---
 lib/Slic3r/GUI/SkeinPanel.pm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm
index bb00af96e..58b5198e0 100644
--- a/lib/Slic3r/GUI/SkeinPanel.pm
+++ b/lib/Slic3r/GUI/SkeinPanel.pm
@@ -4,8 +4,8 @@ use warnings;
 use utf8;
 
 use File::Basename qw(basename dirname);
-use Wx qw(:sizer :progressdialog wxOK wxICON_INFORMATION wxICON_WARNING wxICON_ERROR wxID_OK wxFD_OPEN
-    wxFD_SAVE wxDEFAULT wxNORMAL);
+use Wx qw(:sizer :progressdialog wxOK wxICON_INFORMATION wxICON_WARNING wxICON_ERROR wxICON_QUESTION
+    wxOK wxCANCEL wxID_OK wxFD_OPEN wxFD_SAVE wxDEFAULT wxNORMAL);
 use Wx::Event qw(EVT_BUTTON);
 use base 'Wx::Panel';
 
@@ -152,6 +152,14 @@ sub do_slice {
     eval {
         # validate configuration
         Slic3r::Config->validate;
+
+        # confirm slicing of more than one copies
+        my $copies = Slic3r::Config->get('duplicate_x') * Slic3r::Config->get('duplicate_y');
+        if ($copies > 1) {
+            my $confirmation = Wx::MessageDialog->new($self, "Are you sure you want to slice $copies copies?",
+                                                      'Confirm', wxICON_QUESTION | wxOK | wxCANCEL);
+            return unless $confirmation->ShowModal == wxID_OK;
+        }
         
         # select input file
         my $dir = $last_skein_dir || $last_config_dir || "";

From 121895d3fc41fea26460eb0f1b3663be420ee050 Mon Sep 17 00:00:00 2001
From: Henrik Brix Andersen <henrik@brixandersen.dk>
Date: Sun, 5 Feb 2012 20:55:17 +0100
Subject: [PATCH 3/5] Add support for notes field in configuration profiles.
 #130

---
 lib/Slic3r.pm                |  3 +++
 lib/Slic3r/Config.pm         | 12 ++++++++++++
 lib/Slic3r/GUI/SkeinPanel.pm |  8 +++++++-
 lib/Slic3r/Print.pm          |  3 +++
 slic3r.pl                    |  3 +++
 5 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm
index 087a9d0da..3408ecede 100644
--- a/lib/Slic3r.pm
+++ b/lib/Slic3r.pm
@@ -38,6 +38,9 @@ use Slic3r::TriangleMesh::IntersectionLine;
 
 our $threads            = 4;
 
+# miscellaneous options
+our $notes              = '';
+
 # output options
 our $output_filename_format = '[input_filename_base].gcode';
 
diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm
index 42b7d8026..a8300c1ba 100644
--- a/lib/Slic3r/Config.pm
+++ b/lib/Slic3r/Config.pm
@@ -7,6 +7,18 @@ use constant PI => 4 * atan2(1, 1);
 
 our $Options = {
 
+    # miscellaneous options
+    'notes' => {
+        label   => 'Configuraton notes',
+        cli		=> 'notes=s',
+        type    => 's',
+        multiline => 1,
+        width   => 350,
+        height  => 300,
+        serialize   => sub { join '\n', split /\R/, $_[0] },
+        deserialize => sub { join "\n", split /\\n/, $_[0] },
+    },
+
     # output options
     'output_filename_format' => {
         label   => 'Output filename format',
diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm
index 58b5198e0..8f2c50a89 100644
--- a/lib/Slic3r/GUI/SkeinPanel.pm
+++ b/lib/Slic3r/GUI/SkeinPanel.pm
@@ -67,6 +67,10 @@ sub new {
             title => 'Output',
             options => [qw(output_filename_format)],
         },
+        notes => {
+            title => 'Notes',
+            options => [qw(notes)],
+        },
     );
     $self->{panels} = \%panels;
 
@@ -99,13 +103,15 @@ sub new {
         $make_tab->([qw(transform accuracy skirt)], [qw(print retract)]),
         $make_tab->([qw(printer filament)], [qw(print_speed speed)]),
         $make_tab->([qw(gcode)]),
+        $make_tab->([qw(notes)]),
         $make_tab->([qw(extrusion)], [qw(output)]),
     );
     
     $tabpanel->AddPage($tabs[0], "Print Settings");
     $tabpanel->AddPage($tabs[1], "Printer and Filament");
     $tabpanel->AddPage($tabs[2], "Start/End GCODE");
-    $tabpanel->AddPage($tabs[3], "Advanced");
+    $tabpanel->AddPage($tabs[3], "Notes");
+    $tabpanel->AddPage($tabs[4], "Advanced");
         
     my $buttons_sizer;
     {
diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm
index bdb393b14..f33ff2b74 100644
--- a/lib/Slic3r/Print.pm
+++ b/lib/Slic3r/Print.pm
@@ -463,6 +463,9 @@ sub export_gcode {
     my @lt = localtime;
     printf $fh "; generated by Slic3r $Slic3r::VERSION on %02d-%02d-%02d at %02d:%02d:%02d\n\n",
         $lt[5] + 1900, $lt[4]+1, $lt[3], $lt[2], $lt[1], $lt[0];
+
+    print $fh "; $_\n" foreach split /\R/, $Slic3r::notes;
+    print $fh "\n" if $Slic3r::notes;
     
     for (qw(layer_height perimeters solid_layers fill_density nozzle_diameter filament_diameter
         perimeter_speed infill_speed travel_speed extrusion_width_ratio scale)) {
diff --git a/slic3r.pl b/slic3r.pl
index 9cd944201..6823f00ce 100755
--- a/slic3r.pl
+++ b/slic3r.pl
@@ -191,6 +191,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
     --duplicate-x       Number of items along X axis (1+, default: $Slic3r::duplicate_x)
     --duplicate-y       Number of items along Y axis (1+, default: $Slic3r::duplicate_y)
     --duplicate-distance Distance in mm between copies (default: $Slic3r::duplicate_distance)
+
+   Miscellaneous options:
+    --notes             Notes to be added as comments to the output file
   
   Flow options (advanced):
     --extrusion-width-ratio

From 87088f72bed29616cf7b1f7c387ce6dc413e1018 Mon Sep 17 00:00:00 2001
From: Henrik Brix Andersen <henrik@brixandersen.dk>
Date: Sun, 5 Feb 2012 20:59:05 +0100
Subject: [PATCH 4/5] Fix help text

---
 slic3r.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/slic3r.pl b/slic3r.pl
index 6823f00ce..ef6101ec0 100755
--- a/slic3r.pl
+++ b/slic3r.pl
@@ -104,7 +104,7 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
                         --output-filename-format to generate the filename)
     
   Output options:
-    --output-filament-format
+    --output-filename-format
                         Output file name format; all config options enclosed in brackets
                         will be replaced by their values, as well as [input_filename_base]
                         and [input_filename] (default: $Slic3r::output_filename_format)

From 635c578eb802d81d0d292769bba1877294aa3248 Mon Sep 17 00:00:00 2001
From: Henrik Brix Andersen <henrik@brixandersen.dk>
Date: Sun, 5 Feb 2012 23:19:21 +0100
Subject: [PATCH 5/5] Synchronize command line help text with actual text.

---
 README.markdown | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/README.markdown b/README.markdown
index 1c33decba..014892e08 100644
--- a/README.markdown
+++ b/README.markdown
@@ -80,13 +80,14 @@ The author is Alessandro Ranellucci (me).
     
         --help              Output this usage screen and exit
         --save <file>       Save configuration to the specified file
-        --load <file>       Load configuration from the specified file
+        --load <file>       Load configuration from the specified file. It can be used 
+                            more than once to load options from multiple files.
         -o, --output <file> File to output gcode to (by default, the file will be saved
                             into the same directory as the input file using the 
                             --output-filename-format to generate the filename)
         
       Output options:
-        --output-filament-format
+        --output-filename-format
                             Output file name format; all config options enclosed in brackets
                             will be replaced by their values, as well as [input_filename_base]
                             and [input_filename] (default: [input_filename_base].gcode)
@@ -173,6 +174,9 @@ The author is Alessandro Ranellucci (me).
         --duplicate-x       Number of items along X axis (1+, default: 1)
         --duplicate-y       Number of items along Y axis (1+, default: 1)
         --duplicate-distance Distance in mm between copies (default: 6)
+    
+       Miscellaneous options:
+        --notes             Notes to be added as comments to the output file
       
       Flow options (advanced):
         --extrusion-width-ratio