mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Rename dialog: Set focus to input text box on dialog show event.
BUG: 351708 FIXED-IN: 15.08.1 REVIEW: 125078
This commit is contained in:
parent
389c909aff
commit
4143a69c05
|
@ -108,7 +108,6 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
|
||||||
|
|
||||||
m_lineEdit->setText(m_newName);
|
m_lineEdit->setText(m_newName);
|
||||||
m_lineEdit->setSelection(0, selectionLength);
|
m_lineEdit->setSelection(0, selectionLength);
|
||||||
m_lineEdit->setFocus();
|
|
||||||
|
|
||||||
topLayout->addWidget(editLabel);
|
topLayout->addWidget(editLabel);
|
||||||
topLayout->addWidget(m_lineEdit);
|
topLayout->addWidget(m_lineEdit);
|
||||||
|
@ -197,6 +196,13 @@ void RenameDialog::slotTextChanged(const QString& newName)
|
||||||
m_okButton->setEnabled(enable);
|
m_okButton->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenameDialog::showEvent(QShowEvent* event)
|
||||||
|
{
|
||||||
|
m_lineEdit->setFocus();
|
||||||
|
|
||||||
|
QDialog::showEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
void RenameDialog::renameItems()
|
void RenameDialog::renameItems()
|
||||||
{
|
{
|
||||||
// Iterate through all items and rename them...
|
// Iterate through all items and rename them...
|
||||||
|
|
|
@ -45,6 +45,9 @@ private slots:
|
||||||
void slotAccepted();
|
void slotAccepted();
|
||||||
void slotTextChanged(const QString& newName);
|
void slotTextChanged(const QString& newName);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void renameItems();
|
void renameItems();
|
||||||
void renameItem(const KFileItem &item, const QString& newName);
|
void renameItem(const KFileItem &item, const QString& newName);
|
||||||
|
|
Loading…
Reference in a new issue