Browse Source

Focus save path when Manual mode is selected initially

Closes #15972.
PR #16536.
adaptive-webui-19844
Aleksandr Cupacenko 3 years ago committed by GitHub
parent
commit
2c8447853b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/gui/addnewtorrentdialog.cpp
  2. 1
      src/gui/fspathedit.cpp
  3. 6
      src/gui/watchedfolderoptionsdialog.cpp

6
src/gui/addnewtorrentdialog.cpp

@ -249,7 +249,11 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
connect(editHotkey, &QShortcut::activated, this, &AddNewTorrentDialog::renameSelectedFile); connect(editHotkey, &QShortcut::activated, this, &AddNewTorrentDialog::renameSelectedFile);
connect(m_ui->contentTreeView, &QAbstractItemView::doubleClicked, this, &AddNewTorrentDialog::renameSelectedFile); connect(m_ui->contentTreeView, &QAbstractItemView::doubleClicked, this, &AddNewTorrentDialog::renameSelectedFile);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setFocus(); // Default focus
if (m_ui->comboTTM->currentIndex() == 0) // 0 is Manual mode
m_ui->savePath->setFocus();
else
m_ui->categoryComboBox->setFocus();
} }
AddNewTorrentDialog::~AddNewTorrentDialog() AddNewTorrentDialog::~AddNewTorrentDialog()

1
src/gui/fspathedit.cpp

@ -189,6 +189,7 @@ FileSystemPathEdit::FileSystemPathEdit(Private::FileEditorWithCompletion *editor
{ {
Q_D(FileSystemPathEdit); Q_D(FileSystemPathEdit);
editor->widget()->setParent(this); editor->widget()->setParent(this);
setFocusProxy(editor->widget());
auto *layout = new QHBoxLayout(this); auto *layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);

6
src/gui/watchedfolderoptionsdialog.cpp

@ -87,7 +87,11 @@ WatchedFolderOptionsDialog::WatchedFolderOptionsDialog(
loadState(); loadState();
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setFocus(); // Default focus
if (m_ui->comboTTM->currentIndex() == 0) // 0 is Manual mode
m_ui->savePath->setFocus();
else
m_ui->categoryComboBox->setFocus();
} }
WatchedFolderOptionsDialog::~WatchedFolderOptionsDialog() WatchedFolderOptionsDialog::~WatchedFolderOptionsDialog()

Loading…
Cancel
Save