Commit Graph

58 Commits (31b0791ab9c3cbd91ee98c5b1f76e90520eb02c8)

Author SHA1 Message Date
Akshay Joshi 510dd5c047 1) Fixed pgAdmin hang issue when the user clicks on 'View Log' menu option.
2) Fixed some code smell in runtime code.
2020-07-29 15:31:38 +05:30
Dave Page 46ba0310fa Make the runtime configuration dialog non-modal. Fixes #5490
Major refactoring of the runtime code, Specifically:
  - Move the bulk of the core code from main() into a new Runtime class.
  - Break up the mass of code that was main() into a number of relatively simple functions.
  - Make the Configuration dialog synchronous so the Log dialog can be properly viewed.
  - Enable/disable menu options at the right time.
  - Remove support for Qt < 5.0.
  - Remove the application name constant and hardcode the name to simplify the code.
  - Improve log messages.
  - Replace the sdbm hashing with Qt's MD5 hashing.
2020-07-28 16:13:05 +05:30
Akshay Joshi cf64e2c97c Fixed runtime issues reported by SonarQube. 2020-06-16 14:53:40 +05:30
Akshay Joshi a23fad0ba8 Tidy up some code to keep SonarQube happy. 2020-06-15 12:12:19 +01:00
Dave Page 109051e1d5 Remove Python 2 support from the desktop runtime
refs #5443
2020-04-30 13:04:09 +05:30
Dave Page e26a9a25d5 Fixed compilation warnings while building pgAdmin. Fixes #5351 2020-04-03 19:23:32 +05:30
Dave Page 01c7636c75 Update copyright notices for 2020. 2020-01-02 14:43:50 +00:00
Dave Page 8cb239abcb Rename some internal environment variables that could conflict with Kubernetes. Fixes #4999. 2019-12-13 10:42:43 +05:30
Murtuza Zabuawala e23d307c56 Update copyright notices for 2019 2019-01-02 15:54:12 +05:30
Dave Page 72a2db53c3 Use Q_NULLPTR instead of nullptr as some of our older build machines don't support C++ 11. 2018-12-06 10:40:49 +00:00
Dave Page 5cfe0ef115 Use C++ style casts. 2018-12-06 10:36:57 +00:00
Dave Page 45cd17af84 Use nullptr instead of NULL or 0. 2018-12-06 10:17:47 +00:00
Akshay Joshi 6a46e43567 Ensure the runtime can startup properly if there are wide characters in the logfile path on Windows. Fixes #3464 2018-09-18 15:08:31 +01:00
Akshay Joshi 003889f15e Added null checks and some more startup logs for runtime 2018-09-17 15:16:48 +05:30
Akshay Joshi 026969e3d1 Add a startup logger to the runtime to aid with debugging. 2018-09-14 14:41:52 +01:00
Anthony DeBarros a6ee27cf25 s/shutdown/shut down/ 2018-06-08 08:45:02 +01:00
Akshay Joshi 5f0799714d Cleanup Python 3 server startup code. Fixes #3277 2018-05-31 10:07:08 -04:00
Dave Page 80b29a85cc Secure runtime temp files. 2018-03-21 11:27:59 +00:00
Maxim Zakharov 54b1a79cb6 Sporadically crashes on Windows when exit. Fixes #3177
1) Shutdown the python server properly.
  2) Disabled "Shutdown server" menu till server is not successfully started.

Initial patch sent by Maxim, modified by Akshay Joshi.
2018-03-15 13:26:24 +05:30
Dave Page 8a56eb9cd0 Fix stupid thinko 2018-02-19 17:06:01 +00:00
Dave Page df667bff53 Python 3 fix for the runtime. 2018-02-19 16:30:43 +00:00
Dave Page 7192a2b675 Rewrite the runtime as a tray-based server which can launch a web browser. Fixes #3086 2018-02-05 15:32:14 +00:00
Dave Page 89821c0d19 Update copyright notices for 2018. 2018-01-05 10:42:50 +00:00
Dave Page f195b18f2d Ship with pre-configured paths that can work in both Server and Desktop modes out of the box. Fixes #2662
Ship the web code using server mode with appropriate paths by default and enable the runtime to override the mode, and force into desktop changing the appropriate paths to user-specific ones.

Note that this change will likely cause more advanced users to have to tweak configs.

RPMs will also need changes to create /var/lib/pgadmin and /var/log/pgadmin, owned by the webserver account.
2017-08-25 10:54:28 +01:00
Dave Page ef4b8e8c1c Another minor perf tweak for the runtime. 2017-06-11 14:34:49 +01:00
Dave Page 44ce8985e0 Fix typo in variable name. 2017-03-28 08:55:38 -04:00
Dave Page 688c810300 Add header that seems to be needed with Python 3. 2017-03-28 08:41:38 -04:00
Maxim Zakharov 72548a99e1 Fix usage of QString::toUtf8(). Fixes #2299
Desktop runtime has a couple bugs using already freed memory supplied to embedded python leading to occasional crashes and failures to start maintenance processes (VACUUM, ANALYZE, REINDEX, CLUSTER).

