ui: fixes in project setup and indexing
* allow to ignore missing paths in project setup * button to remove missing paths in project setup * fixed progress dialog stays on empty project indexing * don't unblock ui between indexin steps
This commit is contained in:
@@ -225,7 +225,7 @@ void Application::refreshProject(RefreshMode refreshMode)
|
||||
{
|
||||
if (m_project && checkSharedMemory())
|
||||
{
|
||||
m_project->refresh(getDialogView().get(), refreshMode);
|
||||
m_project->refresh(refreshMode, getDialogView().get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ void DialogView::finishedIndexingDialog(
|
||||
{
|
||||
}
|
||||
|
||||
void DialogView::hideDialogs()
|
||||
void DialogView::hideDialogs(bool unblockUI)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
size_t indexedFileCount, size_t totalIndexedFileCount, size_t completedFileCount, size_t totalFileCount,
|
||||
float time, ErrorCountInfo errorInfo, bool interrupted);
|
||||
|
||||
virtual void hideDialogs();
|
||||
virtual void hideDialogs(bool unblockUI = true);
|
||||
|
||||
int confirm(const std::string& message);
|
||||
virtual int confirm(const std::string& message, const std::vector<std::string>& options);
|
||||
|
||||
@@ -21,7 +21,7 @@ void TaskParseWrapper::doEnter(std::shared_ptr<Blackboard> blackboard)
|
||||
blackboard->get("source_file_count", sourceFileCount);
|
||||
if (std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView())
|
||||
{
|
||||
dialogView->hideUnknownProgressDialog();
|
||||
dialogView->hideDialogs(false);
|
||||
dialogView->updateIndexingDialog(0, 0, sourceFileCount, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ void Project::load()
|
||||
}
|
||||
}
|
||||
|
||||
void Project::refresh(DialogView* dialogView, RefreshMode refreshMode)
|
||||
void Project::refresh(RefreshMode refreshMode, DialogView* dialogView)
|
||||
{
|
||||
if (m_state == PROJECT_STATE_NOT_LOADED)
|
||||
{
|
||||
@@ -274,7 +274,7 @@ void Project::refresh(DialogView* dialogView, RefreshMode refreshMode)
|
||||
}
|
||||
else
|
||||
{
|
||||
buildIndex(info);
|
||||
buildIndex(info, dialogView);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,11 +296,15 @@ RefreshInfo Project::getRefreshInfo(RefreshMode mode) const
|
||||
}
|
||||
}
|
||||
|
||||
void Project::buildIndex(const RefreshInfo& info)
|
||||
void Project::buildIndex(const RefreshInfo& info, DialogView* dialogView)
|
||||
{
|
||||
if (info.mode == REFRESH_NONE || (!info.filesToClear.size() && !info.filesToIndex.size()))
|
||||
{
|
||||
if (!m_hasGUI)
|
||||
if (m_hasGUI)
|
||||
{
|
||||
dialogView->hideDialogs();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageFinishedParsing().dispatch();
|
||||
}
|
||||
@@ -312,6 +316,8 @@ void Project::buildIndex(const RefreshInfo& info)
|
||||
MessageStatus("Preparing Indexing", false, true).dispatch();
|
||||
MessageClearErrorCount().dispatch();
|
||||
|
||||
dialogView->showUnknownProgressDialog("Preparing Indexing", "Setting up Indexers");
|
||||
|
||||
if (info.mode == REFRESH_ALL_FILES)
|
||||
{
|
||||
m_storage->clear();
|
||||
@@ -426,6 +432,10 @@ void Project::buildIndex(const RefreshInfo& info)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogView->hideUnknownProgressDialog();
|
||||
}
|
||||
|
||||
taskSequential->addTask(std::make_shared<TaskFinishParsing>(m_storage.get(), m_storageCache));
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ public:
|
||||
|
||||
void load();
|
||||
|
||||
void refresh(DialogView* dialogView, RefreshMode refreshMode);
|
||||
void refresh(RefreshMode refreshMode, DialogView* dialogView);
|
||||
|
||||
RefreshInfo getRefreshInfo(RefreshMode mode) const;
|
||||
|
||||
void buildIndex(const RefreshInfo& info);
|
||||
void buildIndex(const RefreshInfo& info, DialogView* dialogView);
|
||||
|
||||
private:
|
||||
enum ProjectStateType
|
||||
|
||||
@@ -178,7 +178,7 @@ std::vector<FilePath> FilePath::expandEnvironmentVariables() const
|
||||
const char * s = match[1].matched ? getenv(match[1].str().c_str()) : getenv(match[2].str().c_str());
|
||||
if (s == nullptr)
|
||||
{
|
||||
LOG_ERROR(match[1].str() + " is not an environment variable");
|
||||
LOG_ERROR_STREAM(<< match[1].str() << " is not an environment variable in: " << text);
|
||||
return paths;
|
||||
}
|
||||
text.replace(match.position(0), match.length(0), s);
|
||||
|
||||
Reference in New Issue
Block a user