This should allow concurrency in the plugins to be independent from their container. Contains also some work on the system for registering plugins.
48 lines
1,018 B
C++
48 lines
1,018 B
C++
#ifndef CRUDTAB_H
|
|
#define CRUDTAB_H
|
|
|
|
#include "catalog/PgClass.h"
|
|
#include <QWidget>
|
|
#include "plugin_support/PluginContentWidget.h"
|
|
#include <memory>
|
|
#include <optional>
|
|
|
|
namespace Ui {
|
|
class CrudTab;
|
|
}
|
|
|
|
class OpenDatabase;
|
|
class CrudModel;
|
|
class DatabaseWindow;
|
|
|
|
class CrudTab : public PluginContentWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CrudTab(IPluginContentWidgetContext *context, DatabaseWindow *parent = nullptr);
|
|
~CrudTab() override;
|
|
|
|
void setConfig(std::shared_ptr<OpenDatabase> db, const PgClass &table);
|
|
|
|
void refresh();
|
|
|
|
virtual std::vector<QAction*> getToolbarActions() override;
|
|
private:
|
|
Ui::CrudTab *ui;
|
|
|
|
DatabaseWindow *m_window;
|
|
|
|
std::shared_ptr<OpenDatabase> m_db;
|
|
std::optional<PgClass> m_table;
|
|
|
|
CrudModel *m_crudModel = nullptr;
|
|
std::vector<QAction*> actions;
|
|
|
|
private slots:
|
|
// void tableView_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
|
void on_actionRemove_rows_triggered();
|
|
void headerCustomContextMenu(const QPoint &pos);
|
|
};
|
|
|
|
#endif // CRUDTAB_H
|