mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-30 21:36:00 +02:00
Disallowed Find and Replace in locked projects
This commit is contained in:
parent
ef57930170
commit
5403cdb748
1 changed files with 17 additions and 3 deletions
|
@ -399,12 +399,17 @@ namespace IDE.ui
|
||||||
Clear();
|
Clear();
|
||||||
QueueLine("Searching...");
|
QueueLine("Searching...");
|
||||||
|
|
||||||
|
bool isReplace = searchOptions.mReplaceString != null;
|
||||||
|
|
||||||
mSearchPaths = new List<String>();
|
mSearchPaths = new List<String>();
|
||||||
mFoundPathSet = new HashSet<String>();
|
mFoundPathSet = new HashSet<String>();
|
||||||
if (searchOptions.mSearchLocation == sEntireSolution)
|
if (searchOptions.mSearchLocation == sEntireSolution)
|
||||||
{
|
{
|
||||||
for (var project in IDEApp.sApp.mWorkspace.mProjects)
|
for (var project in IDEApp.sApp.mWorkspace.mProjects)
|
||||||
{
|
{
|
||||||
|
if ((isReplace) && (project.mLocked))
|
||||||
|
continue;
|
||||||
|
|
||||||
AddFromFilesFolder(project.mRootFolder, searchOptions);
|
AddFromFilesFolder(project.mRootFolder, searchOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,7 +418,8 @@ namespace IDE.ui
|
||||||
var sourceViewPanel = gApp.GetActiveSourceViewPanel(true);
|
var sourceViewPanel = gApp.GetActiveSourceViewPanel(true);
|
||||||
if (sourceViewPanel != null)
|
if (sourceViewPanel != null)
|
||||||
{
|
{
|
||||||
mSearchPaths.Add(new String(sourceViewPanel.mFilePath));
|
if (!sourceViewPanel.mEditWidget.mEditWidgetContent.CheckReadOnly())
|
||||||
|
mSearchPaths.Add(new String(sourceViewPanel.mFilePath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (searchOptions.mSearchLocation == sCurrentProject)
|
else if (searchOptions.mSearchLocation == sCurrentProject)
|
||||||
|
@ -422,7 +428,15 @@ namespace IDE.ui
|
||||||
if (sourceViewPanel != null)
|
if (sourceViewPanel != null)
|
||||||
{
|
{
|
||||||
if (sourceViewPanel.mProjectSource != null)
|
if (sourceViewPanel.mProjectSource != null)
|
||||||
AddFromFilesFolder(sourceViewPanel.mProjectSource.mProject.mRootFolder, searchOptions);
|
{
|
||||||
|
var project = sourceViewPanel.mProjectSource.mProject;
|
||||||
|
if ((isReplace) && (project.mLocked))
|
||||||
|
{
|
||||||
|
QueueLine(scope String()..AppendF("ERROR: Project '{}' not processed for Find and Replace because it's locked", project.mProjectName));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
AddFromFilesFolder(project.mRootFolder, searchOptions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -606,7 +620,7 @@ namespace IDE.ui
|
||||||
delete pendingLine;
|
delete pendingLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
Write(sb);
|
WriteSmart(sb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue