Browse CVS Repository
Diff of /malonnote/mnFrameController.cpp
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 112 |
dlg = new wxDirDialog(frame); |
dlg = new wxDirDialog(frame); |
| 113 |
if(dlg->ShowModal() == wxID_OK) { |
if(dlg->ShowModal() == wxID_OK) { |
| 114 |
gotDirName = dlg->GetPath(); |
gotDirName = dlg->GetPath(); |
| 115 |
frame->addNotePanel(&gotDirName); |
if(isExistConfig(&gotDirName) == false){ |
| 116 |
|
frame->addNotePanel(&gotDirName); |
| 117 |
|
} |
| 118 |
|
else { |
| 119 |
|
wxMessageBox(wxT("It already exist in MalonNote"), wxT("Already exist"), wxOK|wxICON_INFORMATION); |
| 120 |
|
return; |
| 121 |
|
} |
| 122 |
} |
} |
| 123 |
updateConfig(); |
updateConfig(); |
| 124 |
} |
} |
| 153 |
} |
} |
| 154 |
delete config; |
delete config; |
| 155 |
} |
} |
| 156 |
|
|
| 157 |
|
bool mnFrameController::isExistConfig(wxString* dir) |
| 158 |
|
{ |
| 159 |
|
wxString* dirName = new wxString(); |
| 160 |
|
wxString gotDirName; |
| 161 |
|
wxDirDialog* dlg; |
| 162 |
|
wxString confKey; |
| 163 |
|
|
| 164 |
|
wxConfig* config = new wxConfig(wxT(CONF_APP_NAME)); |
| 165 |
|
for(int i = 0; ;i++) { |
| 166 |
|
if(i == 0) { |
| 167 |
|
confKey.sprintf(wxT(CONF_WIKI_DIR)); |
| 168 |
|
} |
| 169 |
|
else { |
| 170 |
|
confKey.sprintf(wxT(CONF_WIKI_DIR) "%d", i); |
| 171 |
|
} |
| 172 |
|
if(config->Read(confKey.c_str(), dirName)) { |
| 173 |
|
if(*dir == *dirName) return true; /* Exist */ |
| 174 |
|
} |
| 175 |
|
else { |
| 176 |
|
break; |
| 177 |
|
} |
| 178 |
|
} |
| 179 |
|
|
| 180 |
|
delete dirName; |
| 181 |
|
delete config; |
| 182 |
|
|
| 183 |
|
return false; |
| 184 |
|
} |
|
|
Legend:
| Removed from v.1.4 |
|
| changed lines |
| |
Added in v.1.5 |
|
|
|