Gives a warning when there are unsaved changes when opening a file or closing the window.

This commit is contained in:
Eelke Klein 2017-01-19 17:48:44 +01:00
parent eb06c57141
commit 35932e7a8d
2 changed files with 42 additions and 0 deletions

View file

@ -27,6 +27,7 @@ namespace Pgsql {
class Connection;
}
class QCloseEvent;
class MainWindow : public QMainWindow
{
@ -47,6 +48,7 @@ private:
std::unique_ptr<QTimer> m_timer;
std::chrono::time_point<std::chrono::steady_clock> m_startTime;
ConnectionConfig m_config;
bool m_queryTextChanged = false;
void startTimer();
@ -67,6 +69,9 @@ private:
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);
private slots:
void startConnect();
@ -75,6 +80,7 @@ private slots:
void performExplain();
void cancel_query();
void queryTextChanged();
void receiveNotice(Pgsql::ErrorDetails notice);
void processCallableQueue();