Skip to content

Commit

Permalink
Enable 'Edit Database Cell' when view is editable (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristilupascu authored and MKleusberg committed Feb 25, 2019
1 parent 0f6946c commit ff455c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MainWindow.cpp
Expand Up @@ -1311,7 +1311,7 @@ void MainWindow::doubleClickTable(const QModelIndex& index)

// * Don't allow editing of other objects than tables (on the browse table) *
bool isEditingAllowed = !db.readOnly() && m_currentTabTableModel == m_browseTableModel &&
(db.getObjectByName(currentlyBrowsedTableName())->type() == sqlb::Object::Types::Table);
m_browseTableModel->isEditable();

// Enable or disable the Apply, Null, & Import buttons in the Edit Cell
// dock depending on the value of the "isEditingAllowed" bool above
Expand All @@ -1335,7 +1335,7 @@ void MainWindow::dataTableSelectionChanged(const QModelIndex& index)
}

bool editingAllowed = !db.readOnly() && (m_currentTabTableModel == m_browseTableModel) &&
(db.getObjectByName(currentlyBrowsedTableName())->type() == sqlb::Object::Types::Table);
m_browseTableModel->isEditable();

// Don't allow editing of other objects than tables
editDock->setReadOnly(!editingAllowed);
Expand Down

0 comments on commit ff455c7

Please sign in to comment.