Added back query menu with execute and explain option.
This commit is contained in:
parent
7450e5bd4c
commit
460d6f5809
2 changed files with 59 additions and 0 deletions
|
|
@ -137,6 +137,27 @@ void DatabaseWindow::createActions()
|
||||||
action->setObjectName("actionCopyAsRawCppString");
|
action->setObjectName("actionCopyAsRawCppString");
|
||||||
action->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_C));
|
action->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_C));
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
QIcon icon;
|
||||||
|
icon.addFile(QString::fromUtf8(":/icons/script_go.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||||
|
auto action = actionExecuteQuery = new QAction(icon, tr("Execute query"), this);
|
||||||
|
action->setObjectName("actionExecuteQuery");
|
||||||
|
action->setShortcut(QKeySequence(Qt::Key_F5));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
QIcon icon;
|
||||||
|
icon.addFile(QString::fromUtf8(":/icons/lightbulb_off.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||||
|
auto action = actionExplain = new QAction(icon, tr("Explain"), this);
|
||||||
|
action->setObjectName("actionExplain");
|
||||||
|
action->setShortcut(QKeySequence(Qt::Key_F7));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
QIcon icon;
|
||||||
|
icon.addFile(QString::fromUtf8(":/icons/lightbulb.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||||
|
auto action = actionExplainAnalyze = new QAction(icon, tr("Explain analyze"), this);
|
||||||
|
action->setObjectName("actionExplainAnalyze");
|
||||||
|
action->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_F7));
|
||||||
|
}
|
||||||
{
|
{
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
icon.addFile(QString::fromUtf8(":/icons/table_save.png"), QSize(), QIcon::Normal, QIcon::On);
|
icon.addFile(QString::fromUtf8(":/icons/table_save.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||||
|
|
@ -226,6 +247,13 @@ void DatabaseWindow::initMenus()
|
||||||
actionGenerateCode
|
actionGenerateCode
|
||||||
});
|
});
|
||||||
|
|
||||||
|
menuQuery = mb->addMenu(tr("Query"));
|
||||||
|
menuQuery->addActions({
|
||||||
|
actionExecuteQuery,
|
||||||
|
actionExplain,
|
||||||
|
actionExplainAnalyze
|
||||||
|
});
|
||||||
|
|
||||||
menuWindow = mb->addMenu(tr("Window"));
|
menuWindow = mb->addMenu(tr("Window"));
|
||||||
menuWindow->addActions({
|
menuWindow->addActions({
|
||||||
actionInspectUserSchemas,
|
actionInspectUserSchemas,
|
||||||
|
|
@ -323,6 +351,30 @@ void DatabaseWindow::on_actionCopyAsRawCppString_triggered()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DatabaseWindow::on_actionExecuteQuery_triggered()
|
||||||
|
{
|
||||||
|
auto query_tool = GetActiveQueryTool();
|
||||||
|
if (query_tool) {
|
||||||
|
query_tool->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DatabaseWindow::on_actionExplain_triggered()
|
||||||
|
{
|
||||||
|
auto query_tool = GetActiveQueryTool();
|
||||||
|
if (query_tool) {
|
||||||
|
query_tool->explain(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DatabaseWindow::on_actionExplainAnalyze_triggered()
|
||||||
|
{
|
||||||
|
auto query_tool = GetActiveQueryTool();
|
||||||
|
if (query_tool) {
|
||||||
|
query_tool->explain(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DatabaseWindow::on_actionExportData_triggered()
|
void DatabaseWindow::on_actionExportData_triggered()
|
||||||
{
|
{
|
||||||
auto query_tool = GetActiveQueryTool();
|
auto query_tool = GetActiveQueryTool();
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@ private:
|
||||||
QAction *actionCopy = nullptr;
|
QAction *actionCopy = nullptr;
|
||||||
QAction *actionCopyAsCString = nullptr;
|
QAction *actionCopyAsCString = nullptr;
|
||||||
QAction *actionCopyAsRawCppString = nullptr;
|
QAction *actionCopyAsRawCppString = nullptr;
|
||||||
|
QAction *actionExecuteQuery = nullptr;
|
||||||
|
QAction *actionExplain = nullptr;
|
||||||
|
QAction *actionExplainAnalyze = nullptr;
|
||||||
QAction *actionExportData = nullptr;
|
QAction *actionExportData = nullptr;
|
||||||
QAction *actionGenerateCode = nullptr;
|
QAction *actionGenerateCode = nullptr;
|
||||||
QAction *actionInspectInformationSchema = nullptr; ///< Create or switch to pgcatalog tab
|
QAction *actionInspectInformationSchema = nullptr; ///< Create or switch to pgcatalog tab
|
||||||
|
|
@ -80,6 +83,7 @@ private:
|
||||||
QMenu *menuEdit = nullptr;
|
QMenu *menuEdit = nullptr;
|
||||||
QMenu *menuFile = nullptr;
|
QMenu *menuFile = nullptr;
|
||||||
QMenu *menuHelp = nullptr;
|
QMenu *menuHelp = nullptr;
|
||||||
|
QMenu *menuQuery = nullptr;
|
||||||
QMenu *menuWindow = nullptr;
|
QMenu *menuWindow = nullptr;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -116,6 +120,9 @@ private slots:
|
||||||
void on_actionCopy_triggered();
|
void on_actionCopy_triggered();
|
||||||
void on_actionCopyAsCString_triggered();
|
void on_actionCopyAsCString_triggered();
|
||||||
void on_actionCopyAsRawCppString_triggered();
|
void on_actionCopyAsRawCppString_triggered();
|
||||||
|
void on_actionExecuteQuery_triggered();
|
||||||
|
void on_actionExplain_triggered();
|
||||||
|
void on_actionExplainAnalyze_triggered();
|
||||||
void on_actionExportData_triggered();
|
void on_actionExportData_triggered();
|
||||||
void on_actionGenerateCode_triggered();
|
void on_actionGenerateCode_triggered();
|
||||||
void on_actionInspectInformationSchema_triggered();
|
void on_actionInspectInformationSchema_triggered();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue