This commit is contained in:
eelke 2017-02-11 08:08:50 +01:00
parent c2e201f813
commit f51105bde0
114 changed files with 92 additions and 0 deletions

View file

@ -1,87 +0,0 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "asyncdbconnection.h"
#include "connectionconfig.h"
#include "tsqueue.h"
#include <QLabel>
#include <QMainWindow>
#include <QSocketNotifier>
#include <memory>
#include <future>
#include "PgsqlConn.h"
#include <chrono>
#include <deque>
#include <mutex>
//class ExplainRoot;
//class QueryResultModel;
//class QueryExplainModel;
namespace Ui {
class MainWindow;
}
namespace Pgsql {
class Connection;
}
class QueryTab;
class MasterController;
class QCloseEvent;
class OpenDatabase;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(MasterController *master, QWidget *parent);
~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.
*/
void QueueTask(TSQueue::t_Callable c);
OpenDatabase* getDatabase() { return m_database; }
private:
Ui::MainWindow *ui;
TSQueue m_taskQueue;
ConnectionConfig m_config;
OpenDatabase *m_database;
MasterController *m_masterController;
QueryTab *GetActiveQueryTab();
void closeEvent(QCloseEvent *event);
void showEvent(QShowEvent *event);
QueryTab *newSqlPage();
private slots:
void processCallableQueue();
void on_actionLoad_SQL_triggered();
void on_actionSave_SQL_triggered();
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();
void on_actionSave_SQL_as_triggered();
void on_actionSave_copy_of_SQL_as_triggered();
void on_actionNew_SQL_triggered();
void on_tabWidget_tabCloseRequested(int index);
void on_actionExplain_triggered();
void on_actionShow_connection_manager_triggered();
void on_actionCopy_triggered();
void on_actionCopy_as_C_string_triggered();
};
#endif // MAINWINDOW_H