Extend the branding code to allow the vendor-specific help options to be hidden.
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 28 Oct 2009 17:21:24 +0000 (17:21 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 28 Oct 2009 17:21:24 +0000 (17:21 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@8073 a7884b65-44f6-0310-8a51-81a127f17b15

CHANGELOG
branding/branding.ini
pgadmin/frm/frmMain.cpp
pgadmin/include/pgAdmin3.h
pgadmin/pgAdmin3.cpp

index f5e69ff0febc7e252343def35513c7b1bef0e3b7..3c0854f3853d0d3c383409a357dbecc7a4f7977b 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -36,6 +36,8 @@ Changes
 
 Date       Dev Ver     Change details
 ---------- --- ------  --------------
+2009-10-28 DP  1.12.0  Extend the branding code to allow the vendor-specific
+                       help options to be hidden.
 2009-10-21 DP  1.10.1  Fix a potential crash bug in the object browser.
 2009-10-13 DP  1.10.1  Reverse engineer empty (not NULL) ACLs correctly.
 2009-10-08 DP  1.12.0  Add 'SELECT Script' for functions and 'EXEC Script' for
index e753233a99a678def9a4db4ca199771c5a91b9b4..04da25e9df521de807f093fea7b08e0faf0fc532 100644 (file)
 ; CSS stylesheet used to format reports.\r
 \r
 ;ReportKeyColour=#009ACE\r
+\r
+; EnterpriseDB and Greenplum both have prominent help options\r
+; on the Help menu. These options, if set to 1 will hide them\r
+\r
+; HideEnterprisedbHelp=0\r
+; HideGreenplumHelp=0\r
+\r
index 369417e682929d5c2b35d94a1b07afda9493491e..2da7aa53e66c11d6c823e0c164571cf28dc3b280 100644 (file)
@@ -425,8 +425,10 @@ void frmMain::CreateMenus()
     helpMenu->AppendSeparator();
 
     new pgsqlHelpFactory(menuFactories, helpMenu, toolBar, true);
-    new edbHelpFactory(menuFactories, helpMenu, toolBar, true);
-    new greenplumHelpFactory(menuFactories, helpMenu, toolBar, true);
+    if (!appearanceFactory->GetHideEnterprisedbHelp())
+        new edbHelpFactory(menuFactories, helpMenu, toolBar, true);
+    if (!appearanceFactory->GetHideGreenplumHelp())
+        new greenplumHelpFactory(menuFactories, helpMenu, toolBar, true);
     new slonyHelpFactory(menuFactories, helpMenu, toolBar, true);
     
     // Don't include this seperator on Mac, because the only option
index eb14ad54362a105d3bd323188db77fcf43bcb558..43f1585fc91c2102ce60f3405c24fefff88c7963 100644 (file)
@@ -187,6 +187,8 @@ public:
     wxString GetLongAppName() { return long_appname; };
     wxString GetWebsiteUrl() { return website_url; };
     wxColour GetReportKeyColour() { return report_key_colour; };
+    bool GetHideEnterprisedbHelp() { return hide_enterprisedb_help; };
+    bool GetHideGreenplumHelp() { return hide_greenplum_help; };
     bool IsBranded() { return is_branded; };
 
 private:
@@ -194,7 +196,7 @@ private:
     wxImage large_icon, small_icon, splash_image;
     long splash_font_size, splash_pos_x, splash_pos_y, splash_pos_offset;
     wxColor splash_text_colour, report_key_colour;
-    bool is_branded;
+    bool hide_enterprisedb_help, hide_greenplum_help, is_branded;
 };
 
 extern pgAppearanceFactory *appearanceFactory;
index 0691dc2d753b7ff299813bfbb7ac7cef68ae451d..4128c83f4c37b0a00085254344409210a65a2d62 100644 (file)
@@ -1521,6 +1521,9 @@ pgAppearanceFactory::pgAppearanceFactory()
     short_appname = wxT("pgadmin3");
     website_url = wxT("http://www.pgadmin.org/");
 
+    hide_enterprisedb_help = false;
+    hide_greenplum_help = false;
+
     // Attempt to overload branding information
     wxFileName brIni(brandingPath + wxT("/branding.ini"));
     if (brIni.FileExists())
@@ -1618,6 +1621,22 @@ pgAppearanceFactory::pgAppearanceFactory()
                 report_key_colour = wxColor(token.AfterFirst('=').Trim());
                 is_branded = true;
             }
+            else if (token.Lower().StartsWith(wxT("hideenterprisedbhelp=")))
+            {
+                if (token.AfterFirst('=').Trim() == wxT("1"))
+                {
+                    hide_enterprisedb_help = true;
+                    is_branded = true;
+                }
+            }
+            else if (token.Lower().StartsWith(wxT("hidegreenplumhelp=")))
+            {
+                if (token.AfterFirst('=').Trim() == wxT("1"))
+                {
+                    hide_greenplum_help = true;
+                    is_branded = true;
+                }
+            }
         }
     }