Improve specifying alternate directory if the source has moved.

This commit is contained in:
Ernie Pasveer
2022-10-22 11:35:30 -05:00
parent 950acc8eff
commit 33c3e15c7b
8 changed files with 81 additions and 65 deletions
+4
View File
@@ -1,6 +1,10 @@
# Seer Change Log
## [1.13beta] - 2022-MM-DD
* Improve specifying an alternate directory if the source has moved. Fewer mouse clicks.
## [1.12] - 2022-10-22
* Added Gdb's Reverse Debugging mode.
+1 -1
View File
@@ -1,4 +1,4 @@
seergdb (1.12) UNRELEASED; urgency=medium
seergdb (1.13beta) UNRELEASED; urgency=medium
* Updated release.
+1 -1
View File
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1.0)
project(seergdb VERSION 1.12 LANGUAGES CXX)
project(seergdb VERSION 1.13.0 LANGUAGES CXX)
set(PROJECT_NAME seergdb)
+10 -2
View File
@@ -83,10 +83,12 @@ void SeerEditorManagerWidget::dumpEntries () const {
SeerEditorManagerEntries::const_iterator b = beginEntry();
SeerEditorManagerEntries::const_iterator e = endEntry();
qDebug() << "Start";
while (b != e) {
qDebug() << "\tFullname:" << b->fullname << "File:" << b->file;
b++;
}
qDebug() << "End";
}
bool SeerEditorManagerWidget::hasEntry (const QString& fullname) const {
@@ -100,6 +102,8 @@ bool SeerEditorManagerWidget::hasEntry (const QString& fullname) const {
SeerEditorManagerEntries::iterator SeerEditorManagerWidget::addEntry (const QString& fullname, const QString& file) {
//qDebug() << "Add entry:" << fullname << file;
SeerEditorManagerEntry entry;
entry.fullname = fullname;
@@ -711,7 +715,9 @@ SeerEditorWidgetSource* SeerEditorManagerWidget::editorWidgetTab (const QString&
SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QString& fullname, const QString& file, const QString& text) {
//qDebug() << fullname << file << text << tabWidget->count() << tabWidget->tabText(0);
//qDebug() << "1:" << fullname << file << tabWidget->count() << tabWidget->tabText(0);
//dumpEntries();
// Are we asked to ignore this file?
if (Seer::matches(editorIgnoreDirectories(), fullname, QRegExp::WildcardUnix) == true) {
@@ -766,7 +772,9 @@ SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QS
SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QString& fullname, const QString& file) {
//qDebug() << fullname << file << tabWidget->count() << tabWidget->tabText(0);
//qDebug() << "2:" << fullname << file << tabWidget->count() << tabWidget->tabText(0);
//dumpEntries();
// Are we asked to ignore this file?
if (Seer::matches(editorIgnoreDirectories(), fullname, QRegExp::WildcardUnix) == true) {
+15 -16
View File
@@ -46,7 +46,6 @@ SeerEditorWidgetSource::SeerEditorWidgetSource(QWidget* parent) : QWidget(parent
QObject::connect(searchCloseToolButton, &QToolButton::clicked, this, &SeerEditorWidgetSource::handleSearchCloseToolButton);
QObject::connect(alternateCloseToolButton, &QToolButton::clicked, this, &SeerEditorWidgetSource::handleAlternateCloseToolButton);
QObject::connect(alternateFileOpenToolButton, &QToolButton::clicked, this, &SeerEditorWidgetSource::handleAlternateFileOpenToolButton);
QObject::connect(alternateAddToGlobalToolButton, &QToolButton::clicked, this, &SeerEditorWidgetSource::handleAlternateAddToGlobalToolButton);
QObject::connect(alternateLineEdit, &QLineEdit::returnPressed, this, &SeerEditorWidgetSource::handleAlternateLineEdit);
QObject::connect(sourceWidget, &SeerEditorWidgetSourceArea::showSearchBar, this, &SeerEditorWidgetSource::showSearchBar);
QObject::connect(sourceWidget, &SeerEditorWidgetSourceArea::showAlternateBar, this, &SeerEditorWidgetSource::showAlternateBar);
@@ -123,14 +122,12 @@ void SeerEditorWidgetSource::setSearchMatchCase (bool flag) {
void SeerEditorWidgetSource::showAlternateBar (bool flag) {
// Set the label's text.
alternateLabel->setText("Enter directory path for '" + sourceArea()->file() + "'");
alternateBarWidget->setVisible(flag);
// If 'show', give the alternateLineEdit the focus.
if (flag) {
alternateLineEdit->setFocus(Qt::MouseFocusReason);
originalLineEdit->setText(sourceArea()->fullname()); // Set the original text.
rememberAlternateCheckBox->setChecked(true); // Set the default remember setting.
alternateLineEdit->setFocus(Qt::MouseFocusReason); // If 'show', give the alternateLineEdit the focus.
}
}
@@ -212,28 +209,30 @@ void SeerEditorWidgetSource::handleAlternateFileOpenToolButton () {
if (filename != "") {
alternateLineEdit->setText(QFileInfo(filename).absolutePath());
}
handleAlternateLineEdit();
}
void SeerEditorWidgetSource::handleAlternateLineEdit () {
showAlternateBar(false);
// Get the base path.
QString dirname = alternateLineEdit->text();
//qDebug() << "alternate dirname=" << dirname;
sourceArea()->open(sourceArea()->fullname(), sourceArea()->file(), dirname);
}
void SeerEditorWidgetSource::handleAlternateAddToGlobalToolButton () {
if (alternateLineEdit->text() == "") {
if (dirname == "") {
return;
}
//qDebug() << "alternate dirname=" << alternateLineEdit->text();
//qDebug() << "alternate dirname=" << dirname;
emit addAlternateDirectory(alternateLineEdit->text());
// Attempt to open the file.
sourceArea()->open(sourceArea()->fullname(), sourceArea()->file(), dirname);
// Add to global alternate list.
if (rememberAlternateCheckBox->isChecked()) {
emit addAlternateDirectory(dirname);
}
}
void SeerEditorWidgetSource::handleTextSearchShortcut () {
-1
View File
@@ -246,7 +246,6 @@ class SeerEditorWidgetSource : public QWidget, protected Ui::SeerEditorWidgetSou
void handleAlternateCloseToolButton ();
void handleAlternateFileOpenToolButton ();
void handleAlternateLineEdit ();
void handleAlternateAddToGlobalToolButton ();
void handleTextSearchShortcut ();
void handleAlternateDirectoryShortcut ();
+49 -43
View File
@@ -16,7 +16,7 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="alternateBarWidget" native="true">
<layout class="QGridLayout" name="alternateBarLayout">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
@@ -29,24 +29,64 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="3">
<widget class="QToolButton" name="alternateAddToGlobalToolButton">
<item row="0" column="0">
<widget class="QLabel" name="orignalLabel">
<property name="text">
<string>Looking for:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="4">
<widget class="QLineEdit" name="originalLineEdit">
<property name="toolTip">
<string>Add path to global list of alternate directories.</string>
<string>Original path location.</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="alternateLabel">
<property name="text">
<string>Alternate path:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QHistoryLineEdit" name="alternateLineEdit">
<property name="toolTip">
<string>Enter path for alternate location.</string>
</property>
<property name="placeholderText">
<string>Enter /path/to/alternate/location</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="alternateFileOpenToolButton">
<property name="toolTip">
<string>Open file dialog for alternate location.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/seer/resources/RelaxLightIcons/list-add.svg</normaloff>:/seer/resources/RelaxLightIcons/list-add.svg</iconset>
<normaloff>:/seer/resources/RelaxLightIcons/document-open.svg</normaloff>:/seer/resources/RelaxLightIcons/document-open.svg</iconset>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QLabel" name="alternateLabel">
<item row="1" column="3">
<widget class="QCheckBox" name="rememberAlternateCheckBox">
<property name="toolTip">
<string>Add path to global list of alternate directories.</string>
</property>
<property name="text">
<string/>
<string>Remember</string>
</property>
</widget>
</item>
@@ -64,40 +104,6 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QHistoryLineEdit" name="alternateLineEdit">
<property name="toolTip">
<string>Enter path for alternate location.</string>
</property>
<property name="placeholderText">
<string>Enter /path/to/alternate/location</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="alternateFileOpenToolButton">
<property name="toolTip">
<string>Open file dialog for alternate location.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="resource.qrc">
<normaloff>:/seer/resources/RelaxLightIcons/document-open.svg</normaloff>:/seer/resources/RelaxLightIcons/document-open.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -252,7 +258,7 @@
<tabstops>
<tabstop>alternateLineEdit</tabstop>
<tabstop>alternateFileOpenToolButton</tabstop>
<tabstop>alternateAddToGlobalToolButton</tabstop>
<tabstop>rememberAlternateCheckBox</tabstop>
<tabstop>alternateCloseToolButton</tabstop>
<tabstop>searchTextLineEdit</tabstop>
<tabstop>matchCaseCheckBox</tabstop>
+1 -1
View File
@@ -6,7 +6,7 @@
// Increment this with every release on GitHub.
// See scripts/change_versionnumber
//
#define SEER_VERSION "1.12"
#define SEER_VERSION "1.13beta"
namespace Seer {