Mercurial > mercurial > hgweb_rsearcher.cgi
comparison 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 |
comparison
equal
deleted
inserted
replaced
14:c1dc1fcee7fe | 15:c262e17de9b1 |
---|---|
1 // Filename : rsearcher.cpp | 1 // Filename : rsearcher.cpp |
2 // Last Change: 2018-12-04 火 16:00:36. | 2 // Last Change: 2019-05-29 水 15:37:32. |
3 // | 3 // |
4 | 4 |
5 #include <wx/arrstr.h> | 5 #include <wx/arrstr.h> |
6 #include <wx/html/htmprint.h> | 6 #include <wx/html/htmprint.h> |
7 #include <wx/clipbrd.h> | 7 #include <wx/clipbrd.h> |
429 stl->Show(); | 429 stl->Show(); |
430 } | 430 } |
431 | 431 |
432 void MainFrame::OnUpdateIndex( wxCommandEvent& WXUNUSED(event ) ) | 432 void MainFrame::OnUpdateIndex( wxCommandEvent& WXUNUSED(event ) ) |
433 { | 433 { |
434 GetDB( 0, 0, 2 ); | 434 GetDB( false, false, true ); |
435 UpdateIndex(); | 435 UpdateIndex(); |
436 wxMessageBox( wxT( "update index done." ) ); | 436 wxMessageBox( wxT( "update index done." ) ); |
437 } | 437 } |
438 | 438 |
439 void MainFrame::OnDownloadManual( wxCommandEvent& WXUNUSED(event) ) | 439 void MainFrame::OnDownloadManual( wxCommandEvent& WXUNUSED(event) ) |
545 bSizerRight->Add( m_textCtrlName, 0, wxALL, 5 ); | 545 bSizerRight->Add( m_textCtrlName, 0, wxALL, 5 ); |
546 | 546 |
547 m_textCtrlAddr = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 160, -1 ), wxTE_READONLY ); | 547 m_textCtrlAddr = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 160, -1 ), wxTE_READONLY ); |
548 m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) ); | 548 m_textCtrlAddr->SetBackgroundColour( wxColour( 180, 210, 240 ) ); |
549 bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 ); | 549 bSizerRight->Add( m_textCtrlAddr, 0, wxALL|wxEXPAND, 5 ); |
550 | |
551 m_dataViewListCtrl = new wxDataViewListCtrl( m_panelRight, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); | |
552 m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ), wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
553 m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( " Date" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
554 m_dataViewListColumnReady = m_dataViewListCtrl->AppendTextColumn( wxT( "Ready" ), wxDATAVIEW_CELL_INERT, 60, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
555 bSizerRight->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 ); | |
556 | |
557 m_dataViewListKana = new wxDataViewListCtrl( m_panelRight, ID_LISTKANA, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); | |
558 m_dataViewListColumnKNo = m_dataViewListKana->AppendTextColumn( wxT( " No" ), wxDATAVIEW_CELL_INERT, 70, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
559 m_dataViewListColumnName = m_dataViewListKana->AppendTextColumn( wxT( " Name" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
560 m_dataViewListColumnAddr = m_dataViewListKana->AppendTextColumn( wxT( " Address" ), wxDATAVIEW_CELL_INERT, -1, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
561 bSizerRight->Add( m_dataViewListKana, 1, wxALL|wxEXPAND, 5 ); | |
550 | 562 |
551 m_checkListBox = new wxCheckListBox( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); | 563 m_checkListBox = new wxCheckListBox( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); |
552 m_checkListBox->Append( wxT( "1: Marksheet" ) ); | 564 m_checkListBox->Append( wxT( "1: Marksheet" ) ); |
553 m_checkListBox->Append( wxT( "2: Marksheet ( R )" ) ); | 565 m_checkListBox->Append( wxT( "2: Marksheet ( R )" ) ); |
554 m_checkListBox->Append( wxT( "3: Special Mention" ) ); | 566 m_checkListBox->Append( wxT( "3: Special Mention" ) ); |
555 m_checkListBox->Append( wxT( "4: Opinion" ) ); | 567 m_checkListBox->Append( wxT( "4: Opinion" ) ); |
556 m_checkListBox->Append( wxT( "5: Opinion ( R )" ) ); | 568 m_checkListBox->Append( wxT( "5: Opinion ( R )" ) ); |
557 bSizerRight->Add( m_checkListBox, 0, wxALL|wxEXPAND, 5 ); | 569 bSizerRight->Add( m_checkListBox, 0, wxALL|wxEXPAND, 5 ); |
558 | 570 |
559 m_dataViewListCtrl = new wxDataViewListCtrl( m_panelRight, ID_LIST, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); | |
560 m_dataViewListColumnNo = m_dataViewListCtrl->AppendTextColumn( wxT( "No" ), wxDATAVIEW_CELL_INERT, 30, wxALIGN_RIGHT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
561 m_dataViewListColumnDate = m_dataViewListCtrl->AppendTextColumn( wxT( " Date" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
562 m_dataViewListColumnReady = m_dataViewListCtrl->AppendTextColumn( wxT( "Ready" ), wxDATAVIEW_CELL_INERT, 60, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
563 bSizerRight->Add( m_dataViewListCtrl, 1, wxALL|wxEXPAND, 5 ); | |
564 | |
565 m_dataViewListKana = new wxDataViewListCtrl( m_panelRight, ID_LISTKANA, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES|wxDV_SINGLE ); | |
566 m_dataViewListColumnKNo = m_dataViewListKana->AppendTextColumn( wxT( " No" ), wxDATAVIEW_CELL_INERT, 70, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
567 m_dataViewListColumnName = m_dataViewListKana->AppendTextColumn( wxT( " Name" ), wxDATAVIEW_CELL_INERT, 80, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
568 m_dataViewListColumnAddr = m_dataViewListKana->AppendTextColumn( wxT( " Address" ), wxDATAVIEW_CELL_INERT, -1, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE|wxDATAVIEW_COL_SORTABLE ); | |
569 bSizerRight->Add( m_dataViewListKana, 1, wxALL|wxEXPAND, 5 ); | |
570 | |
571 m_textCtrlLog = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 40 ), 0 ); | 571 m_textCtrlLog = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 40 ), 0 ); |
572 bSizerRight->Add( m_textCtrlLog, 0, wxALL|wxEXPAND, 5 ); | 572 bSizerRight->Add( m_textCtrlLog, 0, wxALL|wxEXPAND, 5 ); |
573 | 573 |
574 wxFlexGridSizer* fgSizerButton = new wxFlexGridSizer( 0, 2, 0, 0 ); | 574 wxFlexGridSizer* fgSizerButton = new wxFlexGridSizer( 0, 2, 0, 0 ); |
575 fgSizerButton->SetFlexibleDirection( wxBOTH ); | 575 fgSizerButton->SetFlexibleDirection( wxBOTH ); |
636 m_staticBitmap4 = new MyStaticBitmap( m_scrolledWindow4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 636 m_staticBitmap4 = new MyStaticBitmap( m_scrolledWindow4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
637 m_staticBitmap5 = new MyStaticBitmap( m_scrolledWindow5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); | 637 m_staticBitmap5 = new MyStaticBitmap( m_scrolledWindow5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0, wxEmptyString ); |
638 | 638 |
639 for ( int i = 0; i < m_checkListBox->GetCount(); i++ ) | 639 for ( int i = 0; i < m_checkListBox->GetCount(); i++ ) |
640 m_checkListBox->Check( i, true ); | 640 m_checkListBox->Check( i, true ); |
641 | |
642 m_spinCtrl->SetValue( wxGetApp().pzoom ); | |
641 } | 643 } |
642 | 644 |
643 void MainFrame::SetAccelerator( void ) | 645 void MainFrame::SetAccelerator( void ) |
644 { | 646 { |
645 wxAcceleratorEntry entries[11]; | 647 wxAcceleratorEntry entries[11]; |
920 m_dataViewListCtrl->SelectRow( 0 ); | 922 m_dataViewListCtrl->SelectRow( 0 ); |
921 } | 923 } |
922 } | 924 } |
923 | 925 |
924 WriteLog( wxT( "[search] " ) + m_hhs ); | 926 WriteLog( wxT( "[search] " ) + m_hhs ); |
925 } | 927 Raise(); |
926 | 928 } |
927 void MainFrame::LoadDB( void ) | 929 |
930 void MainFrame::LoadDB( bool load_hhsdb ) | |
928 { | 931 { |
929 wxProgressDialog pd( wxT( "Load Data" ), wxT( "Now loading..." ), 100, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE ); | 932 wxProgressDialog pd( wxT( "Load Data" ), wxT( "Now loading..." ), 100, NULL, wxPD_APP_MODAL|wxPD_ELAPSED_TIME|wxPD_REMAINING_TIME|wxPD_AUTO_HIDE ); |
930 pd.SetSize( wxSize( 320, 140 ) ); | 933 pd.SetSize( wxSize( 320, 140 ) ); |
931 | 934 |
932 // index | 935 // index |
933 UpdateIndex(); | 936 UpdateIndex(); |
934 | 937 |
935 // decrypto | 938 if ( !load_hhsdb ) { |
939 return; | |
940 } | |
941 // decrypto hhs | |
936 wxString key = wxT( "12345678900123456789abcdefabcdef" ); | 942 wxString key = wxT( "12345678900123456789abcdefabcdef" ); |
937 wxArrayString args; | 943 wxArrayString args; |
938 args.Add( wxT( "crypto.exe" ) ); | 944 args.Add( wxT( "crypto.exe" ) ); |
939 args.Add( wxT( "-d" ) ); | 945 args.Add( wxT( "-d" ) ); |
940 args.Add( wxT( "hhs.db" ) ); | 946 args.Add( wxT( "hhs.db" ) ); |
1060 { | 1066 { |
1061 WriteLog( wxT( "[logout]" ) ); | 1067 WriteLog( wxT( "[logout]" ) ); |
1062 if ( !IsIconized() && !IsMaximized() ) { | 1068 if ( !IsIconized() && !IsMaximized() ) { |
1063 wxGetApp().rect = this->GetRect(); | 1069 wxGetApp().rect = this->GetRect(); |
1064 } | 1070 } |
1071 wxGetApp().pzoom = m_spinCtrl->GetValue(); | |
1065 Destroy(); | 1072 Destroy(); |
1066 } | 1073 } |
1067 | 1074 |
1068 void MainFrame::InDevelop( bool flag ) | 1075 void MainFrame::InDevelop( bool flag ) |
1069 { | 1076 { |
1070 if ( !flag ) return; | 1077 if ( !flag ) return; |
1071 | 1078 |
1079 bool cb = false; | |
1080 m_checkListBox->Enable( cb ); | |
1081 //m_checkListBox->Show( cb ); | |
1082 | |
1072 bool lo = false; | 1083 bool lo = false; |
1073 m_buttonLogout->Enable( lo ); | 1084 m_buttonLogout->Enable( lo ); |
1074 m_buttonLogout->Show( lo ); | 1085 m_buttonLogout->Show( lo ); |
1075 | 1086 |
1076 bool sl = false; | 1087 bool sl = false; |