mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: Assist now automagically adds packages
git-svn-id: svn://ultimatepp.org/upp/trunk@7899 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
0878b31e0b
commit
37f9eb1711
4 changed files with 579 additions and 553 deletions
|
|
@ -651,6 +651,17 @@ void AssistEditor::AssistInsert()
|
|||
Assist();
|
||||
IgnoreMouseUp();
|
||||
return;
|
||||
} else {
|
||||
String pkg = include_path.Left(include_path.GetCount()-1);
|
||||
Vector<String> nests = SplitDirs(GetVar("UPP"));
|
||||
for(int i = 0; i < nests.GetCount(); i++){
|
||||
if(FileExists(nests[i]+"/"+include_path+GetFileName(pkg)+".upp")) {
|
||||
Ide *ide = dynamic_cast<Ide *>(TheIde());
|
||||
if(ide)
|
||||
ide->AddPackage(pkg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -558,6 +558,20 @@ const Workspace& Ide::IdeWorkspace() const
|
|||
return wspc;
|
||||
}
|
||||
|
||||
void Ide::AddPackage(const String& p)
|
||||
{
|
||||
const Workspace& wspc = IdeWorkspace();
|
||||
for(int i = 0; i < wspc.GetCount(); i++){
|
||||
if(wspc[i] == p)
|
||||
return;
|
||||
}
|
||||
if(!PromptOKCancel("Package [* " + p + "] is not yet in the workspace.&Do you want to add it?"))
|
||||
return;
|
||||
OptItem& m = actual.uses.Add();
|
||||
m.text = p;
|
||||
SaveLoadPackage();
|
||||
}
|
||||
|
||||
int Ide::GetPackageIndex()
|
||||
{
|
||||
const Workspace& wspc = IdeWorkspace();
|
||||
|
|
|
|||
|
|
@ -866,6 +866,7 @@ public:
|
|||
void SaveConfigOnTime();
|
||||
|
||||
int GetPackageIndex();
|
||||
void AddPackage(const String& p);
|
||||
|
||||
void BeepMuteExclamation() { if(!mute_sounds) BeepExclamation(); }
|
||||
void BeepMuteInformation() { if(!mute_sounds) BeepInformation(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue