Switched DatabaseWindow to using the form designer.
This commit is contained in:
parent
03b4194193
commit
7300865c77
4 changed files with 604 additions and 437 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "DatabaseWindow.h"
|
||||
#include "ui_DatabaseWindow.h"
|
||||
#include "util.h"
|
||||
#include "crud/CrudTab.h"
|
||||
#include "widgets/CatalogTablesPage.h"
|
||||
|
|
@ -28,41 +29,40 @@ namespace pg = Pgsql;
|
|||
|
||||
DatabaseWindow::DatabaseWindow(MasterController *master, QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::DatabaseWindow)
|
||||
, m_masterController(master)
|
||||
{
|
||||
m_tabWidget = new QTabWidget(this);
|
||||
m_tabWidget->setObjectName("m_tabWidget");
|
||||
setCentralWidget(m_tabWidget);
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(m_tabWidget, &QTabWidget::tabCloseRequested, this, &DatabaseWindow::m_tabWidget_tabCloseRequested);
|
||||
connect(m_tabWidget, &QTabWidget::currentChanged, this, &DatabaseWindow::m_tabWidget_currentChanged);
|
||||
|
||||
createActions();
|
||||
initMenus();
|
||||
connect(ui->mainTabs, &QTabWidget::tabCloseRequested, this, &DatabaseWindow::mainTabCloseRequested);
|
||||
connect(ui->mainTabs, &QTabWidget::currentChanged, this, &DatabaseWindow::currentMainTabChanged);
|
||||
|
||||
setAcceptDrops(true);
|
||||
}
|
||||
|
||||
DatabaseWindow::~DatabaseWindow() = default;
|
||||
DatabaseWindow::~DatabaseWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DatabaseWindow::addPage(QWidget* page, QString caption)
|
||||
{
|
||||
m_tabWidget->addTab(page, caption);
|
||||
m_tabWidget->setCurrentWidget(page);
|
||||
ui->mainTabs->addTab(page, caption);
|
||||
ui->mainTabs->setCurrentWidget(page);
|
||||
}
|
||||
|
||||
void DatabaseWindow::setTabCaptionForWidget(QWidget *widget, const QString &caption, const QString &hint)
|
||||
{
|
||||
auto index = m_tabWidget->indexOf(widget);
|
||||
m_tabWidget->setTabText(index, caption);
|
||||
m_tabWidget->setTabToolTip(index, hint);
|
||||
auto index = ui->mainTabs->indexOf(widget);
|
||||
ui->mainTabs->setTabText(index, caption);
|
||||
ui->mainTabs->setTabToolTip(index, hint);
|
||||
}
|
||||
|
||||
void DatabaseWindow::setTabIcon(QWidget *widget, const QString &iconname)
|
||||
{
|
||||
auto index = m_tabWidget->indexOf(widget);
|
||||
auto index = ui->mainTabs->indexOf(widget);
|
||||
auto n = ":/icons/16x16/" + iconname;
|
||||
m_tabWidget->setTabIcon(index, QIcon(n));
|
||||
ui->mainTabs->setTabIcon(index, QIcon(n));
|
||||
}
|
||||
|
||||
void DatabaseWindow::newCodeGenPage(QString query, std::shared_ptr<const Pgsql::Result> dbres)
|
||||
|
|
@ -74,22 +74,24 @@ void DatabaseWindow::newCodeGenPage(QString query, std::shared_ptr<const Pgsql::
|
|||
|
||||
QueryTool *DatabaseWindow::GetActiveQueryTool()
|
||||
{
|
||||
auto widget = m_tabWidget->currentWidget();
|
||||
auto widget = ui->mainTabs->currentWidget();
|
||||
auto qt = dynamic_cast<QueryTool*>(widget);
|
||||
return qt;
|
||||
}
|
||||
|
||||
CrudTab *DatabaseWindow::GetActiveCrud()
|
||||
{
|
||||
auto widget = m_tabWidget->currentWidget();
|
||||
auto widget = ui->mainTabs->currentWidget();
|
||||
auto ct = dynamic_cast<CrudTab*>(widget);
|
||||
return ct;
|
||||
}
|
||||
|
||||
void DatabaseWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
for (int idx = 0; idx < m_tabWidget->count(); ++idx) {
|
||||
if (!canCloseTab(idx)) {
|
||||
for (int idx = 0; idx < ui->mainTabs->count(); ++idx)
|
||||
{
|
||||
if (!canCloseTab(idx))
|
||||
{
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
|
|
@ -99,166 +101,44 @@ void DatabaseWindow::closeEvent(QCloseEvent *event)
|
|||
void DatabaseWindow::setConfig(const ConnectionConfig &config)
|
||||
{
|
||||
m_config = config;
|
||||
try {
|
||||
try
|
||||
{
|
||||
QString title = "pglab - ";
|
||||
title += m_config.name();
|
||||
setWindowTitle(title);
|
||||
|
||||
auto cfg = m_config;
|
||||
auto qthis = QPointer(this);
|
||||
QtConcurrent::run([cfg] {
|
||||
return OpenDatabase::createOpenDatabase(cfg);
|
||||
}).then(qApp, [qthis](OpenDatabase::OpenDatabaseSPtr db) {
|
||||
if (qthis) {
|
||||
qthis.data()->catalogLoaded(db);
|
||||
QtConcurrent::run([cfg]
|
||||
{
|
||||
return OpenDatabase::createOpenDatabase(cfg);
|
||||
}
|
||||
});
|
||||
).then(qApp, [qthis](OpenDatabase::OpenDatabaseSPtr db)
|
||||
{
|
||||
if (qthis)
|
||||
qthis.data()->catalogLoaded(db);
|
||||
}
|
||||
);
|
||||
|
||||
} catch (std::runtime_error &ex) {
|
||||
}
|
||||
catch (std::runtime_error &ex)
|
||||
{
|
||||
QMessageBox::critical(this, "Error reading database",
|
||||
QString::fromUtf8(ex.what()));
|
||||
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
QAction* DatabaseWindow::createAction(QString iconname, QString caption, void (DatabaseWindow::*func)())
|
||||
{
|
||||
QIcon icon;
|
||||
icon.addFile(iconname, QSize(), QIcon::Normal, QIcon::On);
|
||||
QAction *action = new QAction(icon, caption, this);
|
||||
connect(action, &QAction::triggered, this, func);
|
||||
return action;
|
||||
}
|
||||
|
||||
QAction* DatabaseWindow::createAction(QString caption, void (DatabaseWindow::*func)())
|
||||
{
|
||||
QAction *action = new QAction(caption, this);
|
||||
connect(action, &QAction::triggered, this, func);
|
||||
return action;
|
||||
}
|
||||
|
||||
void DatabaseWindow::createActions()
|
||||
{
|
||||
actionAbout = createAction(":/icons/about.png", tr("About"), &DatabaseWindow::actionAbout_triggered);
|
||||
actionCancelQuery = createAction(":/icons/script_delete.png", tr("Cancel query"), &DatabaseWindow::actionCancelQuery_triggered);
|
||||
actionClose = createAction(":/icons/page_white_delete.png", tr("Close"), &DatabaseWindow::actionClose_triggered);
|
||||
actionCopy = createAction(":/icons/page_white_copy.png", tr("Copy"), &DatabaseWindow::actionCopy_triggered);
|
||||
actionCopyAsCString = createAction(":/icons/token_shortland_character.png", tr("Copy as C string"), &DatabaseWindow::actionCopyAsCString_triggered);
|
||||
actionCopyAsRawCppString = createAction(":/icons/token_shortland_character.png", tr("Copy as raw C++-string"), &DatabaseWindow::actionCopyAsRawCppString_triggered);
|
||||
actionExecuteQuery = createAction(":/icons/script_go.png", tr("Execute query"), &DatabaseWindow::actionExecuteQuery_triggered);
|
||||
actionExplain = createAction(":/icons/lightbulb_off.png", tr("Explain"), &DatabaseWindow::actionExplain_triggered);
|
||||
actionExplainAnalyze = createAction(":/icons/lightbulb.png", tr("Explain analyze"), &DatabaseWindow::actionExplainAnalyze_triggered);
|
||||
actionExportData = createAction(":/icons/table_save.png", tr("Export data"), &DatabaseWindow::actionExportData_triggered);
|
||||
actionGenerateCode = createAction(tr("Generate code"), &DatabaseWindow::actionGenerateCode_triggered);
|
||||
actionInspectInformationSchema = createAction(":/icons/page_white_add.png", tr("Inspect information_schema"), &DatabaseWindow::actionInspectInformationSchema_triggered);
|
||||
actionInspectPgCatalog = createAction(":/icons/page_white_add.png", tr("Inspect pg_catalog"), &DatabaseWindow::actionInspectPgCatalog_triggered);
|
||||
actionInspectUserSchemas = createAction(":/icons/page_white_add.png", tr("Inspect user schemas"), &DatabaseWindow::actionInspectUserSchemas_triggered);
|
||||
actionServerInspector = createAction(":/icons/page_white_add.png", tr("Inspect server"), &DatabaseWindow::actionServerInspector_triggered);
|
||||
actionNewSql = createAction(":/icons/new_query_tab.png", tr("New Query"), &DatabaseWindow::actionNewSql_triggered);
|
||||
actionOpenSql = createAction(":/icons/folder.png", tr("Open Query"), &DatabaseWindow::actionOpenSql_triggered);
|
||||
actionSaveSql = createAction(":/icons/script_save.png", tr("Save Query"), &DatabaseWindow::actionSaveSql_triggered);
|
||||
actionPasteLangString = createAction(tr("Paste lang string"), &DatabaseWindow::actionPasteLangString_triggered);
|
||||
actionRefreshCatalog = createAction(tr("Refresh"), &DatabaseWindow::actionRefreshCatalog_triggered);
|
||||
actionRefreshCrud = createAction(tr("Refresh"), &DatabaseWindow::actionRefreshCrud_triggered);
|
||||
actionSaveSqlAs = createAction(tr("Save query as"), &DatabaseWindow::actionSaveSqlAs_triggered);
|
||||
actionSaveCopyOfSqlAs = createAction(tr("Save copy of query as"), &DatabaseWindow::actionSaveCopyOfSqlAs_triggered);
|
||||
actionShowConnectionManager = createAction(tr("Show connection manager"), &DatabaseWindow::actionShowConnectionManager_triggered);
|
||||
|
||||
actionClose->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_W));
|
||||
actionCopy->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_C));
|
||||
actionCopyAsCString->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C));
|
||||
actionExecuteQuery->setShortcut(QKeySequence(Qt::Key_F5));
|
||||
actionExplain->setShortcut(QKeySequence(Qt::Key_F7));
|
||||
actionExplainAnalyze->setShortcut(QKeySequence(Qt::SHIFT | Qt::Key_F7));
|
||||
actionNewSql->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
|
||||
actionOpenSql->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_O));
|
||||
actionSaveSql->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S));
|
||||
}
|
||||
|
||||
|
||||
void DatabaseWindow::initMenus()
|
||||
{
|
||||
auto mb = new QMenuBar(this);
|
||||
menuFile = mb->addMenu(tr("File"));
|
||||
menuFile->addActions({
|
||||
actionNewSql,
|
||||
actionOpenSql,
|
||||
seperator(),
|
||||
actionSaveSql,
|
||||
actionSaveSqlAs,
|
||||
actionSaveCopyOfSqlAs,
|
||||
seperator(),
|
||||
actionExportData,
|
||||
seperator(),
|
||||
actionClose
|
||||
});
|
||||
|
||||
menuEdit = mb->addMenu(tr("Edit"));
|
||||
menuEdit->addActions({
|
||||
actionCopy,
|
||||
actionCopyAsCString,
|
||||
actionCopyAsRawCppString,
|
||||
// standard Paste missing Ctrl+V works however by default
|
||||
actionPasteLangString,
|
||||
actionGenerateCode
|
||||
});
|
||||
|
||||
menuQuery = mb->addMenu(tr("Query"));
|
||||
menuQuery->addActions({
|
||||
actionExecuteQuery,
|
||||
actionExplain,
|
||||
actionExplainAnalyze,
|
||||
actionCancelQuery
|
||||
});
|
||||
|
||||
menuCatalog = mb->addMenu(tr("Catalog"));
|
||||
menuCatalog->addActions({
|
||||
actionRefreshCatalog
|
||||
});
|
||||
|
||||
menuCrud = mb->addMenu(tr("CRUD"));
|
||||
menuCrud->addActions({
|
||||
actionRefreshCrud
|
||||
});
|
||||
|
||||
menuWindow = mb->addMenu(tr("Window"));
|
||||
menuWindow->addActions({
|
||||
actionInspectUserSchemas,
|
||||
actionInspectPgCatalog,
|
||||
actionInspectInformationSchema,
|
||||
actionServerInspector,
|
||||
seperator(),
|
||||
actionShowConnectionManager
|
||||
});
|
||||
|
||||
|
||||
menuHelp = mb->addMenu(tr("Help"));
|
||||
menuHelp->addActions({
|
||||
seperator(),
|
||||
actionAbout
|
||||
});
|
||||
|
||||
setMenuBar(mb);
|
||||
}
|
||||
|
||||
QAction *DatabaseWindow::seperator()
|
||||
{
|
||||
auto ac = new QAction(this);
|
||||
ac->setSeparator(true);
|
||||
return ac;
|
||||
}
|
||||
|
||||
void DatabaseWindow::newCreateTablePage()
|
||||
{
|
||||
auto w = new EditTableWidget(m_database, this);
|
||||
m_tabWidget->addTab(w, "Create table");
|
||||
ui->mainTabs->addTab(w, "Create table");
|
||||
}
|
||||
|
||||
void DatabaseWindow::newCrudPage(Oid tableoid)
|
||||
{
|
||||
CrudTab *ct = new CrudTab(this, this);
|
||||
ct->addAction(actionRefreshCrud);
|
||||
ct->addAction(ui->actionRefreshCrud);
|
||||
addPage(ct, "crud");
|
||||
ct->setConfig(tableoid);
|
||||
}
|
||||
|
|
@ -269,7 +149,7 @@ void DatabaseWindow::newCatalogInspectorPage(QString caption, NamespaceFilter fi
|
|||
return; // would be better if we queued the operation for later
|
||||
|
||||
auto ct = new CatalogInspector(m_database, this);
|
||||
ct->addAction(actionRefreshCatalog);
|
||||
ct->addAction(ui->actionRefreshCatalog);
|
||||
|
||||
addPage(ct, caption);
|
||||
ct->setNamespaceFilter(filter);
|
||||
|
|
@ -288,44 +168,48 @@ void DatabaseWindow::closeTab(int index)
|
|||
if (index < 0)
|
||||
return;
|
||||
|
||||
if (canCloseTab(index)) {
|
||||
QWidget *widget = m_tabWidget->widget(index);
|
||||
m_tabWidget->removeTab(index);
|
||||
if (canCloseTab(index))
|
||||
{
|
||||
QWidget *widget = ui->mainTabs->widget(index);
|
||||
ui->mainTabs->removeTab(index);
|
||||
delete widget;
|
||||
}
|
||||
}
|
||||
|
||||
bool DatabaseWindow::canCloseTab(int index) const
|
||||
{
|
||||
QWidget *widget = m_tabWidget->widget(index);
|
||||
QWidget *widget = ui->mainTabs->widget(index);
|
||||
auto mp = dynamic_cast<ManagedPage*>(widget);
|
||||
if (mp) {
|
||||
if (mp)
|
||||
return mp->CanClose(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DatabaseWindow::openSqlFile(QString file_name)
|
||||
{
|
||||
if ( ! file_name.isEmpty()) {
|
||||
if (!file_name.isEmpty())
|
||||
{
|
||||
auto *ct = new QueryTool(this, this);
|
||||
if (ct->load(file_name)) {
|
||||
ct->addAction(actionExecuteQuery);
|
||||
if (ct->load(file_name))
|
||||
{
|
||||
ct->addAction(ui->actionExecute_query);
|
||||
addPage(ct, ct->title());
|
||||
}
|
||||
else {
|
||||
else
|
||||
delete ct;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DatabaseWindow::catalogLoaded(OpenDatabase::OpenDatabaseSPtr db)
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
m_database = db;
|
||||
actionNewSql_triggered();
|
||||
} catch (const OpenDatabaseException &ex) {
|
||||
on_actionNew_Query_triggered();
|
||||
}
|
||||
catch (const OpenDatabaseException &ex)
|
||||
{
|
||||
QMessageBox::critical(this, "Error reading database", ex.text());
|
||||
close();
|
||||
}
|
||||
|
|
@ -336,222 +220,49 @@ void DatabaseWindow::tableSelected(Oid tableoid)
|
|||
newCrudPage(tableoid);
|
||||
}
|
||||
|
||||
|
||||
void DatabaseWindow::actionAbout_triggered()
|
||||
{
|
||||
QMessageBox::about(this, "pgLab 0.1", tr(
|
||||
"Copyrights 2016-2019, Eelke Klein, All Rights Reserved.\n"
|
||||
"\n"
|
||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS "
|
||||
"FOR A PARTICULAR PURPOSE.\n"
|
||||
"\n"
|
||||
"This program is dynamically linked with Qt 5.12 Copyright (C) 2018 "
|
||||
"The Qt Company Ltd. https://www.qt.io/licensing/. \n"
|
||||
"\n"
|
||||
"Icons by fatcow http://www.fatcow.com/free-icons provided under Creative Commons "
|
||||
"attribution 3.0 license."
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionCancelQuery_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool) {
|
||||
query_tool->cancel();
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionClose_triggered()
|
||||
{
|
||||
m_tabWidget->tabCloseRequested(m_tabWidget->currentIndex());
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionCopy_triggered()
|
||||
{
|
||||
QWidget *w = QApplication::focusWidget();
|
||||
if (w == nullptr)
|
||||
return;
|
||||
|
||||
QTableView *tv = dynamic_cast<QTableView*>(w);
|
||||
if (tv)
|
||||
copySelectionToClipboard(tv);
|
||||
else
|
||||
InvokeCopyIfPresent(w);
|
||||
}
|
||||
|
||||
void DatabaseWindow::InvokeCopyIfPresent(QWidget *w)
|
||||
{
|
||||
const QMetaObject *meta = w->metaObject();
|
||||
int i = meta->indexOfMethod("copy()");
|
||||
if (i != -1) {
|
||||
if (i != -1)
|
||||
{
|
||||
QMetaMethod method = meta->method(i);
|
||||
method.invoke(w, Qt::AutoConnection);
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionCopyAsCString_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->copyQueryAsCString();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionCopyAsRawCppString_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->copyQueryAsRawCppString();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionExecuteQuery_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->execute();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionExplain_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->explain(false);
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionExplainAnalyze_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->explain(true);
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionExportData_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->exportData();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionGenerateCode_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->generateCode();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionInspectInformationSchema_triggered()
|
||||
{
|
||||
newCatalogInspectorPage("information_schema", NamespaceFilter::InformationSchema);
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionInspectPgCatalog_triggered()
|
||||
{
|
||||
newCatalogInspectorPage("pg_catalog", NamespaceFilter::PgCatalog);
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionInspectUserSchemas_triggered()
|
||||
{
|
||||
newCatalogInspectorPage("Schema", NamespaceFilter::User);
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionServerInspector_triggered()
|
||||
{
|
||||
newServerInspectorPage();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionNewSql_triggered()
|
||||
{
|
||||
auto *ct = new QueryTool(this, this);
|
||||
ct->addAction(actionExecuteQuery);
|
||||
addPage(ct, "new");
|
||||
ct->newdoc();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionOpenSql_triggered()
|
||||
{
|
||||
QString home_dir = QStandardPaths::locate(QStandardPaths::HomeLocation, "", QStandardPaths::LocateDirectory);
|
||||
QString file_name = QFileDialog::getOpenFileName(this,
|
||||
tr("Open sql query"), home_dir, tr("SQL files (*.sql *.txt)"));
|
||||
openSqlFile(file_name);
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionPasteLangString_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->pasteLangString();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionRefreshCatalog_triggered()
|
||||
{
|
||||
m_database->refresh();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionRefreshCrud_triggered()
|
||||
{
|
||||
auto crud = GetActiveCrud();
|
||||
if (crud)
|
||||
crud->refresh();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionSaveSql_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->save();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionSaveSqlAs_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->saveAs();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionSaveCopyOfSqlAs_triggered()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
query_tool->saveCopyAs();
|
||||
}
|
||||
|
||||
void DatabaseWindow::actionShowConnectionManager_triggered()
|
||||
{
|
||||
m_masterController->connectionController()->showConnectionManager();
|
||||
}
|
||||
|
||||
void DatabaseWindow::m_tabWidget_tabCloseRequested(int index)
|
||||
void DatabaseWindow::mainTabCloseRequested(int index)
|
||||
{
|
||||
closeTab(index);
|
||||
}
|
||||
|
||||
void DatabaseWindow::m_tabWidget_currentChanged(int)
|
||||
void DatabaseWindow::currentMainTabChanged(int)
|
||||
{
|
||||
auto widget = m_tabWidget->currentWidget();
|
||||
auto widget = ui->mainTabs->currentWidget();
|
||||
auto qt = dynamic_cast<QueryTool*>(widget);
|
||||
auto ct = dynamic_cast<CrudTab*>(widget);
|
||||
auto ci = dynamic_cast<CatalogInspector*>(widget);
|
||||
|
||||
menuQuery->menuAction()->setVisible(qt != nullptr);
|
||||
menuCatalog->menuAction()->setVisible(ci != nullptr);
|
||||
menuCrud->menuAction()->setVisible(ct != nullptr);
|
||||
ui->menuQuery->menuAction()->setVisible(qt != nullptr);
|
||||
ui->menuCatalog->menuAction()->setVisible(ci != nullptr);
|
||||
ui->menuCRUD->menuAction()->setVisible(ct != nullptr);
|
||||
}
|
||||
|
||||
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);
|
||||
int i = ui->mainTabs->indexOf(widget);
|
||||
if (i >= 0)
|
||||
{
|
||||
ui->mainTabs->setTabText(i, title);
|
||||
ui->mainTabs->setTabToolTip(i, hint);
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWindow::setIconForWidget(QWidget *widget, QIcon icon)
|
||||
{
|
||||
int i = m_tabWidget->indexOf(widget);
|
||||
int i = ui->mainTabs->indexOf(widget);
|
||||
if (i >= 0)
|
||||
m_tabWidget->setTabIcon(i, icon);
|
||||
ui->mainTabs->setTabIcon(i, icon);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -574,9 +285,163 @@ void DatabaseWindow::dragEnterEvent(QDragEnterEvent *event)
|
|||
|
||||
void DatabaseWindow::dropEvent(QDropEvent *event)
|
||||
{
|
||||
foreach (const QUrl &url, event->mimeData()->urls()) {
|
||||
foreach (const QUrl &url, event->mimeData()->urls())
|
||||
{
|
||||
QString file_name = url.toLocalFile();
|
||||
qDebug() << "Dropped file:" << file_name;
|
||||
openSqlFile(file_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DatabaseWindow::on_actionAbout_triggered()
|
||||
{
|
||||
QMessageBox::about(this, "pgLab 0.1", tr(
|
||||
"Copyrights 2016-2019, Eelke Klein, All Rights Reserved.\n"
|
||||
"\n"
|
||||
"The program is provided AS IS with NO WARRANTY OF ANY KIND, "
|
||||
"INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS "
|
||||
"FOR A PARTICULAR PURPOSE.\n"
|
||||
"\n"
|
||||
"This program is dynamically linked with Qt 5.12 Copyright (C) 2018 "
|
||||
"The Qt Company Ltd. https://www.qt.io/licensing/. \n"
|
||||
"\n"
|
||||
"Icons by fatcow http://www.fatcow.com/free-icons provided under Creative Commons "
|
||||
"attribution 3.0 license."
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
void DatabaseWindow::on_actionCancel_query_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::cancel);
|
||||
}
|
||||
|
||||
|
||||
void DatabaseWindow::on_actionClose_triggered()
|
||||
{
|
||||
ui->mainTabs->tabCloseRequested(ui->mainTabs->currentIndex());
|
||||
}
|
||||
|
||||
|
||||
void DatabaseWindow::on_actionCopy_triggered()
|
||||
{
|
||||
QWidget *w = QApplication::focusWidget();
|
||||
if (w == nullptr)
|
||||
return;
|
||||
|
||||
QTableView *tv = dynamic_cast<QTableView*>(w);
|
||||
if (tv)
|
||||
copySelectionToClipboard(tv);
|
||||
else
|
||||
InvokeCopyIfPresent(w);
|
||||
}
|
||||
|
||||
|
||||
void DatabaseWindow::on_actionCopy_as_C_string_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::copyQueryAsCString);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionCopy_as_raw_C_string_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::copyQueryAsRawCppString);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionExecute_query_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::execute);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionExplain_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::explain, false);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionExplain_analyze_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::explain, true);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionExport_data_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::exportData);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionGenerate_code_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::generateCode);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspect_information_schema_triggered()
|
||||
{
|
||||
newCatalogInspectorPage("information_schema", NamespaceFilter::InformationSchema);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspect_pg_catalog_triggered()
|
||||
{
|
||||
newCatalogInspectorPage("pg_catalog", NamespaceFilter::PgCatalog);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspect_user_schemas_triggered()
|
||||
{
|
||||
newCatalogInspectorPage("Schema", NamespaceFilter::User);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionInspect_server_triggered()
|
||||
{
|
||||
newServerInspectorPage();
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionNew_Query_triggered()
|
||||
{
|
||||
auto *ct = new QueryTool(this, this);
|
||||
ct->addAction(ui->actionExecute_query);
|
||||
addPage(ct, "new");
|
||||
ct->newdoc();
|
||||
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionOpen_Query_triggered()
|
||||
{
|
||||
QString home_dir = QStandardPaths::locate(QStandardPaths::HomeLocation, "", QStandardPaths::LocateDirectory);
|
||||
QString file_name = QFileDialog::getOpenFileName(this,
|
||||
tr("Open sql query"), home_dir, tr("SQL files (*.sql *.txt)"));
|
||||
openSqlFile(file_name);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionSave_Query_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::save);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionPaste_lang_string_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::pasteLangString);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionRefreshCatalog_triggered()
|
||||
{
|
||||
m_database->refresh();
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionRefreshCrud_triggered()
|
||||
{
|
||||
CallOnActiveCrud(&CrudTab::refresh);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionSave_query_as_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::saveAs);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionSave_copy_of_query_as_triggered()
|
||||
{
|
||||
CallOnActiveQueryTool(&QueryTool::saveCopyAs);
|
||||
}
|
||||
|
||||
void DatabaseWindow::on_actionShow_connection_manager_triggered()
|
||||
{
|
||||
m_masterController->connectionController()->showConnectionManager();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
#include <QMainWindow>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class DatabaseWindow;
|
||||
}
|
||||
namespace Pgsql {
|
||||
class Connection;
|
||||
}
|
||||
|
|
@ -53,56 +56,13 @@ protected:
|
|||
virtual void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
private:
|
||||
QTabWidget *m_tabWidget = nullptr;
|
||||
QToolBar *m_mainToolBar = nullptr;
|
||||
Ui::DatabaseWindow *ui;
|
||||
|
||||
ConnectionConfig m_config;
|
||||
std::shared_ptr<OpenDatabase> m_database;
|
||||
|
||||
MasterController *m_masterController;
|
||||
|
||||
// Standard menu's
|
||||
QMenu *m_fileMenu = nullptr;
|
||||
|
||||
// Standard actions
|
||||
QAction *actionAbout = nullptr;
|
||||
QAction *actionCancelQuery = nullptr;
|
||||
QAction *actionClose = nullptr;
|
||||
QAction *actionCopy = nullptr;
|
||||
QAction *actionCopyAsCString = nullptr;
|
||||
QAction *actionCopyAsRawCppString = nullptr;
|
||||
QAction *actionExecuteQuery = nullptr;
|
||||
QAction *actionExplain = nullptr;
|
||||
QAction *actionExplainAnalyze = nullptr;
|
||||
QAction *actionExportData = nullptr;
|
||||
QAction *actionGenerateCode = nullptr;
|
||||
QAction *actionInspectInformationSchema = nullptr; ///< Create or switch to pgcatalog tab
|
||||
QAction *actionInspectPgCatalog = nullptr; ///< Create or switch to pgcatalog tab
|
||||
QAction *actionInspectUserSchemas = nullptr; ///< Create or switch to pgcatalog tab
|
||||
QAction *actionServerInspector = nullptr;
|
||||
QAction *actionNewSql = nullptr;
|
||||
QAction *actionOpenSql = nullptr;
|
||||
QAction *actionPasteLangString = nullptr;
|
||||
QAction *actionRefreshCatalog = nullptr;
|
||||
QAction *actionRefreshCrud = nullptr;
|
||||
QAction *actionSaveSql = nullptr;
|
||||
QAction *actionSaveSqlAs = nullptr;
|
||||
QAction *actionSaveCopyOfSqlAs = nullptr;
|
||||
QAction *actionShowConnectionManager = nullptr;
|
||||
|
||||
QMenu *menuEdit = nullptr;
|
||||
QMenu *menuFile = nullptr;
|
||||
QMenu *menuHelp = nullptr;
|
||||
QMenu *menuQuery = nullptr;
|
||||
QMenu *menuCatalog = nullptr;
|
||||
QMenu *menuCrud = nullptr;
|
||||
QMenu *menuWindow = nullptr;
|
||||
|
||||
void createActions();
|
||||
void initMenus();
|
||||
|
||||
QAction* seperator();
|
||||
|
||||
void newCreateTablePage();
|
||||
void newCrudPage(Oid tableoid);
|
||||
void newCatalogInspectorPage(QString caption, NamespaceFilter filter);
|
||||
|
|
@ -115,41 +75,37 @@ private:
|
|||
/// If it has it invokes this method using reflection.
|
||||
static void InvokeCopyIfPresent(QWidget *w);
|
||||
|
||||
QAction* createAction(QString icon, QString caption, void (DatabaseWindow::*func)());
|
||||
QAction* createAction(QString caption, void (DatabaseWindow::*func)());
|
||||
|
||||
private slots:
|
||||
void catalogLoaded(OpenDatabase::OpenDatabaseSPtr db);
|
||||
void tableSelected(Oid tableoid);
|
||||
void mainTabCloseRequested(int index);
|
||||
void currentMainTabChanged(int index);
|
||||
|
||||
void actionAbout_triggered();
|
||||
void actionCancelQuery_triggered();
|
||||
void actionClose_triggered();
|
||||
void actionCopy_triggered();
|
||||
void actionCopyAsCString_triggered();
|
||||
void actionCopyAsRawCppString_triggered();
|
||||
void actionExecuteQuery_triggered();
|
||||
void actionExplain_triggered();
|
||||
void actionExplainAnalyze_triggered();
|
||||
void actionExportData_triggered();
|
||||
void actionGenerateCode_triggered();
|
||||
void actionInspectInformationSchema_triggered();
|
||||
void actionInspectPgCatalog_triggered();
|
||||
void actionInspectUserSchemas_triggered();
|
||||
void actionServerInspector_triggered();
|
||||
void actionNewSql_triggered();
|
||||
void actionOpenSql_triggered();
|
||||
void actionPasteLangString_triggered();
|
||||
void actionRefreshCatalog_triggered();
|
||||
void actionRefreshCrud_triggered();
|
||||
void actionSaveSql_triggered();
|
||||
void actionSaveSqlAs_triggered();
|
||||
void actionSaveCopyOfSqlAs_triggered();
|
||||
void actionShowConnectionManager_triggered();
|
||||
void m_tabWidget_tabCloseRequested(int index);
|
||||
void m_tabWidget_currentChanged(int index);
|
||||
void on_actionAbout_triggered();
|
||||
void on_actionCancel_query_triggered();
|
||||
void on_actionClose_triggered();
|
||||
void on_actionCopy_triggered();
|
||||
void on_actionCopy_as_C_string_triggered();
|
||||
void on_actionCopy_as_raw_C_string_triggered();
|
||||
void on_actionExecute_query_triggered();
|
||||
void on_actionExplain_triggered();
|
||||
void on_actionExplain_analyze_triggered();
|
||||
void on_actionExport_data_triggered();
|
||||
void on_actionGenerate_code_triggered();
|
||||
void on_actionInspect_information_schema_triggered();
|
||||
void on_actionInspect_pg_catalog_triggered();
|
||||
void on_actionInspect_user_schemas_triggered();
|
||||
void on_actionInspect_server_triggered();
|
||||
void on_actionNew_Query_triggered();
|
||||
void on_actionOpen_Query_triggered();
|
||||
void on_actionSave_Query_triggered();
|
||||
void on_actionPaste_lang_string_triggered();
|
||||
void on_actionRefreshCatalog_triggered();
|
||||
void on_actionRefreshCrud_triggered();
|
||||
void on_actionSave_query_as_triggered();
|
||||
void on_actionSave_copy_of_query_as_triggered();
|
||||
void on_actionShow_connection_manager_triggered();
|
||||
|
||||
// IDatabaseWindow interface
|
||||
public:
|
||||
virtual void setTitleForWidget(QWidget *widget, QString title, QString hint) override;
|
||||
virtual void setIconForWidget(QWidget *widget, QIcon icon) override;
|
||||
|
|
@ -160,6 +116,24 @@ public:
|
|||
protected:
|
||||
virtual void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
virtual void dropEvent(QDropEvent *event) override;
|
||||
|
||||
private:
|
||||
|
||||
template <typename T, class... Params>
|
||||
void CallOnActiveQueryTool(T (QueryTool::*Func)(Params...), Params... args)
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
if (query_tool)
|
||||
(query_tool->*Func)(&args...);
|
||||
}
|
||||
|
||||
template <typename T, class... Params>
|
||||
void CallOnActiveCrud(T (CrudTab::*Func)(Params...), Params... args)
|
||||
{
|
||||
auto crud = GetActiveCrud();
|
||||
if (crud)
|
||||
(crud->*Func)(&args...);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
327
pglab/DatabaseWindow.ui
Normal file
327
pglab/DatabaseWindow.ui
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DatabaseWindow</class>
|
||||
<widget class="QMainWindow" name="DatabaseWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1260</width>
|
||||
<height>732</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>pglab</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="mainTabs">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1260</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionNew_Query"/>
|
||||
<addaction name="actionOpen_Query"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSave_Query"/>
|
||||
<addaction name="actionSave_query_as"/>
|
||||
<addaction name="actionSave_copy_of_query_as"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExport_data"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionClose"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuEdit">
|
||||
<property name="title">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
<addaction name="actionCopy"/>
|
||||
<addaction name="actionCopy_as_C_string"/>
|
||||
<addaction name="actionCopy_as_raw_C_string"/>
|
||||
<addaction name="actionPaste_lang_string"/>
|
||||
<addaction name="actionGenerate_code"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuQuery">
|
||||
<property name="title">
|
||||
<string>Query</string>
|
||||
</property>
|
||||
<addaction name="actionExecute_query"/>
|
||||
<addaction name="actionExplain"/>
|
||||
<addaction name="actionExplain_analyze"/>
|
||||
<addaction name="actionCancel_query"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuCatalog">
|
||||
<property name="title">
|
||||
<string>Catalog</string>
|
||||
</property>
|
||||
<addaction name="actionRefreshCatalog"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuCRUD">
|
||||
<property name="title">
|
||||
<string>CRUD</string>
|
||||
</property>
|
||||
<addaction name="actionRefreshCrud"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuWindow">
|
||||
<property name="title">
|
||||
<string>View</string>
|
||||
</property>
|
||||
<addaction name="actionInspect_user_schemas"/>
|
||||
<addaction name="actionInspect_pg_catalog"/>
|
||||
<addaction name="actionInspect_information_schema"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionInspect_server"/>
|
||||
<addaction name="actionShow_connection_manager"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuQuery"/>
|
||||
<addaction name="menuCatalog"/>
|
||||
<addaction name="menuCRUD"/>
|
||||
<addaction name="menuWindow"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/about.png</normaloff>:/icons/about.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCancel_query">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/script_delete.png</normaloff>:/icons/script_delete.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel query</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClose">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/page_white_delete.png</normaloff>:/icons/page_white_delete.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+W</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/page_white_copy.png</normaloff>:/icons/page_white_copy.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+C</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy_as_C_string">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/token_shortland_character.png</normaloff>:/icons/token_shortland_character.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy as C string</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Shift+C</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy_as_raw_C_string">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/token_shortland_character.png</normaloff>:/icons/token_shortland_character.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copy as raw C++-string</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExecute_query">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/script_go.png</normaloff>:/icons/script_go.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Execute query</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F5</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExplain">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/lightbulb_off.png</normaloff>:/icons/lightbulb_off.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Explain</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F7</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExplain_analyze">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/lightbulb.png</normaloff>:/icons/lightbulb.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Explain analyze</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Shift+F7</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExport_data">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/table_save.png</normaloff>:/icons/table_save.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Export data</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionGenerate_code">
|
||||
<property name="text">
|
||||
<string>Generate code</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInspect_information_schema">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/page_white_add.png</normaloff>:/icons/page_white_add.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Inspect information_schema</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInspect_pg_catalog">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/page_white_add.png</normaloff>:/icons/page_white_add.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Inspect pg_catalog</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInspect_user_schemas">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/page_white_add.png</normaloff>:/icons/page_white_add.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Inspect user schemas</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInspect_server">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/page_white_add.png</normaloff>:/icons/page_white_add.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Inspect server</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew_Query">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/new_query_tab.png</normaloff>:/icons/new_query_tab.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>New Query</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+N</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpen_Query">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/folder.png</normaloff>:/icons/folder.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Query</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+O</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_Query">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/icons/script_save.png</normaloff>:/icons/script_save.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save Query</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPaste_lang_string">
|
||||
<property name="text">
|
||||
<string>Paste lang string</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRefreshCatalog">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRefreshCrud">
|
||||
<property name="text">
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_query_as">
|
||||
<property name="text">
|
||||
<string>Save query as</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_copy_of_query_as">
|
||||
<property name="text">
|
||||
<string>Save copy of query as</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShow_connection_manager">
|
||||
<property name="text">
|
||||
<string>Show connection manager</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -172,6 +172,7 @@ CustomDataRole.h \
|
|||
FORMS += \
|
||||
ConnectionManagerWindow.ui \
|
||||
CreateDatabaseDialog.ui \
|
||||
DatabaseWindow.ui \
|
||||
TuplesResultWidget.ui \
|
||||
QueryTab.ui \
|
||||
ProcessStdioWidget.ui \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue