mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Fixed issues in theide HelpWindow - problems displaying plugin/bz2 content and view margins
git-svn-id: svn://ultimatepp.org/upp/trunk@441 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
305dff7459
commit
df9c8ce618
4 changed files with 76 additions and 58 deletions
|
|
@ -192,7 +192,7 @@ HelpWindow::HelpWindow()
|
|||
view.SetZoom(Zoom(1, 1));
|
||||
zoom.m = 160;
|
||||
SetZoom();
|
||||
view.Margins(2);
|
||||
view.Margins(Rect(12, 12, 2, 2));
|
||||
SetRect(Ctrl::GetWorkArea().Deflated(80));
|
||||
tree <<= THISBACK(TreeCursor);
|
||||
tree.NoRoot();
|
||||
|
|
|
|||
|
|
@ -152,38 +152,42 @@ void SyncTopicFile(const String& link, const String& path)
|
|||
SyncTopicFile(ParseQTF(tp.text), link, path, tp.title);
|
||||
}
|
||||
|
||||
void SyncRefsDir(const char *dir, const String& rel, Progress& pi)
|
||||
{
|
||||
for(FindFile pff(AppendFileName(dir, "*.*")); pff; pff.Next()) {
|
||||
if(pff.IsFolder() && *pff.GetName() != '.') {
|
||||
pi.Step();
|
||||
TopicLink tl;
|
||||
tl.package = rel + pff.GetName();
|
||||
String pdir = AppendFileName(dir, pff.GetName());
|
||||
for(FindFile ff(AppendFileName(pdir, "*.tpp")); ff; ff.Next()) {
|
||||
if(ff.IsFolder()) {
|
||||
String group = GetFileTitle(ff.GetName());
|
||||
tl.group = group;
|
||||
String dir = AppendFileName(pdir, ff.GetName());
|
||||
for(FindFile ft(AppendFileName(dir, "*.tpp")); ft; ft.Next()) {
|
||||
if(ft.IsFile()) {
|
||||
String path = AppendFileName(dir, ft.GetName());
|
||||
tl.topic = GetFileTitle(ft.GetName());
|
||||
String link = TopicLinkString(tl);
|
||||
pi.SetText("Indexing topic " + tl.topic);
|
||||
SyncTopicFile(link, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SyncRefsDir(pdir, tl.package + '/', pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SyncRefs()
|
||||
{
|
||||
Progress pi;
|
||||
pi.AlignText(ALIGN_LEFT);
|
||||
Vector<String> upp = GetUppDirs();
|
||||
for(int i = 0; i < upp.GetCount(); i++) {
|
||||
for(FindFile pff(AppendFileName(upp[i], "*.*")); pff; pff.Next()) {
|
||||
if(pff.IsFolder()) {
|
||||
pi.Step();
|
||||
String package = pff.GetName();
|
||||
String pdir = PackageDirectory(package);
|
||||
TopicLink tl;
|
||||
tl.package = package;
|
||||
for(FindFile ff(AppendFileName(pdir, "*.tpp")); ff; ff.Next()) {
|
||||
if(ff.IsFolder()) {
|
||||
String group = GetFileTitle(ff.GetName());
|
||||
tl.group = group;
|
||||
String dir = AppendFileName(pdir, ff.GetName());
|
||||
for(FindFile ft(AppendFileName(dir, "*.tpp")); ft; ft.Next()) {
|
||||
if(ft.IsFile()) {
|
||||
String path = AppendFileName(dir, ft.GetName());
|
||||
tl.topic = GetFileTitle(ft.GetName());
|
||||
String link = TopicLinkString(tl);
|
||||
pi.SetText("Indexing topic " + tl.topic);
|
||||
SyncTopicFile(link, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < upp.GetCount(); i++)
|
||||
SyncRefsDir(upp[i], String(), pi);
|
||||
}
|
||||
|
||||
Vector<String> GetRefLinks(const String& ref)
|
||||
|
|
|
|||
|
|
@ -128,6 +128,43 @@ void GatherLinks(Index<String>& link, const char *topic)
|
|||
}
|
||||
}
|
||||
|
||||
Index<String> TopicCtrl::idelink;
|
||||
|
||||
void TopicCtrl::ScanDirForTpp(const char *dir, Index<String>& li, Vector<int>& sdx,
|
||||
const String& lng,
|
||||
VectorMap<String, VectorMap<String, Vector<String> > >& map,
|
||||
const String& rel)
|
||||
{
|
||||
TopicLink tl;
|
||||
for(FindFile pff(AppendFileName(dir, "*.*")); pff; pff.Next()) {
|
||||
if(pff.IsFolder() && *pff.GetName() != '.') {
|
||||
String pdir = AppendFileName(dir, pff.GetName());
|
||||
tl.package = rel + pff.GetName();
|
||||
for(FindFile ff(AppendFileName(pdir, "*.tpp")); ff; ff.Next())
|
||||
if(ff.IsFolder()) {
|
||||
tl.group = GetFileTitle(ff.GetName());
|
||||
String dir = AppendFileName(pdir, ff.GetName());
|
||||
for(FindFile ft(AppendFileName(dir, "*.tpp")); ft; ft.Next())
|
||||
if(ft.IsFile()) {
|
||||
tl.topic = GetFileTitle(ft.GetName());
|
||||
int q = tl.topic.ReverseFind('$');
|
||||
String l;
|
||||
if(q >= 0) {
|
||||
l = ToUpper(tl.topic.Mid(q + 1));
|
||||
li.FindAdd(l);
|
||||
}
|
||||
String link = TopicLinkString(tl);
|
||||
if(idelink.Find(link) < 0 && MatchTopicLink(link, sdx) &&
|
||||
(lng == "All" || lng == l)) {
|
||||
map.GetAdd(tl.package).GetAdd(tl.group).Add(tl.topic);
|
||||
}
|
||||
}
|
||||
}
|
||||
ScanDirForTpp(pdir, li, sdx, lng, map, tl.package + '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TopicCtrl::SyncDocTree()
|
||||
{
|
||||
Vector<String> ss = Split((String)~search, ' ');
|
||||
|
|
@ -137,7 +174,6 @@ void TopicCtrl::SyncDocTree()
|
|||
|
||||
ClearTree();
|
||||
|
||||
static Index<String> idelink;
|
||||
String hdx = "topic://ide/app/index$en-us";
|
||||
if(idelink.GetCount() == 0)
|
||||
GatherLinks(idelink, hdx);
|
||||
|
|
@ -157,34 +193,8 @@ void TopicCtrl::SyncDocTree()
|
|||
lang.Clear();
|
||||
lang.Add("All");
|
||||
Index<String> li;
|
||||
for(int i = 0; i < upp.GetCount(); i++) {
|
||||
TopicLink tl;
|
||||
for(FindFile pff(AppendFileName(upp[i], "*.*")); pff; pff.Next()) {
|
||||
if(pff.IsFolder()) {
|
||||
String pdir = AppendFileName(upp[i], pff.GetName());
|
||||
tl.package = pff.GetName();
|
||||
for(FindFile ff(AppendFileName(pdir, "*.tpp")); ff; ff.Next())
|
||||
if(ff.IsFolder()) {
|
||||
tl.group = GetFileTitle(ff.GetName());
|
||||
String dir = AppendFileName(pdir, ff.GetName());
|
||||
for(FindFile ft(AppendFileName(dir, "*.tpp")); ft; ft.Next())
|
||||
if(ft.IsFile()) {
|
||||
tl.topic = GetFileTitle(ft.GetName());
|
||||
int q = tl.topic.ReverseFind('$');
|
||||
String l;
|
||||
if(q >= 0) {
|
||||
l = ToUpper(tl.topic.Mid(q + 1));
|
||||
li.FindAdd(l);
|
||||
}
|
||||
String link = TopicLinkString(tl);
|
||||
if(idelink.Find(link) < 0 && MatchTopicLink(link, sdx) &&
|
||||
(lng == "All" || lng == l))
|
||||
map.GetAdd(tl.package).GetAdd(tl.group).Add(tl.topic);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < upp.GetCount(); i++)
|
||||
ScanDirForTpp(upp[i], li, sdx, lng, map, String());
|
||||
Vector<String> sli = li.PickKeys();
|
||||
Sort(sli);
|
||||
for(int i = 0; i < sli.GetCount(); i++)
|
||||
|
|
@ -199,7 +209,7 @@ void TopicCtrl::SyncDocTree()
|
|||
TopicLink tl;
|
||||
tl.package = map.GetKey(i);
|
||||
int pid = AddTree(used.Find(tl.package) >= 0 ? usid : otid,
|
||||
TopicImg::Package(), Null, tl.package);
|
||||
TopicImg::Package(), Null, tl.package);
|
||||
VectorMap<String, Vector<String> >& package = map[i];
|
||||
for(int i = 0; i < package.GetCount(); i++) {
|
||||
tl.group = package.GetKey(i);
|
||||
|
|
|
|||
|
|
@ -268,12 +268,16 @@ private:
|
|||
void All();
|
||||
void Lang();
|
||||
void SShow();
|
||||
void ScanDirForTpp(const char *dir, Index<String>& li, Vector<int>& sdx, const String& lng,
|
||||
VectorMap<String, VectorMap<String, Vector<String> > >& map,
|
||||
const String& rel);
|
||||
|
||||
Label search_label;
|
||||
WithDropChoice<EditString> search;
|
||||
DropList lang;
|
||||
bool internal;
|
||||
bool showwords, issearch, all;
|
||||
static Index<String> idelink;
|
||||
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue