Develop and Download Open Source Software

Browse CVS Repository

Diff of /malonnote/mnNotePanelController.cpp

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

revision 1.10 by maloninc, Tue Jan 24 09:31:13 2006 UTC revision 1.14 by maloninc, Tue Oct 24 04:45:10 2006 UTC
# Line 25  END_EVENT_TABLE() Line 25  END_EVENT_TABLE()
25  mnNotePanelController::mnNotePanelController(mnNotePanel* inPanel, wxString* inWikiDir)  mnNotePanelController::mnNotePanelController(mnNotePanel* inPanel, wxString* inWikiDir)
26  {  {
27          wiki = new mnModel(inWikiDir->mb_str());          wiki = new mnModel(inWikiDir->mb_str());
28            wiki->readAll(true);
29    
30          panel = inPanel;          panel = inPanel;
31  }  }
32    
# Line 32  mnNotePanelController::~mnNotePanelContr Line 34  mnNotePanelController::~mnNotePanelContr
34  {  {
35  }  }
36    
37    void mnNotePanelController::readAll()
38    {
39            wiki->readAll(false); /* read wiki data in background */
40    }
41    
42  const wxString* mnNotePanelController::getWikiDataDir()  const wxString* mnNotePanelController::getWikiDataDir()
43  {  {
44          return  wiki->getWikiDataDir();          return  wiki->getWikiDataDir();
# Line 343  void mnNotePanelController::openDoc(wxSt Line 350  void mnNotePanelController::openDoc(wxSt
350          wxString cmd;          wxString cmd;
351    
352  #ifdef __WXMSW__  #ifdef __WXMSW__
353          wxString tempFile = wxFileName::CreateTempFileName(wxT("malonnote-temp"));  #include <windows.h>
354          FILE* fp;          ShellExecute(NULL, wxT("OPEN"), doc.c_str(), NULL, NULL, SW_SHOWNORMAL);
355            return;
         tempFile = tempFile + wxT(".vbs");  
         fp = fopen((const char*)tempFile.mb_str(), "w");  
         if(fp == NULL) {  
                 wxLogMessage(wxT("Cant't create temp file"));  
                 return;  
         }  
         fprintf(fp, "Set obj = CreateObject(\"Shell.Application\")\n");  
         fprintf(fp, "obj.Open \"%s\"", (const char*)doc.mb_str());  
         fclose(fp);  
         cmd.sprintf(wxT("cscript \"%s\""), tempFile.c_str());  
356  #endif  #endif
357    
358  #ifdef __WXMAC__  #ifdef __WXMAC__
# Line 370  void mnNotePanelController::openDoc(wxSt Line 367  void mnNotePanelController::openDoc(wxSt
367          cmd.sprintf(wxT("gnome-open \'%s\'"), doc.c_str());          cmd.sprintf(wxT("gnome-open \'%s\'"), doc.c_str());
368  #endif  #endif
369    
370          wxExecute(cmd, wxEXEC_ASYNC);          wxExecute(cmd);
371  }  }
372    
373  void mnNotePanelController::openDir(wxString& dir)  void mnNotePanelController::openDir(wxString& dir)

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.14

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