Fix show filename in tab after opening file and make F5 execute shortcut
work.
This commit is contained in:
parent
e53b85bd86
commit
47b3ea83e9
3 changed files with 11 additions and 2 deletions
|
|
@ -507,7 +507,7 @@ void DatabaseWindow::on_actionNewSql_triggered()
|
|||
{
|
||||
auto *ct = new QueryTool(this, this);
|
||||
ct->addAction(actionExecuteQuery);
|
||||
addPage(ct, "query");
|
||||
addPage(ct, "new");
|
||||
ct->newdoc();
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,8 @@ void DatabaseWindow::on_actionOpenSql_triggered()
|
|||
if ( ! file_name.isEmpty()) {
|
||||
auto *ct = new QueryTool(this, this);
|
||||
if (ct->load(file_name)) {
|
||||
addPage(ct, "");
|
||||
ct->addAction(actionExecuteQuery);
|
||||
addPage(ct, ct->title());
|
||||
}
|
||||
else {
|
||||
delete ct;
|
||||
|
|
|
|||
|
|
@ -234,6 +234,12 @@ void QueryTool::cancel()
|
|||
m_dbConnection.cancel();
|
||||
}
|
||||
|
||||
QString QueryTool::title() const
|
||||
{
|
||||
QFileInfo fileInfo(m_fileName);
|
||||
QString fn(fileInfo.fileName());
|
||||
return fn;
|
||||
}
|
||||
|
||||
void QueryTool::setFileName(const QString &filename)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public:
|
|||
bool isNew() const { return m_new; }
|
||||
void focusEditor();
|
||||
|
||||
QString title() const;
|
||||
|
||||
public slots:
|
||||
void execute();
|
||||
/// Save the document under its current name, a file save dialog will be shown if this is a new document
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue