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.8 by maloninc, Tue Jan 3 23:20:39 2006 UTC revision 1.9 by maloninc, Fri Jan 20 12:49:54 2006 UTC
# Line 311  void mnNotePanelController::handleOpenDo Line 311  void mnNotePanelController::handleOpenDo
311          wxExecute(cmd);          wxExecute(cmd);
312    
313          /* open docs directory */          /* open docs directory */
314          openDoc(docDir);          openDir(docDir);
315  }  }
316    
317  void mnNotePanelController::openUrl(wxString& url)  void mnNotePanelController::openUrl(wxString& url)
# Line 323  void mnNotePanelController::openUrl(wxSt Line 323  void mnNotePanelController::openUrl(wxSt
323  #endif  #endif
324    
325  #ifdef __WXMAC__  #ifdef __WXMAC__
326          cmd.sprintf(wxT("open %s"), url.c_str());          cmd.sprintf(wxT("open \'%s\'"), url.c_str());
327  #endif  #endif
328    
329  #ifdef __WXCOCOA__  #ifdef __WXCOCOA__
330          cmd.sprintf(wxT("open %s"), url.c_str());          cmd.sprintf(wxT("open \'%s\'"), url.c_str());
331  #endif  #endif
332    
333  #ifdef __WXGTK__  #ifdef __WXGTK__
334          cmd.sprintf(wxT("gnome-open %s"), url.c_str());          cmd.sprintf(wxT("gnome-open \'%s\'"), url.c_str());
335  #endif  #endif
336    
337          //wxExecute(argv);          //wxExecute(argv);
# Line 343  void mnNotePanelController::openDoc(wxSt Line 343  void mnNotePanelController::openDoc(wxSt
343          wxString cmd;          wxString cmd;
344    
345  #ifdef __WXMSW__  #ifdef __WXMSW__
346          cmd.sprintf(wxT("cmd /c \"start %s\""), doc.c_str());          wxString tempFile = wxFileName::CreateTempFileName(wxT("malonnote-temp"));
347            FILE* fp;
348    
349    wxLogMessage(wxT("temp:[%s]"), tempFile.c_str());
350    return;
351            fp = fopen(tempFile.mb_str(), "w");
352            fprintf(fp, "Set obj = CreateObject(\"Shell.Application\")\n");
353            fprintf(fp, "obj.Open \"%s\"", doc.mb_str());
354            fclose(fp);
355            ///cmd.sprintf(wxT("cscript \"%s\""), tempFile.c_str());
356  #endif  #endif
357    
358  #ifdef __WXMAC__  #ifdef __WXMAC__
359          cmd.sprintf(wxT("open %s"), doc.c_str());          cmd.sprintf(wxT("open \'%s\'"), doc.c_str());
360  #endif  #endif
361    
362  #ifdef __WXCOCOA__  #ifdef __WXCOCOA__
363          cmd.sprintf(wxT("open %s"), doc.c_str());          cmd.sprintf(wxT("open \'%s\'"), doc.c_str());
364  #endif  #endif
365    
366  #ifdef __WXGTK__  #ifdef __WXGTK__
367          cmd.sprintf(wxT("gnome-open %s"), doc.c_str());          cmd.sprintf(wxT("gnome-open \'%s\'"), doc.c_str());
368    #endif
369    
370            wxExecute(cmd, wxEXEC_ASYNC);
371    }
372    
373    void mnNotePanelController::openDir(wxString& dir)
374    {
375            wxString cmd;
376    
377    #ifdef __WXMSW__
378            cmd.sprintf(wxT("explorer \"%s\""), dir.c_str());
379    #endif
380    
381    #ifdef __WXMAC__
382            cmd.sprintf(wxT("open \'%s\'"), dir.c_str());
383    #endif
384    
385    #ifdef __WXCOCOA__
386            cmd.sprintf(wxT("open \'%s\'"), dir.c_str());
387    #endif
388    
389    #ifdef __WXGTK__
390            cmd.sprintf(wxT("gnome-open \'%s\'"), dir.c_str());
391  #endif  #endif
392    
393          wxExecute(cmd);          wxExecute(cmd);
394  }  }
395    
396    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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