PostgreSQL.hhp

From: "Darko Prenosil" <Darko(dot)Prenosil(at)finteh(dot)hr>
To: <pgadmin-hackers(at)postgresql(dot)org>
Subject: PostgreSQL.hhp
Date: 2003-07-20 21:23:14
Message-ID: 000701c34f05$3f4dcd00$6b96bfd5@darko
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Now when there is hhp file for PostgreSQL help why not enable it in
PgAdmin3.

So:

In misc.h add function declaration:

void DisplayPgSqlHelp(wxWindow *wnd, const wxString &helpTopic, char
**icon=0);

In misc.cpp add function definition:

void DisplayPgSqlHelp(wxWindow *wnd, const wxString &helpTopic, char
**icon){
extern wxString docPath;
static wxHtmlHelpController *helpCtl=0;
static bool firstCall=true;

if (firstCall)
{
firstCall=false;
wxString helpfile=docPath + wxT("/") +
settings->GetCanonicalLanguage() + wxT("/pg/PostgreSQL");

if (!wxFile::Exists(helpfile + wxT(".hhp")) &&
!wxFile::Exists(helpfile + wxT(".zip")))
helpfile=docPath + wxT("/en_US/pg/PostgreSQL");

if (wxFile::Exists(helpfile + wxT(".hhp")) ||
wxFile::Exists(helpfile + wxT(".zip")))
{
helpCtl=new wxHtmlHelpController();
helpCtl->Initialize(helpfile);
}
}

if (helpCtl)
{
if (helpTopic == wxT("index"))
helpCtl->DisplayContents();
else
helpCtl->DisplaySection(helpTopic + wxT(".html"));
}
else
{
while (wnd->GetParent())
wnd=wnd->GetParent();

frmHelp::LoadLocalDoc(wnd, helpTopic + wxT(".html"));
}
}

In events.cpp change function definition:

void frmMain::OnPgsqlHelp(wxCommandEvent& event)
{
DisplayPgSqlHelp(this, wxT("index"));
}

And we have Postgresql help available.

I promise I make a patch next time, I forgot to save originals, sorry !

Regards !

Browse pgadmin-hackers by date

  From Date Subject
Next Message Adam H.Pendleton 2003-07-20 21:45:51 Re: patch for the tips.txt translation.
Previous Message Darko Prenosil 2003-07-20 21:08:57 Re: acinclude.m4.patch