From e5fe2e9d544cc431fc4e0604e759e2f42c31e31c Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 22 Jan 2022 11:34:42 -0600 Subject: [PATCH] Add proper text for alternate diretory window. --- src/SeerEditorWidget.cpp | 8 +++++--- src/SeerEditorWidget.h | 26 +++++++++++++------------- src/SeerEditorWidget.ui | 2 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/SeerEditorWidget.cpp b/src/SeerEditorWidget.cpp index c587427..b11df5d 100644 --- a/src/SeerEditorWidget.cpp +++ b/src/SeerEditorWidget.cpp @@ -39,6 +39,7 @@ SeerEditorWidget::SeerEditorWidget(QWidget *parent) : QWidget(parent) { QObject::connect(alternateCloseToolButton, &QToolButton::clicked, this, &SeerEditorWidget::handleAlternateCloseToolButton); QObject::connect(alternateFileOpenToolButton, &QToolButton::clicked, this, &SeerEditorWidget::handleAlternateFileOpenToolButton); QObject::connect(alternateAcceptToolButton, &QToolButton::clicked, this, &SeerEditorWidget::handleAlternateAcceptToolButton); + QObject::connect(alternateLineEdit, &QLineEdit::returnPressed, this, &SeerEditorWidget::handleAlternateAcceptToolButton); QObject::connect(sourceWidget, &SeerEditorWidgetSourceArea::showSearchBar, this, &SeerEditorWidget::showSearchBar); QObject::connect(sourceWidget, &SeerEditorWidgetSourceArea::showAlternateBar, this, &SeerEditorWidget::showAlternateBar); } @@ -140,6 +141,9 @@ bool SeerEditorWidget::isSearchBarShown () const { void SeerEditorWidget::showAlternateBar (bool flag) { + // Set the label's text. + alternateLabel->setText("Enter directory path for '" + sourceArea()->file() + "'"); + // Go through the widgets in the search bar and hide/show them. for (int i = 0; i != alternateBarLayout->count(); ++i) { QWidget* w = alternateBarLayout->itemAt(i)->widget(); @@ -205,8 +209,6 @@ void SeerEditorWidget::handleAlternateAcceptToolButton () { //qDebug() << "alternate dirname=" << dirname; - if (dirname != "") { - sourceArea()->open(sourceArea()->fullname(), sourceArea()->file(), dirname); - } + sourceArea()->open(sourceArea()->fullname(), sourceArea()->file(), dirname); } diff --git a/src/SeerEditorWidget.h b/src/SeerEditorWidget.h index 2fadd69..109b5bf 100644 --- a/src/SeerEditorWidget.h +++ b/src/SeerEditorWidget.h @@ -214,21 +214,21 @@ class SeerEditorWidget : public QWidget, protected Ui::SeerEditorWidgetForm { explicit SeerEditorWidget (QWidget* parent = 0); ~SeerEditorWidget (); - SeerEditorWidgetSourceArea* sourceArea (); + SeerEditorWidgetSourceArea* sourceArea (); - void handleSearchLineNumberLineEdit (); - void handleSearchTextLineEdit (); - void handleSearchDownToolButton (); - void handleSearchUpToolButton (); - void handleSearchCloseToolButton (); - void handleAlternateCloseToolButton (); - void handleAlternateFileOpenToolButton (); - void handleAlternateAcceptToolButton (); + void handleSearchLineNumberLineEdit (); + void handleSearchTextLineEdit (); + void handleSearchDownToolButton (); + void handleSearchUpToolButton (); + void handleSearchCloseToolButton (); + void handleAlternateCloseToolButton (); + void handleAlternateFileOpenToolButton (); + void handleAlternateAcceptToolButton (); public slots: - void showSearchBar (bool flag); - bool isSearchBarShown () const; - void showAlternateBar (bool flag); - bool isAlternateBarShown () const; + void showSearchBar (bool flag); + bool isSearchBarShown () const; + void showAlternateBar (bool flag); + bool isAlternateBarShown () const; }; diff --git a/src/SeerEditorWidget.ui b/src/SeerEditorWidget.ui index 9e01c45..391a3a6 100644 --- a/src/SeerEditorWidget.ui +++ b/src/SeerEditorWidget.ui @@ -33,7 +33,7 @@ - TextLabel +