Restructured locations of source.

This commit is contained in:
Eelke Klein 2017-08-27 07:34:42 +02:00
parent 78a4c6d730
commit 7c4e8e95e8
151 changed files with 1 additions and 0 deletions

View file

@ -1,130 +0,0 @@
#ifndef QUERYTAB_H
#define QUERYTAB_H
#include "ASyncDBConnection.h"
#include "ParamListModel.h"
#include "ParamTypeDelegate.h"
#include "QueryResultModel.h"
#include "QueryExplainModel.h"
#include "stopwatch.h"
#include "tuplesresultwidget.h"
#include <QWidget>
#include <memory>
namespace Ui {
class QueryTab;
}
class QTableView;
class QTabWidget;
class MainWindow;
class SqlSyntaxHighlighter;
class ExplainRoot;
class QueryResultModel;
class QueryExplainModel;
class PgTypeContainer;
class OpenDatabase;
class QueryParamListController : public QObject {
Q_OBJECT
public:
QueryParamListController(QTableView *tv, OpenDatabase *opendb, QWidget *parent);
Pgsql::Params params() const;
public slots:
void on_addParam();
void on_removeParam();
private:
QTableView *paramTableView;
OpenDatabase *m_openDatabase;
ParamListModel m_paramList;
ParamTypeDelegate m_typeDelegate;
};
class QueryTab : public QWidget {
Q_OBJECT
public:
QueryTab(MainWindow *win, QWidget *parent = nullptr);
~QueryTab();
void setConfig(const ConnectionConfig &config);
void newdoc();
// void open();
bool load(const QString &filename);
bool save();
bool saveAs();
void saveCopyAs();
void execute();
void explain(bool analyze);
void cancel();
bool canClose();
void copyQueryAsCString();
void exportData(const QString &filename);
QString fileName() const { return m_fileName; }
bool isChanged() const { return m_queryTextChanged; }
bool isNew() const { return m_new; }
private:
// struct ResultTab {
// public:
// std::shared_ptr<QueryResultModel> resultModel;
// std::shared_ptr<TuplesResultWidget> tuplesResult;
//// ResultTab(std::shared_ptr<QueryResultModel> rm, Ui::TuplesResult *tr)
//// : resultModel(rm), tuplesResult(tr)
//// {}
// };
using ResultTabContainer = std::vector<TuplesResultWidget*>;
Ui::QueryTab *ui;
MainWindow *m_win;
SqlSyntaxHighlighter* highlighter;
ConnectionConfig m_config;
StopWatch m_stopwatch;
QueryParamListController *m_queryParamListController = nullptr;
bool m_new = true;
QString m_fileName; ///< use setFileName function to set
bool m_queryTextChanged = false;
void setFileName(const QString &filename);
bool continueWithoutSavingWarning();
bool saveSqlTo(const QString &filename);
QString promptUserForSaveSqlFilename();
ASyncDBConnection m_dbConnection;
std::unique_ptr<QueryExplainModel> explainModel;
ResultTabContainer resultList;
void addLog(QString s);
std::string getCommand() const;
void explain_ready(ExplainRoot::SPtr explain);
void query_ready(std::shared_ptr<Pgsql::Result> dbres, qint64 elapsedms);
QTabWidget *getTabWidget();
void setTabCaption(const QString &caption, const QString &tooltip);
void clearResult();
private slots:
void queryTextChanged();
void connectionStateChanged(ASyncDBConnection::State state);
void receiveNotice(Pgsql::ErrorDetails notice);
void startConnect();
};
#endif // QUERYTAB_H