This is caused by incorrect usage of QString::toUtf8() which returns newly created QByteArray which is automatically destroyed once closing context; e.g.
Py_SetPythonHome(pythonHome.toUtf8().data());
2017-03-28 08:26:16 -04:00
Ashesh Vashi 7767c085c3 Resolved an issue finding the python interpreter on *nix systems, and
Windows 2008 R2 (32 bit), while running the pgAdmin 4 as runtime for
the PostgreSQL one click installers.

- Found a typo in runtime code, we were appending the path using ';' on
  *nix systems too. We should have used ':', and that did not allow the
  os.environ['PATH'] to identify the correct path of the python
  interpreter under the 'venv' directory.

- On Windows 2008, it was not honouring the environment variables, set
  under the Qt application (e.g. pgAdmin4.exe runtime), in the python
  application. (e.g. pgAdmin4.py). We will need to assume that - the
  python interpreter resides under the 'venv' directory outside the
  'bin' directory.

- Also, on windows 2008, it was setting PYTHONHOME environment variable
  to the full path of the pgAdmin4.exe, we need to reset it to 'venv'
  directory, if we find the python interpreter under it.

Thanks Murtuza Zabuawala for tips, and help.
2017-03-10 21:19:06 +05:30
Dave Page 6696b3c316 Authenticate the runtime to the server. Fixes #2228 2017-03-06 14:53:49 +00:00
Dave Page f221194bcc Update copyright notices for 2017. 2017-01-04 13:33:32 +00:00
Dave Page 58910c4b62 Allow the ApplicationPath to be absolute. 2016-12-02 11:10:08 +09:00
Neel Patel a3e8ba93ae Ensure that argc/argv are set for the runtime interpretor, and that
PYTHONHOME is properly configured.
2016-08-16 11:29:42 +01:00
Ashesh Vashi fc34f85aa3 Set the sys path from the runtime as we were doing it earlier along with the
PYTHONPATH environment variable settings.
2016-06-21 18:24:07 +05:30
Ashesh Vashi 980ab4735e Revert "Adding proper virtual environment path on windows."
As per Dave, we are not using 'pgAdmin 4' from the community installer,
hence - we should not bother about it.

This reverts commit 3484998775.
2016-06-21 17:44:46 +05:30
Ashesh Vashi 3484998775 Adding proper virtual environment path on windows. 2016-06-21 16:54:34 +05:30
Ashesh Vashi 061a9d9322 Using the preprocessor macor Q_OS_WIN differently, it was failing to
compile the runtime on windows with C1017 error.
2016-06-21 15:45:26 +05:30
Ashesh Vashi 4a7607445f Setting the PYTHONPATH variable before initializing the python
environment using Py_Initialize() function.

Also, add virtual environment binary path to the PATH environment
variable.
2016-06-21 15:02:35 +05:30
Ashesh Vashi 8b8e6fe59b Passing the arguments to the function appending the path by reference. 2016-06-20 23:04:00 +05:30
Ashesh Vashi 691f01b623 [Runtime] Setting few of the environment variables (i.e. PATH and
PYTHONPATH) to run the runtime with the virtual environment properly.
And, also allow to use the python interpreter to be used with the
background process modules.

- Add binary directory of the virtual environment to PATH environment
  variable.
- Add lib, dynamic libraries (python specific), and site-package
  directories of the virtual environment in the PYTHONPATH environment
  variable.
2016-06-20 21:31:19 +05:30
Asser Schrøder Femø fc955537a8 Fix runtime compatibility with newer Python versions
Initial patch by Asser. Change restricted to Python 3.3 and above by me as PyUnicode_DecodeFSDefault was added in 3.3.
2016-06-20 10:51:46 +01:00
Dave Page 73988bcece Do a more sensible venv search on Windows, and don't update the
registry upon installation.
2016-06-16 16:22:45 +01:00
Dave Page cef0dc7c88 Hunt for the runtime on Windows in the same way we do on Mac. 2016-06-16 13:07:35 +01:00
Dave Page fa917a0828 Prevent the runtime from compiling bytecode to avoid permissions issues. 2016-06-16 11:30:23 +01:00
Dave Page 4380c6714e Fix venv search path on Mac. 2016-06-07 12:12:39 +01:00
Sandeep Thakkar 3074af101b Add Mac Appbundle generation support. 2016-06-02 13:56:56 +01:00
Dave Page a5bb65c468 Search path for the runtime when running in a Mac dev env. 2016-05-10 16:39:02 +01:00
Sandeep Thakkar c8406a5994 Fix the runtime search path when running in a Mac App Bundle 2016-05-06 15:53:00 +01:00
Neel Patel efc8815ecb Update the runtime to properly support Windows. 2016-02-02 13:16:01 +00:00
Dave Page 7c9347873f Use a custom configuration dialogue and allow the user to specify
the application path as well as the Python path.
2016-01-19 10:26:36 +00:00