DatabaseWindow now provides some functionality to its child components through the IDatabaseWindow interface.
This way children do not need to include the full header to get access to some utility functions for changing the titles and icons of tabpages (and in fact do not need to know that there are tabs, could be something else)
This commit is contained in:
parent
6d4df99100
commit
1a2ec6a224
6 changed files with 84 additions and 135 deletions
|
|
@ -10,6 +10,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QMetaMethod>
|
#include <QMetaMethod>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QStatusBar>
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
|
|
||||||
#include "EditTableWidget.h"
|
#include "EditTableWidget.h"
|
||||||
|
|
@ -434,7 +435,7 @@ void DatabaseWindow::on_actionInspectUserSchemas_triggered()
|
||||||
|
|
||||||
void DatabaseWindow::on_actionNewSql_triggered()
|
void DatabaseWindow::on_actionNewSql_triggered()
|
||||||
{
|
{
|
||||||
auto *ct = new QueryTool(m_database, this);
|
auto *ct = new QueryTool(this, this);
|
||||||
addPage(ct, "query");
|
addPage(ct, "query");
|
||||||
ct->newdoc();
|
ct->newdoc();
|
||||||
}
|
}
|
||||||
|
|
@ -445,7 +446,7 @@ void DatabaseWindow::on_actionOpenSql_triggered()
|
||||||
QString file_name = QFileDialog::getOpenFileName(this,
|
QString file_name = QFileDialog::getOpenFileName(this,
|
||||||
tr("Open sql query"), home_dir, tr("SQL files (*.sql *.txt)"));
|
tr("Open sql query"), home_dir, tr("SQL files (*.sql *.txt)"));
|
||||||
if ( ! file_name.isEmpty()) {
|
if ( ! file_name.isEmpty()) {
|
||||||
auto *ct = new QueryTool(m_database, this);
|
auto *ct = new QueryTool(this, this);
|
||||||
if (ct->load(file_name)) {
|
if (ct->load(file_name)) {
|
||||||
addPage(ct, "");
|
addPage(ct, "");
|
||||||
}
|
}
|
||||||
|
|
@ -484,3 +485,33 @@ void DatabaseWindow::on_actionShowConnectionManager_triggered()
|
||||||
m_masterController->showConnectionManager();
|
m_masterController->showConnectionManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void DatabaseWindow::setTitleForWidget(QWidget *widget, QString title, QString hint)
|
||||||
|
{
|
||||||
|
int i = m_tabWidget->indexOf(widget);
|
||||||
|
if (i >= 0) {
|
||||||
|
m_tabWidget->setTabText(i, title);
|
||||||
|
m_tabWidget->setTabToolTip(i, hint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DatabaseWindow::setIconForWidget(QWidget *widget, QIcon icon)
|
||||||
|
{
|
||||||
|
int i = m_tabWidget->indexOf(widget);
|
||||||
|
if (i >= 0) {
|
||||||
|
m_tabWidget->setTabIcon(i, icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::shared_ptr<OpenDatabase> DatabaseWindow::openDatabase()
|
||||||
|
{
|
||||||
|
return m_database;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DatabaseWindow::showStatusBarMessage(QString message)
|
||||||
|
{
|
||||||
|
statusBar()->showMessage(message);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include "OpenDatabase.h"
|
#include "OpenDatabase.h"
|
||||||
#include "Pgsql_Connection.h"
|
#include "Pgsql_Connection.h"
|
||||||
#include "ControllableTask.h"
|
#include "ControllableTask.h"
|
||||||
|
#include "IDatabaseWindow.h"
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
@ -24,11 +25,10 @@ class QMenu;
|
||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
class QToolBar;
|
class QToolBar;
|
||||||
|
|
||||||
|
|
||||||
/** This is the class for windows that handle tasks for a specific database/catalog
|
/** This is the class for windows that handle tasks for a specific database/catalog
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DatabaseWindow : public QMainWindow {
|
class DatabaseWindow : public QMainWindow, public IDatabaseWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DatabaseWindow(MasterController *master, QWidget *parent);
|
DatabaseWindow(MasterController *master, QWidget *parent);
|
||||||
|
|
@ -136,6 +136,13 @@ private slots:
|
||||||
void on_actionSaveSqlAs_triggered();
|
void on_actionSaveSqlAs_triggered();
|
||||||
void on_actionSaveCopyOfSqlAs_triggered();
|
void on_actionSaveCopyOfSqlAs_triggered();
|
||||||
void on_actionShowConnectionManager_triggered();
|
void on_actionShowConnectionManager_triggered();
|
||||||
|
|
||||||
|
// IDatabaseWindow interface
|
||||||
|
public:
|
||||||
|
virtual void setTitleForWidget(QWidget *widget, QString title, QString hint) override;
|
||||||
|
virtual void setIconForWidget(QWidget *widget, QIcon icon) override;
|
||||||
|
virtual std::shared_ptr<OpenDatabase> openDatabase() override;
|
||||||
|
virtual void showStatusBarMessage(QString message) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
|
||||||
20
pglab/IDatabaseWindow.h
Normal file
20
pglab/IDatabaseWindow.h
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef IDATABASEWINDOW_H
|
||||||
|
#define IDATABASEWINDOW_H
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class OpenDatabase;
|
||||||
|
class QWidget;
|
||||||
|
/** Abstract class definition to make some functions
|
||||||
|
* available to other classes without having to know everything about the window.
|
||||||
|
*/
|
||||||
|
class IDatabaseWindow {
|
||||||
|
public:
|
||||||
|
virtual void setTitleForWidget(QWidget* widget, QString title, QString hint) = 0;
|
||||||
|
virtual void setIconForWidget(QWidget* widget, QIcon icon) = 0;
|
||||||
|
virtual std::shared_ptr<OpenDatabase> openDatabase() = 0;
|
||||||
|
virtual void showStatusBarMessage(QString message) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // IDATABASEWINDOW_H
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QStatusBar>
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QTextDocumentFragment>
|
#include <QTextDocumentFragment>
|
||||||
|
|
@ -19,17 +20,20 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "GlobalIoService.h"
|
#include "GlobalIoService.h"
|
||||||
#include "UserConfiguration.h"
|
#include "UserConfiguration.h"
|
||||||
|
#include "IDatabaseWindow.h"
|
||||||
|
|
||||||
|
|
||||||
QueryTool::QueryTool(std::shared_ptr<OpenDatabase> open_database, QWidget *parent)
|
QueryTool::QueryTool(IDatabaseWindow *context, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
, m_context(context)
|
||||||
, ui(new Ui::QueryTab)
|
, ui(new Ui::QueryTab)
|
||||||
, m_dbConnection(*getGlobalAsioIoService())
|
, m_dbConnection(*getGlobalAsioIoService())
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
m_config = open_database->config();
|
auto db = context->openDatabase();
|
||||||
m_catalog = open_database->catalog();
|
m_config = db->config();
|
||||||
|
m_catalog = db->catalog();
|
||||||
|
|
||||||
connect(&m_dbConnection, &ASyncDBConnection::onStateChanged, this, &QueryTool::connectionStateChanged);
|
connect(&m_dbConnection, &ASyncDBConnection::onStateChanged, this, &QueryTool::connectionStateChanged);
|
||||||
connect(&m_dbConnection, &ASyncDBConnection::onNotice, this, &QueryTool::receiveNotice);
|
connect(&m_dbConnection, &ASyncDBConnection::onNotice, this, &QueryTool::receiveNotice);
|
||||||
|
|
@ -39,11 +43,9 @@ QueryTool::QueryTool(std::shared_ptr<OpenDatabase> open_database, QWidget *paren
|
||||||
highlighter = new SqlSyntaxHighlighter(ui->queryEdit->document());
|
highlighter = new SqlSyntaxHighlighter(ui->queryEdit->document());
|
||||||
highlighter->setTypes(*m_catalog->types());
|
highlighter->setTypes(*m_catalog->types());
|
||||||
|
|
||||||
initActions();
|
|
||||||
|
|
||||||
connect(ui->queryEdit, &QPlainTextEdit::textChanged, this, &QueryTool::queryTextChanged);
|
connect(ui->queryEdit, &QPlainTextEdit::textChanged, this, &QueryTool::queryTextChanged);
|
||||||
|
|
||||||
m_queryParamListController = new QueryParamListController(ui->paramTableView, open_database, this);
|
m_queryParamListController = new QueryParamListController(ui->paramTableView, m_context->openDatabase(), this);
|
||||||
connect(ui->addButton, &QPushButton::clicked, m_queryParamListController,
|
connect(ui->addButton, &QPushButton::clicked, m_queryParamListController,
|
||||||
&QueryParamListController::on_addParam);
|
&QueryParamListController::on_addParam);
|
||||||
connect(ui->removeButton, &QPushButton::clicked, m_queryParamListController,
|
connect(ui->removeButton, &QPushButton::clicked, m_queryParamListController,
|
||||||
|
|
@ -226,7 +228,7 @@ void QueryTool::setFileName(const QString &filename)
|
||||||
m_fileName = filename;
|
m_fileName = filename;
|
||||||
QFileInfo fileInfo(filename);
|
QFileInfo fileInfo(filename);
|
||||||
QString fn(fileInfo.fileName());
|
QString fn(fileInfo.fileName());
|
||||||
// context()->setCaption(this, fn, m_fileName);
|
m_context->setTitleForWidget(this, fn, m_fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QueryTool::continueWithoutSavingWarning()
|
bool QueryTool::continueWithoutSavingWarning()
|
||||||
|
|
@ -282,29 +284,27 @@ void QueryTool::queryTextChanged()
|
||||||
m_queryTextChanged = true;
|
m_queryTextChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QueryTool::connectionStateChanged(ASyncDBConnection::State state)
|
void QueryTool::connectionStateChanged(ASyncDBConnection::State state)
|
||||||
{
|
{
|
||||||
QString iconname;
|
QString iconname;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ASyncDBConnection::State::NotConnected:
|
case ASyncDBConnection::State::NotConnected:
|
||||||
case ASyncDBConnection::State::Connecting:
|
case ASyncDBConnection::State::Connecting:
|
||||||
iconname = "document_red.png";
|
iconname = "red.png";
|
||||||
break;
|
break;
|
||||||
case ASyncDBConnection::State::Connected:
|
case ASyncDBConnection::State::Connected:
|
||||||
iconname = "document_green.png";
|
iconname = "green.png";
|
||||||
break;
|
break;
|
||||||
case ASyncDBConnection::State::QuerySend:
|
case ASyncDBConnection::State::QuerySend:
|
||||||
case ASyncDBConnection::State::CancelSend:
|
case ASyncDBConnection::State::CancelSend:
|
||||||
iconname = "document_yellow.png";
|
iconname = "yellow.png";
|
||||||
break;
|
break;
|
||||||
case ASyncDBConnection::State::Terminating:
|
case ASyncDBConnection::State::Terminating:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// context()->setIcon(this, iconname);
|
m_context->setIconForWidget(this, QIcon(":/icons/16x16/document_" + iconname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QueryTool::addLog(QString s)
|
void QueryTool::addLog(QString s)
|
||||||
{
|
{
|
||||||
QTextCursor text_cursor = QTextCursor(ui->edtLog->document());
|
QTextCursor text_cursor = QTextCursor(ui->edtLog->document());
|
||||||
|
|
@ -390,12 +390,13 @@ void QueryTool::explain_ready(ExplainRoot::SPtr explain)
|
||||||
ui->explainTreeView->setColumnWidth(6, 600);
|
ui->explainTreeView->setColumnWidth(6, 600);
|
||||||
ui->tabWidget->setCurrentWidget(ui->explainTab);
|
ui->tabWidget->setCurrentWidget(ui->explainTab);
|
||||||
|
|
||||||
// context()->showStatusMessage(tr("Explain ready."));
|
m_context->showStatusBarMessage(tr("Explain ready."));
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
addLog("Explain no result");
|
addLog(tr("Explain no result"));
|
||||||
ui->tabWidget->setCurrentWidget(ui->messageTab);
|
ui->tabWidget->setCurrentWidget(ui->messageTab);
|
||||||
// statusBar()->showMessage(tr("Explain failed."));
|
m_context->showStatusBarMessage(tr("Explain no result"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -417,27 +418,6 @@ std::string QueryTool::getCommandUtf8() const
|
||||||
return getCommand().toUtf8().data();
|
return getCommand().toUtf8().data();
|
||||||
}
|
}
|
||||||
|
|
||||||
//QTabWidget *QueryTab::getTabWidget()
|
|
||||||
//{
|
|
||||||
// QWidget * w = parentWidget();
|
|
||||||
// QWidget * p = w->parentWidget();
|
|
||||||
// QTabWidget *tw = dynamic_cast<QTabWidget*>(p);
|
|
||||||
// return tw;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void QueryTab::setTabCaption(const QString &caption, const QString &tooltip)
|
|
||||||
//{
|
|
||||||
// QTabWidget *tabwidget = getTabWidget();
|
|
||||||
// if (tabwidget) {
|
|
||||||
// int i = tabwidget->indexOf(this);
|
|
||||||
// if (i >= 0) {
|
|
||||||
// tabwidget->setTabText(i, caption);
|
|
||||||
// tabwidget->setTabToolTip(i, tooltip);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
void QueryTool::query_ready(std::shared_ptr<Pgsql::Result> dbres, qint64 elapsedms)
|
void QueryTool::query_ready(std::shared_ptr<Pgsql::Result> dbres, qint64 elapsedms)
|
||||||
{
|
{
|
||||||
if (dbres) {
|
if (dbres) {
|
||||||
|
|
@ -564,14 +544,6 @@ void QueryTool::clearResult()
|
||||||
|
|
||||||
void QueryTool::copyQueryAsCString()
|
void QueryTool::copyQueryAsCString()
|
||||||
{
|
{
|
||||||
// QString command;
|
|
||||||
// QTextCursor cursor = ui->queryEdit->textCursor();
|
|
||||||
// if (cursor.hasSelection()) {
|
|
||||||
// command = cursor.selection().toPlainText();
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// command = ui->queryEdit->toPlainText();
|
|
||||||
// }
|
|
||||||
QString command = getCommand();
|
QString command = getCommand();
|
||||||
QString cs = ConvertToMultiLineCString(command);
|
QString cs = ConvertToMultiLineCString(command);
|
||||||
QApplication::clipboard()->setText(cs);
|
QApplication::clipboard()->setText(cs);
|
||||||
|
|
@ -583,7 +555,6 @@ void QueryTool::copyQueryAsCString()
|
||||||
void QueryTool::copyQueryAsRawCppString()
|
void QueryTool::copyQueryAsRawCppString()
|
||||||
{
|
{
|
||||||
QString command = getCommand();
|
QString command = getCommand();
|
||||||
//auto sql = getAllOrSelectedSql();
|
|
||||||
QString cs = ConvertToMultiLineRawCppString(command);
|
QString cs = ConvertToMultiLineRawCppString(command);
|
||||||
QApplication::clipboard()->setText(cs);
|
QApplication::clipboard()->setText(cs);
|
||||||
}
|
}
|
||||||
|
|
@ -623,69 +594,3 @@ void QueryTool::exportData()
|
||||||
tr("Export data"), home_dir, tr("CSV file (*.csv)"));
|
tr("Export data"), home_dir, tr("CSV file (*.csv)"));
|
||||||
exportDataToFilename(file_name);
|
exportDataToFilename(file_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryTool::initActions()
|
|
||||||
{
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/script_save.png"), tr("Save SQL"), this);
|
|
||||||
ac->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::save);
|
|
||||||
m_saveSqlAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/script_save.png"), tr("Save SQL as"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::saveAs);
|
|
||||||
m_saveSqlAsAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/script_save.png"), tr("Save copy of SQL as"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::saveCopyAs);
|
|
||||||
m_saveCopyOfSqlAsAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/table_save.png"), tr("&Export data"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::exportData);
|
|
||||||
m_exportDataAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/token_shortland_character.png"), tr("Copy as C string"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::copyQueryAsCString);
|
|
||||||
m_copyQueryAsCStringAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/token_shortland_character.png"), tr("Copy as raw C++ string"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::copyQueryAsRawCppString);
|
|
||||||
m_copyQueryAsRawCppStringAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/script_go.png"), tr("Execute"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::execute);
|
|
||||||
ac->setShortcut(QKeySequence(Qt::Key_F5));
|
|
||||||
m_executeAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/lightbulb_off.png"), tr("Explain"), this);
|
|
||||||
connect(ac, &QAction::triggered, [this] { explain(false); });
|
|
||||||
ac->setShortcut(QKeySequence(Qt::Key_F7));
|
|
||||||
m_explainAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/lightbulb.png"), tr("Analyze"), this);
|
|
||||||
connect(ac, &QAction::triggered, [this] { explain(true); });
|
|
||||||
ac->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F7));
|
|
||||||
m_analyzeAction = ac;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto ac = new QAction(QIcon(":/icons/script_delete.png"), tr("Cancel"), this);
|
|
||||||
connect(ac, &QAction::triggered, this, &QueryTool::cancel);
|
|
||||||
m_analyzeAction = ac;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<QAction *> QueryTool::actions()
|
|
||||||
{
|
|
||||||
return { m_saveSqlAction, m_saveSqlAsAction, m_saveCopyOfSqlAsAction,
|
|
||||||
m_exportDataAction,
|
|
||||||
m_copyQueryAsCStringAction, m_copyQueryAsRawCppStringAction,
|
|
||||||
m_executeAction, m_explainAction, m_analyzeAction };
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
class IDatabaseWindow;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class QueryTab;
|
class QueryTab;
|
||||||
}
|
}
|
||||||
|
|
@ -33,7 +35,7 @@ class PgDatabaseCatalog;
|
||||||
class QueryTool : public QWidget {
|
class QueryTool : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QueryTool(std::shared_ptr<OpenDatabase> open_database, QWidget *parent = nullptr);
|
QueryTool(IDatabaseWindow *context, QWidget *parent = nullptr);
|
||||||
~QueryTool() override;
|
~QueryTool() override;
|
||||||
|
|
||||||
void newdoc();
|
void newdoc();
|
||||||
|
|
@ -51,8 +53,6 @@ public:
|
||||||
bool isNew() const { return m_new; }
|
bool isNew() const { return m_new; }
|
||||||
void focusEditor();
|
void focusEditor();
|
||||||
|
|
||||||
QList<QAction *> actions();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void execute();
|
void execute();
|
||||||
/// Save the document under its current name, a file save dialog will be shown if this is a new document
|
/// Save the document under its current name, a file save dialog will be shown if this is a new document
|
||||||
|
|
@ -69,22 +69,12 @@ public slots:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
using ResultTabContainer = std::vector<TuplesResultWidget*>;
|
using ResultTabContainer = std::vector<TuplesResultWidget*>;
|
||||||
|
IDatabaseWindow *m_context;
|
||||||
Ui::QueryTab *ui;
|
Ui::QueryTab *ui;
|
||||||
SqlSyntaxHighlighter* highlighter;
|
SqlSyntaxHighlighter* highlighter;
|
||||||
ConnectionConfig m_config;
|
ConnectionConfig m_config;
|
||||||
StopWatch m_stopwatch;
|
StopWatch m_stopwatch;
|
||||||
|
|
||||||
QAction *m_saveSqlAction = nullptr;
|
|
||||||
QAction *m_saveSqlAsAction = nullptr;
|
|
||||||
QAction *m_saveCopyOfSqlAsAction = nullptr;
|
|
||||||
QAction *m_exportDataAction = nullptr;
|
|
||||||
QAction *m_copyQueryAsCStringAction = nullptr;
|
|
||||||
QAction *m_copyQueryAsRawCppStringAction = nullptr;
|
|
||||||
QAction *m_executeAction = nullptr;
|
|
||||||
QAction *m_explainAction = nullptr;
|
|
||||||
QAction *m_analyzeAction = nullptr;
|
|
||||||
|
|
||||||
QueryParamListController *m_queryParamListController = nullptr;
|
QueryParamListController *m_queryParamListController = nullptr;
|
||||||
|
|
||||||
bool m_new = true;
|
bool m_new = true;
|
||||||
|
|
@ -102,18 +92,13 @@ private:
|
||||||
bool saveSqlTo(const QString &filename);
|
bool saveSqlTo(const QString &filename);
|
||||||
QString promptUserForSaveSqlFilename();
|
QString promptUserForSaveSqlFilename();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void addLog(QString s);
|
void addLog(QString s);
|
||||||
|
|
||||||
QString getCommand() const;
|
QString getCommand() const;
|
||||||
std::string getCommandUtf8() const;
|
std::string getCommandUtf8() const;
|
||||||
|
|
||||||
//QTabWidget *getTabWidget();
|
|
||||||
//void setTabCaption(const QString &caption, const QString &tooltip);
|
|
||||||
void clearResult();
|
void clearResult();
|
||||||
void markError(const Pgsql::ErrorDetails &details);
|
void markError(const Pgsql::ErrorDetails &details);
|
||||||
void initActions();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ PropertyProxyModel.cpp \
|
||||||
widgets/CatalogSequencesPage.cpp
|
widgets/CatalogSequencesPage.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
IDatabaseWindow.h \
|
||||||
NotificationListWidget.h \
|
NotificationListWidget.h \
|
||||||
NotificationModel.h \
|
NotificationModel.h \
|
||||||
NotificationService.h \
|
NotificationService.h \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue