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->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;
|
||||
icon.addFile(QString::fromUtf8(":/icons/table_save.png"), QSize(), QIcon::Normal, QIcon::On);
|
||||
|
|
@ -226,6 +247,13 @@ void DatabaseWindow::initMenus()
|
|||
actionGenerateCode
|
||||
});
|
||||
|
||||
menuQuery = mb->addMenu(tr("Query"));
|
||||
menuQuery->addActions({
|
||||
actionExecuteQuery,
|
||||
actionExplain,
|
||||
actionExplainAnalyze
|
||||
});
|
||||
|
||||
menuWindow = mb->addMenu(tr("Window"));
|
||||
menuWindow->addActions({
|
||||
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()
|
||||
{
|
||||
auto query_tool = GetActiveQueryTool();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue