mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-09 03:24:59 -06:00
ide: Search the web for errors
git-svn-id: svn://ultimatepp.org/upp/trunk@14694 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c9ecfb9806
commit
f88cdc930e
2 changed files with 20 additions and 5 deletions
|
|
@ -602,22 +602,36 @@ void Ide::ShowFound()
|
|||
GoToError(FFound());
|
||||
}
|
||||
|
||||
void Ide::CopyError(bool all)
|
||||
String Ide::GetErrorsText(bool all, bool src)
|
||||
{
|
||||
int c = error.GetCursor();
|
||||
if(!all && c < 0)
|
||||
return;
|
||||
return Null;
|
||||
String txt;
|
||||
int h = all ? error.GetCount() : error.GetCursor() + 1;
|
||||
for(int i = all ? 0 : c; i < h; i++)
|
||||
txt << error.Get(i, 0) << " (" << error.Get(i, 1) << "): " << error.Get(i, 2) << "\r\n";
|
||||
WriteClipboardText(txt);
|
||||
for(int i = all ? 0 : c; i < h; i++) {
|
||||
if(src)
|
||||
txt << error.Get(i, 0) << " (" << error.Get(i, 1) << "): ";
|
||||
txt << error.Get(i, 2) << "\r\n";
|
||||
}
|
||||
return txt;
|
||||
}
|
||||
|
||||
void Ide::CopyError(bool all)
|
||||
{
|
||||
String s = GetErrorsText(all, true);
|
||||
if(s.GetCount())
|
||||
WriteClipboardText(s);
|
||||
}
|
||||
|
||||
void Ide::ErrorMenu(Bar& bar)
|
||||
{
|
||||
bar.Add(error.IsCursor(), "Copy", THISBACK1(CopyError, false));
|
||||
bar.Add("Copy all", THISBACK1(CopyError, true));
|
||||
bar.Separator();
|
||||
bar.Add(error.IsCursor(), "Search the web..", IdeImg::Google(), [=] {
|
||||
LaunchWebBrowser("https://www.google.com/search?q=" + GetErrorsText(false, false));
|
||||
});
|
||||
}
|
||||
|
||||
void Ide::SelError()
|
||||
|
|
|
|||
|
|
@ -1033,6 +1033,7 @@ public:
|
|||
void ConsoleLine(const String& line, bool assist = false);
|
||||
void ConsoleRunEnd();
|
||||
void SyncErrorsMessage();
|
||||
String GetErrorsText(bool all, bool src);
|
||||
void CopyError(bool all);
|
||||
void ErrorMenu(Bar& bar);
|
||||
void ShowError();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue