diff src/rsearcher.cpp @ 8:82f9af6aa7e4

add net.cpp
author pyon@macmini
date Tue, 30 Oct 2018 17:26:02 +0900
parents 29829e98d510
children ae89ce4793d8
line wrap: on
line diff
--- a/src/rsearcher.cpp	Fri Oct 26 21:05:11 2018 +0900
+++ b/src/rsearcher.cpp	Tue Oct 30 17:26:02 2018 +0900
@@ -1,5 +1,5 @@
 // Filename   : rsearcher.cpp
-// Last Change: 2018-10-26 ‹à 15:12:02.
+// Last Change: 2018-10-30 ‰Î 11:19:28.
 //
 
 #include <wx/arrstr.h> 
@@ -302,7 +302,10 @@
 
 void MainFrame::OnPasteSearch( wxCommandEvent& WXUNUSED(event) )
 {
-	PasteSeaarch();
+	m_textCtrlName->SetValue( wxEmptyString );
+	m_textCtrlAddr->SetValue( wxEmptyString );
+	m_dataViewListCtrl->DeleteAllItems();
+	PasteSearch();
 }
 
 void MainFrame::OnPrint( wxCommandEvent& WXUNUSED(event) )
@@ -489,9 +492,10 @@
 
 void MainFrame::Cmd( wxString cmd )
 {
-	m_dataViewListCtrl->DeleteAllItems();
 	m_textCtrlName->SetValue( wxEmptyString );
 	m_textCtrlAddr->SetValue( wxEmptyString );
+	m_dataViewListCtrl->DeleteAllItems();
+	wxGetApp().RemoveFile( wxT( ".cache/*" )  );
 	LoadBitmaps( wxEmptyString, false );
 
     wxRegEx reHhs( wxT( "^0[1238][0-9]{8}$" ) );
@@ -518,7 +522,7 @@
     }
 
     if ( cmd.IsSameAs( wxT( "*" ), false ) ) {
-		PasteSeaarch();
+		PasteSearch();
 		return;
 	}
 
@@ -640,15 +644,15 @@
 
 void MainFrame::GetImages( wxString hhs, wxString date )
 {
-	GetImages2( hhs, date); return;	// here comment out
+	//GetImages2( hhs, date); return;	// here comment out ( by client.exe & return )
 
-	int estimate = 5;
+	int estimate = http.GetImagesSize( hhs, date ) / 1000000;
     wxProgressDialog pd( wxT( "Connecting Server" ), wxT( "Start..." ), estimate, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE );
     pd.SetSize( wxSize( 320, 140 ) );
 	
 	http.GetImages( hhs, date );
 	for ( int i = 0; i < estimate; i++ ) {
-		wxSleep( 1 );
+		wxMilliSleep( 1 );
 		pd.Update( i, wxT( "Now Loading..." ) );
 	}
 }
@@ -740,7 +744,7 @@
 		pd.Update( i, wxString::Format( wxT( "Now loding ... ( %0.1f %% )" ), (float)i ) );
 	}
 	if ( errors.GetCount() > 0 ) {
-		wxMessageBox( errors[0] );
+		wxMessageBox( wxT( "crypto error: " )+ errors[0] );
 		return;
 	}
 	for ( int i = 0; i < output.GetCount(); i++ ) {
@@ -749,7 +753,7 @@
 	}
 }
 
-void MainFrame::PasteSeaarch( void )
+void MainFrame::PasteSearch( void )
 {
 	wxString s;
 	if ( wxTheClipboard->Open() ) {