Moved everything associated with executing and explaining queries to querytab.
It is now possible to create multiple independent query tabs. However somethings are currently a bit broken.
This commit is contained in:
parent
6c268bd774
commit
7f379f3b80
13 changed files with 668 additions and 634 deletions
44
mainwindow.h
44
mainwindow.h
|
|
@ -14,10 +14,9 @@
|
|||
#include <deque>
|
||||
#include <mutex>
|
||||
|
||||
class ExplainRoot;
|
||||
class QueryResultModel;
|
||||
class QueryExplainModel;
|
||||
class SqlHighlighter;
|
||||
//class ExplainRoot;
|
||||
//class QueryResultModel;
|
||||
//class QueryExplainModel;
|
||||
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
|
|
@ -44,55 +43,35 @@ public:
|
|||
*/
|
||||
void QueueTask(TSQueue::t_Callable c);
|
||||
|
||||
|
||||
private:
|
||||
TSQueue m_taskQueue;
|
||||
QLabel *m_timeElapsedLabel;
|
||||
std::chrono::duration<float, std::milli> elapsedTime;
|
||||
|
||||
ConnectionConfig m_config;
|
||||
|
||||
|
||||
std::unique_ptr<QTimer> m_timer;
|
||||
std::chrono::time_point<std::chrono::steady_clock> m_startTime;
|
||||
ConnectionConfig m_config;
|
||||
bool m_queryTextChanged = false;
|
||||
QString m_fileName;
|
||||
|
||||
|
||||
void startTimer();
|
||||
void endTimer();
|
||||
std::chrono::duration<float, std::milli> elapsedTime;
|
||||
|
||||
|
||||
Ui::MainWindow *ui;
|
||||
QueryTab *m_queryTab = nullptr;
|
||||
std::unique_ptr<SqlHighlighter> highlighter;
|
||||
|
||||
ASyncDBConnection m_dbConnection;
|
||||
QueryTab *GetActiveQueryTab();
|
||||
|
||||
void connectionStateChanged(ASyncDBConnection::State state);
|
||||
|
||||
std::unique_ptr<QueryResultModel> resultModel;
|
||||
std::unique_ptr<QueryExplainModel> explainModel;
|
||||
|
||||
void query_ready(std::shared_ptr<Pgsql::Result> res);
|
||||
void explain_ready(std::shared_ptr<ExplainRoot> explain);
|
||||
std::string getCommand() const;
|
||||
|
||||
bool continueWithoutSaving();
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void showEvent(QShowEvent *event);
|
||||
QString promptUserForSaveSqlFilename();
|
||||
void saveSqlTo(const QString &filename);
|
||||
void newSqlPage();
|
||||
private slots:
|
||||
|
||||
void startConnect();
|
||||
|
||||
void performQuery();
|
||||
void performExplain();
|
||||
|
||||
void cancel_query();
|
||||
void queryTextChanged();
|
||||
void receiveNotice(Pgsql::ErrorDetails notice);
|
||||
|
||||
void processCallableQueue();
|
||||
|
||||
void addLog(QString s);
|
||||
void updateTimer();
|
||||
void on_actionLoad_SQL_triggered();
|
||||
void on_actionSave_SQL_triggered();
|
||||
|
|
@ -104,6 +83,7 @@ private slots:
|
|||
void on_actionCancel_triggered();
|
||||
void on_actionSave_SQL_as_triggered();
|
||||
void on_actionSave_copy_of_SQL_as_triggered();
|
||||
void on_actionNew_SQL_triggered();
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue