Browse CVS Repository
Diff of /malonnote/main.cpp
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 26 |
|
|
| 27 |
bool mnApp::OnInit() |
bool mnApp::OnInit() |
| 28 |
{ |
{ |
| 29 |
|
wxString* dirName = new wxString(); |
| 30 |
|
wxString gotDirName; |
| 31 |
|
wxDirDialog* dlg; |
| 32 |
|
wxString confKey; |
| 33 |
|
|
| 34 |
const wxString appName = wxString::Format(wxT(MN_APP_NAME) wxT("-%s"), wxGetUserId().c_str()); |
const wxString appName = wxString::Format(wxT(MN_APP_NAME) wxT("-%s"), wxGetUserId().c_str()); |
| 35 |
|
|
| 52 |
|
|
| 53 |
SetTopWindow(mainFrame); |
SetTopWindow(mainFrame); |
| 54 |
mainFrame->Show(); |
mainFrame->Show(); |
| 55 |
|
|
| 56 |
|
/* add note panel */ |
| 57 |
|
wxConfig* config = new wxConfig(wxT(CONF_APP_NAME)); |
| 58 |
|
if(config->Read(wxT(CONF_WIKI_DIR), dirName) == FALSE) { |
| 59 |
|
delete dirName; |
| 60 |
|
dlg = new wxDirDialog(mainFrame); |
| 61 |
|
if(dlg->ShowModal() == wxID_OK) { |
| 62 |
|
gotDirName = dlg->GetPath(); |
| 63 |
|
config->Write(wxT(CONF_WIKI_DIR), gotDirName.c_str()); |
| 64 |
|
mainFrame->addNotePanel(&gotDirName); |
| 65 |
|
} |
| 66 |
|
else { |
| 67 |
|
mainFrame->Close(); |
| 68 |
|
} |
| 69 |
|
} |
| 70 |
|
else { |
| 71 |
|
mainFrame->addNotePanel(dirName); |
| 72 |
|
|
| 73 |
|
for(int i = 1; ;i++) { |
| 74 |
|
confKey.sprintf(wxT(CONF_WIKI_DIR) "%d", i); |
| 75 |
|
if(config->Read(confKey.c_str(), dirName) == FALSE) break; |
| 76 |
|
mainFrame->addNotePanel(dirName); |
| 77 |
|
} |
| 78 |
|
mainFrame->getNotebook()->SetSelection(0); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
delete config; |
| 82 |
|
|
| 83 |
return true; |
return true; |
| 84 |
} |
} |
|
|
Legend:
| Removed from v.1.5 |
|
| changed lines |
| |
Added in v.1.6 |
|
|
|