mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Rework the kinda broken add record button
Now it should always be possible to add a new record, no matter how the table is defined or what the new data default is. The default new data setting will be removed in the next commit.
This commit is contained in:
@@ -367,11 +367,14 @@ void MainWindow::closeEvent( QCloseEvent* event )
|
||||
|
||||
void MainWindow::addRecord()
|
||||
{
|
||||
if (db.addRecord()){
|
||||
if (db.addRecord(db.curBrowseTableName))
|
||||
{
|
||||
populateTable(db.curBrowseTableName);
|
||||
//added record will be the last one in view
|
||||
updateTableView(db.getRecordCount()-1);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information( this, QApplication::applicationName(),
|
||||
tr("Error adding record, make sure a table is selected.\n\n"
|
||||
"If the table contain fields declared as NOT NULL\n"
|
||||
|
||||
Reference in New Issue
Block a user