mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
Added the Set keywords menu item to add server search keywords
Добавлена возможность через контекстное меню сервера добавлять ключевые слова. Требуется перезапуск приложения для применения изменений.
This commit is contained in:
parent
8ffa0a1806
commit
b292d82661
2 changed files with 38 additions and 0 deletions
|
|
@ -687,6 +687,13 @@ public:
|
||||||
wxWindow *StartDialog(frmMain *form, pgObject *obj);
|
wxWindow *StartDialog(frmMain *form, pgObject *obj);
|
||||||
bool CheckEnable(pgObject *obj);
|
bool CheckEnable(pgObject *obj);
|
||||||
};
|
};
|
||||||
|
class keywordsServerFactory : public contextActionFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
keywordsServerFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar);
|
||||||
|
wxWindow *StartDialog(frmMain *form, pgObject *obj);
|
||||||
|
bool CheckEnable(pgObject *obj);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class disconnectServerFactoryAll : public contextActionFactory
|
class disconnectServerFactoryAll : public contextActionFactory
|
||||||
|
|
|
||||||
|
|
@ -2111,6 +2111,37 @@ bool stopServiceFactory::CheckEnable(pgObject *obj)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
keywordsServerFactory::keywordsServerFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : contextActionFactory(list)
|
||||||
|
{
|
||||||
|
mnu->Append(id, _("&Set keywords"), _("Set keywords list the selected server."));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxWindow *keywordsServerFactory::StartDialog(frmMain *form, pgObject *obj)
|
||||||
|
{
|
||||||
|
pgServer *server = (pgServer *)obj;
|
||||||
|
wxString kw=server->GetKeywords();
|
||||||
|
wxTextEntryDialog dialog(form,
|
||||||
|
_("Please enter keywords\n")
|
||||||
|
,
|
||||||
|
_("Keywords server"),
|
||||||
|
kw,
|
||||||
|
wxOK | wxCANCEL); //setName( dlg.GetValue().wc_str() );
|
||||||
|
if (dialog.ShowModal() == wxID_OK) {
|
||||||
|
kw = dialog.GetValue();
|
||||||
|
server->iSetKeywords(kw);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool keywordsServerFactory::CheckEnable(pgObject *obj)
|
||||||
|
{
|
||||||
|
if (obj && obj->IsCreatedBy(serverFactory))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
connectServerFactory::connectServerFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : contextActionFactory(list)
|
connectServerFactory::connectServerFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar) : contextActionFactory(list)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue