wip: codegenerator, basic widget present for showing the generated code and specifying
parameters. Some code is also generated but it is not complete yet. minimum still required - field assignments - properly format and escape the query string
This commit is contained in:
parent
daf9536bed
commit
f5145f36ed
19 changed files with 380 additions and 32 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include "QueryTab.h"
|
||||
#include "util.h"
|
||||
#include "PlgPage.h"
|
||||
#include "CodeGenerator.h"
|
||||
#include "MasterController.h"
|
||||
#include "CrudTab.h"
|
||||
#include "WorkManager.h"
|
||||
|
|
@ -58,6 +59,14 @@ void MainWindow::newCrudPage(const PgClass &table)
|
|||
addPage(ct, table.name);
|
||||
}
|
||||
|
||||
void MainWindow::newCodeGenPage(QString query, std::shared_ptr<const Pgsql::Result> dbres)
|
||||
{
|
||||
auto cgtab = new CodeGenerator(this);
|
||||
cgtab->Init(query, dbres);
|
||||
addPage(cgtab, "Codegen");
|
||||
}
|
||||
|
||||
|
||||
QueryTab *MainWindow::GetActiveQueryTab()
|
||||
{
|
||||
QWidget *widget = ui->tabWidget->currentWidget();
|
||||
|
|
@ -344,3 +353,12 @@ void MainWindow::on_tabWidget_currentChanged(int index)
|
|||
}
|
||||
m_previousPage = page;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionGenerate_code_triggered()
|
||||
{
|
||||
QueryTab *tab = GetActiveQueryTab();
|
||||
if (tab) {
|
||||
tab->generateCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue