ui: load source from directory via MenuBar
Added MenuBar action Project->New, which opens a directory dialog for choosing the new source directory to parse the files from. The ConfigManager can be created empty now and setValue calls can be used to set values. fortune cookie message = Your troubles will be faded by the luck you will soon have.
This commit is contained in:
@@ -50,7 +50,25 @@ void Application::loadProject(const std::string& projectSettingsFilePath)
|
||||
message.dispatch();
|
||||
}
|
||||
|
||||
void Application::loadSource(const std::string& sourceDirectoryPath)
|
||||
{
|
||||
m_storage->clear();
|
||||
m_project = Project::create(m_storage);
|
||||
|
||||
m_project->clearProjectSettings();
|
||||
m_project->setSourceDirectoryPath(sourceDirectoryPath);
|
||||
m_project->parseCode();
|
||||
|
||||
MessageActivateToken message(1);
|
||||
message.dispatch();
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageLoadProject* message)
|
||||
{
|
||||
loadProject(message->projectSettingsFilePath);
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageLoadSource* message)
|
||||
{
|
||||
loadSource(message->sourceDirectoryPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user