mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Added 'enable minimap' option to Editor config page.
This commit is contained in:
@@ -315,6 +315,16 @@ bool SeerConfigDialog::editorHighlighterEnabled () const {
|
|||||||
return _editorConfigPage->highlighterEnabled();
|
return _editorConfigPage->highlighterEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SeerConfigDialog::setEditorMinimapEnabled (bool flag) {
|
||||||
|
|
||||||
|
_editorConfigPage->setMinimapEnabled(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SeerConfigDialog::editorMinimapEnabled () const {
|
||||||
|
|
||||||
|
return _editorConfigPage->minimapEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
void SeerConfigDialog::setExternalEditorCommand (const QString& externalEditorCommand) {
|
void SeerConfigDialog::setExternalEditorCommand (const QString& externalEditorCommand) {
|
||||||
|
|
||||||
_editorConfigPage->setExternalEditorCommand(externalEditorCommand);
|
_editorConfigPage->setExternalEditorCommand(externalEditorCommand);
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm {
|
|||||||
void setEditorHighlighterEnabled (bool flag);
|
void setEditorHighlighterEnabled (bool flag);
|
||||||
bool editorHighlighterEnabled () const;
|
bool editorHighlighterEnabled () const;
|
||||||
|
|
||||||
|
void setEditorMinimapEnabled (bool flag);
|
||||||
|
bool editorMinimapEnabled () const;
|
||||||
|
|
||||||
void setExternalEditorCommand (const QString& externalEditorCommand);
|
void setExternalEditorCommand (const QString& externalEditorCommand);
|
||||||
QString externalEditorCommand () const;
|
QString externalEditorCommand () const;
|
||||||
|
|
||||||
|
|||||||
@@ -162,8 +162,6 @@ const SeerHighlighterSettings& SeerEditorConfigPage::highlighterSettings() const
|
|||||||
|
|
||||||
void SeerEditorConfigPage::setHighlighterEnabled (bool flag) {
|
void SeerEditorConfigPage::setHighlighterEnabled (bool flag) {
|
||||||
|
|
||||||
qDebug() << flag;
|
|
||||||
|
|
||||||
highlighterEnabledCheckBox->setChecked(flag);
|
highlighterEnabledCheckBox->setChecked(flag);
|
||||||
|
|
||||||
editorWidget->sourceArea()->setHighlighterEnabled(flag);
|
editorWidget->sourceArea()->setHighlighterEnabled(flag);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ SeerEditorManagerWidget::SeerEditorManagerWidget (QWidget* parent) : QWidget(par
|
|||||||
_editorFont = QFont("monospace", 10); // Default font.
|
_editorFont = QFont("monospace", 10); // Default font.
|
||||||
_editorHighlighterSettings = SeerHighlighterSettings::populate(""); // Default syntax highlighting.
|
_editorHighlighterSettings = SeerHighlighterSettings::populate(""); // Default syntax highlighting.
|
||||||
_editorHighlighterEnabled = true;
|
_editorHighlighterEnabled = true;
|
||||||
|
_editorMinimapEnabled = false;
|
||||||
_editorKeySettings = SeerKeySettings::populate(); // Default key settings.
|
_editorKeySettings = SeerKeySettings::populate(); // Default key settings.
|
||||||
_editorTabSize = 4;
|
_editorTabSize = 4;
|
||||||
_editorExternalEditorCommand = "";
|
_editorExternalEditorCommand = "";
|
||||||
@@ -384,9 +385,36 @@ void SeerEditorManagerWidget::setEditorHighlighterEnabled (bool flag) {
|
|||||||
|
|
||||||
bool SeerEditorManagerWidget::editorHighlighterEnabled () const {
|
bool SeerEditorManagerWidget::editorHighlighterEnabled () const {
|
||||||
|
|
||||||
|
|
||||||
return _editorHighlighterEnabled;
|
return _editorHighlighterEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SeerEditorManagerWidget::setEditorMinimapEnabled (bool flag) {
|
||||||
|
|
||||||
|
_editorMinimapEnabled = flag;
|
||||||
|
|
||||||
|
// Update current editors.
|
||||||
|
SeerEditorManagerEntries::iterator b = beginEntry();
|
||||||
|
SeerEditorManagerEntries::iterator e = endEntry();
|
||||||
|
|
||||||
|
while (b != e) {
|
||||||
|
b->widget->sourceArea()->enableMiniMapArea(_editorMinimapEnabled);
|
||||||
|
b++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't forget about the assembly widget.
|
||||||
|
SeerEditorWidgetAssembly* assemblyWidget = assemblyWidgetTab();
|
||||||
|
|
||||||
|
if (assemblyWidget) {
|
||||||
|
assemblyWidget->assemblyArea()->enableMiniMapArea(_editorMinimapEnabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SeerEditorManagerWidget::editorMinimapEnabled () const {
|
||||||
|
|
||||||
|
return _editorMinimapEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
void SeerEditorManagerWidget::setEditorAlternateDirectories (const QStringList alternateDirectories) {
|
void SeerEditorManagerWidget::setEditorAlternateDirectories (const QStringList alternateDirectories) {
|
||||||
|
|
||||||
_editorAlternateDirectories = alternateDirectories;
|
_editorAlternateDirectories = alternateDirectories;
|
||||||
@@ -1076,6 +1104,7 @@ SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QS
|
|||||||
editorWidget->sourceArea()->setHighlighterSettings(editorHighlighterSettings());
|
editorWidget->sourceArea()->setHighlighterSettings(editorHighlighterSettings());
|
||||||
editorWidget->sourceArea()->setHighlighterEnabled(editorHighlighterEnabled());
|
editorWidget->sourceArea()->setHighlighterEnabled(editorHighlighterEnabled());
|
||||||
editorWidget->sourceArea()->setAlternateDirectories(editorAlternateDirectories());
|
editorWidget->sourceArea()->setAlternateDirectories(editorAlternateDirectories());
|
||||||
|
editorWidget->sourceArea()->enableMiniMapArea(editorMinimapEnabled());
|
||||||
editorWidget->setKeySettings(editorKeySettings());
|
editorWidget->setKeySettings(editorKeySettings());
|
||||||
|
|
||||||
// Set the tooltip for the tab.
|
// Set the tooltip for the tab.
|
||||||
@@ -1141,6 +1170,7 @@ SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QS
|
|||||||
editorWidget->sourceArea()->setHighlighterSettings(editorHighlighterSettings());
|
editorWidget->sourceArea()->setHighlighterSettings(editorHighlighterSettings());
|
||||||
editorWidget->sourceArea()->setHighlighterEnabled(editorHighlighterEnabled());
|
editorWidget->sourceArea()->setHighlighterEnabled(editorHighlighterEnabled());
|
||||||
editorWidget->sourceArea()->setAlternateDirectories(editorAlternateDirectories());
|
editorWidget->sourceArea()->setAlternateDirectories(editorAlternateDirectories());
|
||||||
|
editorWidget->sourceArea()->enableMiniMapArea(editorMinimapEnabled());
|
||||||
editorWidget->setKeySettings(editorKeySettings());
|
editorWidget->setKeySettings(editorKeySettings());
|
||||||
|
|
||||||
// Set the tooltip for the tab.
|
// Set the tooltip for the tab.
|
||||||
@@ -1240,6 +1270,7 @@ SeerEditorWidgetAssembly* SeerEditorManagerWidget::createAssemblyWidgetTab () {
|
|||||||
assemblyWidget->assemblyArea()->setEditorTabSize(editorTabSize());
|
assemblyWidget->assemblyArea()->setEditorTabSize(editorTabSize());
|
||||||
assemblyWidget->assemblyArea()->setHighlighterSettings(editorHighlighterSettings());
|
assemblyWidget->assemblyArea()->setHighlighterSettings(editorHighlighterSettings());
|
||||||
assemblyWidget->assemblyArea()->setHighlighterEnabled(editorHighlighterEnabled());
|
assemblyWidget->assemblyArea()->setHighlighterEnabled(editorHighlighterEnabled());
|
||||||
|
assemblyWidget->assemblyArea()->enableMiniMapArea(editorMinimapEnabled());
|
||||||
|
|
||||||
assemblyWidget->setShowAddressColumn(assemblyShowAddressColumn());
|
assemblyWidget->setShowAddressColumn(assemblyShowAddressColumn());
|
||||||
assemblyWidget->setShowOffsetColumn(assemblyShowOffsetColumn());
|
assemblyWidget->setShowOffsetColumn(assemblyShowOffsetColumn());
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
|||||||
const SeerHighlighterSettings& editorHighlighterSettings () const;
|
const SeerHighlighterSettings& editorHighlighterSettings () const;
|
||||||
void setEditorHighlighterEnabled (bool flag);
|
void setEditorHighlighterEnabled (bool flag);
|
||||||
bool editorHighlighterEnabled () const;
|
bool editorHighlighterEnabled () const;
|
||||||
|
void setEditorMinimapEnabled (bool flag);
|
||||||
|
bool editorMinimapEnabled () const;
|
||||||
void setEditorAlternateDirectories (const QStringList alternateDirectories);
|
void setEditorAlternateDirectories (const QStringList alternateDirectories);
|
||||||
const QStringList& editorAlternateDirectories () const;
|
const QStringList& editorAlternateDirectories () const;
|
||||||
void setEditorIgnoreDirectories (const QStringList ignoreDirectories);
|
void setEditorIgnoreDirectories (const QStringList ignoreDirectories);
|
||||||
@@ -162,6 +164,7 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
|
|||||||
SeerEditorManagerEntries _entries;
|
SeerEditorManagerEntries _entries;
|
||||||
SeerHighlighterSettings _editorHighlighterSettings;
|
SeerHighlighterSettings _editorHighlighterSettings;
|
||||||
bool _editorHighlighterEnabled;
|
bool _editorHighlighterEnabled;
|
||||||
|
bool _editorMinimapEnabled;
|
||||||
QFont _editorFont;
|
QFont _editorFont;
|
||||||
QStringList _editorAlternateDirectories;
|
QStringList _editorAlternateDirectories;
|
||||||
QStringList _editorIgnoreDirectories;
|
QStringList _editorIgnoreDirectories;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ SeerEditorWidgetAssemblyArea::SeerEditorWidgetAssemblyArea(QWidget* parent) : Se
|
|||||||
enableOffsetArea(true);
|
enableOffsetArea(true);
|
||||||
enableOpcodeArea(true);
|
enableOpcodeArea(true);
|
||||||
enableBreakPointArea(true);
|
enableBreakPointArea(true);
|
||||||
enableMiniMapArea(true);
|
enableMiniMapArea(false);
|
||||||
enableSourceLines(true);
|
enableSourceLines(true);
|
||||||
setConvertUppercase(false);
|
setConvertUppercase(false);
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ SeerEditorWidgetSourceArea::SeerEditorWidgetSourceArea(QWidget* parent) : SeerPl
|
|||||||
|
|
||||||
enableLineNumberArea(true);
|
enableLineNumberArea(true);
|
||||||
enableBreakPointArea(true);
|
enableBreakPointArea(true);
|
||||||
enableMiniMapArea(true);
|
enableMiniMapArea(false);
|
||||||
|
|
||||||
_altHeldTimer->setInterval(40); // 40 ms interval = 25Hz update rate
|
_altHeldTimer->setInterval(40); // 40 ms interval = 25Hz update rate
|
||||||
QObject::connect(_altHeldTimer, &QTimer::timeout, this, [this]() {
|
QObject::connect(_altHeldTimer, &QTimer::timeout, this, [this]() {
|
||||||
@@ -108,26 +108,31 @@ SeerEditorWidgetSourceArea::SeerEditorWidgetSourceArea(QWidget* parent) : SeerPl
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SeerEditorWidgetSourceArea::enableLineNumberArea (bool flag) {
|
void SeerEditorWidgetSourceArea::enableLineNumberArea (bool flag) {
|
||||||
|
|
||||||
_enableLineNumberArea = flag;
|
_enableLineNumberArea = flag;
|
||||||
|
|
||||||
updateMarginAreasWidth(0);
|
updateMarginAreasWidth(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SeerEditorWidgetSourceArea::lineNumberAreaEnabled () const {
|
bool SeerEditorWidgetSourceArea::lineNumberAreaEnabled () const {
|
||||||
|
|
||||||
return _enableLineNumberArea;
|
return _enableLineNumberArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeerEditorWidgetSourceArea::enableBreakPointArea (bool flag) {
|
void SeerEditorWidgetSourceArea::enableBreakPointArea (bool flag) {
|
||||||
|
|
||||||
_enableBreakPointArea = flag;
|
_enableBreakPointArea = flag;
|
||||||
|
|
||||||
updateMarginAreasWidth(0);
|
updateMarginAreasWidth(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SeerEditorWidgetSourceArea::breakPointAreaEnabled () const {
|
bool SeerEditorWidgetSourceArea::breakPointAreaEnabled () const {
|
||||||
|
|
||||||
return _enableBreakPointArea;
|
return _enableBreakPointArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeerEditorWidgetSourceArea::enableMiniMapArea (bool flag) {
|
void SeerEditorWidgetSourceArea::enableMiniMapArea (bool flag) {
|
||||||
|
|
||||||
_enableMiniMapArea = flag;
|
_enableMiniMapArea = flag;
|
||||||
|
|
||||||
invalidateMiniMapCache();
|
invalidateMiniMapCache();
|
||||||
@@ -135,6 +140,7 @@ void SeerEditorWidgetSourceArea::enableMiniMapArea (bool flag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SeerEditorWidgetSourceArea::miniMapAreaEnabled () const {
|
bool SeerEditorWidgetSourceArea::miniMapAreaEnabled () const {
|
||||||
|
|
||||||
return _enableMiniMapArea;
|
return _enableMiniMapArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -819,7 +819,7 @@ void SeerMainWindow::handleSettingsConfiguration () {
|
|||||||
dlg.setEditorTabSize(gdbWidget->editorManager()->editorTabSize());
|
dlg.setEditorTabSize(gdbWidget->editorManager()->editorTabSize());
|
||||||
dlg.setEditorHighlighterSettings(gdbWidget->editorManager()->editorHighlighterSettings());
|
dlg.setEditorHighlighterSettings(gdbWidget->editorManager()->editorHighlighterSettings());
|
||||||
dlg.setEditorHighlighterEnabled(gdbWidget->editorManager()->editorHighlighterEnabled());
|
dlg.setEditorHighlighterEnabled(gdbWidget->editorManager()->editorHighlighterEnabled());
|
||||||
dlg.setEditorHighlighterEnabled(gdbWidget->editorManager()->editorHighlighterEnabled());
|
dlg.setEditorMinimapEnabled(gdbWidget->editorManager()->editorMinimapEnabled());
|
||||||
dlg.setExternalEditorCommand(gdbWidget->editorManager()->editorExternalEditorCommand());
|
dlg.setExternalEditorCommand(gdbWidget->editorManager()->editorExternalEditorCommand());
|
||||||
dlg.setEditorAutoSourceReload(gdbWidget->editorManager()->editorAutoSourceReload());
|
dlg.setEditorAutoSourceReload(gdbWidget->editorManager()->editorAutoSourceReload());
|
||||||
dlg.setSourceAlternateDirectories(gdbWidget->sourceAlternateDirectories());
|
dlg.setSourceAlternateDirectories(gdbWidget->sourceAlternateDirectories());
|
||||||
@@ -866,6 +866,7 @@ void SeerMainWindow::handleSettingsConfiguration () {
|
|||||||
gdbWidget->editorManager()->setEditorTabSize(dlg.editorTabSize());
|
gdbWidget->editorManager()->setEditorTabSize(dlg.editorTabSize());
|
||||||
gdbWidget->editorManager()->setEditorHighlighterSettings(dlg.editorHighlighterSettings());
|
gdbWidget->editorManager()->setEditorHighlighterSettings(dlg.editorHighlighterSettings());
|
||||||
gdbWidget->editorManager()->setEditorHighlighterEnabled(dlg.editorHighlighterEnabled());
|
gdbWidget->editorManager()->setEditorHighlighterEnabled(dlg.editorHighlighterEnabled());
|
||||||
|
gdbWidget->editorManager()->setEditorMinimapEnabled(dlg.editorMinimapEnabled());
|
||||||
gdbWidget->editorManager()->setEditorExternalEditorCommand(dlg.externalEditorCommand());
|
gdbWidget->editorManager()->setEditorExternalEditorCommand(dlg.externalEditorCommand());
|
||||||
gdbWidget->editorManager()->setEditorAutoSourceReload(dlg.editorAutoSourceReload());
|
gdbWidget->editorManager()->setEditorAutoSourceReload(dlg.editorAutoSourceReload());
|
||||||
gdbWidget->setSourceAlternateDirectories(dlg.sourceAlternateDirectories());
|
gdbWidget->setSourceAlternateDirectories(dlg.sourceAlternateDirectories());
|
||||||
@@ -1772,6 +1773,7 @@ void SeerMainWindow::writeConfigSettings () {
|
|||||||
settings.setValue("tabsize", gdbWidget->editorManager()->editorTabSize());
|
settings.setValue("tabsize", gdbWidget->editorManager()->editorTabSize());
|
||||||
settings.setValue("externaleditorcommand", gdbWidget->editorManager()->editorExternalEditorCommand());
|
settings.setValue("externaleditorcommand", gdbWidget->editorManager()->editorExternalEditorCommand());
|
||||||
settings.setValue("autosourcereload", gdbWidget->editorManager()->editorAutoSourceReload());
|
settings.setValue("autosourcereload", gdbWidget->editorManager()->editorAutoSourceReload());
|
||||||
|
settings.setValue("minimapenabled", gdbWidget->editorManager()->editorMinimapEnabled());
|
||||||
|
|
||||||
settings.beginGroup("highlighter"); {
|
settings.beginGroup("highlighter"); {
|
||||||
|
|
||||||
@@ -1874,6 +1876,7 @@ void SeerMainWindow::readConfigSettings () {
|
|||||||
gdbWidget->editorManager()->setEditorTabSize(settings.value("tabsize", 4).toInt());
|
gdbWidget->editorManager()->setEditorTabSize(settings.value("tabsize", 4).toInt());
|
||||||
gdbWidget->editorManager()->setEditorExternalEditorCommand(settings.value("externaleditorcommand").toString());
|
gdbWidget->editorManager()->setEditorExternalEditorCommand(settings.value("externaleditorcommand").toString());
|
||||||
gdbWidget->editorManager()->setEditorAutoSourceReload(settings.value("autosourcereload").toBool());
|
gdbWidget->editorManager()->setEditorAutoSourceReload(settings.value("autosourcereload").toBool());
|
||||||
|
gdbWidget->editorManager()->setEditorMinimapEnabled(settings.value("minimapenabled",false).toBool());
|
||||||
|
|
||||||
settings.beginGroup("highlighter"); {
|
settings.beginGroup("highlighter"); {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user