Merge branch 'master' of github.com:royqh1979/RedPanda-CPP
# Conflicts: # NEWS.md
This commit is contained in:
commit
326d8ea5f7
8
NEWS.md
8
NEWS.md
|
@ -19,6 +19,14 @@ Red Panda C++ Version 0.13.3
|
|||
- fix: project files' charset settings doesn't work correctly
|
||||
- enhancement: add exec charset option to compiler set settings
|
||||
- enhancement: delete to word begin /delete to word end
|
||||
- fix: when open a file, all blank lines's indents are removed.
|
||||
- fix: indent lines displayed at wrong position, when there are folded lines
|
||||
- fix: if editor's active line color is disabled, caret's position may not be correct redrawn
|
||||
- fix: insert code snippets will crash, if current compiler set's include dir list is not empty and lib dir list is empty
|
||||
- fix: search around option can't be disabled
|
||||
- enhancement: show a confirm dialog when search/replace around
|
||||
- enhancement: auto zoom ui when screen's zoom factor changed (windows)
|
||||
- enhancement: parser not called when open a file, if option "clean parser symbols when hidden" is turned on.
|
||||
|
||||
Red Panda C++ Version 0.13.2
|
||||
- fix: "delete and exit" button in the environtment / folder option page doesn't work correctly
|
||||
|
|
|
@ -43,7 +43,7 @@ PSynHighlighter HighlighterManager::getHighlighter(const QString &filename)
|
|||
|| suffix == "CPP" || suffix =="H" || suffix == "c++"
|
||||
|| suffix == "h++") {
|
||||
return getCppHighlighter();
|
||||
} else if (suffix == "vs" || suffix == "fs") {
|
||||
} else if (suffix == "vs" || suffix == "fs" || suffix == "frag") {
|
||||
return getGLSLHighlighter();
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -32,7 +32,15 @@ AutolinkManager::AutolinkManager()
|
|||
|
||||
PAutolink AutolinkManager::getLink(const QString &header) const
|
||||
{
|
||||
return mLinks.value(header,PAutolink());
|
||||
PAutolink link = mLinks.value(header,PAutolink());
|
||||
if (link)
|
||||
return link;
|
||||
foreach (QString key, mLinks.keys()) {
|
||||
if (header.endsWith("/"+key, PATH_SENSITIVITY)) {
|
||||
return mLinks.value(key);
|
||||
}
|
||||
}
|
||||
return PAutolink();
|
||||
}
|
||||
|
||||
void AutolinkManager::load()
|
||||
|
|
|
@ -534,11 +534,10 @@ QString Compiler::parseFileIncludesForAutolink(
|
|||
PCppParser& parser)
|
||||
{
|
||||
QString result;
|
||||
QString baseName = extractFileName(filename);
|
||||
if (parsedFiles.contains(filename))
|
||||
return result;
|
||||
parsedFiles.insert(filename);
|
||||
PAutolink autolink = pAutolinkManager->getLink(baseName);
|
||||
PAutolink autolink = pAutolinkManager->getLink(filename);
|
||||
if (autolink) {
|
||||
result += ' '+autolink->linkOption;
|
||||
}
|
||||
|
|
|
@ -100,11 +100,6 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
|||
mFilename = tr("untitled")+QString("%1").arg(getNewFileNumber());
|
||||
}
|
||||
QFileInfo fileInfo(mFilename);
|
||||
if (mParentPageControl!=nullptr) {
|
||||
mParentPageControl->addTab(this,"");
|
||||
updateCaption();
|
||||
}
|
||||
|
||||
PSynHighlighter highlighter;
|
||||
if (!isNew) {
|
||||
loadFile();
|
||||
|
@ -134,7 +129,6 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
|||
&& mParser && (mParser->isSystemHeaderFile(mFilename) || mParser->isProjectHeaderFile(mFilename))) {
|
||||
this->setModified(false);
|
||||
setReadOnly(true);
|
||||
updateCaption();
|
||||
}
|
||||
|
||||
mCompletionPopup = pMainWindow->completionPopup();
|
||||
|
@ -180,6 +174,10 @@ Editor::Editor(QWidget *parent, const QString& filename,
|
|||
resetBreakpoints();
|
||||
}
|
||||
mStatementColors = pMainWindow->statementColors();
|
||||
if (mParentPageControl!=nullptr) {
|
||||
mParentPageControl->addTab(this,"");
|
||||
updateCaption();
|
||||
}
|
||||
}
|
||||
|
||||
Editor::~Editor() {
|
||||
|
@ -524,12 +522,6 @@ void Editor::wheelEvent(QWheelEvent *event) {
|
|||
void Editor::focusInEvent(QFocusEvent *event)
|
||||
{
|
||||
SynEdit::focusInEvent(event);
|
||||
if (mParser) {
|
||||
connect(mParser.get(),
|
||||
&CppParser::onEndParsing,
|
||||
this,
|
||||
&SynEdit::invalidate);
|
||||
}
|
||||
pMainWindow->updateAppTitle();
|
||||
pMainWindow->updateEditorActions();
|
||||
pMainWindow->updateStatusbarForLineCol();
|
||||
|
@ -540,12 +532,6 @@ void Editor::focusInEvent(QFocusEvent *event)
|
|||
void Editor::focusOutEvent(QFocusEvent *event)
|
||||
{
|
||||
SynEdit::focusOutEvent(event);
|
||||
if (mParser) {
|
||||
disconnect(mParser.get(),
|
||||
&CppParser::onEndParsing,
|
||||
this,
|
||||
&SynEdit::invalidate);
|
||||
}
|
||||
//pMainWindow->updateClassBrowserForEditor(nullptr);
|
||||
pMainWindow->updateStatusbarForLineCol();
|
||||
pMainWindow->updateForStatusbarModeInfo();
|
||||
|
@ -1195,6 +1181,40 @@ void Editor::closeEvent(QCloseEvent *)
|
|||
pMainWindow->functionTip()->hide();
|
||||
}
|
||||
|
||||
void Editor::showEvent(QShowEvent */*event*/)
|
||||
{
|
||||
if (pSettings->codeCompletion().clearWhenEditorHidden()
|
||||
&& !inProject()) {
|
||||
initParser();
|
||||
}
|
||||
if (mParser) {
|
||||
connect(mParser.get(),
|
||||
&CppParser::onEndParsing,
|
||||
this,
|
||||
&SynEdit::invalidate);
|
||||
}
|
||||
if (pSettings->codeCompletion().clearWhenEditorHidden()
|
||||
&& !inProject()) {
|
||||
reparse();
|
||||
}
|
||||
reparseTodo();
|
||||
setHideTime(QDateTime());
|
||||
}
|
||||
|
||||
void Editor::hideEvent(QHideEvent */*event*/)
|
||||
{
|
||||
if (mParser) {
|
||||
disconnect(mParser.get(),
|
||||
&CppParser::onEndParsing,
|
||||
this,
|
||||
&SynEdit::invalidate);
|
||||
}
|
||||
if (pSettings->codeCompletion().clearWhenEditorHidden()
|
||||
&& !inProject() && mParser)
|
||||
mParser->reset();
|
||||
setHideTime(QDateTime::currentDateTime());
|
||||
}
|
||||
|
||||
void Editor::copyToClipboard()
|
||||
{
|
||||
if (pSettings->editor().copySizeLimit()) {
|
||||
|
@ -3124,7 +3144,7 @@ QString Editor::getFileHint(const QString &s)
|
|||
return "";
|
||||
}
|
||||
|
||||
QString Editor::getParserHint(const QStringList& expression,const QString &s, int line)
|
||||
QString Editor::getParserHint(const QStringList& expression,const QString &/*s*/, int line)
|
||||
{
|
||||
// This piece of code changes the parser database, possibly making hints and code completion invalid...
|
||||
QString result;
|
||||
|
|
|
@ -372,6 +372,11 @@ protected:
|
|||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void inputMethodEvent(QInputMethodEvent *) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
// QWidget interface
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
};
|
||||
|
||||
QString getWordAtPosition(SynEdit* editor,
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QStringList>
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDir>
|
||||
#include "common.h"
|
||||
#include "colorscheme.h"
|
||||
|
@ -60,7 +61,8 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/
|
|||
}
|
||||
break;
|
||||
case WM_DPICHANGED:
|
||||
//todo
|
||||
setDesktopDpi(HIWORD(pMsg->wParam));
|
||||
pMainWindow->updateDPI();
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
@ -159,6 +161,7 @@ int main(int argc, char *argv[])
|
|||
//set default open folder
|
||||
QDir::setCurrent(pSettings->environment().defaultOpenFolder());
|
||||
|
||||
setDesktopDpi(qApp->desktop()->logicalDpiY());
|
||||
|
||||
MainWindow mainWindow;
|
||||
pMainWindow = &mainWindow;
|
||||
|
|
|
@ -689,6 +689,11 @@ void MainWindow::setActiveBreakpoint(QString FileName, int Line, bool setFocus)
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateDPI()
|
||||
{
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void MainWindow::updateAppTitle()
|
||||
{
|
||||
QString appName=tr("Red Panda C++");
|
||||
|
@ -949,8 +954,6 @@ void MainWindow::openFiles(const QStringList &files)
|
|||
auto end = finally([this] {
|
||||
this->mEditorList->endUpdate();
|
||||
mOpenningFiles = false;
|
||||
updateEditorParser(ui->EditorTabsLeft);
|
||||
updateEditorParser(ui->EditorTabsRight);
|
||||
});
|
||||
//Check if there is a project file in the list and open it
|
||||
for (const QString& file:files) {
|
||||
|
@ -5217,39 +5220,6 @@ PSymbolUsageManager &MainWindow::symbolUsageManager()
|
|||
return mSymbolUsageManager;
|
||||
}
|
||||
|
||||
void MainWindow::updateEditorParser(QTabWidget* tabWidget) {
|
||||
if (mOpenningFiles)
|
||||
return;
|
||||
Editor * editor = mEditorList->getEditor(-1,tabWidget);
|
||||
if (pSettings->codeCompletion().clearWhenEditorHidden()) {
|
||||
for (int i=0;i<tabWidget->count();i++) {
|
||||
Editor * e = (Editor*)(tabWidget->widget(i));
|
||||
if (!e->inProject()) {
|
||||
if (e!=editor && e->parser() && !e->notParsed()) {
|
||||
e->parser()->reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (editor && editor->parser() && editor->notParsed()) {
|
||||
resetCppParser(editor->parser());
|
||||
editor->reparse();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateEditorHideTime(QTabWidget* tabWidget) {
|
||||
Editor * editor = mEditorList->getEditor(-1,tabWidget);
|
||||
for (int i=0;i<tabWidget->count();i++) {
|
||||
Editor * e = (Editor*)(tabWidget->widget(i));
|
||||
if (e!=editor) {
|
||||
if (!e->hideTime().isValid())
|
||||
e->setHideTime(QDateTime::currentDateTime());
|
||||
} else {
|
||||
e->setHideTime(QDateTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::showHideInfosTab(QWidget *widget, bool show)
|
||||
{
|
||||
int idx = findTabIndex(ui->tabInfos,widget);
|
||||
|
@ -5388,26 +5358,13 @@ void MainWindow::onEditorRenamed(const QString &oldFilename, const QString &newF
|
|||
|
||||
void MainWindow::on_EditorTabsLeft_currentChanged(int)
|
||||
{
|
||||
Editor * editor = mEditorList->getEditor(-1,ui->EditorTabsLeft);
|
||||
if (editor) {
|
||||
editor->reparseTodo();
|
||||
}
|
||||
updateEditorParser(ui->EditorTabsLeft);
|
||||
updateEditorHideTime(ui->EditorTabsLeft);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_EditorTabsRight_currentChanged(int)
|
||||
{
|
||||
Editor * editor = mEditorList->getEditor(-1,ui->EditorTabsRight);
|
||||
if (editor) {
|
||||
editor->reparseTodo();
|
||||
}
|
||||
updateEditorParser(ui->EditorTabsRight);
|
||||
updateEditorHideTime(ui->EditorTabsRight);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_tableTODO_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
PTodoItem item = mTodoModel.getItem(index);
|
||||
|
@ -5417,7 +5374,6 @@ void MainWindow::on_tableTODO_doubleClicked(const QModelIndex &index)
|
|||
editor->setCaretPositionAndActivate(item->lineNo,item->ch+1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -215,6 +215,7 @@ public slots:
|
|||
void onTodoParsing(const QString& filename, int lineNo, int ch, const QString& line);
|
||||
void onTodoParseFinished();
|
||||
void setActiveBreakpoint(QString FileName, int Line, bool setFocus);
|
||||
void updateDPI();
|
||||
|
||||
private:
|
||||
void prepareProjectForCompile();
|
||||
|
@ -242,8 +243,6 @@ private:
|
|||
void doCompileRun(RunType runType);
|
||||
void updateProblemCaseOutput(POJProblemCase problemCase);
|
||||
void applyCurrentProblemCaseChanges();
|
||||
void updateEditorParser(QTabWidget* tabWidget);
|
||||
void updateEditorHideTime(QTabWidget* tabWidget);
|
||||
void showHideInfosTab(QWidget *widget, bool show);
|
||||
void showHideMessagesTab(QWidget *widget, bool show);
|
||||
void prepareTabInfosData();
|
||||
|
|
|
@ -266,14 +266,8 @@ void SynEdit::setCaretXYEx(bool CallEnsureCursorPosVisible, BufferCoord value)
|
|||
if (mCaretY != value.Line) {
|
||||
int oldCaretY = mCaretY;
|
||||
mCaretY = value.Line;
|
||||
if (mActiveLineColor.isValid()) {
|
||||
invalidateLine(mCaretY);
|
||||
invalidateLine(oldCaretY);
|
||||
}
|
||||
if (mGutter.activeLineTextColor().isValid()) {
|
||||
invalidateGutterLine(mCaretY);
|
||||
invalidateGutterLine(oldCaretY);
|
||||
}
|
||||
invalidateLine(mCaretY);
|
||||
invalidateLine(oldCaretY);
|
||||
mStatusChanges.setFlag(SynStatusChange::scCaretY);
|
||||
}
|
||||
// Call UpdateLastCaretX before DecPaintLock because the event handler it
|
||||
|
@ -4761,7 +4755,7 @@ void SynEdit::doSetSelText(const QString &Value)
|
|||
}
|
||||
|
||||
int SynEdit::searchReplace(const QString &sSearch, const QString &sReplace, SynSearchOptions sOptions, PSynSearchBase searchEngine,
|
||||
SynSearchMathedProc matchedCallback)
|
||||
SynSearchMathedProc matchedCallback, SynSearchConfirmAroundProc confirmAroundCallback)
|
||||
{
|
||||
if (!searchEngine)
|
||||
return 0;
|
||||
|
@ -4923,9 +4917,10 @@ int SynEdit::searchReplace(const QString &sSearch, const QString &sReplace, SynS
|
|||
ptCurrent.Line--;
|
||||
else
|
||||
ptCurrent.Line++;
|
||||
if (
|
||||
((ptCurrent.Line < ptStart.Line) || (ptCurrent.Line > ptEnd.Line))
|
||||
&& bFromCursor){
|
||||
if (((ptCurrent.Line < ptStart.Line) || (ptCurrent.Line > ptEnd.Line))
|
||||
&& bFromCursor && sOptions.testFlag(ssoWrapAround)){
|
||||
if (confirmAroundCallback && !confirmAroundCallback())
|
||||
break;
|
||||
//search start from cursor, search has finished but no result founds
|
||||
bFromCursor = false;
|
||||
ptStart.Char = 1;
|
||||
|
|
|
@ -147,6 +147,7 @@ using SynPaintProc = std::function<void(const QPaintDevice& paintDevice )>;
|
|||
// SynFontStyles& style, QColor& foreground, QColor& background)>;
|
||||
using SynSearchMathedProc = std::function<SynSearchAction(const QString& sSearch,
|
||||
const QString& sReplace, int Line, int ch, int wordLen)>;
|
||||
using SynSearchConfirmAroundProc = std::function<bool ()>;
|
||||
|
||||
class SynEdit;
|
||||
using PSynEdit = std::shared_ptr<SynEdit>;
|
||||
|
@ -244,7 +245,8 @@ public:
|
|||
void setSelText(const QString& text);
|
||||
|
||||
int searchReplace(const QString& sSearch, const QString& sReplace, SynSearchOptions options,
|
||||
PSynSearchBase searchEngine, SynSearchMathedProc matchedCallback = nullptr);
|
||||
PSynSearchBase searchEngine, SynSearchMathedProc matchedCallback = nullptr,
|
||||
SynSearchConfirmAroundProc confirmAroundCallback = nullptr);
|
||||
|
||||
int maxScrollWidth() const;
|
||||
int maxScrollHeight() const;
|
||||
|
|
|
@ -556,18 +556,25 @@ void SynEditStringList::loadFromFile(const QString& filename, const QByteArray&
|
|||
}
|
||||
internalClear();
|
||||
while (true) {
|
||||
if (line.endsWith("\r\n")) {
|
||||
line.remove(line.length()-2,2);
|
||||
} else if (line.endsWith("\r")) {
|
||||
line.remove(line.length()-1,1);
|
||||
} else if (line.endsWith("\n")){
|
||||
line.remove(line.length()-1,1);
|
||||
}
|
||||
if (allAscii) {
|
||||
allAscii = isTextAllAscii(line);
|
||||
}
|
||||
if (allAscii) {
|
||||
addItem(trimRight(QString::fromLatin1(line)));
|
||||
addItem(QString::fromLatin1(line));
|
||||
} else {
|
||||
QString newLine = codec->toUnicode(line.constData(),line.length(),&state);
|
||||
if (state.invalidChars>0) {
|
||||
needReread = true;
|
||||
break;
|
||||
}
|
||||
addItem(trimRight(newLine));
|
||||
addItem(newLine);
|
||||
}
|
||||
if (file.atEnd()){
|
||||
break;
|
||||
|
@ -600,7 +607,14 @@ void SynEditStringList::loadFromFile(const QString& filename, const QByteArray&
|
|||
QString line;
|
||||
internalClear();
|
||||
while (textStream.readLineInto(&line)) {
|
||||
addItem(trimRight(line));
|
||||
if (line.endsWith("\r\n")) {
|
||||
line.remove(line.length()-2,2);
|
||||
} else if (line.endsWith("\r")) {
|
||||
line.remove(line.length()-1,1);
|
||||
} else if (line.endsWith("\n")){
|
||||
line.remove(line.length()-1,1);
|
||||
}
|
||||
addItem(line);
|
||||
}
|
||||
emit inserted(0,mList.count());
|
||||
}
|
||||
|
|
|
@ -723,7 +723,7 @@ void SynEditTextPainter::PaintFoldAttributes()
|
|||
if (vLine > edit->mLines->count() && edit->mLines->count() > 0)
|
||||
break;
|
||||
// Set vertical coord
|
||||
Y = (vLine - edit->mTopLine) * edit->mTextHeight; // limit inside clip rect
|
||||
Y = (cRow - edit->mTopLine) * edit->mTextHeight; // limit inside clip rect
|
||||
if (edit->mTextHeight % 2 == 1 && vLine % 2 == 0) {
|
||||
Y++;
|
||||
}
|
||||
|
|
|
@ -1591,22 +1591,22 @@ bool Settings::CompilerSet::validateExes(QString &msg)
|
|||
msg ="";
|
||||
if (!fileExists(mCCompiler)) {
|
||||
msg += QObject::tr("Cannot find the %1 \"%2\"")
|
||||
.arg("C Compiler")
|
||||
.arg(QObject::tr("C Compiler"))
|
||||
.arg(mCCompiler);
|
||||
}
|
||||
if (!fileExists(mCppCompiler)) {
|
||||
msg += QObject::tr("Cannot find the %1 \"%2\"")
|
||||
.arg("C++ Compiler")
|
||||
.arg(QObject::tr("C++ Compiler"))
|
||||
.arg(mCppCompiler);
|
||||
}
|
||||
if (!fileExists(mMake)) {
|
||||
if (!mMake.isEmpty() && !fileExists(mMake)) {
|
||||
msg += QObject::tr("Cannot find the %1 \"%2\"")
|
||||
.arg("Maker")
|
||||
.arg(QObject::tr("Maker"))
|
||||
.arg(mMake);
|
||||
}
|
||||
if (!fileExists(mDebugger)) {
|
||||
msg += QObject::tr("Cannot find the %1 \"%2\"")
|
||||
.arg("Maker")
|
||||
.arg(QObject::tr("Debugger"))
|
||||
.arg(mDebugger);
|
||||
}
|
||||
if (!msg.isEmpty())
|
||||
|
@ -2533,22 +2533,27 @@ void Settings::CompilerSets::clearSets()
|
|||
void Settings::CompilerSets::findSets()
|
||||
{
|
||||
clearSets();
|
||||
QSet<QString> searched;
|
||||
#ifdef Q_OS_WIN
|
||||
addSets(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW32"+QDir::separator()+"bin");
|
||||
addSets(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW64"+QDir::separator()+"bin");
|
||||
searched.insert(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW32"+QDir::separator()+"bin");
|
||||
searched.insert(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW64"+QDir::separator()+"bin");
|
||||
#endif
|
||||
|
||||
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
QString path = env.value("PATH");
|
||||
QStringList pathList = path.split(PATH_SEPARATOR);
|
||||
QSet<QString> searched;
|
||||
foreach (const QString& s, pathList){
|
||||
if (searched.contains(s))
|
||||
continue;;
|
||||
searched.insert(s);
|
||||
if (s!="/bin") // /bin/gcc is symbolic link to /usr/bin/gcc
|
||||
if (s!="/bin") { // /bin/gcc is symbolic link to /usr/bin/gcc
|
||||
addSets(s);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Settings::CompilerSets::saveSets()
|
||||
|
|
|
@ -59,7 +59,6 @@ CompilerSetOptionWidget::~CompilerSetOptionWidget()
|
|||
|
||||
void CompilerSetOptionWidget::init()
|
||||
{
|
||||
ui->cbEncoding->setVisible(false);
|
||||
ui->cbEncodingDetails->setVisible(false);
|
||||
ui->cbEncoding->clear();
|
||||
ui->cbEncoding->addItem(tr("ANSI"),ENCODING_SYSTEM_DEFAULT);
|
||||
|
@ -144,7 +143,6 @@ static void loadCompilerSetSettings(Settings::PCompilerSet pSet, Ui::CompilerSet
|
|||
ui->txtResourceCompiler->setText(pSet->resourceCompiler());
|
||||
ui->txtProfiler->setText(pSet->profiler());
|
||||
|
||||
ui->cbEncoding->setVisible(pSet->autoAddCharsetParams());
|
||||
if (pSet->execCharset() == ENCODING_AUTO_DETECT
|
||||
|| pSet->execCharset() == ENCODING_SYSTEM_DEFAULT
|
||||
|| pSet->execCharset() == ENCODING_UTF8) {
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
<item>
|
||||
<widget class="QCheckBox" name="chkAutoAddCharset">
|
||||
<property name="text">
|
||||
<string>Add Charset arguments when calling the compiler</string>
|
||||
<string>Convert Executable's Charset as</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -50,6 +50,7 @@ void EditorCodeCompletionWidget::doLoad()
|
|||
ui->chkIgnoreCases->setChecked(pSettings->codeCompletion().ignoreCase());
|
||||
ui->chkAppendFunc->setChecked(pSettings->codeCompletion().appendFunc());
|
||||
ui->chkShowCodeIns->setChecked(pSettings->codeCompletion().showCodeIns());
|
||||
ui->chkClearWhenEditorHidden->setChecked(pSettings->codeCompletion().clearWhenEditorHidden());
|
||||
|
||||
ui->spinMinCharRequired->setValue(pSettings->codeCompletion().minCharRequired());
|
||||
}
|
||||
|
@ -74,6 +75,7 @@ void EditorCodeCompletionWidget::doSave()
|
|||
pSettings->codeCompletion().setShowCodeIns(ui->chkShowCodeIns->isChecked());
|
||||
pSettings->codeCompletion().setMinCharRequired(ui->spinMinCharRequired->value());
|
||||
|
||||
pSettings->codeCompletion().setClearWhenEditorHidden(ui->chkClearWhenEditorHidden->isChecked());
|
||||
|
||||
pSettings->codeCompletion().save();
|
||||
}
|
||||
|
|
|
@ -825,7 +825,7 @@ QString parseMacros(const QString &s)
|
|||
|
||||
// Only provide the first lib dir
|
||||
if (compilerSet->defaultLibDirs().count()>0)
|
||||
result.replace("<LIB>", localizePath(compilerSet->defaultCppIncludeDirs().front()));
|
||||
result.replace("<LIB>", localizePath(compilerSet->defaultLibDirs().front()));
|
||||
else
|
||||
result.replace("<LIB>","");
|
||||
}
|
||||
|
@ -1001,12 +1001,12 @@ QString localizePath(const QString &path)
|
|||
|
||||
float pointToPixel(float point)
|
||||
{
|
||||
return point * qApp->desktop()->logicalDpiY() / 72;
|
||||
return point * desktopDpi() / 72;
|
||||
}
|
||||
|
||||
float pixelToPoint(float pixel)
|
||||
{
|
||||
return pixel * 72 / qApp->desktop()->logicalDpiY();
|
||||
return pixel * 72 / desktopDpi();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1076,9 +1076,12 @@ QStringList splitProcessCommand(const QString &cmd)
|
|||
return result;
|
||||
}
|
||||
|
||||
static float saved_desktop_dpi = -1;
|
||||
float desktopDpi()
|
||||
{
|
||||
return qApp->desktop()->logicalDpiY();
|
||||
if (saved_desktop_dpi<1)
|
||||
saved_desktop_dpi = qApp->desktop()->logicalDpiY();
|
||||
return saved_desktop_dpi;
|
||||
}
|
||||
|
||||
qulonglong stringToHex(const QString &str, qulonglong defaultValue)
|
||||
|
@ -1089,3 +1092,8 @@ qulonglong stringToHex(const QString &str, qulonglong defaultValue)
|
|||
return value;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
void setDesktopDpi(float dpi)
|
||||
{
|
||||
saved_desktop_dpi = dpi;
|
||||
}
|
||||
|
|
|
@ -232,6 +232,8 @@ class CppParser;
|
|||
void resetCppParser(std::shared_ptr<CppParser> parser, int compilerSetIndex=-1);
|
||||
|
||||
float desktopDpi();
|
||||
void setDesktopDpi(float dpi);
|
||||
|
||||
float pointToPixel(float point);
|
||||
float pixelToPoint(float pixel);
|
||||
|
||||
|
|
|
@ -250,7 +250,15 @@ void SearchDialog::on_btnExecute_clicked()
|
|||
if (actionType == SearchAction::Find) {
|
||||
Editor *e = pMainWindow->editorList()->getEditor();
|
||||
if (e!=nullptr) {
|
||||
findCount+=execute(e,ui->cbFind->currentText(),"");
|
||||
findCount+=execute(e,ui->cbFind->currentText(),"",nullptr,
|
||||
[](){
|
||||
return QMessageBox::question(pMainWindow,
|
||||
tr("Continue Search"),
|
||||
tr("End of file has been reached. ")
|
||||
+tr("Do you want to continue from file's beginning?"),
|
||||
QMessageBox::Yes|QMessageBox::No,
|
||||
QMessageBox::Yes) == QMessageBox::Yes;
|
||||
});
|
||||
}
|
||||
} else if (actionType == SearchAction::Replace) {
|
||||
Editor *e = pMainWindow->editorList()->getEditor();
|
||||
|
@ -279,6 +287,14 @@ void SearchDialog::on_btnExecute_clicked()
|
|||
} else {
|
||||
return SynSearchAction::ReplaceAll;
|
||||
}
|
||||
},
|
||||
[](){
|
||||
return QMessageBox::question(pMainWindow,
|
||||
tr("Continue Replace"),
|
||||
tr("End of file has been reached. ")
|
||||
+tr("Do you want to continue from file's beginning?"),
|
||||
QMessageBox::Yes|QMessageBox::No,
|
||||
QMessageBox::Yes) == QMessageBox::Yes;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -376,7 +392,9 @@ void SearchDialog::on_btnExecute_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
int SearchDialog::execute(SynEdit *editor, const QString &sSearch, const QString &sReplace, SynSearchMathedProc matchCallback)
|
||||
int SearchDialog::execute(SynEdit *editor, const QString &sSearch, const QString &sReplace,
|
||||
SynSearchMathedProc matchCallback,
|
||||
SynSearchConfirmAroundProc confirmAroundCallback)
|
||||
{
|
||||
if (editor==nullptr)
|
||||
return 0;
|
||||
|
@ -398,7 +416,7 @@ int SearchDialog::execute(SynEdit *editor, const QString &sSearch, const QString
|
|||
}
|
||||
|
||||
return editor->searchReplace(sSearch, sReplace, mSearchOptions,
|
||||
mSearchEngine, matchCallback);
|
||||
mSearchEngine, matchCallback, confirmAroundCallback);
|
||||
}
|
||||
|
||||
std::shared_ptr<SearchResultTreeItem> SearchDialog::batchFindInEditor(SynEdit *e, const QString& filename,const QString &keyword)
|
||||
|
|
|
@ -61,7 +61,9 @@ private slots:
|
|||
void on_btnExecute_clicked();
|
||||
private:
|
||||
int execute(SynEdit* editor, const QString& sSearch,
|
||||
const QString& sReplace, SynSearchMathedProc matchCallback = nullptr);
|
||||
const QString& sReplace,
|
||||
SynSearchMathedProc matchCallback = nullptr,
|
||||
SynSearchConfirmAroundProc confirmAroundCallback = nullptr);
|
||||
std::shared_ptr<SearchResultTreeItem> batchFindInEditor(SynEdit * editor,const QString& filename, const QString& keyword);
|
||||
private:
|
||||
Ui::SearchDialog *ui;
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
redpanda-cpp (0.13.3-1) unstable; urgency=medium
|
||||
|
||||
* Update to 0.13.3
|
||||
|
||||
-- Roy Qu (瞿华) <royqh1979@gmail.com> Mon, 24 Jan 2022 21:50:00 +0800
|
||||
|
||||
redpanda-cpp (0.13.2-1) unstable; urgency=medium
|
||||
|
||||
* Update to 0.13.2
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Startup
|
||||
|
||||
!include "config32.nsh"
|
||||
!define FINALNAME "RedPanda.C++.32bit.${DEVCPP_VERSION}.No.Compiler.Setup.exe"
|
||||
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win32.No.Compiler.Setup.exe"
|
||||
!define DISPLAY_NAME "Red Panda C++ 32bit ${DEVCPP_VERSION}"
|
||||
|
||||
!include "MUI2.nsh"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
!include "config32.nsh"
|
||||
!define COMPILERFOLDER "MinGW32"
|
||||
!define FINALNAME "RedPanda.C++.32bit.${DEVCPP_VERSION}.${COMPILERNAME}.Setup.exe"
|
||||
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win32.${COMPILERNAME}.Setup.exe"
|
||||
!define DISPLAY_NAME "Red Panda C++ 32 bit ${DEVCPP_VERSION}"
|
||||
|
||||
!include "MUI2.nsh"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Startup
|
||||
|
||||
!include "config.nsh"
|
||||
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.No.Compiler.Setup.exe"
|
||||
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win64.No.Compiler.Setup.exe"
|
||||
!define DISPLAY_NAME "Red Panda C++ ${DEVCPP_VERSION}"
|
||||
|
||||
!include "MUI2.nsh"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
!include "config.nsh"
|
||||
!define COMPILERFOLDER "MinGW64"
|
||||
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.${COMPILERNAME}.Setup.exe"
|
||||
!define FINALNAME "RedPanda.C++.${DEVCPP_VERSION}.win64.${COMPILERNAME}.Setup.exe"
|
||||
!define DISPLAY_NAME "Red Panda C++ ${DEVCPP_VERSION}"
|
||||
|
||||
!include "MUI2.nsh"
|
||||
|
|
Loading…
Reference in New Issue