summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp b/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
index 86f48bf..b42848a 100644
--- a/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/windows/tablewindow.cpp
@@ -865,6 +865,9 @@ void TableWindow::changesSuccessfullyCommitted()
}
}
}
+
+ if (ui->tabWidget->currentIndex() == getDataTabIdx())
+ ui->dataView->refreshData();
}
void TableWindow::changesFailedToCommit(int errorCode, const QString& errorText)
@@ -1047,7 +1050,7 @@ bool TableWindow::validate(bool skipWarning)
QStringList nonStrictColumns;
for (SqliteCreateTable::Column* column : createTable->columns)
{
- if (DataType::isStrict(column->type->name))
+ if (DataType::isStrict(column->type ? column->type->name : QString()))
continue;
nonStrictColumns << column->name;
@@ -1310,7 +1313,7 @@ void TableWindow::importTable()
ImportDialog dialog(this);
dialog.setDbAndTable(db, table);
if (dialog.exec() == QDialog::Accepted && dataLoaded)
- ui->dataView->refreshData();
+ ui->dataView->refreshData(false);
}
void TableWindow::populateTable()
@@ -1318,7 +1321,7 @@ void TableWindow::populateTable()
PopulateDialog dialog(this);
dialog.setDbAndTable(db, table);
if (dialog.exec() == QDialog::Accepted && dataLoaded)
- ui->dataView->refreshData();
+ ui->dataView->refreshData(false);
}
void TableWindow::createSimilarTable()
@@ -1342,15 +1345,16 @@ void TableWindow::tabChanged(int newTab)
"Do you want to commit the structure, or do you want to go back to the structure tab?"),
tr("Go back to structure tab"), tr("Commit modifications and browse data."));
- ui->tabWidget->setCurrentIndex(0);
if (res == 1)
commitStructure(true);
+ else
+ focusStructureTab();
return;
}
if (!dataLoaded)
- ui->dataView->refreshData();
+ ui->dataView->refreshData(false);
}
}
@@ -1393,8 +1397,11 @@ void TableWindow::strictChanged()
{
for (SqliteCreateTable::Column* column : createTable->columns)
{
- column->type->precision = QVariant();
- column->type->scale = QVariant();
+ if (column->type)
+ {
+ column->type->precision = QVariant();
+ column->type->scale = QVariant();
+ }
}
}
@@ -1644,6 +1651,16 @@ void TableWindow::delColumn(const QString& columnName)
delColumn(colIdx);
}
+void TableWindow::focusStructureTab()
+{
+ ui->tabWidget->setCurrentIndex(getStructureTabIdx());
+}
+
+void TableWindow::focusDataTab()
+{
+ ui->tabWidget->setCurrentIndex(getDataTabIdx());
+}
+
void TableWindow::updateTabsOrder()
{
tabsMoving = true;