| 20 |
#else |
#else |
| 21 |
EVT_COMMAND(XRCID("wikiHtmlTextCtrl"), mnEVT_LINK_CLICK, mnNotePanelController::handleLinkClick) |
EVT_COMMAND(XRCID("wikiHtmlTextCtrl"), mnEVT_LINK_CLICK, mnNotePanelController::handleLinkClick) |
| 22 |
#endif |
#endif |
| 23 |
|
EVT_TIMER(wxID_ANY, mnNotePanelController::readAll) |
| 24 |
END_EVENT_TABLE() |
END_EVENT_TABLE() |
| 25 |
|
|
| 26 |
mnNotePanelController::mnNotePanelController(mnNotePanel* inPanel, wxString* inWikiDir) |
mnNotePanelController::mnNotePanelController(mnNotePanel* inPanel, wxString* inWikiDir) |
| 27 |
{ |
{ |
| 28 |
wiki = new mnModel(inWikiDir->mb_str()); |
wiki = new mnModel(inWikiDir->mb_str()); |
| 29 |
|
wiki->readAll(true); |
| 30 |
|
|
| 31 |
|
wxTimer* timer = new wxTimer(this); |
| 32 |
|
timer->Start(MN_READ_INTERVAL); |
| 33 |
|
|
| 34 |
panel = inPanel; |
panel = inPanel; |
| 35 |
} |
} |
| 36 |
|
|
| 38 |
{ |
{ |
| 39 |
} |
} |
| 40 |
|
|
| 41 |
|
void mnNotePanelController::readAll(wxTimerEvent& event) |
| 42 |
|
{ |
| 43 |
|
wiki->readAll(false); /* read wiki data in background */ |
| 44 |
|
} |
| 45 |
|
|
| 46 |
const wxString* mnNotePanelController::getWikiDataDir() |
const wxString* mnNotePanelController::getWikiDataDir() |
| 47 |
{ |
{ |
| 48 |
return wiki->getWikiDataDir(); |
return wiki->getWikiDataDir(); |
| 354 |
wxString cmd; |
wxString cmd; |
| 355 |
|
|
| 356 |
#ifdef __WXMSW__ |
#ifdef __WXMSW__ |
| 357 |
wxString tempFile = wxFileName::CreateTempFileName(wxT("malonnote-temp")); |
#include <windows.h> |
| 358 |
FILE* fp; |
ShellExecute(NULL, wxT("OPEN"), doc.c_str(), NULL, NULL, SW_SHOWNORMAL); |
| 359 |
|
return; |
|
wxLogMessage(wxT("temp:[%s]"), tempFile.c_str()); |
|
|
return; |
|
|
fp = fopen(tempFile.mb_str(), "w"); |
|
|
fprintf(fp, "Set obj = CreateObject(\"Shell.Application\")\n"); |
|
|
fprintf(fp, "obj.Open \"%s\"", doc.mb_str()); |
|
|
fclose(fp); |
|
|
///cmd.sprintf(wxT("cscript \"%s\""), tempFile.c_str()); |
|
| 360 |
#endif |
#endif |
| 361 |
|
|
| 362 |
#ifdef __WXMAC__ |
#ifdef __WXMAC__ |
| 371 |
cmd.sprintf(wxT("gnome-open \'%s\'"), doc.c_str()); |
cmd.sprintf(wxT("gnome-open \'%s\'"), doc.c_str()); |
| 372 |
#endif |
#endif |
| 373 |
|
|
| 374 |
wxExecute(cmd, wxEXEC_ASYNC); |
wxExecute(cmd); |
| 375 |
} |
} |
| 376 |
|
|
| 377 |
void mnNotePanelController::openDir(wxString& dir) |
void mnNotePanelController::openDir(wxString& dir) |