summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp b/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
index be805af..c7ec7d8 100644
--- a/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
+++ b/SQLiteStudio3/guiSQLiteStudio/windows/viewwindow.cpp
@@ -259,6 +259,13 @@ void ViewWindow::init()
updateQueryToolbarStatus();
updateTriggersState();
updateColumnButtons();
+ updateAfterInit();
+}
+
+void ViewWindow::updateAfterInit()
+{
+ for (QWidget* tab : {ui->dataTab, ui->triggersTab})
+ ui->tabWidget->setTabEnabled(ui->tabWidget->indexOf(tab), existingView);
}
void ViewWindow::newView()
@@ -624,6 +631,7 @@ void ViewWindow::changesSuccessfullyCommitted()
initView();
updateQueryToolbarStatus();
updateWindowTitle();
+ updateAfterInit();
if (oldView.compare(view, Qt::CaseInsensitive) == 0)
notifyInfo(tr("Committed changes for view '%1' successfully.").arg(view));
@@ -874,7 +882,7 @@ void ViewWindow::refreshTriggers()
QTableWidgetItem* item = nullptr;
QString event;
int row = 0;
- foreach (SqliteCreateTriggerPtr trig, triggers)
+ for (SqliteCreateTriggerPtr trig : triggers)
{
item = new QTableWidgetItem(trig->trigger);
item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable);
@@ -1017,10 +1025,10 @@ void ViewWindow::executeStructureChanges()
MessageListDialog dialog(tr("Following problems will take place while modifying the view.\n"
"Would you like to proceed?", "view window"));
dialog.setWindowTitle(tr("View modification", "view window"));
- foreach (const QString& error, viewModifier->getErrors())
+ for (const QString& error : viewModifier->getErrors())
dialog.addError(error);
- foreach (const QString& warn, viewModifier->getWarnings())
+ for (const QString& warn : viewModifier->getWarnings())
dialog.addWarning(warn);
if (dialog.exec() != QDialog::Accepted)