Browse Source

add dialog title setter, set focus on last changed element

kvazar
kvazar-network 6 months ago
parent
commit
618dac55c8
  1. 15
      src/qt/kevaaddkeydialog.cpp
  2. 1
      src/qt/kevaaddkeydialog.h
  3. 4
      src/qt/kevadialog.cpp

15
src/qt/kevaaddkeydialog.cpp

@ -28,11 +28,24 @@ KevaAddKeyDialog::~KevaAddKeyDialog() @@ -28,11 +28,24 @@ KevaAddKeyDialog::~KevaAddKeyDialog()
delete ui;
}
void KevaAddKeyDialog::setTitle(const QString &value)
{
setWindowTitle(
value
);
}
void KevaAddKeyDialog::setKey(const QString &value)
{
ui->keyText->setEnabled(
true
);
ui->keyText->setText(
value
);
ui->keyText->setFocus();
}
void KevaAddKeyDialog::setValue(const QString &value)
@ -40,6 +53,8 @@ void KevaAddKeyDialog::setValue(const QString &value) @@ -40,6 +53,8 @@ void KevaAddKeyDialog::setValue(const QString &value)
ui->valueText->setPlainText(
value
);
ui->valueText->setFocus();
}
void KevaAddKeyDialog::create()

1
src/qt/kevaaddkeydialog.h

@ -34,6 +34,7 @@ private: @@ -34,6 +34,7 @@ private:
public Q_SLOTS:
void create();
void cancel();
void setTitle(const QString& value);
void setKey(const QString& value);
void setValue(const QString& value);
void onKeyChanged(const QString& key);

4
src/qt/kevadialog.cpp

@ -325,6 +325,10 @@ void KevaDialog::on_updateButton_clicked() @@ -325,6 +325,10 @@ void KevaDialog::on_updateButton_clicked()
for (const QModelIndex& index : ui->kevaView->selectionModel()->selectedRows())
{
dialog->setTitle(
"Create new record for this key"
);
dialog->setKey(
index.sibling(
index.row(),

Loading…
Cancel
Save