2016-01-19 04:26:01 -06:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2018-01-05 04:42:49 -06:00
|
|
|
// Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
2016-01-19 04:26:01 -06:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
// ConfigWindow.h - Configuration window
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "ConfigWindow.h"
|
|
|
|
#include "ui_ConfigWindow.h"
|
|
|
|
|
|
|
|
ConfigWindow::ConfigWindow(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::ConfigWindow)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfigWindow::~ConfigWindow()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigWindow::on_buttonBox_accepted()
|
|
|
|
{
|
|
|
|
this->close();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigWindow::on_buttonBox_rejected()
|
|
|
|
{
|
|
|
|
this->close();
|
|
|
|
}
|
|
|
|
|
2018-07-19 06:54:53 -05:00
|
|
|
void ConfigWindow::on_chkFixedPort_stateChanged(int state)
|
|
|
|
{
|
|
|
|
if (state == Qt::Checked)
|
|
|
|
ui->spinPortNumber->setEnabled(true);
|
|
|
|
else
|
|
|
|
ui->spinPortNumber->setEnabled(false);
|
|
|
|
}
|
|
|
|
|
2018-02-05 09:32:14 -06:00
|
|
|
QString ConfigWindow::getBrowserCommand()
|
|
|
|
{
|
|
|
|
return ui->browserCommandLineEdit->text();
|
|
|
|
}
|
|
|
|
|
2018-07-19 06:54:53 -05:00
|
|
|
bool ConfigWindow::getFixedPort()
|
|
|
|
{
|
|
|
|
return ui->chkFixedPort->isChecked();
|
|
|
|
}
|
|
|
|
|
|
|
|
int ConfigWindow::getPortNumber()
|
|
|
|
{
|
|
|
|
return ui->spinPortNumber->value();
|
|
|
|
}
|
|
|
|
|
2016-01-19 04:26:01 -06:00
|
|
|
QString ConfigWindow::getPythonPath()
|
|
|
|
{
|
|
|
|
return ui->pythonPathLineEdit->text();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString ConfigWindow::getApplicationPath()
|
|
|
|
{
|
|
|
|
return ui->applicationPathLineEdit->text();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-05 09:32:14 -06:00
|
|
|
void ConfigWindow::setBrowserCommand(QString command)
|
|
|
|
{
|
|
|
|
ui->browserCommandLineEdit->setText(command);
|
|
|
|
}
|
|
|
|
|
2018-07-19 06:54:53 -05:00
|
|
|
void ConfigWindow::setFixedPort(bool fixedPort)
|
|
|
|
{
|
|
|
|
if (fixedPort)
|
|
|
|
{
|
|
|
|
ui->chkFixedPort->setCheckState(Qt::Checked);
|
|
|
|
ui->spinPortNumber->setEnabled(true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ui->chkFixedPort->setCheckState(Qt::Unchecked);
|
|
|
|
ui->spinPortNumber->setEnabled(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigWindow::setPortNumber(int port)
|
|
|
|
{
|
|
|
|
ui->spinPortNumber->setValue(port);
|
|
|
|
}
|
|
|
|
|
2016-01-19 04:26:01 -06:00
|
|
|
void ConfigWindow::setPythonPath(QString path)
|
|
|
|
{
|
|
|
|
ui->pythonPathLineEdit->setText(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigWindow::setApplicationPath(QString path)
|
|
|
|
{
|
|
|
|
ui->applicationPathLineEdit->setText(path);
|
|
|
|
}
|
|
|
|
|