| 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 |
|
readAll(true); |
| 29 |
|
|
| 30 |
panel = inPanel; |
panel = inPanel; |
| 31 |
} |
} |
| 32 |
|
|
| 34 |
{ |
{ |
| 35 |
} |
} |
| 36 |
|
|
| 37 |
|
void mnNotePanelController::readAll(bool flag) |
| 38 |
|
{ |
| 39 |
|
wiki->readAll(flag); |
| 40 |
|
} |
| 41 |
|
|
| 42 |
const wxString* mnNotePanelController::getWikiDataDir() |
const wxString* mnNotePanelController::getWikiDataDir() |
| 43 |
{ |
{ |
| 44 |
return wiki->getWikiDataDir(); |
return wiki->getWikiDataDir(); |
| 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__ |
| 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) |