Develop and Download Open Source Software

Browse CVS Repository

Diff of /malonnote/mnController.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.17 by maloninc, Thu Sep 15 03:02:37 2005 UTC revision 1.18 by maloninc, Thu Sep 15 09:20:48 2005 UTC
# Line 102  void mnController::handleSearch(wxComman Line 102  void mnController::handleSearch(wxComman
102          }          }
103    
104          wiki->addSearchStr(str);          wiki->addSearchStr(str);
105            wiki->addSearchList(str, wikiList);
106    
107          if(autoUpdateMode)          frame->addSearchResult(wiki, str);
                 frame->showSearchResult(wiki);  
         else  
                 frame->addSearchResult(wiki, str);  
108  }  }
109    
110  void mnController::handleGroup(wxCommandEvent& event)  void mnController::handleGroup(wxCommandEvent& event)
# Line 152  void mnController::handleRemoveButton(wx Line 150  void mnController::handleRemoveButton(wx
150  {  {
151          wxTreeItemData* item = frame->getSelectedItem();          wxTreeItemData* item = frame->getSelectedItem();
152    
153          if(item){          if(frame->isEditableTreeLabel(frame->getSelection())) {
154                  if(wxMessageBox(wxT("Do you realy remove this memo?\n") + frame->getSelectedLabel(), wxT("Realy?"), wxYES_NO|wxICON_QUESTION) == wxYES){                  if(wxMessageBox(wxT("Do you realy remove this memo?\n") + frame->getSelectedLabel(), wxT("Realy?"), wxYES_NO|wxICON_QUESTION) == wxYES){
155                          ((WikiData*)(item))->removeDataFile();                          ((WikiData*)(item))->removeDataFile();
156                  }                  }
# Line 262  void mnController::handleEditButton(wxCo Line 260  void mnController::handleEditButton(wxCo
260          mnWikiDataEntryDialog* dlg = new mnWikiDataEntryDialog(frame, -1, wxT("Malon Note"));          mnWikiDataEntryDialog* dlg = new mnWikiDataEntryDialog(frame, -1, wxT("Malon Note"));
261          int             ans;          int             ans;
262    
263          if(itemData == NULL) return;          if(!frame->isEditableTreeLabel(frame->getSelection())) return; /* selection is not memo data */
264    
265          const wxString* wikiText = ((WikiData*)(itemData))->getText();          const wxString* wikiText = ((WikiData*)(itemData))->getText();
266    
267          dlg->setSubject(subject);          dlg->setSubject(subject);
# Line 279  void mnController::handleEditButton(wxCo Line 278  void mnController::handleEditButton(wxCo
278    
279          ((WikiData*)(itemData))->modSubject(&newSubjectStr);          ((WikiData*)(itemData))->modSubject(&newSubjectStr);
280    
281          if(autoUpdateMode)          const wxArrayString*  searchStrList= wiki->getSearchStrList();
282                  frame->showSearchResult(wiki);          char*  tokenList[32];
283            memset(tokenList, 0, sizeof(char*)*32);
284            for(int i = 0; i < searchStrList->Count(); i++) {
285                    wxString& searchStr = searchStrList->Item(i);
286                    if( wiki->makeSearchToken(searchStr.mb_str(), tokenList) ) { /* create token */
287                            if(wiki->matchWithToken((wxString*)((WikiData*)(itemData))->getFileName(), tokenList)) { /* match */
288                                    wiki->addSearchResultList(&searchStr, (WikiData*)(itemData));
289                                    frame->updateSearchResult(wiki, &searchStr);
290                            }
291                            else {
292                                    //wiki->delSearchResultList(searchStr, (WikiData*)(itemData));
293                                    //frame->updateSearchResult(wiki, &searchStr);  
294                            }
295                    }
296            }
297          delete dlg;          delete dlg;
298  }  }
299    

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26