Mercurial > mercurial > hgweb_searcher2.cgi
changeset 16:b67c74848dd0
fix bugs.
author | pyon@macmini |
---|---|
date | Sat, 09 Jul 2011 08:30:00 +0900 |
parents | 168531d2c45f |
children | 17e78fc76e1f |
files | include/myframe.h include/symbol.h man/index.html src/main.cpp src/myframe.cpp start.bat |
diffstat | 6 files changed, 29 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- 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; // 履歴機能
--- 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
--- 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 @@ <h2><font color="green">未実装の機能</font></h2> <ul> <li> 被保険者情報をCSVファイルで取り込めるようにする予定.(200人まで) - <li> ボタンひとつでターゲットフォルダの画像を印刷する. </ul> </body> </html>
--- 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 );
--- 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 )