Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/options/optionsdlgbase.cpp b/src/options/optionsdlgbase.cpp
- index 7bb9d8fe..79f53a57 100644
- --- a/src/options/optionsdlgbase.cpp
- +++ b/src/options/optionsdlgbase.cpp
- @@ -449,4 +449,10 @@ void OptionsDlgBase::doApply() { d->doApply(); }
- void OptionsDlgBase::enableCommonControls(bool enable) { d->enableCommonControls(enable); }
- +void OptionsDlgBase::keyPressEvent(QKeyEvent *e)
- +{
- + if(e->modifiers() & Qt::ControlModifier && e->key() == Qt::Key_F)
- + openTab("tree");
- +}
- +
- #include "optionsdlgbase.moc"
- diff --git a/src/options/optionsdlgbase.h b/src/options/optionsdlgbase.h
- index 0e350c23..d890ce11 100644
- --- a/src/options/optionsdlgbase.h
- +++ b/src/options/optionsdlgbase.h
- @@ -38,6 +38,7 @@ public:
- protected:
- void setTabs(QList<OptionsTab *> tabs); /* can be called from constructor */
- + void keyPressEvent(QKeyEvent *e);
- signals:
- void applyOptions();
- diff --git a/src/psioptionseditor.cpp b/src/psioptionseditor.cpp
- index fedab6be..3da67de8 100644
- --- a/src/psioptionseditor.cpp
- +++ b/src/psioptionseditor.cpp
- @@ -115,11 +115,15 @@ PsiOptionsEditor::PsiOptionsEditor(QWidget *parent) : QWidget(parent)
- layout->setSpacing(0);
- layout->setMargin(0);
- - auto filterLe = new QLineEdit(this);
- - filterLe->setProperty("isOption", false);
- - filterLe->setToolTip(tr("Options filter"));
- - layout->addWidget(filterLe);
- - connect(filterLe, &QLineEdit::textChanged, this, [this, filterLe]() { tpm_->setFilterWildcard(filterLe->text()); });
- + QHBoxLayout *filterLayout = new QHBoxLayout;
- + le_filter = new QLineEdit(this);
- + le_filter->setProperty("isOption", false);
- + le_filter->setToolTip(tr("Options filter"));
- + lb_filter = new QLabel(tr("Filter"),this);
- + filterLayout->addWidget(lb_filter);
- + filterLayout->addWidget(le_filter);
- + layout->addItem(filterLayout);
- + connect(le_filter, &QLineEdit::textChanged, this, [this]() { tpm_->setFilterWildcard(le_filter->text()); });
- tv_ = new QTreeView(this);
- tv_->setModel(tpm_);
- @@ -157,19 +161,24 @@ PsiOptionsEditor::PsiOptionsEditor(QWidget *parent) : QWidget(parent)
- layout->addLayout(buttonLine);
- cb_ = new QCheckBox(this);
- - cb_->setText(tr("Flat"));
- + cb_->setText(tr("Display all options as a flat list"));
- cb_->setToolTip(tr("Display all options as a flat list."));
- cb_->setProperty("isOption", false);
- - connect(cb_, &QCheckBox::toggled, tm_, [this, filterLe](bool b) {
- + connect(cb_, &QCheckBox::toggled, tm_, [this](bool b) {
- if (tm_->setFlat(b)) {
- if (!b) {
- tpm_->setFilterWildcard(QString());
- + le_filter->setFocusPolicy(Qt::NoFocus);
- + } else {
- + le_filter->setFocusPolicy(Qt::StrongFocus);
- + QTimer::singleShot(0, le_filter, SLOT(setFocus()));
- }
- - filterLe->setVisible(b);
- + lb_filter->setVisible(b);
- + le_filter->setVisible(b);
- }
- });
- - filterLe->setVisible(cb_->isChecked());
- - buttonLine->addWidget(cb_);
- + cb_->setChecked(true);
- + layout->insertWidget(0, cb_);
- buttonLine->addStretch(1);
- diff --git a/src/psioptionseditor.h b/src/psioptionseditor.h
- index 1910343f..9b23b2b2 100644
- --- a/src/psioptionseditor.h
- +++ b/src/psioptionseditor.h
- @@ -39,11 +39,13 @@ private:
- QLabel * lb_type;
- QLabel * lb_path;
- QLabel * lb_comment;
- + QLabel * lb_filter;
- QPushButton * pb_delete;
- QPushButton * pb_reset;
- QPushButton * pb_edit;
- QPushButton * pb_new;
- QToolButton * pb_detach;
- + QLineEdit * le_filter;
- };
- #endif // PSIOPTIONSEDITOR_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement