From 5bef6641069c1a76ecca15b32c44ba4b0d88fded Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 25 Feb 2023 21:42:30 +0800 Subject: [PATCH] - fix: Search dialog shouldn't have "confirm when replace". - change: Default value for the debugger debugger panel "memory view's columns" is changed from 8 to 16. - change: Default value for the debugger debugger panel "memory view's rows" is changed from 8 to 16. - enhancement: Display hex value as ascii chars in the debugger panel memory view tab. --- NEWS.md | 4 ++++ RedPandaIDE/debugger.cpp | 21 ++++++++++++++++----- RedPandaIDE/settings.cpp | 4 ++-- RedPandaIDE/widgets/searchdialog.ui | 28 +++++++++------------------- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0a3ca509..a732585f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,10 @@ Red Panda C++ Version 2.15 - fix: Static class members is not correctly recognized as static. - fix: Function with reference type return value is not correctly parsed. - enhancement: Add descriptions for x86 registers in the cpu info dialog. + - fix: Search dialog shouldn't have "confirm when replace". + - change: Default value for the debugger debugger panel "memory view's columns" is changed from 8 to 16. + - change: Default value for the debugger debugger panel "memory view's rows" is changed from 8 to 16. + - enhancement: Display hex value as ascii chars in the debugger panel memory view tab. Red Panda C++ Version 2.14 diff --git a/RedPandaIDE/debugger.cpp b/RedPandaIDE/debugger.cpp index da2ac2e5..3a824e21 100644 --- a/RedPandaIDE/debugger.cpp +++ b/RedPandaIDE/debugger.cpp @@ -44,7 +44,7 @@ Debugger::Debugger(QObject *parent) : QObject(parent), mBacktraceModel = std::make_shared(this); mWatchModel = std::make_shared(this); mRegisterModel = std::make_shared(this); - mMemoryModel = std::make_shared(8,this); + mMemoryModel = std::make_shared(16,this); connect(mMemoryModel.get(),&MemoryModel::setMemoryData, this, &Debugger::setMemoryData); @@ -3089,7 +3089,7 @@ int MemoryModel::rowCount(const QModelIndex &/*parent*/) const int MemoryModel::columnCount(const QModelIndex &/*parent*/) const { - return mDataPerLine; + return mDataPerLine+1; } QVariant MemoryModel::data(const QModelIndex &index, int role) const @@ -3100,10 +3100,21 @@ QVariant MemoryModel::data(const QModelIndex &index, int role) const return QVariant(); PMemoryLine line = mLines[index.row()]; int col = index.column(); - if (col<0 || col>=line->datas.count()) + if (col<0 || col>line->datas.count()) return QVariant(); - if (role == Qt::DisplayRole) - return QString("%1").arg(line->datas[col],2,16,QChar('0')); + if (role == Qt::DisplayRole) { + if (col==line->datas.count()) { + QString s; + foreach (unsigned char ch, line->datas) { + if (ch<' ' || ch>=128) + s+='.'; + else + s+=ch; + } + return s; + } else + return QString("%1").arg(line->datas[col],2,16,QChar('0')); + } return QVariant(); } diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 780244f3..448c948d 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -3961,8 +3961,8 @@ void Settings::Debugger::doLoad() mUseGDBServer = boolValue("use_gdb_server", true); #endif mGDBServerPort = intValue("gdb_server_port",41234); - mMemoryViewRows = intValue("memory_view_rows",8); - mMemoryViewColumns = intValue("memory_view_columns",8); + mMemoryViewRows = intValue("memory_view_rows",16); + mMemoryViewColumns = intValue("memory_view_columns",16); } Settings::CodeCompletion::CodeCompletion(Settings *settings):_Base(settings, SETTING_CODE_COMPLETION) diff --git a/RedPandaIDE/widgets/searchdialog.ui b/RedPandaIDE/widgets/searchdialog.ui index 13ad7bbf..d5781555 100644 --- a/RedPandaIDE/widgets/searchdialog.ui +++ b/RedPandaIDE/widgets/searchdialog.ui @@ -7,7 +7,7 @@ 0 0 609 - 242 + 297 @@ -179,13 +179,6 @@ 7 - - - - Case Sensitive - - - @@ -196,16 +189,6 @@ - - - - Prompt on replace - - - true - - - @@ -226,6 +209,13 @@ + + + + Case Sensitive + + + @@ -242,7 +232,7 @@ - + Close after search