diff src/rsearcher.cpp @ 15:c262e17de9b1

db download skip-mode.
author pyon@macmini
date Sat, 08 Jun 2019 15:50:59 +0900
parents c1dc1fcee7fe
children b651aa41b9d4
line wrap: on
line diff
--- a/src/rsearcher.cpp	Sun Dec 09 14:38:15 2018 +0900
+++ b/src/rsearcher.cpp	Sat Jun 08 15:50:59 2019 +0900
@@ -1,5 +1,5 @@
 // Filename   : rsearcher.cpp
-// Last Change: 2018-12-04 火 16:00:36.
+// Last Change: 2019-05-29 水 15:37:32.
 //
 
 #include <wx/arrstr.h> 
@@ -431,7 +431,7 @@
 
 void MainFrame::OnUpdateIndex( wxCommandEvent& WXUNUSED(event ) )
 {
-	GetDB( 0, 0, 2 );
+	GetDB( false, false, true );
 	UpdateIndex();
 	wxMessageBox( wxT( "update index done." ) );
 }
@@ -548,14 +548,6 @@
 	m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) );
 	bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 );
 	
-	m_checkListBox = new wxCheckListBox( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
-	m_checkListBox->Append( wxT( "1: Marksheet" ) );
-	m_checkListBox->Append( wxT( "2: Marksheet ( R )" ) );
-	m_checkListBox->Append( wxT( "3: Special Mention" ) );
-	m_checkListBox->Append( wxT( "4: Opinion" ) );
-	m_checkListBox->Append( wxT( "5: Opinion ( R )" ) );
-	bSizerRight->Add( m_checkListBox, 0, wxALL|wxEXPAND, 5 );
-
 	m_dataViewListCtrl = new wxDataViewListCtrl( m_panelRight, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE );
 	m_dataViewListColumnNo    = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ),      wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT,  wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
 	m_dataViewListColumnDate  = m_dataViewListCtrl->AppendTextColumn( wxT( "  Date" ),  wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT,   wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
@@ -568,6 +560,14 @@
 	m_dataViewListColumnAddr = m_dataViewListKana->AppendTextColumn( wxT( "  Address" ), wxDATAVIEW_CELL_INERT, -1, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE );
 	bSizerRight->Add( m_dataViewListKana, 1, wxALL|wxEXPAND, 5 );
 	
+	m_checkListBox = new wxCheckListBox( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
+	m_checkListBox->Append( wxT( "1: Marksheet" ) );
+	m_checkListBox->Append( wxT( "2: Marksheet ( R )" ) );
+	m_checkListBox->Append( wxT( "3: Special Mention" ) );
+	m_checkListBox->Append( wxT( "4: Opinion" ) );
+	m_checkListBox->Append( wxT( "5: Opinion ( R )" ) );
+	bSizerRight->Add( m_checkListBox, 0, wxALL|wxEXPAND, 5 );
+
 	m_textCtrlLog = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 40 ), 0 );
 	bSizerRight->Add( m_textCtrlLog, 0, wxALL|wxEXPAND, 5 );
 
@@ -638,6 +638,8 @@
 
 	for ( int i = 0; i < m_checkListBox->GetCount(); i++ )
 		m_checkListBox->Check( i, true );
+
+	m_spinCtrl->SetValue( wxGetApp().pzoom );
 }
 
 void MainFrame::SetAccelerator( void )
@@ -922,9 +924,10 @@
 	}
 
 	WriteLog( wxT( "[search] " ) + m_hhs );
+	Raise();
 }
 
-void MainFrame::LoadDB( void )
+void MainFrame::LoadDB( bool load_hhsdb )
 {
     wxProgressDialog pd( wxT( "Load Data" ), wxT( "Now loading..." ), 100, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE );
     pd.SetSize( wxSize( 320, 140 ) );
@@ -932,7 +935,10 @@
 	// index
 	UpdateIndex();
 
-	// decrypto
+	if ( !load_hhsdb ) {
+		return;
+	}
+	// decrypto hhs
 	wxString key = wxT( "12345678900123456789abcdefabcdef" );
 	wxArrayString args;
 	args.Add( wxT( "crypto.exe" ) );
@@ -1062,6 +1068,7 @@
     if ( !IsIconized() && !IsMaximized() ) {
         wxGetApp().rect = this->GetRect();
     }
+	wxGetApp().pzoom = m_spinCtrl->GetValue();
     Destroy();
 }
 
@@ -1069,6 +1076,10 @@
 {
     if ( !flag ) return;
     
+	bool cb = false;
+	m_checkListBox->Enable( cb );
+	//m_checkListBox->Show( cb );
+
 	bool lo = false;
 	m_buttonLogout->Enable( lo );
 	m_buttonLogout->Show( lo );