diff --git a/uppsrc/CtrlLib/FileList.cpp b/uppsrc/CtrlLib/FileList.cpp index 119ea4613..f331d59c0 100644 --- a/uppsrc/CtrlLib/FileList.cpp +++ b/uppsrc/CtrlLib/FileList.cpp @@ -279,6 +279,15 @@ void FileList::Set(int ii, KillEdit(); } +void FileList::Set(int ii, const File& f) +{ + Value v; + File& m = CreateRawValue(v); + m = f; + ColumnList::Set(ii, v, !m.isdir); + KillEdit(); +} + void FileList::SetIcon(int ii, const Image& icon) { Value v; diff --git a/uppsrc/CtrlLib/FileSel.h b/uppsrc/CtrlLib/FileSel.h index 9f1cfd83b..6295ffbef 100644 --- a/uppsrc/CtrlLib/FileSel.h +++ b/uppsrc/CtrlLib/FileSel.h @@ -88,6 +88,7 @@ public: bool isdir = false, int64 length = 0, Time time = Null, Color extink = Null, const String& desc = Null, Font descfont = Null, Value data = Null, Color underline = Null, bool unixexe = false, bool hidden = false); + void Set(int ii, const File& f); void SetIcon(int ii, const Image& icon); void Add(const String& name, const Image& icon = Null, Font font = StdFont(), Color ink = SColorText(), diff --git a/uppsrc/CtrlLib/init b/uppsrc/CtrlLib/init index 0a86c1384..66ee01a5b 100644 --- a/uppsrc/CtrlLib/init +++ b/uppsrc/CtrlLib/init @@ -2,7 +2,7 @@ #define _CtrlLib_icpp_init_stub #include "CtrlCore/init" #include "PdfDraw/init" -#define BLITZ_INDEX__ FED7D29EA5A0406C1453E5254B65174A9 +#define BLITZ_INDEX__ FF09FB60AB3A287882911CDBDE7CE1518 #include "CtrlLib.icpp" #undef BLITZ_INDEX__ #endif diff --git a/uppsrc/CtrlLib/src.tpp/FileList$en-us.tpp b/uppsrc/CtrlLib/src.tpp/FileList$en-us.tpp index af2f41cf4..01911bf59 100644 --- a/uppsrc/CtrlLib/src.tpp/FileList$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/FileList$en-us.tpp @@ -201,7 +201,7 @@ nt]_[*@3 ii], [@(0.0.255) const]_[_^Image^ Image][@(0.0.255) `&]_[*@3 icon])&] [s2;%% Replaces an icon of file item.&] [s3;%% &] [s4; &] -[s5;:FileList`:`:Add`(const String`&`,const Image`&`,Font`,Color`,bool`,int64`,Time`,Color`,const String`&`,Font`,Value`,Color`,bool`): [@(0.0.255) v +[s5;:FileList`:`:Add`(const String`&`,const Image`&`,Font`,Color`,bool`,int64`,Time`,Color`,const String`&`,Font`,Value`,Color`,bool`,bool`): [@(0.0.255) v oid]_[* Add]([@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 name], [@(0.0.255) const]_[_^Image^ Image][@(0.0.255) `&]_[*@3 icon]_`=_Null, [_^Font^ Font]_[*@3 font]_`=_StdFont(), [_^Color^ Color]_[*@3 ink]_`=_SColorText(), @@ -210,7 +210,7 @@ oid]_[* Add]([@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 name], [@(0.0.255) const]_[_^String^ String][@(0.0.255) `&]_[*@3 desc]_`=_Null, [_^Font^ Font]_[*@3 descfont]_`=_Null, [_^Value^ Value]_[*@3 data]_`=_Null, [_^Color^ Color]_[*@3 underline]_`=_Null, [@(0.0.255) bool]_[*@3 unixexe]_`=_[@(0.0.255) fa -lse])&] +lse], [@(0.0.255) bool]_[*@3 hidden]_`=_[@(0.0.255) false])&] [s2;%% Adds a new file item at the end of list.&] [s3;%% &] [s4; &] @@ -250,6 +250,11 @@ lse], [@(0.0.255) bool]_[*@3 hidden]_`=_[@(0.0.255) false])&] [s2;%% Replaces an information about a file item at specified position.&] [s3;%% &] [s4; &] +[s5;:FileList`:`:Set`(int`,const FileList`:`:File`&`): [@(0.0.255) void]_[* Set]([@(0.0.255) i +nt]_[*@3 ii], [@(0.0.255) const]_[_^FileList`:`:File^ File][@(0.0.255) `&]_[*@3 f])&] +[s2;%% Replaces an information about a file item at specified position.&] +[s3;%% &] +[s4; &] [s5;:FileList`:`:GetCurrentName`(`)const: [_^String^ String]_[* GetCurrentName]()_[@(0.0.255) c onst]&] [s2;%% Returns the filename of item with cursor. If there is no cursor, diff --git a/uppsrc/Web/ctrl/DlgHttpServer.cpp b/uppsrc/Web/ctrl/DlgHttpServer.cpp index 97f57d91e..fc92b629b 100644 --- a/uppsrc/Web/ctrl/DlgHttpServer.cpp +++ b/uppsrc/Web/ctrl/DlgHttpServer.cpp @@ -2,6 +2,7 @@ // DlgServerGui: ISAPI web server connector. #include "WebCtrl.h" + #pragma hdrstop #define LNGFILE diff --git a/uppsrc/Web/ctrl/DlgHttpServer.h b/uppsrc/Web/ctrl/DlgHttpServer.h index f5b838593..28c00a37a 100644 --- a/uppsrc/Web/ctrl/DlgHttpServer.h +++ b/uppsrc/Web/ctrl/DlgHttpServer.h @@ -1,5 +1,7 @@ ////////////////////////////////////////////////////////////////////// +using namespace Upp; + class DlgServerGui; class DlgHttpServer diff --git a/uppsrc/Web/ctrl/DlgHttpServer.lay b/uppsrc/Web/ctrl/DlgHttpServer.lay index 2dc6301af..7adc004ab 100644 --- a/uppsrc/Web/ctrl/DlgHttpServer.lay +++ b/uppsrc/Web/ctrl/DlgHttpServer.lay @@ -1,5 +1,3 @@ -#ifdef LAYOUTFILE - LAYOUT(HttpServerLayout, 250, 144) ITEM(Label, semaphore, LeftPosZ(24, 30).TopPosZ(12, 48)) ITEM(Label, dv___1, SetLabel(t_("Hit count:")).LeftPosZ(80, 76).TopPosZ(4, 19)) @@ -16,4 +14,3 @@ LAYOUT(HttpServerLayout, 250, 144) ITEM(Button, cancel, SetLabel(t_("Stop")).RightPosZ(4, 80).BottomPosZ(4, 22)) END_LAYOUT -#endif diff --git a/uppsrc/ide/UppDlg.h b/uppsrc/ide/UppDlg.h index 38addd290..3bd99d963 100644 --- a/uppsrc/ide/UppDlg.h +++ b/uppsrc/ide/UppDlg.h @@ -127,9 +127,10 @@ struct UppList : FileList { struct WorkspaceWork { static Font ListFont(); - FileList package; - UppList filelist; - Vector fileindex; + FileList package; + Vector speed; + UppList filelist; + Vector fileindex; String main; String actualpackage; @@ -160,6 +161,8 @@ struct WorkspaceWork { bool organizer; bool showtime; bool sort; + + Index errorfiles; virtual void PackageCursor(); virtual void FileCursor(); @@ -175,6 +178,7 @@ struct WorkspaceWork { void ScanWorkspace(); void SavePackage(); void RestoreBackup(); + void SyncErrorPackages(); void SerializeFileSetup(Stream& s) { s % filelist % package; } @@ -193,8 +197,8 @@ struct WorkspaceWork { String GetActivePackagePath() const { return PackagePath(package.GetCurrentName()); } String GetActiveFileName() const; String GetActiveFilePath() const; - void OpenFileFolder(); - void OpenPackageFolder(); + void OpenFileFolder(); + void OpenPackageFolder(); bool IsActiveFile() const; Package::File& ActiveFile(); String FileName(int i) const; @@ -228,6 +232,7 @@ struct WorkspaceWork { void RemovePackageMenu(Bar& bar); void RemovePackage(String from_package); + static bool IsAux(const String& p); bool IsAux(); void PackageMenu(Bar& bar); @@ -235,6 +240,8 @@ struct WorkspaceWork { void SpecialFileMenu(Bar& bar); String PackagePathA(const String& pn); + + void SetErrorFiles(const Vector& files); void SerializeClosed(Stream& s); diff --git a/uppsrc/ide/UppWspc.cpp b/uppsrc/ide/UppWspc.cpp index c031ef5bf..8b48c35a9 100644 --- a/uppsrc/ide/UppWspc.cpp +++ b/uppsrc/ide/UppWspc.cpp @@ -4,11 +4,34 @@ const char tempaux[] = ""; const char prjaux[] = ""; const char ideaux[] = ""; +Image OverLtRed(const Image& m) +{ + Image red = CreateImage(m.GetSize(), Blend(LtRed, SColorPaper)); + Over(red, Point(0, 0), m, m.GetSize()); + return red; +} + +Image ImageOverRed(const Image& m) +{ + return MakeImage(m, OverLtRed); +} + Font WorkspaceWork::ListFont() { return StdFont(); }; +void WorkspaceWork::SetErrorFiles(const Vector& files) +{ + errorfiles <<= files; + int i = filelist.GetCursor(); + int s = filelist.GetSbPos(); + SaveLoadPackage(); + filelist.SetSbPos(s); + filelist.SetCursor(i); + SyncErrorPackages(); +} + String WorkspaceWork::PackagePathA(const String& pn) { if(pn == prjaux) { String nm; @@ -54,6 +77,28 @@ struct PackageOrder { } }; +void WorkspaceWork::SyncErrorPackages() +{ + TIMING("SyncErrorPackages"); + for(int i = 0; i < package.GetCount(); i++) { + FileList::File f = package.Get(i); + if(!IsAux(f.name) && i < speed.GetCount()) { + FileList::File ff = f; + String path = GetFileFolder(PackagePath(f.name)); + ff.icon = speed[i] ? IdeCommonImg::FastPackage() : IdeImg::Package(); + ff.underline = Null; + for(int q = 0; q < errorfiles.GetCount(); q++) { + if(errorfiles[q].StartsWith(path)) { + ff.icon = ImageOverRed(ff.icon); + ff.underline = LtRed; + break; + } + } + package.Set(i, ff); + } + } +} + void WorkspaceWork::ScanWorkspace() { Workspace wspc; wspc.Scan(main); @@ -62,7 +107,7 @@ void WorkspaceWork::ScanWorkspace() { filelist.Clear(); package.Clear(); Vector pks; - Vector speed; + speed.Clear(); for(int i = 0; i < wspc.package.GetCount(); i++) { pks.Add(wspc.package.GetKey(i)); speed.Add(wspc.GetPackage(i).optimize_speed); @@ -82,9 +127,7 @@ void WorkspaceWork::ScanWorkspace() { fnt.Bold(); if(pi.italic) fnt.Italic(); - package.Add(pk, - speed[i] ? IdeCommonImg::FastPackage() : IdeImg::Package(), - fnt, Nvl(pi.ink, SColorText()), false, 0, Null, SColorMark); + package.Add(pk, Null, fnt, Nvl(pi.ink, SColorText()), false, 0, Null, SColorMark); } if(!organizer) { package.Add(prjaux, IdeImg::PrjAux(), ListFont(), Magenta); @@ -93,6 +136,8 @@ void WorkspaceWork::ScanWorkspace() { package.Add(METAPACKAGE, IdeImg::Meta(), ListFont(), Red); } package.SetCursor(0); + + SyncErrorPackages(); } void WorkspaceWork::SavePackage() @@ -211,6 +256,10 @@ void WorkspaceWork::LoadActualPackage() m = TopicImg::IGroup(); else m = TopicImg::Group(); + if(errorfiles.Find(p) >= 0) { + m = ImageOverRed(m); + uln = LtRed; + } filelist.Add(f, m, ListFont(), SColorText, false, 0, Null, SColorMark, Null, Null, Null, uln); fileindex.Add(i); @@ -689,9 +738,14 @@ void WorkspaceWork::ShowFile(int pi) } } +bool WorkspaceWork::IsAux(const String& p) +{ + return p == tempaux || p == prjaux || p == ideaux || p == METAPACKAGE; +} + bool WorkspaceWork::IsAux() { - return actualpackage == tempaux || actualpackage == prjaux || actualpackage == ideaux || actualpackage == METAPACKAGE; + return IsAux(actualpackage); } void WorkspaceWork::SpecialFileMenu(Bar& menu) diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index 2b04a3442..2737ecac6 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -487,6 +487,8 @@ void Ide::ClearErrorEditor() for(int i = 0; i < filedata.GetCount(); i++) { ClearErrorEditor(filedata.GetKey(i)); } + + SetErrorFiles(Vector()); } void Ide::ClearErrorEditor(String file) @@ -513,8 +515,11 @@ void Ide::SetErrorEditor() One host = CreateHost(false); String hfile; EditorBar hbar; + Vector errorfiles; for(int i = 0; i < console.GetLineCount(); i++) { if(FindLineError(console.GetUtf8Line(i), *host, file, lineno, error)) { + file = NormalizePath(file); + errorfiles.Add(file); if(editfile == file) { editor.SetError(lineno - 1, error); refresh = true; @@ -534,6 +539,7 @@ void Ide::SetErrorEditor() Filedata(hfile).lineinfo = hbar.GetLineInfo(); if(refresh) editor.RefreshFrame(); + SetErrorFiles(errorfiles); } void Ide::Renumber() {