diff --git a/pglab/CrudTab.cpp b/pglab/CrudTab.cpp index 98fc220..a82529d 100644 --- a/pglab/CrudTab.cpp +++ b/pglab/CrudTab.cpp @@ -68,3 +68,14 @@ void CrudTab::on_actionRemove_rows_triggered() m_crudModel->removeRow(ui->tableView->currentIndex().row()); //removeRows(); } + +std::vector CrudTab::getToolbarActions() +{ + if (actions.empty()) { + QAction *action = new QAction(QIcon(":/icons/script_go.png"), tr("Refresh"), this); + action->setShortcut(QKeySequence(Qt::Key_F5)); + connect(action, &QAction::triggered, this, &CrudTab::refresh); + actions.push_back(action); + } + return actions; +} diff --git a/pglab/CrudTab.h b/pglab/CrudTab.h index d783dc1..82b557d 100644 --- a/pglab/CrudTab.h +++ b/pglab/CrudTab.h @@ -25,6 +25,8 @@ public: void setConfig(std::shared_ptr db, const PgClass &table); void refresh(); + + virtual std::vector getToolbarActions() override; private: Ui::CrudTab *ui; @@ -34,6 +36,7 @@ private: PgClass m_table; CrudModel *m_crudModel = nullptr; + std::vector actions; private slots: // void tableView_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous); diff --git a/pglab/QueryTab.cpp b/pglab/QueryTab.cpp index 5f0402c..53b2d1a 100644 --- a/pglab/QueryTab.cpp +++ b/pglab/QueryTab.cpp @@ -607,7 +607,8 @@ void QueryTab::focusEditor() std::vector QueryTab::getToolbarActions() { if (actions.empty()) { - QAction *action = new QAction(tr("Execute"), this); + QAction *action = new QAction(QIcon(":/icons/script_go.png"), tr("Execute"), this); + action->setShortcut(QKeySequence(Qt::Key_F5)); connect(action, &QAction::triggered, this, &QueryTab::execute); actions.push_back(action); }