The catalogue now loads the list of databases en there is a table model that can show this data.
This commit is contained in:
parent
a9430bca1a
commit
20af12535e
22 changed files with 504 additions and 118 deletions
|
|
@ -1,13 +1,10 @@
|
|||
#include "MainWindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
//#include "QueryResultModel.h"
|
||||
//#include "QueryExplainModel.h"
|
||||
#include <QStandardPaths>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QTextTable>
|
||||
#include <QTimer>
|
||||
#include <QElapsedTimer>
|
||||
#include <windows.h>
|
||||
#include <algorithm>
|
||||
|
|
@ -23,15 +20,12 @@ namespace pg = Pgsql;
|
|||
|
||||
|
||||
MainWindow::MainWindow(MasterController *master, QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
: ASyncWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
, m_masterController(master)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->setDocumentMode(true);
|
||||
|
||||
|
||||
//ui->tabWidget->setTabsClosable(true);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
|
@ -69,25 +63,6 @@ void MainWindow::setConfig(const ConnectionConfig &config)
|
|||
newSqlPage();
|
||||
}
|
||||
|
||||
void MainWindow::QueueTask(TSQueue::t_Callable c)
|
||||
{
|
||||
m_taskQueue.add(c);
|
||||
// Theoretically this needs to be only called if the queue was empty because otherwise it already would
|
||||
// be busy emptying the queue. For now however I think it is safer to call it just to make sure.
|
||||
QMetaObject::invokeMethod(this, "processCallableQueue", Qt::QueuedConnection); // queues on main thread
|
||||
}
|
||||
|
||||
void MainWindow::processCallableQueue()
|
||||
{
|
||||
if (!m_taskQueue.empty()) {
|
||||
auto c = m_taskQueue.pop();
|
||||
c();
|
||||
if (!m_taskQueue.empty()) {
|
||||
QTimer::singleShot(0, this, SLOT(processCallableQueue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionLoad_SQL_triggered()
|
||||
{
|
||||
QString home_dir = QStandardPaths::locate(QStandardPaths::HomeLocation, "", QStandardPaths::LocateDirectory);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue