# HG changeset patch # User pyon@macmini # Date 1310167800 -32400 # Node ID b67c74848dd0181e566b73f525e66eca3dc799ab # Parent 168531d2c45f8d688e691a729394d57cbd5d30d5 fix bugs. diff -r 168531d2c45f -r b67c74848dd0 include/myframe.h --- a/include/myframe.h Fri Jul 01 20:13:49 2011 +0900 +++ b/include/myframe.h Sat Jul 09 08:30:00 2011 +0900 @@ -1,5 +1,5 @@ // Filename : myframe.h -// Last Change: 24-Jun-2011. +// Last Change: 06-Jul-2011. // #ifndef MYFRAME #define MYFRAME @@ -32,6 +32,7 @@ virtual void OnChar( wxKeyEvent& event ); void OnCmd( wxCommandEvent& event ); void PrintImages( wxString& path ); + void WriteLog( wxString& cmd, wxString& path ); wxArrayString path; // 履歴機能 diff -r 168531d2c45f -r b67c74848dd0 include/symbol.h --- a/include/symbol.h Fri Jul 01 20:13:49 2011 +0900 +++ b/include/symbol.h Sat Jul 09 08:30:00 2011 +0900 @@ -1,10 +1,10 @@ // Filename : symbol.h -// Last Change: 01-Jul-2011. +// Last Change: 06-Jul-2011. // #define MYAPPNAME wxT("Searcher2") #define VER 2 -#define REV 10 -#define BLD 20110701 +#define REV 11 +#define BLD 20110708 diff -r 168531d2c45f -r b67c74848dd0 man/index.html --- a/man/index.html Fri Jul 01 20:13:49 2011 +0900 +++ b/man/index.html Sat Jul 09 08:30:00 2011 +0900 @@ -23,7 +23,6 @@

未実装の機能

diff -r 168531d2c45f -r b67c74848dd0 src/main.cpp --- a/src/main.cpp Fri Jul 01 20:13:49 2011 +0900 +++ b/src/main.cpp Sat Jul 09 08:30:00 2011 +0900 @@ -1,5 +1,5 @@ // Filename : main.cpp -// Last Change: 22-Jun-2011. +// Last Change: 06-Jul-2011. // #include "common.h" @@ -48,12 +48,11 @@ wxString key; config->SetPath( wxT("/SearchHistory") ); - for ( int i=0; i<5; i++ ) { + for ( int i=0; i<10; i++ ) { key.Printf( wxT("h%02d"), i ); config->Write( key, searchhist[i] ); } - delete config; return 0; @@ -73,7 +72,7 @@ wxString key; wxString value; config->SetPath( wxT("/SearchHistory") ); - for ( int i=0; i<5; i++ ) { + for ( int i=0; i<10; i++ ) { key.Printf( wxT("h%02d"), i ); config->Read( key, &value ); searchhist.Add( value ); diff -r 168531d2c45f -r b67c74848dd0 src/myframe.cpp --- a/src/myframe.cpp Fri Jul 01 20:13:49 2011 +0900 +++ b/src/myframe.cpp Sat Jul 09 08:30:00 2011 +0900 @@ -1,5 +1,5 @@ // Filename : mainframe.cpp -// Last Change: 01-Jul-2011. +// Last Change: 06-Jul-2011. // #include "wx/html/htmprint.h" #include "wx/print.h" @@ -28,7 +28,7 @@ { // for search history hist = wxGetApp().searchhist; - histpos = 5; + histpos = 10; // for autocomplete hhs wxString gszFile = wxGetCwd() + wxT("/db/ccn.db"); @@ -313,16 +313,7 @@ wxExecute( execmd ); mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); - // 検索履歴をログに保存 - wxString logfn = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("log.txt"); - wxTextFile logFile; - logFile.Open( logfn ); - wxDateTime now = wxDateTime::Now(); - wxString log = now.Format() + wxT(" ") + cmd + wxT(" ") + path[val]; - logFile.AddLine( log ); - logFile.Write(); - logFile.Close(); - + WriteLog( cmd, path[val] ); break; } // ファイル印刷 @@ -333,6 +324,7 @@ break; } PrintImages( path[0] ); + WriteLog( cmd, path[0] ); break; } // 制御用コマンド @@ -427,6 +419,21 @@ return; } +// 検索履歴をログに保存 +void MyCmdBox::WriteLog( wxString& cmd, wxString& path ) +{ + wxString logfn = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("log.txt"); + wxTextFile logFile; + logFile.Open( logfn ); + wxDateTime now = wxDateTime::Now(); + wxString log = now.Format( wxT("%Y-%m-%d %H:%M:%S") ) + wxT(" ") + cmd + wxT(" ") + path; + logFile.AddLine( log ); + logFile.Write(); + logFile.Close(); + + return; +} + ////////////////////////////////////////////////////////////////////////// // frame constructor MyFrame::MyFrame( wxWindow* parent, wxWindowID id, const wxString& title ) diff -r 168531d2c45f -r b67c74848dd0 start.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/start.bat Sat Jul 09 08:30:00 2011 +0900 @@ -0,0 +1,2 @@ +start /min Y:\ +start searcher2 \ No newline at end of file