mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Enable Apply button when changes are made in editor
This commit is contained in:
@@ -38,6 +38,9 @@ EditDialog::EditDialog(QWidget* parent)
|
||||
editorFont.setPointSize(PreferencesDialog::getSettingsValue("databrowser", "fontsize").toInt());
|
||||
ui->editorText->setFont(editorFont);
|
||||
hexEdit->setFont(editorFont);
|
||||
|
||||
connect(ui->editorText, SIGNAL(textChanged()), this, SLOT(updateApplyButton()));
|
||||
connect(hexEdit, SIGNAL(dataChanged()), this, SLOT(updateApplyButton()));
|
||||
}
|
||||
|
||||
EditDialog::~EditDialog()
|
||||
@@ -52,6 +55,8 @@ void EditDialog::setCurrentIndex(const QModelIndex& idx)
|
||||
QByteArray data = idx.data(Qt::EditRole).toByteArray();
|
||||
loadData(data);
|
||||
updateCellInfo(data);
|
||||
|
||||
ui->buttonApply->setDisabled(true);
|
||||
}
|
||||
|
||||
void EditDialog::showEvent(QShowEvent*)
|
||||
@@ -314,6 +319,12 @@ void EditDialog::setNull()
|
||||
ui->editorText->setFocus();
|
||||
}
|
||||
|
||||
void EditDialog::updateApplyButton()
|
||||
{
|
||||
if (!isReadOnly)
|
||||
ui->buttonApply->setEnabled(true);
|
||||
}
|
||||
|
||||
void EditDialog::accept()
|
||||
{
|
||||
if(!currentIndex.isValid())
|
||||
|
||||
@@ -32,6 +32,7 @@ private slots:
|
||||
virtual void importData();
|
||||
virtual void exportData();
|
||||
virtual void setNull();
|
||||
void updateApplyButton();
|
||||
virtual void accept();
|
||||
virtual int checkDataType(const QByteArray& data);
|
||||
virtual void loadData(const QByteArray& data);
|
||||
|
||||
Reference in New Issue
Block a user