pawelsalawa / sqlitestudio

A free, open source, multi-platform SQLite database manager.
https://sqlitestudio.pl
Other
4.67k stars 571 forks source link

Uncommited structure modification when tab change #5077

Closed marcpley closed 5 days ago

marcpley commented 3 weeks ago

Details

This don't work when clicking on "Go back to structure tab" : Capture d’écran du 2024-10-27 05-44-48 if "Place data tab as first place" is set in config: Capture d’écran du 2024-10-27 05-50-10

Steps to reproduce

Modify table structure and try to go to data tab before commit the structure modification.

marcpley commented 2 weeks ago

Bug-fix proposal : In ../guiSQLiteStudio/windows/tablewindow.cpp line 1345 ui->tabWidget->setCurrentIndex(0); add that before

            if (CFG_UI.General.DataTabAsFirstInTables.get())
                ui->tabWidget->setCurrentIndex(1);
            else

In ../guiSQLiteStudio/windows/viewwindow.cpp line 622 ui->tabWidget->setCurrentIndex(0); add that before

                if (CFG_UI.General.DataTabAsFirstInViews.get())
                    ui->tabWidget->setCurrentIndex(1);
                else
pawelsalawa commented 2 weeks ago

Thank you! Just applied.

P.S. You can always attach diff files (git diff) to posts - it will be easier/quicker for you.

marcpley commented 1 week ago

Bug-fix proposal : In ../guiSQLiteStudio/windows/tablewindow.cpp line 1345

            if (res == 1)
            {
                commitStructure(true);
                ui->tabWidget->setCurrentIndex(CFG_UI.General.DataTabAsFirstInTables.get() ? 0 : 1);
                ui->dataView->refreshData();
            }
            else
                ui->tabWidget->setCurrentIndex(CFG_UI.General.DataTabAsFirstInTables.get() ? 1 : 0);
pawelsalawa commented 5 days ago

Okay, this time I hope it's fully fixed ;) Please git pulll and check on your side.