mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Support tabs in the runtime browser.
Added functionality to open different website link and load the
website data to different tab. To achieve this, new customized
QTabWidget and QWebView are added to render the data to WebView
widget. All the widgets (New Tab, WebViewWinodw, and QToolButton)
are added dynamically. QToolButton is used to traverse back and
forward to web document opened in WebViewWindow.
Introduced the New class called WebViewWindow which is derived
from QWebView. Each tab of the QTabWidget contains the instance
of WebViewWindow class. WebViewWindow class is useful to display
the web document.
Introduced New class called TabWindow which is derived from
QTabWidget. This class is useful to achieve following functionality:
- Customize the close button of tabbar so that it can only be
visible other then main pgAdmin 4 window.
- Enable/Disable the toolbutton added left side of tabbar
depending on the web history traversed by the user in WebViewWindow.
- Set the tooltip text of the tabbar depending on the title change
event of WebViewWindow class.
Modified the Qt project file to support the both the version
of python 2 and python 3.
Qt5 is recommended to test pgAdmin4 in dektop mode.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// pgAdmin 4 - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2013, The pgAdmin Development Team
|
||||
// Copyright (C) 2013 - 2016, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
// pgAdmin4.cpp - Main application entry point
|
||||
@@ -14,14 +14,14 @@
|
||||
// Must be before QT
|
||||
#include <Python.h>
|
||||
|
||||
// QT headers
|
||||
#include <QtGlobal>
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <QtWidgets>
|
||||
#else
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QtNetwork>
|
||||
#include <QLineEdit>
|
||||
#include <QInputDialog>
|
||||
#endif
|
||||
|
||||
// App headers
|
||||
@@ -38,11 +38,18 @@ int main(int argc, char * argv[])
|
||||
QCoreApplication::setOrganizationDomain("pgadmin.org");
|
||||
QCoreApplication::setApplicationName(PGA_APP_NAME);
|
||||
|
||||
quint16 port = 0L;
|
||||
|
||||
// Find an unused port number. Essentially, we're just reserving one
|
||||
// here that Flask will use when we start up the server.
|
||||
QTcpSocket socket;
|
||||
socket.bind(0, QAbstractSocket::DontShareAddress);
|
||||
quint16 port = socket.localPort();
|
||||
// In order to use the socket, we need to free this socket ASAP.
|
||||
// Hence - putting this code in a code block so the scope of the socket
|
||||
// variable vanishes to make that socket available.
|
||||
{
|
||||
QTcpSocket socket;
|
||||
socket.bind(0, QAbstractSocket::DontShareAddress);
|
||||
port = socket.localPort();
|
||||
}
|
||||
|
||||
// Fire up the webserver
|
||||
Server *server = new Server(port);
|
||||
|
||||
Reference in New Issue
Block a user