mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-31 01:04:20 +00:00
add dialog title setter, set focus on last changed element
This commit is contained in:
parent
9ce6743227
commit
618dac55c8
@ -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)
|
||||
ui->valueText->setPlainText(
|
||||
value
|
||||
);
|
||||
|
||||
ui->valueText->setFocus();
|
||||
}
|
||||
|
||||
void KevaAddKeyDialog::create()
|
||||
|
@ -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);
|
||||
|
@ -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…
x
Reference in New Issue
Block a user