pgLab/pglab/DatabaseWindow.h

44 lines
864 B
C
Raw Normal View History

#ifndef DATABASEWINDOW_H
#define DATABASEWINDOW_H
#include "ASyncDBConnection.h"
#include "tsqueue.h"
#include <QMainWindow>
namespace Ui {
class DatabaseWindow;
}
class DatabaseWindow : public QMainWindow
{
Q_OBJECT
public:
explicit DatabaseWindow(QWidget *parent = 0);
~DatabaseWindow();
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);
private:
Ui::DatabaseWindow *ui;
TSQueue m_taskQueue;
ASyncDBConnection m_dbConnection;
ConnectionConfig m_config;
void connectionStateChanged(ASyncDBConnection::State state);
void receiveNotice(Pgsql::ErrorDetails notice);
void startConnect();
private slots:
void processCallableQueue();
};
#endif // DATABASEWINDOW_H