diff --git a/NEWS.md b/NEWS.md
index 4445569c..3ef01d5e 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -34,6 +34,7 @@ Red Panda C++ Version 2.12
- enhancement: Delay for tooltips.
- enhancement: "Tool tips delay" option in Options/editor/Tooltips
- change: Remove "Compile & Run" menu item. It's replaced by "Run".
+ - enhancement: Limit max speed for mouse scroll (and touch pad?)
Red Panda C++ Version 2.11
diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp
index 0542ee1d..7b5ceed2 100644
--- a/RedPandaIDE/mainwindow.cpp
+++ b/RedPandaIDE/mainwindow.cpp
@@ -2189,7 +2189,7 @@ void MainWindow::debug()
tr("Enable debugging"),
tr("You are not using a Debug compiler setting.")
+"
"
- +tr("Please choose a Debug compiler set in the toolbar, or enable the \"generate debugging info (-g3)\" and disable the \"strip additional info (-s)\" options in the compiler set settings's \"settings\" page.")
+ +tr("Please choose a Debug compiler set in the toolbarin the compiler set settings's \"settings\" page.")
+"
"
+tr("Do you want to set it now?")
) == QMessageBox::Yes) {
diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp
index 86e90230..1e5139d8 100644
--- a/RedPandaIDE/settings.cpp
+++ b/RedPandaIDE/settings.cpp
@@ -1708,7 +1708,6 @@ Settings::CompilerSet::CompilerSet(const Settings::CompilerSet &set):
mCppCompiler(set.mCppCompiler),
mMake(set.mMake),
mDebugger(set.mDebugger),
- mProfiler(set.mProfiler),
mResourceCompiler(set.mResourceCompiler),
mDebugServer(set.mDebugServer),
mAssembler(set.assembler()),
@@ -1965,16 +1964,6 @@ void Settings::CompilerSet::setDebugger(const QString &name)
mDebugger = name;
}
-const QString &Settings::CompilerSet::profiler() const
-{
- return mProfiler;
-}
-
-void Settings::CompilerSet::setProfiler(const QString &name)
-{
- mProfiler = name;
-}
-
const QString &Settings::CompilerSet::resourceCompiler() const
{
return mResourceCompiler;
@@ -2348,7 +2337,6 @@ void Settings::CompilerSet::setExecutables()
}
mMake = findProgramInBinDirs(MAKE_PROGRAM);
mResourceCompiler = findProgramInBinDirs(WINDRES_PROGRAM);
- mProfiler = findProgramInBinDirs(GPROF_PROGRAM);
mAssembler = findProgramInBinDirs(ASSEMBLER);
}
@@ -3108,10 +3096,8 @@ void Settings::CompilerSets::saveSet(int index)
savePath("debug_server", pSet->debugServer());
savePath("make", pSet->make());
savePath("windres", pSet->resourceCompiler());
- savePath("profiler", pSet->profiler());
savePath("assembler", pSet->assembler());
-
mSettings->mSettings.remove("Options");
foreach(const PCompilerOption& option, CompilerInfoManager::getInstance()->getCompilerOptions(pSet->compilerType())) {
mSettings->mSettings.remove(option->key);
@@ -3188,7 +3174,6 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index)
pSet->setDebugServer(loadPath("debug_server"));
pSet->setMake(loadPath("make"));
pSet->setResourceCompiler(loadPath("windres"));
- pSet->setProfiler(loadPath("profiler"));
pSet->setAssembler(loadPath("assembler"));
pSet->setDumpMachine(mSettings->mSettings.value("DumpMachine").toString());
diff --git a/RedPandaIDE/settings.h b/RedPandaIDE/settings.h
index 439344ef..f2359b94 100644
--- a/RedPandaIDE/settings.h
+++ b/RedPandaIDE/settings.h
@@ -1332,8 +1332,6 @@ public:
void setMake(const QString& name);
const QString& debugger() const;
void setDebugger(const QString& name);
- const QString& profiler() const;
- void setProfiler(const QString& name);
const QString& resourceCompiler() const;
void setResourceCompiler(const QString& name);
const QString &debugServer() const;
@@ -1430,7 +1428,6 @@ public:
QString mCppCompiler;
QString mMake;
QString mDebugger;
- QString mProfiler;
QString mResourceCompiler;
QString mDebugServer;
QString mAssembler;
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
index b7096a24..8d96f36f 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp
@@ -98,7 +98,6 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet
ui->txtDebugger->setText(pSet->debugger());
ui->txtGDBServer->setText(pSet->debugServer());
ui->txtResourceCompiler->setText(pSet->resourceCompiler());
- ui->txtProfiler->setText(pSet->profiler());
ui->txtAssembler->setText(pSet->assembler());
if (pSet->execCharset() == ENCODING_AUTO_DETECT
@@ -208,7 +207,6 @@ void CompilerSetOptionWidget::saveCurrentCompilerSet()
pSet->setDebugger(ui->txtDebugger->text().trimmed());
pSet->setDebugServer(ui->txtGDBServer->text().trimmed());
pSet->setResourceCompiler(ui->txtResourceCompiler->text().trimmed());
- pSet->setProfiler(ui->txtProfiler->text().trimmed());
pSet->setAssembler(ui->txtAssembler->text().trimmed());
pSet->binDirs()=mBinDirWidget->dirList();
@@ -335,7 +333,6 @@ void CompilerSetOptionWidget::updateIcons(const QSize& /*size*/)
pIconsManager->setIcon(ui->btnChooseGDB, IconsManager::ACTION_FILE_OPEN_FOLDER);
pIconsManager->setIcon(ui->btnChooseGDBServer, IconsManager::ACTION_FILE_OPEN_FOLDER);
pIconsManager->setIcon(ui->btnChooseMake, IconsManager::ACTION_FILE_OPEN_FOLDER);
- pIconsManager->setIcon(ui->btnChooseProfiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
pIconsManager->setIcon(ui->btnChooseAssembler, IconsManager::ACTION_FILE_OPEN_FOLDER);
pIconsManager->setIcon(ui->btnChooseResourceCompiler, IconsManager::ACTION_FILE_OPEN_FOLDER);
}
@@ -437,18 +434,6 @@ void CompilerSetOptionWidget::on_btnChooseResourceCompiler_clicked()
}
-void CompilerSetOptionWidget::on_btnChooseProfiler_clicked()
-{
- QString fileName = QFileDialog::getOpenFileName(
- this,
- tr("Locate gprof"),
- getBinDir(),
- tr("Executable files (*.exe)"));
- if (fileExists(fileName))
- ui->txtProfiler->setText(fileName);
-}
-
-
void CompilerSetOptionWidget::on_btnChooseAssembler_clicked()
{
QString fileName = QFileDialog::getOpenFileName(
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.h b/RedPandaIDE/settingsdialog/compilersetoptionwidget.h
index 31bb261f..d13e47ec 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.h
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.h
@@ -70,7 +70,6 @@ private slots:
void on_btnChooseGDB_clicked();
void on_btnChooseGDBServer_clicked();
void on_btnChooseResourceCompiler_clicked();
- void on_btnChooseProfiler_clicked();
void on_btnChooseAssembler_clicked();
};
diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
index afc6694c..5d5735f7 100644
--- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
+++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui
@@ -110,7 +110,7 @@
-
- 3
+ 0
false
@@ -249,90 +249,16 @@
QFrame::Raised
-
-
-
-
- Choose Resource Compiler
-
+
-
+
+
+ -
+
+
+ -
+
- ...
-
-
-
- :/icons/images/newlook24/053-open.png
-
-
-
-
- -
-
-
- Choose C Compiler
-
-
- ...
-
-
-
- :/icons/images/newlook24/053-open.png
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- C++ Compiler(g++)
-
-
-
- -
-
-
- ...
-
-
-
- :/icons/images/newlook24/053-open.png:/icons/images/newlook24/053-open.png
-
-
-
- -
-
-
- -
-
-
- Choose C++ Compiler
-
-
- ...
-
-
-
- :/icons/images/newlook24/053-open.png
-
-
-
-
- -
-
-
- Choose Profiler
-
-
- ...
-
-
-
- :/icons/images/newlook24/053-open.png
-
+ make
@@ -351,16 +277,13 @@
- -
-
+
-
+
- make
+ C++ Compiler(g++)
- -
-
-
-
@@ -368,19 +291,24 @@
- -
-
+
-
+
- -
-
+
-
+
+
+ Choose C++ Compiler
+
- C Compiler(gcc)
+ ...
+
+
+
+ :/icons/images/newlook24/053-open.png
+
- -
-
-
-
@@ -396,30 +324,6 @@
- -
-
-
- Profiler(gprof)
-
-
-
- -
-
-
- -
-
-
- Resource Compiler(windres)
-
-
-
- -
-
-
- gdb
-
-
-
-
@@ -427,8 +331,18 @@
- -
-
+
-
+
+
+ -
+
+
+ C Compiler(gcc)
+
+
+
+ -
+
-
@@ -441,6 +355,67 @@
+ -
+
+
+ Choose C Compiler
+
+
+ ...
+
+
+
+ :/icons/images/newlook24/053-open.png
+
+
+
+
+ -
+
+
+ Resource Compiler(windres)
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Choose Resource Compiler
+
+
+ ...
+
+
+
+ :/icons/images/newlook24/053-open.png
+
+
+
+
+ -
+
+
+ ...
+
+
+
+ :/icons/images/newlook24/053-open.png:/icons/images/newlook24/053-open.png
+
+
+
+ -
+
+
+ gdb
+
+
+
diff --git a/RedPandaIDE/systemconsts.h b/RedPandaIDE/systemconsts.h
index c96b0056..0a6de1ca 100644
--- a/RedPandaIDE/systemconsts.h
+++ b/RedPandaIDE/systemconsts.h
@@ -30,7 +30,6 @@
#define GDB32_PROGRAM "gdb32.exe"
#define MAKE_PROGRAM "mingw32-make.exe"
#define WINDRES_PROGRAM "windres.exe"
-#define GPROF_PROGRAM "gprof.exe"
#define CLEAN_PROGRAM "del /q /f"
#define CPP_PROGRAM "cpp.exe"
#define GIT_PROGRAM "git.exe"
@@ -65,7 +64,6 @@
#define GDB32_PROGRAM "gdb32"
#define MAKE_PROGRAM "make"
#define WINDRES_PROGRAM ""
-#define GPROF_PROGRAM "gprof"
#define CLEAN_PROGRAM "rm -rf"
#define CPP_PROGRAM "cpp"
#define GIT_PROGRAM "git"
diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp
index 03a9ec4b..90786935 100644
--- a/libs/qsynedit/qsynedit/qsynedit.cpp
+++ b/libs/qsynedit/qsynedit/qsynedit.cpp
@@ -43,7 +43,9 @@
namespace QSynedit {
QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
- mDropped(false)
+ mDropped{false},
+ mLastWheelEventTime{QDateTime::currentMSecsSinceEpoch()},
+ mWheelEventTimes{0}
{
mCharWidth=1;
mTextHeight = 1;
@@ -3323,42 +3325,35 @@ void QSynEdit::updateModifiedStatus()
int QSynEdit::scanFrom(int Index, int canStopIndex)
{
- SyntaxState iRange;
- int Result = std::max(0,Index);
- if (Result >= mDocument->count())
- return Result;
+ SyntaxState state;
+ int result = std::max(0,Index);
+ if (result >= mDocument->count())
+ return result;
- if (Result == 0) {
+ if (result == 0) {
mSyntaxer->resetState();
} else {
- mSyntaxer->setState(mDocument->getSyntaxState(Result-1));
+ mSyntaxer->setState(mDocument->getSyntaxState(result-1));
}
do {
- mSyntaxer->setLine(mDocument->getLine(Result), Result);
+ mSyntaxer->setLine(mDocument->getLine(result), result);
mSyntaxer->nextToEol();
- iRange = mSyntaxer->getState();
- if (Result > canStopIndex){
- if (mDocument->getSyntaxState(Result) == iRange
- && mDocument->getSyntaxState(Result).blockLevel == iRange.blockLevel
- && mDocument->getSyntaxState(Result).blockStarted == iRange.blockStarted
- && mDocument->getSyntaxState(Result).blockEnded == iRange.blockEnded
- && mDocument->getSyntaxState(Result).blockEndedLastLine == iRange.blockEndedLastLine
- && mDocument->getSyntaxState(Result).braceLevel == iRange.braceLevel
- && mDocument->getSyntaxState(Result).parenthesisLevel == iRange.parenthesisLevel
- && mDocument->getSyntaxState(Result).bracketLevel == iRange.bracketLevel
+ state = mSyntaxer->getState();
+ if (result > canStopIndex){
+ if (mDocument->getSyntaxState(result) == state
) {
if (mUseCodeFolding)
rescanFolds();
- return Result;// avoid the final Decrement
+ return result;// avoid the final Decrement
}
}
- mDocument->setSyntaxState(Result,iRange);
- Result ++ ;
- } while (Result < mDocument->count());
- Result--;
+ mDocument->setSyntaxState(result,state);
+ result ++ ;
+ } while (result < mDocument->count());
+ result--;
if (mUseCodeFolding)
rescanFolds();
- return Result;
+ return result;
}
void QSynEdit::rescanRange(int line)
@@ -6336,6 +6331,15 @@ void QSynEdit::leaveEvent(QEvent *)
void QSynEdit::wheelEvent(QWheelEvent *event)
{
+ qint64 current=QDateTime::currentMSecsSinceEpoch();
+ if (current-mLastWheelEventTime<=1000) {
+ mWheelEventTimes+=1;
+ if (mWheelEventTimes>30)
+ return;
+ } else {
+ mWheelEventTimes=0;
+ mLastWheelEventTime=current;
+ }
if (event->modifiers() == Qt::ShiftModifier) {
if (event->angleDelta().y()>0) {
horizontalScrollBar()->setValue(horizontalScrollBar()->value()-mMouseWheelScrollSpeed);
diff --git a/libs/qsynedit/qsynedit/qsynedit.h b/libs/qsynedit/qsynedit/qsynedit.h
index 85c7e004..67774530 100644
--- a/libs/qsynedit/qsynedit/qsynedit.h
+++ b/libs/qsynedit/qsynedit/qsynedit.h
@@ -682,7 +682,6 @@ private:
PUndoList mUndoList;
PRedoList mRedoList;
QPoint mMouseDownPos;
- int mMouseWheelAccumulator;
EditCaretType mOverwriteCaret;
EditCaretType mInsertCaret;
QPoint mCaretOffset;
@@ -744,6 +743,8 @@ private:
BufferCoord mDragSelBeginSave;
BufferCoord mDragSelEndSave;
bool mDropped;
+ qint64 mLastWheelEventTime;
+ int mWheelEventTimes;
friend class QSynEditPainter;