Пример #1
0
frmMainConfig::frmMainConfig(frmMain *parent, pgServer *server)
	: frmConfig(parent, BCE_TITLE, 0)
{
	wxString applicationname = appearanceFactory->GetLongAppName() + _(" - Configuration Editor");
	if (server)
		conn = server->CreateConn(wxEmptyString, 0, applicationname);

	InitForm();
	Init();

	if (conn)
	{
		if (serverFileName.IsEmpty())
			serverFileName = wxT("postgresql.conf");


		wxString txt;
		txt.Printf(_(" - %s on %s (%s:%d)"),
		           serverFileName.c_str(), server->GetDescription().c_str(),
		           server->GetName().c_str(), server->GetPort());
		SetTitle(BCE_TITLE + txt);

		wxString str;
		str = conn->ExecuteScalar(wxT("SELECT pg_file_read('") + serverFileName + wxT("', 0, ")
		                          wxT("pg_file_length('") + serverFileName + wxT("'))"));

		DisplayFile(str);

		statusBar->SetStatusText(wxString::Format(_(" Configuration read from %s"), conn->GetHost().c_str()));
	}
}
Пример #2
0
frmMainConfig::frmMainConfig(const wxString &title, const wxString &configFile)
	: frmConfig(title + wxT(" - ") + _("Backend Configuration Editor"), configFile)
{
	InitForm();
	Init();
	OpenLastFile();
}
Пример #3
0
frmMain::frmMain(QWidget *parent):
    QDialog(parent),
    ui(new Ui::frmMain)
{
    ui->setupUi(this);
    myHelper::FormInCenter(this);
    InitStyle();
    InitForm();
}