// Add the previous app if required.\r
if (!util->title.IsEmpty() && !util->command.IsEmpty())\r
{\r
- CreatePluginUtility(util);\r
- ClearPluginUtility(util);\r
- pluginUtilityCount++;\r
+ // We're only going to add this if the keyfile exists or isn't specified\r
+ if (util->keyfile.IsEmpty() || wxFileExists(util->keyfile))\r
+ {\r
+ CreatePluginUtility(util);\r
+ ClearPluginUtility(util);\r
+ pluginUtilityCount++;\r
+ }\r
}\r
\r
util->title = token.AfterFirst('=').Trim();\r
if (token.Lower().StartsWith(wxT("description=")))\r
util->description = token.AfterFirst('=').Trim();\r
\r
+ // KeyFile\r
+ if (token.Lower().StartsWith(wxT("keyfile=")))\r
+ util->keyfile = token.AfterFirst('=').Trim();\r
+\r
// Database\r
if (token.Lower().StartsWith(wxT("database=")))\r
{\r
// Add the last app if required.\r
if (!util->title.IsEmpty() && !util->command.IsEmpty())\r
{\r
- CreatePluginUtility(util);\r
- ClearPluginUtility(util);\r
- pluginUtilityCount++;\r
+ // We're only going to add this if the keyfile exists or isn't specified\r
+ if (util->keyfile.IsEmpty() || wxFileExists(util->keyfile))\r
+ {\r
+ CreatePluginUtility(util);\r
+ ClearPluginUtility(util);\r
+ pluginUtilityCount++;\r
+ }\r
}\r
\r
if (util)\r
util->title = wxEmptyString;\r
util->command = wxEmptyString;\r
util->description = wxEmptyString;\r
+ util->keyfile = wxEmptyString;\r
util->database = false;\r
util->applies_to.Clear();\r
util->set_password = false;\r
;\r
; Description - A description of the utility for use in tooltips etc.\r
;\r
+; KeyFile - If specified, this file must exist for the plugin to be shown\r
+; on the menus.\r
+;\r
; Database - Set to 'Yes' to indicate that the command needs to be executed\r
; where database connection is possible - ie. when the currently\r
; selected object in the treeview is a database or child object.\r
;\r
; Title=PSQL Console\r
; Command=/usr/bin/xterm -e /usr/local/pgsql/bin/psql -h $$HOSTNAME -p $$PORT -U $$USERNAME $$DATABASE\r
+; KeyFile=/usr/local/pgsql/bin/psql\r
; Description=Open a PSQL console to the current database.\r
; Database=Yes\r
; SetPassword=Yes\r
; Title=PSQL Console\r
; Command="C:\Program Files\PostgreSQL\8.3\bin\psql.exe" -h $$HOSTNAME -p $$PORT -U $$USERNAME $$DATABASE\r
; Description=Open a PSQL console to the current database.\r
+; KeyFile=C:\Program Files\PostgreSQL\8.3\bin\psql.exe\r
; Database=Yes\r
; SetPassword=Yes\r
;\r
;\r
; Title=PSQL Console\r
; Command=/usr/bin/osascript -e 'ignoring application responses' -e 'tell application "Terminal"' -e 'activate' -e 'do script with command "/usr/local/pgsql/bin/psql -h $$HOSTNAME -p $$PORT -U $$USERNAME $$DATABASE && exit || sleep 5 && exit"' -e 'end tell' -e 'end ignoring'\r
+; KeyFile=/usr/local/pgsql/bin/psql\r
; Description=Open a PSQL console to the current database.\r
; Database=Yes\r
; SetPassword=Yes\r