2013-06-16 08:17:46 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2016-01-18 08:33:28 -06:00
|
|
|
// Copyright (C) 2013 - 2016, The pgAdmin Development Team
|
2013-06-16 08:17:46 -05:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
// BrowserWindow.h - Declaration of the main window class
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef BROWSERWINDOW_H
|
|
|
|
#define BROWSERWINDOW_H
|
|
|
|
|
2013-06-21 17:21:11 -05:00
|
|
|
#include "pgAdmin4.h"
|
2016-01-18 08:33:28 -06:00
|
|
|
#include "TabWindow.h"
|
|
|
|
#include "WebViewWindow.h"
|
2013-06-16 08:17:46 -05:00
|
|
|
|
|
|
|
#if QT_VERSION >= 0x050000
|
|
|
|
#include <QtWidgets>
|
|
|
|
#include <QtWebKitWidgets>
|
|
|
|
#else
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QWebView>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QAction;
|
|
|
|
class QMenu;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class BrowserWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-10-04 12:16:31 -05:00
|
|
|
BrowserWindow(QString url);
|
2013-06-16 08:17:46 -05:00
|
|
|
|
2013-10-04 09:08:18 -05:00
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
2013-06-21 18:49:40 -05:00
|
|
|
protected slots:
|
|
|
|
void finishLoading(bool);
|
2016-01-18 08:33:28 -06:00
|
|
|
void urlLinkClicked(const QUrl &);
|
|
|
|
void closetabs();
|
|
|
|
void tabTitleChanged(const QString &);
|
2013-06-21 18:49:40 -05:00
|
|
|
|
2013-06-16 08:17:46 -05:00
|
|
|
private slots:
|
|
|
|
void openUrl();
|
2016-01-19 04:26:01 -06:00
|
|
|
void configuration();
|
2013-06-16 08:17:46 -05:00
|
|
|
void about();
|
|
|
|
|
2016-01-18 08:33:28 -06:00
|
|
|
public slots:
|
|
|
|
void tabIndexChanged(int index);
|
|
|
|
void goBackPage();
|
|
|
|
void goForwardPage();
|
|
|
|
|
2013-06-16 08:17:46 -05:00
|
|
|
private:
|
2013-10-04 11:12:10 -05:00
|
|
|
QString m_appServerUrl;
|
2016-01-18 08:33:28 -06:00
|
|
|
WebViewWindow *m_mainWebView;
|
2013-06-16 08:17:46 -05:00
|
|
|
QMenu *fileMenu;
|
|
|
|
QMenu *helpMenu;
|
|
|
|
QAction *openUrlAction;
|
2016-01-19 04:26:01 -06:00
|
|
|
QAction *configurationAction;
|
2013-06-16 08:17:46 -05:00
|
|
|
QAction *exitAction;
|
|
|
|
QAction *aboutAction;
|
|
|
|
|
2016-01-18 08:33:28 -06:00
|
|
|
QGridLayout *m_tabGridLayout;
|
|
|
|
QGridLayout *m_mainGridLayout;
|
|
|
|
TabWindow *m_tabWidget;
|
|
|
|
QWidget *m_pgAdminMainTab;
|
|
|
|
|
|
|
|
QWidget *m_addNewTab;
|
|
|
|
QGridLayout *m_addNewGridLayout;
|
|
|
|
WebViewWindow *m_addNewWebView;
|
|
|
|
QHBoxLayout *m_horizontalLayout;
|
|
|
|
QWidget *m_widget;
|
|
|
|
QToolButton *m_toolBtnBack;
|
|
|
|
QToolButton *m_toolBtnForward;
|
|
|
|
|
2013-10-04 11:12:10 -05:00
|
|
|
bool m_initialLoad;
|
|
|
|
int m_loadAttempt;
|
2013-06-21 18:49:40 -05:00
|
|
|
|
2013-06-16 08:17:46 -05:00
|
|
|
void createActions();
|
|
|
|
void createMenus();
|
2013-06-21 18:49:40 -05:00
|
|
|
void pause(int seconds = 1);
|
2016-01-18 08:33:28 -06:00
|
|
|
int findURLTab(const QUrl &name);
|
2013-06-16 08:17:46 -05:00
|
|
|
};
|
|
|
|
|
2013-06-21 17:21:11 -05:00
|
|
|
#endif // BROWSERWINDOW_H
|