mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 03:21:43 -06:00
When saving a SQL file in the Execute Query tab don't always ask for a new file name but use the file name used when last saving the tab or used when a file was opened. Add a 'Save As' menu option with the old behaviour of always asking for a file name. See issue #152.
50 lines
1.0 KiB
C++
50 lines
1.0 KiB
C++
#ifndef SQLEXECUTIONAREA_H
|
|
#define SQLEXECUTIONAREA_H
|
|
|
|
#include "sqltextedit.h"
|
|
|
|
#include <QWidget>
|
|
|
|
class SqliteTableModel;
|
|
class DBBrowserDB;
|
|
class QMenu;
|
|
|
|
namespace Ui {
|
|
class SqlExecutionArea;
|
|
}
|
|
|
|
class SqlExecutionArea : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SqlExecutionArea(QWidget* parent = 0, DBBrowserDB* _db = 0);
|
|
~SqlExecutionArea();
|
|
|
|
QString getSql() const;
|
|
QString getSelectedSql() const;
|
|
|
|
QString fileName() const { return sqlFileName; }
|
|
void setFileName(const QString& filename) { sqlFileName = filename; }
|
|
|
|
SqliteTableModel* getModel() { return model; }
|
|
QTextEdit* getResultView();
|
|
SqlTextEdit* getEditor();
|
|
|
|
public slots:
|
|
virtual void setTableNames(const QStringList& tables);
|
|
virtual void finishExecution(const QString& result);
|
|
virtual void enableSaveButton(bool enable);
|
|
virtual void saveAsCsv();
|
|
virtual void saveAsView();
|
|
|
|
private:
|
|
DBBrowserDB* db;
|
|
Ui::SqlExecutionArea* ui;
|
|
SqliteTableModel* model;
|
|
QMenu* menuPopupSave;
|
|
QString sqlFileName;
|
|
};
|
|
|
|
#endif
|