Log Message:
-----------
more Hint enhancements
Modified Files:
--------------
pgadmin3:
CHANGELOG.txt (r1.206 -> r1.207)
pgadmin3/docs/en_US/hints:
pk.html (r1.3 -> r1.4)
pgadmin3/src:
pgAdmin3.dsp (r1.127 -> r1.128)
pgadmin3/src/include:
frmHint.h (r1.5 -> r1.6)
pgObject.h (r1.67 -> r1.68)
pgTable.h (r1.30 -> r1.31)
pgadmin3/src/schema:
pgTable.cpp (r1.65 -> r1.66)
pgadmin3/src/ui:
events.cpp (r1.129 -> r1.130)
frmHint.cpp (r1.6 -> r1.7)
frmMain.cpp (r1.126 -> r1.127)
pgadmin3/src/ui/common:
frmHint.xrc (r1.4 -> r1.5)
Added Files:
-----------
pgadmin3/docs/en_US/hints:
multiple.html (r1.1)
pgadmin3/src/include/images:
hint2.xpm (r1.1)
Index: CHANGELOG.txt
===================================================================
RCS file: /projects/pgadmin3/CHANGELOG.txt,v
retrieving revision 1.206
retrieving revision 1.207
diff -LCHANGELOG.txt -LCHANGELOG.txt -u -w -r1.206 -r1.207
--- CHANGELOG.txt
+++ CHANGELOG.txt
@@ -17,6 +17,7 @@
</ul>
<br>
<ul>
+ <li>2005-04-22 AP more Hint enhancements
<li>2005-04-19 AP Hint enhancements
<li>2005-04-18 AP Unix Domain Socket additional stuff
<li>2005-04-18 AP switch to wxWidgets 2.6
--- /dev/null
+++ docs/en_US/hints/multiple.html
@@ -0,0 +1,13 @@
+<html>
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<link rel="STYLESHEET" type="text/css" href="../pgadmin3.css">
+<title>Guru Hints</title>
+</head>
+<body>
+<p>
+pgAdmin III has found multiple issues on the current object.
+</p>
+</body>
+</html>
Index: pk.html
===================================================================
RCS file: /projects/pgadmin3/docs/en_US/hints/pk.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -Ldocs/en_US/hints/pk.html -Ldocs/en_US/hints/pk.html -u -w -r1.3 -r1.4
--- docs/en_US/hints/pk.html
+++ docs/en_US/hints/pk.html
@@ -31,7 +31,7 @@
</p>
<p>
As the case of system tables shows, the goal of uniqueness and fast access can
be achieved with other approaches than
-a primary key. Still, for clarity of the data model, you're strongly
encouraged to use them.
+a primary key. Still, for clarity of the data model, you're strongly
encouraged to use primary keys for this purpose.
</p>
</body>
</html>
Index: pgAdmin3.dsp
===================================================================
RCS file: /projects/pgadmin3/src/pgAdmin3.dsp,v
retrieving revision 1.127
retrieving revision 1.128
diff -Lsrc/pgAdmin3.dsp -Lsrc/pgAdmin3.dsp -u -w -r1.127 -r1.128
--- src/pgAdmin3.dsp
+++ src/pgAdmin3.dsp
@@ -1043,15 +1043,11 @@
# PROP Default_Filter "*.xpm"
# Begin Source File
-SOURCE=.\include\images\agent.xpm
-# End Source File
-# Begin Source File
-
SOURCE=.\include\images\aggregate.xpm
# End Source File
# Begin Source File
-SOURCE=.\include\images\arguments.xpm
+SOURCE=.\include\images\back.xpm
# End Source File
# Begin Source File
@@ -1163,6 +1159,90 @@
# End Source File
# Begin Source File
+SOURCE=.\include\images\elephant32.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\elephant48.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\encoding.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\event.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_aggregate.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_append.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_group.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_hash.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_join.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_limit.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_materialize.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_merge.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_nested.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_result.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_scan.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_seek.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_setop.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_sort.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_subplan.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_unique.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\ex_unknown.xpm
+# End Source File
+# Begin Source File
+
SOURCE=.\include\images\file_open.xpm
# End Source File
# Begin Source File
@@ -1175,6 +1255,10 @@
# End Source File
# Begin Source File
+SOURCE=.\include\images\forward.xpm
+# End Source File
+# Begin Source File
+
SOURCE=.\include\images\function.xpm
# End Source File
# Begin Source File
@@ -1195,11 +1279,11 @@
# End Source File
# Begin Source File
-SOURCE=.\include\images\index.xpm
+SOURCE=.\include\images\hint2.xpm
# End Source File
# Begin Source File
-SOURCE=.\include\images\indexcolumn.xpm
+SOURCE=.\include\images\index.xpm
# End Source File
# Begin Source File
@@ -1231,10 +1315,6 @@
# End Source File
# Begin Source File
-SOURCE=.\include\images\pgAdmin3.ico
-# End Source File
-# Begin Source File
-
SOURCE=.\include\images\pgAdmin3.xpm
# End Source File
# Begin Source File
@@ -1283,6 +1363,10 @@
# End Source File
# Begin Source File
+SOURCE=.\include\images\reload.xpm
+# End Source File
+# Begin Source File
+
SOURCE=.\include\images\restore.xpm
# End Source File
# Begin Source File
@@ -1335,6 +1419,10 @@
# End Source File
# Begin Source File
+SOURCE=.\include\images\sortfilter.xpm
+# End Source File
+# Begin Source File
+
SOURCE=.\include\images\splash.xpm
# End Source File
# Begin Source File
Index: pgObject.h
===================================================================
RCS file: /projects/pgadmin3/src/include/pgObject.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -Lsrc/include/pgObject.h -Lsrc/include/pgObject.h -u -w -r1.67 -r1.68
--- src/include/pgObject.h
+++ src/include/pgObject.h
@@ -118,7 +118,7 @@
void iSetAcl(const wxString& newVal) { acl = newVal; }
virtual bool GetSystemObject() const { return false; }
virtual bool IsCollection() const { return false; }
- virtual void ShowHint(frmMain *form) {}
+ virtual void ShowHint(frmMain *form, bool force) {}
void ShowTree(frmMain *form, wxTreeCtrl *browser, ctlListView *properties,
ctlSQLBox *sqlPane);
Index: pgTable.h
===================================================================
RCS file: /projects/pgadmin3/src/include/pgTable.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lsrc/include/pgTable.h -Lsrc/include/pgTable.h -u -w -r1.30 -r1.31
--- src/include/pgTable.h
+++ src/include/pgTable.h
@@ -33,7 +33,7 @@
wxString GetAllConstraints(wxTreeCtrl *browser, wxTreeItemId collectionId,
int type);
void ShowTreeDetail(wxTreeCtrl *browser, frmMain *form=0, ctlListView
*properties=0, ctlSQLBox *sqlPane=0);
void ShowStatistics(frmMain *form, ctlListView *statistics);
- void ShowHint(frmMain *form);
+ void ShowHint(frmMain *form, bool force);
static pgObject *ReadObjects(pgCollection *collection, wxTreeCtrl
*browser, const wxString &restriction=wxT(""));
static void ShowStatistics(pgCollection *collection, ctlListView
*statistics);
@@ -77,6 +77,7 @@
private:
void UpdateInheritance();
+ bool GetVacuumHint();
wxULongLong rows;
double estimatedRows;
Index: frmHint.h
===================================================================
RCS file: /projects/pgadmin3/src/include/frmHint.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lsrc/include/frmHint.h -Lsrc/include/frmHint.h -u -w -r1.5 -r1.6
--- src/include/frmHint.h
+++ src/include/frmHint.h
@@ -19,7 +19,7 @@
#define HINT_PRIMARYKEY wxT("pk")
#define HINT_FKINDEX wxT("fki")
#define HINT_VACUUM wxT("vacuum")
-
+#define HINT_QUERYRUNTIME wxT("query-runtime")
#define HINT_RC_FIX 42
@@ -27,22 +27,28 @@
class frmHint : public DialogWithHelp
{
public:
- static int ShowHint(wxWindow *fr, const wxString &hint, const wxString
&info=wxEmptyString);
+ static int ShowHint(wxWindow *fr, const wxString &hint, const wxString
&info=wxEmptyString, bool force=false);
+ static int ShowHint(wxWindow *fr, const wxArrayString &hints, const
wxString &info=wxEmptyString);
static bool WantHint(const wxString &hint);
static void ResetHints();
+ void SetHint(int hint, const wxString &info);
+ void SetHint(const wxArrayInt &hintnos, const wxString &info);
+
private:
- frmHint(wxWindow *fr, int hint, const wxString &info=wxEmptyString);
+ frmHint(wxWindow *fr, bool force);
~frmHint();
void OnFix(wxCommandEvent &ev);
static int GetHintNo(const wxString &hint);
static bool WantHint(int hintno);
+ wxString GetPage(const wxChar *hintpage);
wxString GetHelpPage() const;
DECLARE_EVENT_TABLE();
int currentHint;
+ bool force;
};
--- /dev/null
+++ src/include/images/hint2.xpm
@@ -0,0 +1,53 @@
+/* XPM */
+static char * hint2_xpm[] = {
+"32 32 18 1",
+" c None",
+". c #FFDFDF",
+"+ c #EFBFBF",
+"@ c #FF8080",
+"# c #FF0000",
+"$ c #C00000",
+"% c #E08080",
+"& c #FFBFBF",
+"* c #FF4040",
+"= c #FFFFFF",
+"- c #808080",
+"; c #000000",
+"> c #BFBFBF",
+", c #E04040",
+"' c #E00000",
+") c #D00000",
+"! c #D04040",
+"~ c #EF4040",
+" .+ ",
+" @##$% ",
+" &@*###$% ",
+" @######$% ",
+" &@######$% ",
+" @###@@@##$% ",
+" &@##*&=&##$% ",
+" @[EMAIL PROTECTED]@##$% ",
+" &@###&===&##$% ",
+" @[EMAIL PROTECTED]@##$% ",
+" &@###&=---=&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED] ",
+" &@###&=-;;;-=&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED] ",
+" &@###&==-;;;-==&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED] ",
+" &@###&===-;;;-===&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED] ",
+" &@###&====-;;;-====&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED] ",
+" &@###&=====>--->=====&##$% ",
+" @[EMAIL PROTECTED]@##$% ",
+" &@###&======>--->======&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED] ",
+" &@###&=======-;;;-=======&##$% ",
+" @[EMAIL PROTECTED];;;[EMAIL PROTECTED]",
+"&@##*&========>--->========&##,%",
+"@[EMAIL PROTECTED]'$",
+"@###@@@@@@@@@@@@@@@@@@@@@@@@##)$",
+"&############################$$!",
+" @~''''''''''''''''''''''''')$!%",
+" $$$$$$$$$$$$$$$$$$$$$$$$$$$% "};
Index: pgTable.cpp
===================================================================
RCS file: /projects/pgadmin3/src/schema/pgTable.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -Lsrc/schema/pgTable.cpp -Lsrc/schema/pgTable.cpp -u -w -r1.65 -r1.66
--- src/schema/pgTable.cpp
+++ src/schema/pgTable.cpp
@@ -408,9 +408,9 @@
properties->AppendItem(_("System table?"), GetSystemObject());
properties->AppendItem(_("Comment"), GetComment());
- if (form && GetCanHint() && !hintShown)
+ if (form && GetVacuumHint() && !hintShown)
{
- ShowHint(form);
+ ShowHint(form, false);
}
}
}
@@ -418,6 +418,12 @@
bool pgTable::GetCanHint()
{
+ return (GetVacuumHint() || primaryKey.IsEmpty());
+}
+
+
+bool pgTable::GetVacuumHint()
+{
bool canHint=false;
if (rowsCounted)
@@ -438,10 +444,24 @@
}
-void pgTable::ShowHint(frmMain *form)
+void pgTable::ShowHint(frmMain *form, bool force)
{
hintShown = true;
- int rc=frmHint::ShowHint(form, HINT_VACUUM, GetFullIdentifier());
+ int rc;
+
+ if (force)
+ {
+ wxArrayString hints;
+ if (GetVacuumHint())
+ hints.Add(HINT_VACUUM);
+ if (primaryKey.IsEmpty())
+ hints.Add(HINT_PRIMARYKEY);
+
+ rc=frmHint::ShowHint(form, hints, GetFullIdentifier());
+ }
+ else
+ rc=frmHint::ShowHint(form, HINT_VACUUM, GetFullIdentifier(), force);
+
if (rc == HINT_RC_FIX)
{
frmMaintenance *frm=new frmMaintenance(form, this);
Index: frmHint.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/frmHint.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lsrc/ui/frmHint.cpp -Lsrc/ui/frmHint.cpp -u -w -r1.6 -r1.7
--- src/ui/frmHint.cpp
+++ src/ui/frmHint.cpp
@@ -33,11 +33,14 @@
#define HINT_CANSUPPRESS 1
#define HINT_CANABORT 2
#define HINT_CANFIX 4
+#define HINT_YESNO 8
+
struct
{
const wxChar *hintPage;
const wxChar *hintCaption;
+ const wxChar *fixText;
const wxChar *helpItem;
int flags;
}
@@ -45,34 +48,47 @@
{
{ HINT_CONNECTSERVER,
__("Server not listening"),
+ 0,
wxT("runtime-config#runtime-config-connection"),
HINT_CANSUPPRESS
},
{ HINT_MISSINGHBA,
__("Server denies access"),
+ 0,
wxT("client-authentication#auth-pg-hba-conf"),
HINT_CANSUPPRESS
},
{ HINT_MISSINGIDENT,
__("Ident authentication failed"),
+ 0,
wxT("auth-methods#auth-ident"),
HINT_CANSUPPRESS
},
{ HINT_PRIMARYKEY,
__("Creation of primary key suggested"),
+ 0,
wxT("ddl-constraints"),
HINT_CANSUPPRESS|HINT_CANABORT
},
{ HINT_FKINDEX,
__("Creation of index in referencing table suggested"),
+ 0,
wxT("ddl-constraints#ddl-constraints-fk"),
HINT_CANSUPPRESS|HINT_CANABORT
},
{ HINT_VACUUM,
__("Running VACUUM recommended"),
+ __("VACUUM"),
wxT("maintenance#routine-vacuuming"),
HINT_CANSUPPRESS | HINT_CANFIX
},
+ {
+ HINT_QUERYRUNTIME,
+ __(""),
+ 0,
+ wxT("pgadmin/query"),
+ HINT_CANSUPPRESS|HINT_CANABORT|HINT_YESNO
+ },
{ 0,0,0,0 }
};
@@ -87,52 +103,168 @@
#define chkSuppress CTRL_CHECKBOX("chkSuppress")
#define htmlHint (XRCCTRL(*this, "htmlHint", wxHtmlWindow))
#define btnFix CTRL_BUTTON("btnFix")
+#define btnYes CTRL_BUTTON("wxID_YES")
+#define btnNo CTRL_BUTTON("wxID_NO")
-frmHint::frmHint(wxWindow *fr, int hintno, const wxString &info) :
DialogWithHelp(0)
+frmHint::frmHint(wxWindow *fr, bool _force) : DialogWithHelp(0)
{
+ force=_force;
wxWindowBase::SetFont(settings->GetSystemFont());
LoadResource(fr, wxT("frmHint"));
+ if (force)
+ btnCancel->Disable();
+
SetIcon(wxIcon(pgAdmin3_xpm));
- SetTitle(_("pgAdmin III Guru Hint") + wxString(wxT(" - ")) +
wxGetTranslation(hintArray[hintno].hintCaption));
+}
+
+
+
+wxString frmHint::GetPage(const wxChar *hintPage)
+{
+ wxString page;
extern wxString docPath;
wxString cn=settings->GetCanonicalLanguage();
if (cn.IsEmpty())
cn=wxT("en_US");
- wxString filename=docPath + wxT("/") + cn + wxT("/hints/") +
hintArray[hintno].hintPage + wxT(".html");
+ wxString filename=docPath + wxT("/") + cn + wxT("/hints/") + hintPage +
wxT(".html");
if (!wxFile::Exists(filename))
- filename = docPath + wxT("/en_US/hints/") + hintArray[hintno].hintPage
+ wxT(".html");
+ filename = docPath + wxT("/en_US/hints/") + hintPage + wxT(".html");
if (wxFile::Exists(filename))
{
- if (info.IsEmpty())
- htmlHint->LoadPage(filename);
- else
- {
- wxString page;
wxUtfFile file(filename);
file.Read(page);
- page.Replace(wxT("<INFO>"), info);
- htmlHint->SetPage(page);
}
+
+ return page;
}
+
+
+void frmHint::SetHint(int hintno, const wxString &info)
+{
+ wxArrayInt hintnos;
+ hintnos.Add(hintno);
+ SetHint(hintnos, info);
+#if 0
+
+ wxString page=GetPage(hintArray[hintno].hintPage);
+
+ if (!info.IsEmpty())
+ page.Replace(wxT("<INFO>"), info);
+
+ htmlHint->SetPage(page);
chkSuppress->SetValue(false);
- if (!(hintArray[hintno].flags & HINT_CANSUPPRESS))
+ if (force || !(hintArray[hintno].flags & HINT_CANSUPPRESS))
chkSuppress->Disable();
- if (!(hintArray[hintno].flags & HINT_CANABORT))
+ if (force || !(hintArray[hintno].flags & HINT_CANABORT))
btnCancel->Disable();
if (!(hintArray[hintno].flags & HINT_CANFIX))
btnFix->Hide();
currentHint = hintno;
+#endif
+};
+
+
+
+void frmHint::SetHint(const wxArrayInt &hintnos, const wxString &info)
+{
+ currentHint = hintnos.Item(0);
+ if (hintnos.GetCount() == 1)
+ SetTitle(_("pgAdmin III Guru Hint") + wxString(wxT(" - ")) +
wxGetTranslation(hintArray[currentHint].hintCaption));
+ else
+ SetTitle(_("pgAdmin III Guru Hints"));
+
+
+
+ wxString header = GetPage(wxT("multiple"));
+ wxString pages;
+
+ if (header.IsEmpty())
+ {
+ header =
+ wxT("<html><head>\n")
+ wxT("<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1252\">\n")
+ wxT("<link rel=\"STYLESHEET\" type=\"text/css\"
href=\"../pgadmin3.css\">\n")
+ wxT("<title>Guru Hints</title></head>\n")
+ wxT("<body><p>\n");
+ }
+ else
+ {
+ int o=header.Find(wxT("</body>"));
+ if (o > 0)
+ header = header.Left(o) + wxT("<p>");
+ }
+
+ size_t i;
+ for (i=0 ; i < hintnos.GetCount() ; i++)
+ {
+ int hintno=hintnos.Item(i);
+ wxString page=GetPage(hintArray[hintno].hintPage);
+ int a=page.Find(wxT("<body>"));
+ int o=page.Find(wxT("</body>"));
+ if (a<0)
+ a=0;
+ if (o < 0)
+ o=wxSTRING_MAXLEN;
+
+
+ int ha=page.Find(wxT("<H3>"));
+ int ho=page.Find(wxT("</H3>"));
+ if (ha < 0)
+ ha=page.Find(wxT("<h3>"));
+ if (ho < 0)
+ ho=page.Find(wxT("</h3>"));
+
+ if (ha > a && ho > ha)
+ {
+ wxString hintTitle=page.Mid(ha+4, ho-ha-4);
+
+ pages += page.Mid(a, ha-a)
+ + wxT("<H3><A Name=\"") + hintArray[hintno].hintPage +
wxT("\">")
+ + hintTitle + wxT("</A>")
+ + page.Mid(ho, o-ho);
+ header += wxString(wxT("<A HREF=\"#")) +
hintArray[hintno].hintPage + wxT("\">")
+ + hintTitle + wxT("</A><BR>");
+ }
+ else
+ pages += page.Mid(a, o-a);
+ }
+
+ pages.Replace(wxT("<INFO>"), info);
+
+ htmlHint->SetPage(header + wxT("</p>") + pages + wxT("</body></html>\n"));
+
+ chkSuppress->SetValue(false);
+
+ if (force || !(hintArray[currentHint].flags & HINT_CANSUPPRESS))
+ chkSuppress->Disable();
+ if (force || !(hintArray[currentHint].flags & HINT_CANABORT))
+ btnCancel->Disable();
+ if (!(hintArray[currentHint].flags & HINT_CANFIX))
+ btnFix->Hide();
+
+ if (!(hintArray[currentHint].flags & HINT_CANFIX))
+ btnFix->Hide();
+ else if (hintArray[currentHint].fixText)
+ btnFix->SetLabel(wxGetTranslation(hintArray[currentHint].fixText));
+
+ if (hintArray[currentHint].flags & HINT_YESNO)
+ btnOK->Hide();
+ else
+ {
+ btnYes->Hide();
+ btnNo->Hide();
+ }
};
frmHint::~frmHint()
{
- if (chkSuppress->GetValue())
+ if (!force && chkSuppress->GetValue())
settings->Write(wxString(wxT("Hints/")) +
hintArray[currentHint].hintPage, wxT("Suppress"));
}
@@ -196,14 +328,41 @@
}
-int frmHint::ShowHint(wxWindow *fr, const wxString &hint, const wxString &info)
+
+int frmHint::ShowHint(wxWindow *fr, const wxArrayString &hints, const wxString
&info)
+{
+ // force implied
+ wxArrayInt hintnos;
+ size_t i;
+
+ if(!hints.GetCount())
+ return wxID_OK;
+ for (i=0 ; i < hints.GetCount() ; i++)
+ hintnos.Add(GetHintNo(hints.Item(i)));
+
+ frmHint *frm=new frmHint(fr, true);
+ frm->SetHint(hintnos, info);
+
+ frm->CenterOnParent();
+ int rc = frm->ShowModal();
+ delete frm;
+
+ if ((rc == wxID_CANCEL || rc == -1))
+ rc = wxID_OK;
+
+ return rc;
+}
+
+
+int frmHint::ShowHint(wxWindow *fr, const wxString &hint, const wxString
&info, bool force)
{
int rc=wxID_OK;
int hintno = GetHintNo(hint);
if (WantHint(hintno))
{
- frmHint *frm=new frmHint(fr, hintno, info);
+ frmHint *frm=new frmHint(fr, force);
+ frm->SetHint(hintno, info);
frm->CenterOnParent();
rc = frm->ShowModal();
Index: events.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/events.cpp,v
retrieving revision 1.129
retrieving revision 1.130
diff -Lsrc/ui/events.cpp -Lsrc/ui/events.cpp -u -w -r1.129 -r1.130
--- src/ui/events.cpp
+++ src/ui/events.cpp
@@ -444,7 +444,7 @@
void frmMain::OnHint(wxCommandEvent &event)
{
if (currentObject)
- currentObject->ShowHint(this);
+ currentObject->ShowHint(this, true);
}
Index: frmMain.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/frmMain.cpp,v
retrieving revision 1.126
retrieving revision 1.127
diff -Lsrc/ui/frmMain.cpp -Lsrc/ui/frmMain.cpp -u -w -r1.126 -r1.127
--- src/ui/frmMain.cpp
+++ src/ui/frmMain.cpp
@@ -53,6 +53,18 @@
// Icons
#include "images/pgAdmin3.xpm"
#include "images/elephant32.xpm"
+#include "images/drop.xpm"
+#include "images/vacuum.xpm"
+#include "images/viewdata.xpm"
+#include "images/viewfiltereddata.xpm"
+#include "images/properties.xpm"
+#include "images/property.xpm"
+#include "images/public.xpm"
+#include "images/refresh.xpm"
+#include "images/relationship.xpm"
+#include "images/hint2.xpm"
+#include "images/help2.xpm"
+
#include "images/aggregate.xpm"
#include "images/baddatabase.xpm"
#include "images/check.xpm"
@@ -65,7 +77,6 @@
#include "images/create.xpm"
#include "images/database.xpm"
#include "images/domain.xpm"
-#include "images/drop.xpm"
#include "images/function.xpm"
#include "images/group.xpm"
#include "images/index.xpm"
@@ -74,11 +85,6 @@
#include "images/namespace.xpm"
#include "images/operator.xpm"
#include "images/operatorclass.xpm"
-#include "images/properties.xpm"
-#include "images/property.xpm"
-#include "images/public.xpm"
-#include "images/refresh.xpm"
-#include "images/relationship.xpm"
#include "images/rule.xpm"
#include "images/sequence.xpm"
#include "images/server.xpm"
@@ -90,15 +96,11 @@
#include "images/trigger.xpm"
#include "images/type.xpm"
#include "images/user.xpm"
-#include "images/vacuum.xpm"
#include "images/view.xpm"
-#include "images/viewdata.xpm"
-#include "images/viewfiltereddata.xpm"
#include "images/triggerfunction.xpm"
#include "images/constraints.xpm"
#include "images/primarykey.xpm"
#include "images/unique.xpm"
-#include "images/help2.xpm"
#include "images/job.xpm"
#include "images/jobdisabled.xpm"
#include "images/step.xpm"
@@ -292,6 +294,7 @@
toolBar->AddTool(MNU_VIEWFILTEREDDATA, _("View Filtered Data"),
wxBitmap(viewfiltereddata_xpm), _("Apply a filter and view the data in the
selected object."), wxITEM_NORMAL);
toolBar->AddTool(MNU_MAINTENANCE, _("Maintenance"), wxBitmap(vacuum_xpm),
_("Maintain the current database or table."), wxITEM_NORMAL);
toolBar->AddSeparator();
+ toolBar->AddTool(MNU_HINT, _("Hints"), wxBitmap(hint2_xpm), _("Display
helpful hints on current object."));
toolBar->AddTool(MNU_HELP, _("SQL Help"), wxBitmap(help2_xpm), _("Display
help on SQL commands."));
// Display the bar and configure buttons.
@@ -1038,7 +1041,8 @@
config=false,
set=false,
setissubscribed=false,
- cluster=false;
+ cluster=false,
+ hint=false;
if (obj)
{
@@ -1053,6 +1057,7 @@
maintenance = obj->CanMaintenance();
backup = obj->CanBackup();
restore = obj->CanRestore();
+ hint = obj->GetCanHint();
status = server != 0 && server->GetSuperUser();
config = status && conn && conn->HasFeature(FEATURE_FILEREAD);
@@ -1091,6 +1096,7 @@
toolBar->EnableTool(MNU_VIEWDATA, viewData);
toolBar->EnableTool(MNU_VIEWFILTEREDDATA, viewData);
toolBar->EnableTool(MNU_MAINTENANCE, maintenance);
+ toolBar->EnableTool(MNU_HINT, hint);
// Handle the menus associated with the buttons
editMenu->Enable(MNU_CREATE, create);
@@ -1122,7 +1128,7 @@
viewMenu->Enable(MNU_REFRESH, refresh);
viewMenu->Enable(MNU_COUNT, false);
- helpMenu->Enable(MNU_HINT, false);
+ helpMenu->Enable(MNU_HINT, hint);
}
Index: frmHint.xrc
===================================================================
RCS file: /projects/pgadmin3/src/ui/common/frmHint.xrc,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/ui/common/frmHint.xrc -Lsrc/ui/common/frmHint.xrc -u -w -r1.4 -r1.5
--- src/ui/common/frmHint.xrc
+++ src/ui/common/frmHint.xrc
@@ -24,7 +24,7 @@
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
- <cols>5</cols>
+ <cols>7</cols>
<rows>1</rows>
<object class="sizeritem">
<object class="wxButton" name="wxID_HELP">
@@ -47,6 +47,24 @@
<border>5</border>
</object>
<object class="sizeritem">
+ <object class="wxButton" name="wxID_YES">
+ <label>&Yes</label>
+ <default>1</default>
+ <pos>93,135d</pos>
+ </object>
+ <flag>wxTOP|wxBOTTOM|wxLEFT|wxRIGHT</flag>
+ <border>5</border>
+ </object>
+ <object class="sizeritem">
+ <object class="wxButton" name="wxID_NO">
+ <label>&No</label>
+ <default>1</default>
+ <pos>93,135d</pos>
+ </object>
+ <flag>wxTOP|wxBOTTOM|wxLEFT|wxRIGHT</flag>
+ <border>5</border>
+ </object>
+ <object class="sizeritem">
<object class="wxButton" name="wxID_OK">
<label>&OK</label>
<default>1</default>
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org