mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: Ide now highlights errorenous files and packages (rm #54)
git-svn-id: svn://ultimatepp.org/upp/trunk@3943 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
29320fc63c
commit
ece45ab88c
10 changed files with 98 additions and 16 deletions
|
|
@ -279,6 +279,15 @@ void FileList::Set(int ii,
|
|||
KillEdit();
|
||||
}
|
||||
|
||||
void FileList::Set(int ii, const File& f)
|
||||
{
|
||||
Value v;
|
||||
File& m = CreateRawValue<File>(v);
|
||||
m = f;
|
||||
ColumnList::Set(ii, v, !m.isdir);
|
||||
KillEdit();
|
||||
}
|
||||
|
||||
void FileList::SetIcon(int ii, const Image& icon)
|
||||
{
|
||||
Value v;
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// DlgServerGui: ISAPI web server connector.
|
||||
|
||||
#include "WebCtrl.h"
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#define LNGFILE <Web/Ctrl/DlgHttpServer.lay>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
class DlgServerGui;
|
||||
|
||||
class DlgHttpServer
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -127,9 +127,10 @@ struct UppList : FileList {
|
|||
struct WorkspaceWork {
|
||||
static Font ListFont();
|
||||
|
||||
FileList package;
|
||||
UppList filelist;
|
||||
Vector<int> fileindex;
|
||||
FileList package;
|
||||
Vector<bool> speed;
|
||||
UppList filelist;
|
||||
Vector<int> fileindex;
|
||||
|
||||
String main;
|
||||
String actualpackage;
|
||||
|
|
@ -160,6 +161,8 @@ struct WorkspaceWork {
|
|||
bool organizer;
|
||||
bool showtime;
|
||||
bool sort;
|
||||
|
||||
Index<String> 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<String>& files);
|
||||
|
||||
void SerializeClosed(Stream& s);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,34 @@ const char tempaux[] = "<temp-aux>";
|
|||
const char prjaux[] = "<prj-aux>";
|
||||
const char ideaux[] = "<ide-aux>";
|
||||
|
||||
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<String>& 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<String> pks;
|
||||
Vector<bool> 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)
|
||||
|
|
|
|||
|
|
@ -487,6 +487,8 @@ void Ide::ClearErrorEditor()
|
|||
for(int i = 0; i < filedata.GetCount(); i++) {
|
||||
ClearErrorEditor(filedata.GetKey(i));
|
||||
}
|
||||
|
||||
SetErrorFiles(Vector<String>());
|
||||
}
|
||||
|
||||
void Ide::ClearErrorEditor(String file)
|
||||
|
|
@ -513,8 +515,11 @@ void Ide::SetErrorEditor()
|
|||
One<Host> host = CreateHost(false);
|
||||
String hfile;
|
||||
EditorBar hbar;
|
||||
Vector<String> 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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue