mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Checkpoint. Search text.
This commit is contained in:
@@ -28,9 +28,6 @@ SeerEditorManagerWidget::SeerEditorManagerWidget (QWidget* parent) : QWidget(par
|
||||
|
||||
tabWidget->setCornerWidget(editorOptionsBar, Qt::TopRightCorner);
|
||||
|
||||
_textSearchShortcut = new QShortcut(QKeySequence(tr("F11")), this);
|
||||
_alternateDirectoryShortcut = new QShortcut(QKeySequence(tr("F12")), this);
|
||||
|
||||
// Create a place holder tab with a special name of "".
|
||||
createEditorWidgetTab("", "");
|
||||
|
||||
@@ -38,8 +35,6 @@ SeerEditorManagerWidget::SeerEditorManagerWidget (QWidget* parent) : QWidget(par
|
||||
QObject::connect(tabWidget, &QTabWidget::tabCloseRequested, this, &SeerEditorManagerWidget::handleTabCloseRequested);
|
||||
QObject::connect(editorOptionsBar->fileOpenToolButton(), &QToolButton::clicked, this, &SeerEditorManagerWidget::handleFileOpenToolButtonClicked);
|
||||
QObject::connect(editorOptionsBar->textSearchToolButton(), &QToolButton::clicked, this, &SeerEditorManagerWidget::handleTextSearchToolButtonClicked);
|
||||
QObject::connect(_textSearchShortcut, &QShortcut::activated, this, &SeerEditorManagerWidget::handleTextSearchShortcut);
|
||||
QObject::connect(_alternateDirectoryShortcut, &QShortcut::activated, this, &SeerEditorManagerWidget::handleAlternateDirectoryShortcut);
|
||||
}
|
||||
|
||||
SeerEditorManagerWidget::~SeerEditorManagerWidget () {
|
||||
@@ -705,33 +700,3 @@ void SeerEditorManagerWidget::handleAddMemoryVisualizer (QString expression) {
|
||||
emit addMemoryVisualize (expression);
|
||||
}
|
||||
|
||||
void SeerEditorManagerWidget::handleTextSearchShortcut () {
|
||||
|
||||
SeerEditorWidget* w = currentEditorWidgetTab();
|
||||
|
||||
if (w == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (w->isSearchBarShown() == true) {
|
||||
w->showSearchBar(false);
|
||||
}else{
|
||||
w->showSearchBar(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SeerEditorManagerWidget::handleAlternateDirectoryShortcut () {
|
||||
|
||||
SeerEditorWidget* w = currentEditorWidgetTab();
|
||||
|
||||
if (w == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (w->isAlternateBarShown() == true) {
|
||||
w->showAlternateBar(false);
|
||||
}else{
|
||||
w->showAlternateBar(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "SeerEditorManagerEntry.h"
|
||||
#include "SeerHighlighterSettings.h"
|
||||
#include <QtGui/QFont>
|
||||
#include <QtWidgets/QShortcut>
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QString>
|
||||
@@ -54,8 +53,6 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
||||
void handleRefreshVariableTrackerValues ();
|
||||
void handleEvaluateVariableExpression (int expressionid, QString expression);
|
||||
void handleAddMemoryVisualizer (QString expression);
|
||||
void handleTextSearchShortcut ();
|
||||
void handleAlternateDirectoryShortcut ();
|
||||
|
||||
private slots:
|
||||
void handleFileOpenToolButtonClicked ();
|
||||
@@ -89,7 +86,5 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
||||
bool _editorHighlighterEnabled;
|
||||
QFont _editorFont;
|
||||
QStringList _editorAlternateDirectories;
|
||||
QShortcut* _textSearchShortcut;
|
||||
QShortcut* _alternateDirectoryShortcut;
|
||||
};
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ SeerEditorWidget::SeerEditorWidget(QWidget *parent) : QWidget(parent) {
|
||||
showAlternateBar(false); // Hide the alternate bar. ctrl+O to show it again.
|
||||
setSearchMatchCase(true); // Search with case sensitivity.
|
||||
|
||||
_textSearchShortcut = new QShortcut(QKeySequence(tr("F11")), this);
|
||||
_alternateDirectoryShortcut = new QShortcut(QKeySequence(tr("F12")), this);
|
||||
|
||||
// Connect things.
|
||||
QObject::connect(searchTextLineEdit, &QLineEdit::returnPressed, this, &SeerEditorWidget::handleSearchTextLineEdit);
|
||||
QObject::connect(searchDownToolButton, &QToolButton::clicked, this, &SeerEditorWidget::handleSearchDownToolButton);
|
||||
@@ -43,6 +46,9 @@ SeerEditorWidget::SeerEditorWidget(QWidget *parent) : QWidget(parent) {
|
||||
QObject::connect(alternateLineEdit, &QLineEdit::returnPressed, this, &SeerEditorWidget::handleAlternateLineEdit);
|
||||
QObject::connect(sourceWidget, &SeerEditorWidgetSourceArea::showSearchBar, this, &SeerEditorWidget::showSearchBar);
|
||||
QObject::connect(sourceWidget, &SeerEditorWidgetSourceArea::showAlternateBar, this, &SeerEditorWidget::showAlternateBar);
|
||||
|
||||
QObject::connect(_textSearchShortcut, &QShortcut::activated, this, &SeerEditorWidget::handleTextSearchShortcut);
|
||||
QObject::connect(_alternateDirectoryShortcut, &QShortcut::activated, this, &SeerEditorWidget::handleAlternateDirectoryShortcut);
|
||||
}
|
||||
|
||||
SeerEditorWidget::~SeerEditorWidget () {
|
||||
@@ -235,3 +241,21 @@ void SeerEditorWidget::handleAlternateAddToGlobalToolButton () {
|
||||
emit addAlternateDirectory(alternateLineEdit->text());
|
||||
}
|
||||
|
||||
void SeerEditorWidget::handleTextSearchShortcut () {
|
||||
|
||||
if (isSearchBarShown() == true) {
|
||||
showSearchBar(false);
|
||||
}else{
|
||||
showSearchBar(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SeerEditorWidget::handleAlternateDirectoryShortcut () {
|
||||
|
||||
if (isAlternateBarShown() == true) {
|
||||
showAlternateBar(false);
|
||||
}else{
|
||||
showAlternateBar(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "SeerCppSourceHighlighter.h"
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtWidgets/QPlainTextEdit>
|
||||
#include <QtWidgets/QShortcut>
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtGui/QPaintEvent>
|
||||
#include <QtGui/QResizeEvent>
|
||||
#include <QtGui/QPixmap>
|
||||
@@ -239,10 +240,14 @@ class SeerEditorWidget : public QWidget, protected Ui::SeerEditorWidgetForm {
|
||||
void handleAlternateFileOpenToolButton ();
|
||||
void handleAlternateLineEdit ();
|
||||
void handleAlternateAddToGlobalToolButton ();
|
||||
void handleTextSearchShortcut ();
|
||||
void handleAlternateDirectoryShortcut ();
|
||||
|
||||
signals:
|
||||
void addAlternateDirectory (QString path);
|
||||
|
||||
private:
|
||||
QShortcut* _textSearchShortcut;
|
||||
QShortcut* _alternateDirectoryShortcut;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user