mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where the application ignores the fixed port configuration value. Fixes #5773
This commit is contained in:
@@ -27,3 +27,4 @@ Bug fixes
|
|||||||
| `Issue #5751 <https://redmine.postgresql.org/issues/5751>`_ - Enable the 'Configure' and 'View log' menu option when the server taking longer than usual time to start.
|
| `Issue #5751 <https://redmine.postgresql.org/issues/5751>`_ - Enable the 'Configure' and 'View log' menu option when the server taking longer than usual time to start.
|
||||||
| `Issue #5754 <https://redmine.postgresql.org/issues/5754>`_ - Fixed an issue where schema diff is not working when providing the options to Foreign Data Wrapper, Foreign Server, and User Mapping.
|
| `Issue #5754 <https://redmine.postgresql.org/issues/5754>`_ - Fixed an issue where schema diff is not working when providing the options to Foreign Data Wrapper, Foreign Server, and User Mapping.
|
||||||
| `Issue #5766 <https://redmine.postgresql.org/issues/5766>`_ - Fixed string indices must be integers issue for PostgreSQL < 9.3.
|
| `Issue #5766 <https://redmine.postgresql.org/issues/5766>`_ - Fixed string indices must be integers issue for PostgreSQL < 9.3.
|
||||||
|
| `Issue #5773 <https://redmine.postgresql.org/issues/5773>`_ - Fixed an issue where the application ignores the fixed port configuration value.
|
||||||
@@ -59,6 +59,8 @@ bool Runtime::go(int argc, char *argv[])
|
|||||||
QCoreApplication::setOrganizationDomain("pgadmin.org");
|
QCoreApplication::setOrganizationDomain("pgadmin.org");
|
||||||
QCoreApplication::setApplicationName("pgadmin4");
|
QCoreApplication::setApplicationName("pgadmin4");
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
// Interlock
|
// Interlock
|
||||||
if (alreadyRunning())
|
if (alreadyRunning())
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -111,7 +113,7 @@ bool Runtime::go(int argc, char *argv[])
|
|||||||
m_floatingWindow->enablePostStartOptions();
|
m_floatingWindow->enablePostStartOptions();
|
||||||
|
|
||||||
// Open the browser if needed
|
// Open the browser if needed
|
||||||
if (m_settings.value("OpenTabAtStartup", true).toBool())
|
if (settings.value("OpenTabAtStartup", true).toBool())
|
||||||
openBrowserTab(url);
|
openBrowserTab(url);
|
||||||
|
|
||||||
// Make sure the server is shutdown if the server is quit by the user
|
// Make sure the server is shutdown if the server is quit by the user
|
||||||
@@ -270,11 +272,12 @@ QSplashScreen * Runtime::displaySplash(QApplication *app)
|
|||||||
quint16 Runtime::getPort() const
|
quint16 Runtime::getPort() const
|
||||||
{
|
{
|
||||||
quint16 port = 0L;
|
quint16 port = 0L;
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
if (m_settings.value("FixedPort", false).toBool())
|
if (settings.value("FixedPort", false).toBool())
|
||||||
{
|
{
|
||||||
// Use the fixed port number
|
// Use the fixed port number
|
||||||
port = m_settings.value("PortNumber", 5050).toInt();
|
port = settings.value("PortNumber", 5050).toUInt();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -339,7 +342,7 @@ FloatingWindow * Runtime::createFloatingWindow(MenuActions *menuActions)
|
|||||||
return floatingWindow;
|
return floatingWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Runtime::isPortInUse(const quint16 port)
|
bool Runtime::isPortInUse(const quint16 port) const
|
||||||
{
|
{
|
||||||
QTcpSocket socket;
|
QTcpSocket socket;
|
||||||
|
|
||||||
@@ -360,7 +363,8 @@ void Runtime::openConfigureWindow(const QString errorMsg)
|
|||||||
|
|
||||||
// Allow the user to tweak the configuration if needed
|
// Allow the user to tweak the configuration if needed
|
||||||
m_configDone = false;
|
m_configDone = false;
|
||||||
bool oldFixedPort = m_settings.value("FixedPort", false).toBool();
|
QSettings settings;
|
||||||
|
bool oldFixedPort = settings.value("FixedPort", false).toBool();
|
||||||
|
|
||||||
|
|
||||||
ConfigWindow *dlg = new ConfigWindow();
|
ConfigWindow *dlg = new ConfigWindow();
|
||||||
@@ -375,8 +379,8 @@ void Runtime::openConfigureWindow(const QString errorMsg)
|
|||||||
delay(100);
|
delay(100);
|
||||||
|
|
||||||
// Read the value of port again if user has changed.
|
// Read the value of port again if user has changed.
|
||||||
bool newFixedPort = m_settings.value("FixedPort", false).toBool();
|
bool newFixedPort = settings.value("FixedPort", false).toBool();
|
||||||
quint16 newPort = m_settings.value("PortNumber").toInt();
|
quint16 newPort = settings.value("PortNumber").toUInt();
|
||||||
|
|
||||||
// User hasn't changed the value of fixed port check box
|
// User hasn't changed the value of fixed port check box
|
||||||
// only change the value of the port
|
// only change the value of the port
|
||||||
@@ -509,7 +513,8 @@ Server * Runtime::startServer(QString key)
|
|||||||
void Runtime::checkServer(QString url)
|
void Runtime::checkServer(QString url)
|
||||||
{
|
{
|
||||||
// Read the server connection timeout from the registry or set the default timeout.
|
// Read the server connection timeout from the registry or set the default timeout.
|
||||||
int timeout = m_settings.value("ConnectionTimeout", 90).toInt();
|
QSettings settings;
|
||||||
|
int timeout = settings.value("ConnectionTimeout", 90).toInt();
|
||||||
|
|
||||||
// Now the server should be up, we'll attempt to connect and get a response.
|
// Now the server should be up, we'll attempt to connect and get a response.
|
||||||
// We'll retry in a loop a few time before aborting if necessary.
|
// We'll retry in a loop a few time before aborting if necessary.
|
||||||
@@ -588,7 +593,8 @@ void Runtime::createAddressFile(QString url) const
|
|||||||
// Open a browser tab
|
// Open a browser tab
|
||||||
void Runtime::openBrowserTab(QString url) const
|
void Runtime::openBrowserTab(QString url) const
|
||||||
{
|
{
|
||||||
QString cmd = m_settings.value("BrowserCommand").toString();
|
QSettings settings;
|
||||||
|
QString cmd = settings.value("BrowserCommand").toString();
|
||||||
|
|
||||||
if (!cmd.isEmpty())
|
if (!cmd.isEmpty())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public:
|
|||||||
bool shutdownServer(QUrl url);
|
bool shutdownServer(QUrl url);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings m_settings;
|
|
||||||
QSharedMemory *m_shmem;
|
QSharedMemory *m_shmem;
|
||||||
bool m_configDone;
|
bool m_configDone;
|
||||||
FloatingWindow *m_floatingWindow = Q_NULLPTR;
|
FloatingWindow *m_floatingWindow = Q_NULLPTR;
|
||||||
@@ -61,7 +60,7 @@ private:
|
|||||||
void openBrowserTab(QString url) const;
|
void openBrowserTab(QString url) const;
|
||||||
QString serverRequest(QUrl url, QString path);
|
QString serverRequest(QUrl url, QString path);
|
||||||
bool pingServer(QUrl url);
|
bool pingServer(QUrl url);
|
||||||
bool isPortInUse(const quint16 port);
|
bool isPortInUse(const quint16 port) const;
|
||||||
void openConfigureWindow(const QString errorMsg);
|
void openConfigureWindow(const QString errorMsg);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
Reference in New Issue
Block a user