diff src/bprint.cpp @ 6:76db82822e73

Implement kana fuzzy search. Implement batch print log.
author pyon@macmini
date Wed, 18 Sep 2013 18:20:40 +0900
parents bc2e2b304095
children 4967d1e2b30c
line wrap: on
line diff
--- a/src/bprint.cpp	Sat Sep 14 08:54:47 2013 +0900
+++ b/src/bprint.cpp	Wed Sep 18 18:20:40 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : bprint.cpp
-// Last Change: 13-Sep-2013.
+// Last Change: 18-Sep-2013.
 //
 
 #include "bprint.h"
@@ -120,6 +120,7 @@
     wxPrintDialogData pd;
     wxPrinter p( &pd );
     p.PrintDialog( NULL );
+    wxArrayString log;
 
     for ( int r = 0; r < m_grid->GetNumberRows(); r++ ) {
         wxString path = m_grid->GetCellValue( r, 2 );
@@ -175,7 +176,9 @@
         p.Print( NULL, &hpout, false );
 
         m_grid->SetCellValue( r, 3, wxT("処理済") );
+        log.Add( path );
     }
+    WriteLog( log );
 }
 
 /* 入力禁止 */
@@ -186,4 +189,20 @@
             m_grid->SetReadOnly( r, c, true );
 }
 
+/* 印刷ログ */
+void FrameBatchPrint::WriteLog( wxArrayString logline )
+{
+    wxDateTime now = wxDateTime::Now();
+    wxString log_file = wxGetCwd() + wxFILE_SEP_PATH + wxT("log") + wxFILE_SEP_PATH + wxT("bp_") + now.Format( wxT("%Y%m%d%H%M%S.log") );
+    wxTextFile file( log_file );
+    file.Create();
+    wxTextFile logfile;
+    logfile.Open( log_file );
 
+    for ( int n = 0; n < logline.GetCount(); n++ ) {
+        logfile.AddLine( logline[n] );
+    }
+    logfile.Write();
+    logfile.Close();
+}
+