Connection manager can now open a query window for selected connection.

Query window has now buttons with icons made in the designer for better looks.
Depending on received responses from the database the tabcontrol with the message, data and explain tab
now switches to the appropriate tab.
This commit is contained in:
Eelke Klein 2017-01-15 21:01:40 +01:00
parent 88fcc0338d
commit d19741f111
26 changed files with 408 additions and 116 deletions

View file

@ -2,6 +2,7 @@
#define MAINWINDOW_H
#include "asyncdbconnection.h"
#include "connectionconfig.h"
#include "tsqueue.h"
#include <QLabel>
#include <QMainWindow>
@ -9,6 +10,8 @@
#include <memory>
#include <future>
#include "PgsqlConn.h"
#include <deque>
#include <mutex>
class ExplainRoot;
class QueryResultModel;
@ -20,28 +23,18 @@ namespace Ui {
}
namespace Pgsql {
class Connection;
}
#include <deque>
#include <mutex>
class TaskQueue {
public:
private:
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void setConfig(const ConnectionConfig &config);
/* Meant to be called from other threads to pass a code block
* that has to be executed in the context of the thread of the window.
*/
@ -52,6 +45,8 @@ private:
QLabel *m_timeElapsedLabel;
std::unique_ptr<QTimer> m_timer;
std::chrono::time_point<std::chrono::steady_clock> m_startTime;
ConnectionConfig m_config;
void startTimer();
void endTimer();
@ -88,6 +83,9 @@ private slots:
void on_actionExport_data_triggered();
void on_actionClose_triggered();
void on_actionAbout_triggered();
void on_actionExecute_SQL_triggered();
void on_actionExplain_Analyze_triggered();
void on_actionCancel_triggered();
};
#endif // MAINWINDOW_H