mirror of https://gitee.com/cxasm/notepad--.git
commit
5d2266e53a
|
@ -1,18 +0,0 @@
|
|||
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
|
||||
QMAKE_CXX.QMAKE_MSC_VER = 1916
|
||||
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191627048
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_MSC_VER \
|
||||
QMAKE_MSC_FULL_VER
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x64" \
|
||||
"C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x64"
|
|
@ -1,4 +1,4 @@
|
|||
#include "CmpareMode.h"
|
||||
#include "CmpareMode.h"
|
||||
#include "Encode.h"
|
||||
#include "rcglobal.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <qobject.h>
|
||||
#include<QVector>
|
||||
#include<QMap>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include <random>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "aboutndd.h"
|
||||
#include "aboutndd.h"
|
||||
|
||||
AboutNdd::AboutNdd(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_aboutndd.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "batchfindreplace.h"
|
||||
#include "batchfindreplace.h"
|
||||
#include "scintillaeditview.h"
|
||||
#include "ccnotepad.h"
|
||||
#include "progresswin.h"
|
||||
|
@ -31,7 +31,7 @@ void BatchFindReplace::setTabWidget(QTabWidget* editTabWidget)
|
|||
m_editTabWidget = editTabWidget;
|
||||
}
|
||||
|
||||
//自动调整当前窗口的状态,如果发生了变化,则需要认定为是首次查找
|
||||
//自动调整当前窗口的状态,如果发生了变化,则需要认定为是首次查找
|
||||
QWidget* BatchFindReplace::autoAdjustCurrentEditWin()
|
||||
{
|
||||
QWidget* pw = m_editTabWidget->currentWidget();
|
||||
|
@ -53,7 +53,7 @@ void BatchFindReplace::appendToFindTable(QString findKeyword)
|
|||
ui.findReplaceTable->setItem(rNum, 1, new QTableWidgetItem());
|
||||
}
|
||||
|
||||
//这里不能追加,而是插入,即对应的Item必须已经存在。否则不插入
|
||||
//这里不能追加,而是插入,即对应的Item必须已经存在。否则不插入
|
||||
void BatchFindReplace::insertToReplaceTable(int row, QString replaceKeyword)
|
||||
{
|
||||
QTableWidgetItem* item = ui.findReplaceTable->item(row, 1);
|
||||
|
@ -97,11 +97,11 @@ void BatchFindReplace::appendToFindReplaceTable(QStringList& findKeyword)
|
|||
|
||||
bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outputKeyWordList)
|
||||
{
|
||||
//把空白字符,空格或者\t \r\n 等字符进行替换为空格
|
||||
//把空白字符,空格或者\t \r\n 等字符进行替换为空格
|
||||
QRegExp re("\\s");
|
||||
findKeyWord.replace(re, QString(" "));
|
||||
|
||||
//再进行空格分隔处理
|
||||
//再进行空格分隔处理
|
||||
outputKeyWordList = findKeyWord.split(" ");
|
||||
|
||||
if (outputKeyWordList.size() > 20000)
|
||||
|
@ -110,7 +110,7 @@ bool BatchFindReplace::tranInputKeyword(QString& findKeyWord, QStringList& outpu
|
|||
return false;
|
||||
}
|
||||
|
||||
//删除每一个空的元素
|
||||
//删除每一个空的元素
|
||||
for (int i = outputKeyWordList.size() - 1; i >= 0; --i)
|
||||
{
|
||||
if (outputKeyWordList[i].trimmed().isEmpty())
|
||||
|
@ -166,7 +166,7 @@ void BatchFindReplace::on_freshBtClick()
|
|||
}
|
||||
}
|
||||
|
||||
//进行批量查找工作
|
||||
//进行批量查找工作
|
||||
void BatchFindReplace::on_findBtClick()
|
||||
{
|
||||
if (m_mainNotepad != nullptr && m_mainNotepad)
|
||||
|
@ -213,7 +213,7 @@ void BatchFindReplace::on_findBtClick()
|
|||
}
|
||||
}
|
||||
|
||||
//进行批量替换工作
|
||||
//进行批量替换工作
|
||||
void BatchFindReplace::on_replaceBtClick()
|
||||
{
|
||||
if (m_mainNotepad != nullptr && m_mainNotepad)
|
||||
|
@ -306,9 +306,9 @@ void BatchFindReplace::on_import()
|
|||
QFileDialog fd(this, QString(), CCNotePad::s_lastOpenDirPath);
|
||||
fd.setFileMode(QFileDialog::ExistingFile);
|
||||
|
||||
if (fd.exec() == QDialog::Accepted) //如果成功的执行
|
||||
if (fd.exec() == QDialog::Accepted) //如果成功的执行
|
||||
{
|
||||
QStringList fileNameList = fd.selectedFiles(); //返回文件列表的名称
|
||||
QStringList fileNameList = fd.selectedFiles(); //返回文件列表的名称
|
||||
QFileInfo fi(fileNameList[0]);
|
||||
|
||||
QSettings setting(fi.filePath(), QSettings::IniFormat);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTabWidget>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "bigfilemessage.h"
|
||||
#include "bigfilemessage.h"
|
||||
|
||||
BigFileMessage::BigFileMessage(QWidget *parent)
|
||||
: QDialog(parent), m_result(-1)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include "ccnotepad.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <memory>
|
||||
#include <memory>
|
||||
#include "ccnotepad.h"
|
||||
#include "filemanager.h"
|
||||
#include "Encode.h"
|
||||
|
@ -1475,21 +1475,14 @@ void CCNotePad::setUserDefShortcutKey(int shortcutId)
|
|||
ui.actionGoline->setShortcut(keySeq);
|
||||
|
||||
break;
|
||||
|
||||
case File_Compare_ID:
|
||||
keySeq = ShortcutKeyMgr::getUserDefShortcutKey(File_Compare);
|
||||
m_fileCompare->setShortcut(keySeq);
|
||||
|
||||
break;
|
||||
case Dir_Compare_ID:
|
||||
keySeq = ShortcutKeyMgr::getUserDefShortcutKey(Dir_Compare);
|
||||
m_dirCompare->setShortcut(keySeq);
|
||||
|
||||
break;
|
||||
case Bin_Compare_ID:
|
||||
keySeq = ShortcutKeyMgr::getUserDefShortcutKey(Bin_Compare);
|
||||
m_binCompare->setShortcut(keySeq);
|
||||
|
||||
break;
|
||||
|
||||
case Trans_code_ID:
|
||||
keySeq = ShortcutKeyMgr::getUserDefShortcutKey(Trans_code);
|
||||
m_transcode->setShortcut(keySeq);
|
||||
|
@ -1545,7 +1538,7 @@ void CCNotePad::slot_dynamicLoadToolMenu()
|
|||
m_isToolMenuLoaded = true;
|
||||
|
||||
#ifdef NO_PLUGIN
|
||||
ui.menuTools->addAction(tr("Plugin Manager"), this, &CCNotePad::slot_pluginMgr);
|
||||
connect(ui.actionPlugin_Manager, &QAction::triggered, this, &CCNotePad::slot_pluginMgr);
|
||||
#endif
|
||||
|
||||
QMenu* formatMenu = new QMenu(tr("Format Language"), this);
|
||||
|
@ -1581,7 +1574,7 @@ void CCNotePad::loadPluginLib()
|
|||
{
|
||||
strDir = dir.absolutePath();
|
||||
|
||||
loadPluginProcs(strDir,ui.menuTools);
|
||||
loadPluginProcs(strDir,ui.menuPlugin);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1594,11 +1587,31 @@ void CCNotePad::onPlugFound(NDD_PROC_DATA& procData, QMenu* pUserData)
|
|||
return;
|
||||
}
|
||||
|
||||
QAction* pAction = new QAction(pMenu);
|
||||
//创建action
|
||||
if (procData.m_menuType == 0)
|
||||
{
|
||||
QAction* pAction = new QAction(procData.m_strPlugName, pMenu);
|
||||
pMenu->addAction(pAction);
|
||||
pAction->setText(procData.m_strPlugName);
|
||||
pAction->setData(procData.m_strFilePath);
|
||||
pMenu->addAction(pAction);
|
||||
connect(pAction, &QAction::triggered, this, &CCNotePad::onPlugWork);
|
||||
}
|
||||
else if (procData.m_menuType == 1)
|
||||
{
|
||||
//创建二级菜单
|
||||
QMenu* pluginMenu = new QMenu(procData.m_strPlugName, pMenu);
|
||||
pMenu->addMenu(pluginMenu);
|
||||
|
||||
//菜单句柄通过procData传递到插件中
|
||||
procData.m_rootMenu = pluginMenu;
|
||||
sendParaToPlugin(procData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_pluginList.append(procData);
|
||||
}
|
||||
|
@ -1620,7 +1633,7 @@ void CCNotePad::onPlugWork(bool check)
|
|||
{
|
||||
std::function<QsciScintilla* ()> foundCallBack = std::bind(&CCNotePad::getCurEditView, this);
|
||||
|
||||
pMainCallBack(this, plugPath, foundCallBack);
|
||||
pMainCallBack(this, plugPath, foundCallBack, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1630,21 +1643,36 @@ void CCNotePad::onPlugWork(bool check)
|
|||
}
|
||||
}
|
||||
|
||||
//把插件需要的参数,传递到插件中去
|
||||
void CCNotePad::sendParaToPlugin(NDD_PROC_DATA& procData)
|
||||
{
|
||||
QString plugPath = procData.m_strFilePath;
|
||||
|
||||
QLibrary* pLib = new QLibrary(plugPath);
|
||||
|
||||
NDD_PROC_MAIN_CALLBACK pMainCallBack;
|
||||
pMainCallBack = (NDD_PROC_MAIN_CALLBACK)pLib->resolve("NDD_PROC_MAIN");
|
||||
|
||||
if (pMainCallBack != NULL)
|
||||
{
|
||||
std::function<QsciScintilla* ()> foundCallBack = std::bind(&CCNotePad::getCurEditView, this);
|
||||
|
||||
pMainCallBack(this, plugPath, foundCallBack, &procData);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.statusBar->showMessage(tr("plugin %1 load failed !").arg(plugPath), 10000);
|
||||
}
|
||||
}
|
||||
|
||||
void CCNotePad::loadPluginProcs(QString strLibDir, QMenu* pMenu)
|
||||
{
|
||||
QMenu* pSubMenu = new QMenu(tr("Plugin"), pMenu);
|
||||
|
||||
std::function<void(NDD_PROC_DATA&, QMenu*)> foundCallBack = std::bind(&CCNotePad::onPlugFound, this, std::placeholders::_1, std::placeholders::_2);
|
||||
|
||||
int nRet = loadProc(strLibDir, foundCallBack, pSubMenu);
|
||||
|
||||
int nRet = loadProc(strLibDir, foundCallBack, pMenu);
|
||||
if (nRet > 0)
|
||||
{
|
||||
pMenu->addMenu(pSubMenu);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete pSubMenu;
|
||||
ui.statusBar->showMessage(tr("load plugin in dir %1 success, plugin num %2").arg(strLibDir).arg(nRet));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QLabel>
|
||||
|
@ -341,6 +341,7 @@ private slots:
|
|||
#ifdef NO_PLUGIN
|
||||
void slot_pluginMgr();
|
||||
void onPlugWork(bool check);
|
||||
void sendParaToPlugin(NDD_PROC_DATA& procData);
|
||||
#endif
|
||||
void slot_showWebAddr(bool check);
|
||||
void slot_langFileSuffix();
|
||||
|
|
|
@ -507,6 +507,12 @@
|
|||
<string>T&ools</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuPlugin">
|
||||
<property name="title">
|
||||
<string>Plugin</string>
|
||||
</property>
|
||||
<addaction name="actionPlugin_Manager"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuSearch"/>
|
||||
|
@ -515,6 +521,7 @@
|
|||
<addaction name="menuLanguage"/>
|
||||
<addaction name="menuSet"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuPlugin"/>
|
||||
<addaction name="menuCompare"/>
|
||||
<addaction name="menuAbout"/>
|
||||
<addaction name="menuAbout_2"/>
|
||||
|
@ -2048,6 +2055,11 @@
|
|||
<string>test</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPlugin_Manager">
|
||||
<property name="text">
|
||||
<string>Plugin Manager</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
@ -2711,22 +2723,6 @@
|
|||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<sender>actionLanguage_Format</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>CCNotePad</receiver>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "filemanager.h"
|
||||
#include "filemanager.h"
|
||||
#include "scintillaeditview.h"
|
||||
#include "scintillahexeditview.h"
|
||||
#include "CmpareMode.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
#include "rcglobal.h"
|
||||
|
@ -11,7 +11,7 @@
|
|||
class ScintillaEditView;
|
||||
class ScintillaHexEditView;
|
||||
|
||||
//小于100k的文件一次性全部读取完毕
|
||||
//小于100k的文件一次性全部读取完毕
|
||||
const int LITTLE_FILE_MAX = 1024000;
|
||||
|
||||
enum ERROR_TYPE {
|
||||
|
@ -29,16 +29,16 @@ struct NewFileIdMgr {
|
|||
}
|
||||
};
|
||||
|
||||
//管理二进制文件的信息
|
||||
//管理二进制文件的信息
|
||||
struct HexFileMgr {
|
||||
QString filePath;
|
||||
QFile* file;
|
||||
qint64 fileOffset;
|
||||
qint64 fileSize;
|
||||
qint16 lineSize;//每次读取多少行,默认为64行,没行16个字符
|
||||
qint16 lineSize;//每次读取多少行,默认为64行,没行16个字符
|
||||
char* contentBuf;
|
||||
int contentRealSize;
|
||||
bool onetimeRead; //是否一次性全部读取到内存。小于等于LITTLE_FILE_MAX的才会全部读取
|
||||
bool onetimeRead; //是否一次性全部读取到内存。小于等于LITTLE_FILE_MAX的才会全部读取
|
||||
HexFileMgr() :file(nullptr), fileOffset(0), lineSize(64), fileSize(0), contentBuf(nullptr), contentRealSize(0),onetimeRead(false)
|
||||
{
|
||||
|
||||
|
@ -62,17 +62,17 @@ private:
|
|||
HexFileMgr(const HexFileMgr&) = delete;
|
||||
};
|
||||
|
||||
//管理大文本文件的信息
|
||||
//管理大文本文件的信息
|
||||
struct TextFileMgr {
|
||||
QString filePath;
|
||||
QFile* file;
|
||||
qint64 fileOffset;
|
||||
qint64 fileSize;
|
||||
qint16 lineSize;//每次读取多少行,默认每次读取1024行。但是最大不超过1M的内容。
|
||||
qint16 lineSize;//每次读取多少行,默认每次读取1024行。但是最大不超过1M的内容。
|
||||
char* contentBuf;
|
||||
int contentRealSize;
|
||||
int loadWithCode;
|
||||
int lineEndType;//行尾类型,win linux mac
|
||||
int lineEndType;//行尾类型,win linux mac
|
||||
|
||||
TextFileMgr() :file(nullptr), fileOffset(0), lineSize(64), fileSize(0), contentBuf(nullptr), contentRealSize(0), loadWithCode(CODE_ID::UNKOWN),lineEndType(RC_LINE_FORM::UNKNOWN_LINE)
|
||||
{
|
||||
|
@ -98,23 +98,23 @@ private:
|
|||
};
|
||||
|
||||
struct BlockIndex {
|
||||
qint64 fileOffset;//块的开始地址
|
||||
quint32 fileSize;//块的大小
|
||||
quint32 lineNumStart;//块中行号的开始值
|
||||
quint32 lineNum;//块中的行数量
|
||||
qint64 fileOffset;//块的开始地址
|
||||
quint32 fileSize;//块的大小
|
||||
quint32 lineNumStart;//块中行号的开始值
|
||||
quint32 lineNum;//块中的行数量
|
||||
};
|
||||
|
||||
//管理大文本文件,可以编辑的信息
|
||||
//管理大文本文件,可以编辑的信息
|
||||
struct BigTextEditFileMgr {
|
||||
QString filePath;
|
||||
QFile* file;
|
||||
uchar* filePtr;//使用的是文件映射的方式打开
|
||||
quint32 m_curBlockIndex; //当前展示中的块索引序号
|
||||
int loadWithCode; //以何种编码来加载解析文件。默认UTF8
|
||||
int lineEndType;//行尾类型,win linux mac
|
||||
static const qint16 BLOCK_SIZE = 1;//块大小,单位M。开始是4M,发现块越大,行越多,那么在一块中定位行的位置越慢
|
||||
uchar* filePtr;//使用的是文件映射的方式打开
|
||||
quint32 m_curBlockIndex; //当前展示中的块索引序号
|
||||
int loadWithCode; //以何种编码来加载解析文件。默认UTF8
|
||||
int lineEndType;//行尾类型,win linux mac
|
||||
static const qint16 BLOCK_SIZE = 1;//块大小,单位M。开始是4M,发现块越大,行越多,那么在一块中定位行的位置越慢
|
||||
|
||||
QVector<BlockIndex> blocks;//每一块的索引。打开文件的时候,需要建立该索引
|
||||
QVector<BlockIndex> blocks;//每一块的索引。打开文件的时候,需要建立该索引
|
||||
|
||||
BigTextEditFileMgr():filePtr(nullptr), file(nullptr), m_curBlockIndex(0), loadWithCode(CODE_ID::UNKOWN), lineEndType(RC_LINE_FORM::UNKNOWN_LINE)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "columnedit.h"
|
||||
#include "columnedit.h"
|
||||
#include "scintillaeditview.h"
|
||||
|
||||
ColumnEdit::ColumnEdit(QWidget *parent)
|
||||
|
@ -54,7 +54,7 @@ void ColumnEdit::slot_bigChar(bool isCheck)
|
|||
ui.capital->setEnabled(isCheck);
|
||||
}
|
||||
|
||||
//自动调整当前窗口的状态
|
||||
//自动调整当前窗口的状态
|
||||
QWidget* ColumnEdit::autoAdjustCurrentEditWin()
|
||||
{
|
||||
QWidget* pw = m_editTabWidget->currentWidget();
|
||||
|
@ -93,7 +93,7 @@ void ColumnEdit::slot_ok()
|
|||
QString prefix = ui.prefix->text();
|
||||
bool isCapital = ui.capital->isChecked();
|
||||
|
||||
//是插入文本模式
|
||||
//是插入文本模式
|
||||
if (ui.textGroupBox->isChecked())
|
||||
{
|
||||
|
||||
|
@ -138,7 +138,7 @@ void ColumnEdit::slot_ok()
|
|||
}
|
||||
else
|
||||
{
|
||||
//这里要加个提示
|
||||
//这里要加个提示
|
||||
QApplication::beep();
|
||||
return;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ void ColumnEdit::slot_ok()
|
|||
lineText.chrg.cpMin = static_cast<Sci_Position>(lineBegin);
|
||||
lineText.chrg.cpMax = static_cast<Sci_Position>(lineEnd);
|
||||
lineText.lpstrText = lineData.data();
|
||||
//获取原始行的内容
|
||||
//获取原始行的内容
|
||||
pEdit->SendScintilla(SCI_GETTEXTRANGE, 0, &lineText);
|
||||
|
||||
if (lineEndCol < cursorCol)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTabWidget>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "common.h"
|
||||
#include "common.h"
|
||||
|
||||
|
||||
int nbDigitsFromNbLines(size_t nbLines)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QAction>
|
||||
#include <qscilexer.h>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "ctipwin.h"
|
||||
#include "ctipwin.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_ctipwin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMap>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "draglineedit.h"
|
||||
#include "draglineedit.h"
|
||||
|
||||
DragLineEdit::DragLineEdit(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
|
@ -12,9 +12,9 @@ DragLineEdit::~DragLineEdit()
|
|||
|
||||
void DragLineEdit::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
if (event->mimeData()->hasFormat("text/uri-list")) //只能打开文本文件
|
||||
if (event->mimeData()->hasFormat("text/uri-list")) //只能打开文本文件
|
||||
{
|
||||
event->accept(); //可以在这个窗口部件上拖放对象
|
||||
event->accept(); //可以在这个窗口部件上拖放对象
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QLineEdit>
|
||||
|
@ -16,10 +16,10 @@ public:
|
|||
|
||||
|
||||
protected:
|
||||
///< 拖动文件到窗口 触发
|
||||
///< 拖动文件到窗口 触发
|
||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
||||
///< 拖动文件到窗口移动文件 触发
|
||||
///< 拖动文件到窗口移动文件 触发
|
||||
void dragMoveEvent(QDragMoveEvent* event) override;
|
||||
///< 拖动文件到窗口释放文件触发
|
||||
///< 拖动文件到窗口释放文件触发
|
||||
void dropEvent(QDropEvent* event) override;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "extlexermanager.h"
|
||||
#include "extlexermanager.h"
|
||||
|
||||
//专门用来管理用户自定义的Ext 和 词法Lexer关联的类。
|
||||
//给出一个文件的ext后缀,快速告知该使用什么lexer进行语法高亮
|
||||
//专门用来管理用户自定义的Ext 和 词法Lexer关联的类。
|
||||
//给出一个文件的ext后缀,快速告知该使用什么lexer进行语法高亮
|
||||
|
||||
ExtLexerManager* ExtLexerManager::s_instance = nullptr;
|
||||
|
||||
|
@ -42,9 +42,9 @@ void ExtLexerManager::remove(QString ext)
|
|||
}
|
||||
|
||||
|
||||
//ext:文件的后缀名 langTagName:语言的tag名称
|
||||
//lexerId 语法的id,如果是用户自定义,则必然是L_USER_TXT,L_USER_CPP,L_USER_HTML,L_USER_JS,L_USER_XML, L_USER_INI 中的一个。
|
||||
//langTagName:只有在用户定义语言下,才需要tagName。因为非用户定义的lexer,其tagname是固定的。
|
||||
//ext:文件的后缀名 langTagName:语言的tag名称
|
||||
//lexerId 语法的id,如果是用户自定义,则必然是L_USER_TXT,L_USER_CPP,L_USER_HTML,L_USER_JS,L_USER_XML, L_USER_INI 中的一个。
|
||||
//langTagName:只有在用户定义语言下,才需要tagName。因为非用户定义的lexer,其tagname是固定的。
|
||||
void ExtLexerManager::addNewExtType(QString ext, LangType lexerId, QString langTagName)
|
||||
{
|
||||
LexerInfo value(lexerId, langTagName);
|
||||
|
@ -61,7 +61,7 @@ bool ExtLexerManager::getLexerTypeByExt(QString ext, LexerInfo& lexer)
|
|||
return false;
|
||||
}
|
||||
|
||||
//列出tag语言下面的所有关联的文件后缀列表
|
||||
//列出tag语言下面的所有关联的文件后缀列表
|
||||
void ExtLexerManager::getExtlistByLangTag(QString tag, QStringList& extList)
|
||||
{
|
||||
for (QMap<QString, LexerInfo>::iterator it = m_extToLexerIdMap.begin(); it != m_extToLexerIdMap.end(); ++it)
|
||||
|
@ -75,7 +75,7 @@ void ExtLexerManager::getExtlistByLangTag(QString tag, QStringList& extList)
|
|||
}
|
||||
}
|
||||
|
||||
//列出tag语言下面的所有关联的文件后缀列表
|
||||
//列出tag语言下面的所有关联的文件后缀列表
|
||||
void ExtLexerManager::getExtlistByLangTag(QMap<QString,QStringList>& extLangMap)
|
||||
{
|
||||
for (QMap<QString, LexerInfo>::iterator it = m_extToLexerIdMap.begin(); it != m_extToLexerIdMap.end(); ++it)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QMap>
|
||||
#include <qscilexer.h>
|
||||
|
||||
|
@ -26,8 +26,8 @@ enum LangType {
|
|||
#endif
|
||||
|
||||
struct LexerInfo{
|
||||
LangType lexerId; //如果是L_USER_DEFINE,则表示母版的类型
|
||||
QString tagName; //语言tag名称。
|
||||
LangType lexerId; //如果是L_USER_DEFINE,则表示母版的类型
|
||||
QString tagName; //语言tag名称。
|
||||
bool isUserDefineLangs()
|
||||
{
|
||||
return (lexerId > L_USER_DEFINE);
|
||||
|
@ -55,10 +55,10 @@ public:
|
|||
|
||||
bool getLexerTypeByExt(QString ext, LexerInfo& lexer);
|
||||
|
||||
//列出tag语言下面的所有关联的文件后缀列表
|
||||
//列出tag语言下面的所有关联的文件后缀列表
|
||||
void getExtlistByLangTag(QString tag, QStringList& extList);
|
||||
|
||||
//列出所有语言下面的所有关联的文件后缀列表
|
||||
//列出所有语言下面的所有关联的文件后缀列表
|
||||
void getExtlistByLangTag(QMap<QString, QStringList>& extLangMap);
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "filecmprulewin.h"
|
||||
#include "filecmprulewin.h"
|
||||
|
||||
FileCmpRuleWin::FileCmpRuleWin(int mode, bool blankMath, int equalRato,QWidget *parent)
|
||||
: QWidget(parent)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_filecmprulewin.h"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "filelistview.h"
|
||||
#include "filelistview.h"
|
||||
#include "rcglobal.h"
|
||||
#include "ccnotepad.h"
|
||||
#include <QListWidgetItem>
|
||||
#include <QMenu>
|
||||
|
||||
|
||||
//当显示文件多了以后,把所有文件列在该列表中
|
||||
//当显示文件多了以后,把所有文件列在该列表中
|
||||
|
||||
FileListView::FileListView(QWidget *parent)
|
||||
: QWidget(parent), m_pNotepad(nullptr)
|
||||
|
@ -14,7 +14,7 @@ FileListView::FileListView(QWidget *parent)
|
|||
|
||||
connect(ui.filelistWidget, &QListWidget::itemDoubleClicked, this, &FileListView::itemDoubleClicked);
|
||||
|
||||
setContextMenuPolicy(Qt::CustomContextMenu); //设置枚举值
|
||||
setContextMenuPolicy(Qt::CustomContextMenu); //设置枚举值
|
||||
|
||||
connect(this, &QListWidget::customContextMenuRequested, this, &FileListView::slot_ShowPopMenu);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ void FileListView::setNotepadWin(QWidget* pNotepad)
|
|||
m_pNotepad = pNotepad;
|
||||
}
|
||||
|
||||
//右键菜单
|
||||
//右键菜单
|
||||
void FileListView::slot_ShowPopMenu(const QPoint& pos)
|
||||
{
|
||||
QListWidgetItem* curItem = ui.filelistWidget->itemAt(pos);
|
||||
|
@ -53,11 +53,11 @@ void FileListView::slot_ShowPopMenu(const QPoint& pos)
|
|||
{
|
||||
pNotePad->closeFileByEditWidget(m_fileEditMap.value(curItem->text()).pEditWidget);
|
||||
}
|
||||
//注意这里不需要在删除m_fileEditMap元素,因为closeFileByEditWidget里面会调用。
|
||||
//注意这里不需要在删除m_fileEditMap元素,因为closeFileByEditWidget里面会调用。
|
||||
}
|
||||
});
|
||||
|
||||
//没有名称表示是对齐的item,不存在对应的文件,只是占位
|
||||
//没有名称表示是对齐的item,不存在对应的文件,只是占位
|
||||
if (curItem->text().isEmpty())
|
||||
{
|
||||
actionAdd->setEnabled(false);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QListWidgetItem>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "findcmpwin.h"
|
||||
#include "findcmpwin.h"
|
||||
#include "qscidisplaywindow.h"
|
||||
#include <QRadioButton>
|
||||
#include <QMessageBox>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTabWidget>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "findresultwin.h"
|
||||
#include "findresultwin.h"
|
||||
#include "findwin.h"
|
||||
#include "common.h"
|
||||
#include "styleset.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QContextMenuEvent>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "findwin.h"
|
||||
#include "findwin.h"
|
||||
#include "scintillaeditview.h"
|
||||
#include "ccnotepad.h"
|
||||
#include "progresswin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTabWidget>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "gotolinewin.h"
|
||||
#include "gotolinewin.h"
|
||||
|
||||
GoToLineWin::GoToLineWin(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_gotolinewin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "hexcmprangewin.h"
|
||||
#include "hexcmprangewin.h"
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QMessageBox>
|
||||
|
@ -23,7 +23,7 @@ void HexCmpRangeWin::slot_ok()
|
|||
close();
|
||||
}
|
||||
|
||||
//通过左边的值同步右边。右边不同步左边,加速用户输入
|
||||
//通过左边的值同步右边。右边不同步左边,加速用户输入
|
||||
void HexCmpRangeWin::slot_asyncStartPos(const QString& text)
|
||||
{
|
||||
ui.rightStartPos->setText(text);
|
||||
|
@ -35,7 +35,7 @@ void HexCmpRangeWin::slot_asyncLenPos(const QString& text)
|
|||
}
|
||||
|
||||
|
||||
//如果取消,则不返回任何有效范围值;错误值也是
|
||||
//如果取消,则不返回任何有效范围值;错误值也是
|
||||
const int MAX_CMP_LENS = 1024 * 1024 * 10;
|
||||
|
||||
void HexCmpRangeWin::getRange(bool & isCancel, qint64 & leftStartPos, int & leftCmpLen, qint64 & rightStartPos, int & rightCmpLen)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_hexcmprangewin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "hexfilegoto.h"
|
||||
#include "hexfilegoto.h"
|
||||
|
||||
HexFileGoto::HexFileGoto(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
|
@ -13,7 +13,7 @@ HexFileGoto::~HexFileGoto()
|
|||
{
|
||||
}
|
||||
|
||||
//显示为
|
||||
//显示为
|
||||
void HexFileGoto::slot_showDecInfo(const QString &text)
|
||||
{
|
||||
bool ok;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_hexfilegoto.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "hexrulewin.h"
|
||||
#include "hexrulewin.h"
|
||||
|
||||
HexRuleWin::HexRuleWin(int mode, int highlight, QWidget *parent): QWidget(parent), m_mode(mode), m_isHighlightBackgroud(highlight)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_hexrulewin.h"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QString>
|
||||
#include <QMenu>
|
||||
|
||||
#define NDD_EXPORTDLL
|
||||
|
||||
|
@ -15,11 +16,18 @@
|
|||
|
||||
struct ndd_proc_data
|
||||
{
|
||||
QString m_strPlugName; //插件名称 必选
|
||||
QString m_strFilePath; //lib 插件的全局路径。必选
|
||||
QString m_strComment; //插件说明
|
||||
QString m_version; //版本号码。可选
|
||||
QString m_auther;//作者名称。可选
|
||||
QString m_strPlugName; //插件名称 必选
|
||||
QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用管,主程序传递下来
|
||||
QString m_strComment; //插件说明
|
||||
QString m_version; //版本号码。可选
|
||||
QString m_auther;//作者名称。可选
|
||||
int m_menuType;//菜单类型。0:不使用二级菜单 1:创建二级菜单
|
||||
QMenu* m_rootMenu;//如果m_menuType = 1,给出二级根菜单的地址。其他值nullptr
|
||||
|
||||
ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "langextset.h"
|
||||
#include "langextset.h"
|
||||
#include "scintillaeditview.h"
|
||||
#include "extlexermanager.h"
|
||||
#include "ccnotepad.h"
|
||||
|
@ -9,8 +9,8 @@
|
|||
#include <QMessageBox>
|
||||
|
||||
int ITEM_CHANGED = Qt::UserRole;
|
||||
int ITEM_LEX_ID = Qt::UserRole + 1; //对应的语法lexer的 ID
|
||||
int ITEM_LEX_EXT_OLD_VALUE = Qt::UserRole + 2; //对应的语法关联EXT文件的旧值
|
||||
int ITEM_LEX_ID = Qt::UserRole + 1; //对应的语法lexer的 ID
|
||||
int ITEM_LEX_EXT_OLD_VALUE = Qt::UserRole + 2; //对应的语法关联EXT文件的旧值
|
||||
|
||||
LangExtSet::LangExtSet(QWidget *parent)
|
||||
: QMainWindow(parent), m_isChanged(false)
|
||||
|
@ -62,7 +62,7 @@ void LangExtSet::initLangName()
|
|||
QTableWidgetItem* item1 = new QTableWidgetItem(extList.join(','));
|
||||
item1->setData(ITEM_CHANGED, QVariant(false));
|
||||
|
||||
//把旧值记起来,后面修改后对比实时修改内存中的改动
|
||||
//把旧值记起来,后面修改后对比实时修改内存中的改动
|
||||
item1->setData(ITEM_LEX_EXT_OLD_VALUE, QVariant(extList));
|
||||
|
||||
ui.langTableWidget->setItem(langId, 1, item1);
|
||||
|
@ -141,12 +141,12 @@ void LangExtSet::slot_save()
|
|||
QString langLexerTag = QString("%1_lexId").arg(langTag);
|
||||
qs.setValue(langLexerTag, lexId);
|
||||
|
||||
//上面是更新文件,下面是更新内存,让实时生效
|
||||
//上面是更新文件,下面是更新内存,让实时生效
|
||||
QStringList oldExtList = item->data(ITEM_LEX_EXT_OLD_VALUE).toStringList();
|
||||
|
||||
updataExtLexerManager(langTag, lexId, oldExtList, extList);
|
||||
|
||||
//更新新值。因为可能不关闭时再次修改
|
||||
//更新新值。因为可能不关闭时再次修改
|
||||
item->setData(ITEM_LEX_EXT_OLD_VALUE, QVariant(extList));
|
||||
}
|
||||
}
|
||||
|
@ -156,15 +156,15 @@ void LangExtSet::slot_save()
|
|||
ui.statusBar->showMessage(tr("Save Finished !"), 10000);
|
||||
}
|
||||
|
||||
//更新ExtLexerManager中tag关联的值
|
||||
//更新ExtLexerManager中tag关联的值
|
||||
void LangExtSet::updataExtLexerManager(QString tag, int lexId, QStringList & oldExtList, QStringList & newExtList)
|
||||
{
|
||||
//把旧的直接删除
|
||||
//把旧的直接删除
|
||||
for (int i = 0; i < oldExtList.size(); ++i)
|
||||
{
|
||||
ExtLexerManager::getInstance()->remove(oldExtList.at(i));
|
||||
}
|
||||
//把新的重新加入一遍
|
||||
//把新的重新加入一遍
|
||||
for (int i = 0; i < newExtList.size(); ++i)
|
||||
{
|
||||
FileExtLexer v;
|
||||
|
@ -175,10 +175,10 @@ void LangExtSet::updataExtLexerManager(QString tag, int lexId, QStringList & old
|
|||
}
|
||||
}
|
||||
|
||||
//加载文件的关联后缀到语法中
|
||||
//加载文件的关联后缀到语法中
|
||||
void LangExtSet::loadExtRelevanceToMagr()
|
||||
{
|
||||
QString userLangFile = QString("notepad/tag_ext");//自定义语言中不能有.字符,否则可能有错,后续要检查
|
||||
QString userLangFile = QString("notepad/tag_ext");//自定义语言中不能有.字符,否则可能有错,后续要检查
|
||||
QSettings qs(QSettings::IniFormat, QSettings::UserScope, userLangFile);
|
||||
qs.setIniCodec("UTF-8");
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "ui_langextset.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "langstyledefine.h"
|
||||
#include "langstyledefine.h"
|
||||
#include "userlexdef.h"
|
||||
#include "extlexermanager.h"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "ui_langstyledefine.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "mytreeview.h"
|
||||
#include "mytreeview.h"
|
||||
|
||||
MyTreeView::MyTreeView(QWidget *parent)
|
||||
: QTreeView(parent)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QTreeView>
|
||||
#include <QModelIndexList>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "nddsetting.h"
|
||||
#include "nddsetting.h"
|
||||
#include <QObject>
|
||||
#include <QtDebug>
|
||||
#include <QCoreApplication>
|
||||
|
@ -7,8 +7,8 @@
|
|||
#include <QStorageInfo>
|
||||
#include <QSettings>
|
||||
|
||||
static short version_num = 29; //1.22.0 是29
|
||||
//配置文件是否存在。如果初始化失败,则不存在
|
||||
static short version_num = 29; //1.22.0 是29
|
||||
//配置文件是否存在。如果初始化失败,则不存在
|
||||
bool NddSetting::s_isExistDb = false;
|
||||
int NddSetting::s_reference = 0;
|
||||
bool NddSetting::s_isContentChanged = false;
|
||||
|
@ -17,10 +17,10 @@ QSettings* NddSetting::s_nddSet = nullptr;
|
|||
|
||||
QSettings* NddSetting::s_winPosSet = nullptr;
|
||||
|
||||
//如果key不存在,则新增key-value。存在:返回true
|
||||
//如果key不存在,则新增key-value。存在:返回true
|
||||
bool NddSetting::checkNoExistAdd(QString key, QVariant& value)
|
||||
{
|
||||
//每次新加字段后,这里要检查一下,不存在则新增
|
||||
//每次新加字段后,这里要检查一下,不存在则新增
|
||||
if (!s_nddSet->contains(key))
|
||||
{
|
||||
s_nddSet->setValue(key, value);
|
||||
|
@ -34,13 +34,13 @@ bool NddSetting::checkNoExistAdd(QString key, QVariant& value)
|
|||
return true;
|
||||
}
|
||||
|
||||
//20220402这里隐含了一个前置条件:数据库句柄是在主线程创建的,最好不要在子线程中调用。
|
||||
//避免因为跨线程访问和多线程冲突访问引发的闪退问题。所以最好配置文件的读写都在主线程中进行
|
||||
//20220402这里隐含了一个前置条件:数据库句柄是在主线程创建的,最好不要在子线程中调用。
|
||||
//避免因为跨线程访问和多线程冲突访问引发的闪退问题。所以最好配置文件的读写都在主线程中进行
|
||||
void NddSetting::init()
|
||||
{
|
||||
++s_reference;
|
||||
|
||||
//如果已经初始化过了,则直接返回
|
||||
//如果已经初始化过了,则直接返回
|
||||
if (s_isExistDb)
|
||||
{
|
||||
return;
|
||||
|
@ -56,42 +56,42 @@ void NddSetting::init()
|
|||
auto initNddSet = []() {
|
||||
QString key = "signdate";
|
||||
//QString date = QDate::currentDate().toString(QString("yyyy/M/d"));
|
||||
//不写今天的时间,否则第一次运行,无条件不会发送心跳。
|
||||
//直接写一个过去的时间,让第一次运行,总是要签到
|
||||
//不写今天的时间,否则第一次运行,无条件不会发送心跳。
|
||||
//直接写一个过去的时间,让第一次运行,总是要签到
|
||||
addKeyValueToSets(key, "2022/2/20");
|
||||
|
||||
QString str;
|
||||
|
||||
//tab的长度,默认为4
|
||||
//tab的长度,默认为4
|
||||
addKeyValueToNumSets("tablens", 4);
|
||||
//space replace tab空格替换tab,默认0, 1为true,0为false
|
||||
//space replace tab空格替换tab,默认0, 1为true,0为false
|
||||
addKeyValueToNumSets("tabnouse", 0);
|
||||
|
||||
addKeyValueToSets("mac", "0");
|
||||
addKeyValueToNumSets("padtimes", 0);
|
||||
addKeyValueToNumSets("serverip", 0);
|
||||
|
||||
//是否高亮不同处背景
|
||||
//是否高亮不同处背景
|
||||
addKeyValueToNumSets("hexhigh", 1);
|
||||
|
||||
addKeyValueToNumSets(VERSION, version_num);
|
||||
|
||||
//皮肤id
|
||||
//皮肤id
|
||||
addKeyValueToNumSets(SKIN_KEY, 0);
|
||||
|
||||
//语言index 0:自动选择 1:中文 2 英文
|
||||
//语言index 0:自动选择 1:中文 2 英文
|
||||
addKeyValueToNumSets(LANGS_KEY, 0);
|
||||
|
||||
//开启自动换行
|
||||
//开启自动换行
|
||||
addKeyValueToNumSets(AUTOWARP_KEY, 0);
|
||||
|
||||
//开启自动缩进
|
||||
//开启自动缩进
|
||||
addKeyValueToNumSets(INDENT_KEY, 0);
|
||||
|
||||
//显示空白
|
||||
//显示空白
|
||||
addKeyValueToNumSets(SHOWSPACE_KEY, 0);
|
||||
|
||||
//最大文本文件的门限。默认100M.(50-300)
|
||||
//最大文本文件的门限。默认100M.(50-300)
|
||||
addKeyValueToNumSets(MAX_BIG_TEXT, 100);
|
||||
|
||||
addKeyValueToSets(SOFT_KEY, "0");
|
||||
|
@ -107,22 +107,22 @@ void NddSetting::init()
|
|||
|
||||
addKeyValueToNumSets(FILELISTPOS, Qt::LeftDockWidgetArea);
|
||||
|
||||
//默认0不显示
|
||||
//默认0不显示
|
||||
addKeyValueToNumSets(FILELISTSHOW, 0);
|
||||
|
||||
//默认显示工具栏
|
||||
//默认显示工具栏
|
||||
addKeyValueToNumSets(TOOLBARSHOW, 1);
|
||||
|
||||
//打开网页,默认不勾选,资源耗费多
|
||||
//打开网页,默认不勾选,资源耗费多
|
||||
addKeyValueToNumSets(SHOWWEBADDR, 0);
|
||||
|
||||
//查找结果框的默认字体大小
|
||||
//查找结果框的默认字体大小
|
||||
addKeyValueToNumSets(FIND_RESULT_FONT_SIZE, 14);
|
||||
};
|
||||
|
||||
if (!s_nddSet->contains(VERSION))
|
||||
{
|
||||
//不存在走初始化流程
|
||||
//不存在走初始化流程
|
||||
initNddSet();
|
||||
s_isContentChanged = true;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ void NddSetting::init()
|
|||
QVariant v(VERSION);
|
||||
if (checkNoExistAdd(VERSION, v))
|
||||
{
|
||||
//如果存在,而且版本是最新,不需要走后面自动检查流程了
|
||||
//如果存在,而且版本是最新,不需要走后面自动检查流程了
|
||||
int curVersion = s_nddSet->value(VERSION).toInt();
|
||||
if (curVersion == version_num)
|
||||
{
|
||||
|
@ -141,12 +141,12 @@ void NddSetting::init()
|
|||
}
|
||||
else if (curVersion < version_num)
|
||||
{
|
||||
//更新版本到最新
|
||||
//更新版本到最新
|
||||
updataKeyValueFromNumSets(VERSION, version_num);
|
||||
}
|
||||
}
|
||||
}
|
||||
//每次新加字段后,这里要检查一下,不存在则新增
|
||||
//每次新加字段后,这里要检查一下,不存在则新增
|
||||
{
|
||||
QVariant v(1);
|
||||
checkNoExistAdd(SKIN_KEY, v);
|
||||
|
@ -237,7 +237,7 @@ void NddSetting::init()
|
|||
|
||||
|
||||
|
||||
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口
|
||||
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口
|
||||
QString NddSetting::getKeyValueFromSets(QString key)
|
||||
{
|
||||
return s_nddSet->value(key,"").toString();
|
||||
|
@ -250,7 +250,7 @@ bool NddSetting::updataKeyValueFromSets(QString key, QString value)
|
|||
return true;
|
||||
}
|
||||
|
||||
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口
|
||||
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口
|
||||
QByteArray NddSetting::getKeyByteArrayValue(QString key)
|
||||
{
|
||||
return s_nddSet->value(key, "").toByteArray();
|
||||
|
@ -262,14 +262,14 @@ void NddSetting::updataKeyByteArrayValue(QString key, QByteArray& value)
|
|||
s_isContentChanged = true;
|
||||
}
|
||||
|
||||
//第一次加一条记录,用于初始化
|
||||
//第一次加一条记录,用于初始化
|
||||
void NddSetting::addKeyValueToSets(QString key, QString value)
|
||||
{
|
||||
s_nddSet->setValue(key, QVariant(value));
|
||||
}
|
||||
|
||||
|
||||
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口.0做默认值,外部最好不用0做初始化值
|
||||
//写一个总的获取配置的接口,避免以后每个字段都需要写一个读写接口.0做默认值,外部最好不用0做初始化值
|
||||
int NddSetting::getKeyValueFromNumSets(const QString key)
|
||||
{
|
||||
QVariant v = s_nddSet->value(key, QVariant(0));
|
||||
|
@ -283,7 +283,7 @@ bool NddSetting::updataKeyValueFromNumSets(const QString key, int value)
|
|||
}
|
||||
|
||||
|
||||
//第一次加一条记录,用于初始化
|
||||
//第一次加一条记录,用于初始化
|
||||
void NddSetting::addKeyValueToNumSets(QString key, int value)
|
||||
{
|
||||
s_nddSet->setValue(key, QVariant(value));
|
||||
|
@ -300,7 +300,7 @@ void NddSetting::close()
|
|||
{
|
||||
s_isExistDb = false;
|
||||
|
||||
//做一次真正的保存
|
||||
//做一次真正的保存
|
||||
if (s_isContentChanged)
|
||||
{
|
||||
s_nddSet->sync();
|
||||
|
@ -309,7 +309,7 @@ void NddSetting::close()
|
|||
s_isContentChanged = false;
|
||||
}
|
||||
|
||||
//在这里保存一下子窗口的位置。不排除有可能子窗口还在,主窗口已经退出的情况,不过问题不大。
|
||||
//在这里保存一下子窗口的位置。不排除有可能子窗口还在,主窗口已经退出的情况,不过问题不大。
|
||||
if (s_winPosSet != nullptr)
|
||||
{
|
||||
s_winPosSet->sync();
|
||||
|
@ -319,7 +319,7 @@ void NddSetting::close()
|
|||
}
|
||||
}
|
||||
|
||||
//子窗口的位置,单独放在一个winpos.ini文件中,而且启动程序时,不需要读取,可避免启动时拖慢速度
|
||||
//子窗口的位置,单独放在一个winpos.ini文件中,而且启动程序时,不需要读取,可避免启动时拖慢速度
|
||||
QByteArray NddSetting::getWinPos(QString key)
|
||||
{
|
||||
winPosInit();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QSettings>
|
||||
#include <QVariant>
|
||||
|
||||
|
@ -10,24 +10,24 @@ static QString SHOWSPACE_KEY = "blank";
|
|||
static QString MAX_BIG_TEXT = "maxtsize";
|
||||
static QString SOFT_STATUS = "rstatus";
|
||||
static QString SOFT_KEY = "rkey";
|
||||
static QString RESTORE_CLOSE_FILE = "restore"; //恢复关闭时打开的文件
|
||||
static QString PRO_DIR = "prodir";//放置配置文件的路径
|
||||
//static QString RESTORE_SIZE = "rsize";//保存关闭时的大小
|
||||
static QString WIN_POS = "pos";//保存关闭是的大小
|
||||
static QString ICON_SIZE = "iconsize";//图标大小
|
||||
static QString ZOOMVALUE = "zoom"; //放大倍数
|
||||
static QString VERSION = "version";//当前版本
|
||||
static QString FINDRESULTPOS = "findpos";//查找窗口悬浮的位置
|
||||
static QString FILELISTPOS = "filepos";//文件列表悬浮框的位置
|
||||
static QString FILELISTSHOW = "showfilelist"; //文件列表框是否显示
|
||||
static QString TOOLBARSHOW = "showbar"; //是否显示工具栏
|
||||
static QString FINDWINSIZE = "findwinsize";//保存查找框的大小。150%放大时界面永久。保留避免每次手动调整
|
||||
static QString SHOWWEBADDR = "showweb";//高亮web地址,双击网页打开
|
||||
static QString FIND_RESULT_FONT_SIZE = "frfs";//查找结果的默认字体大小,默认为14
|
||||
static QString RESTORE_CLOSE_FILE = "restore"; //恢复关闭时打开的文件
|
||||
static QString PRO_DIR = "prodir";//放置配置文件的路径
|
||||
//static QString RESTORE_SIZE = "rsize";//保存关闭时的大小
|
||||
static QString WIN_POS = "pos";//保存关闭是的大小
|
||||
static QString ICON_SIZE = "iconsize";//图标大小
|
||||
static QString ZOOMVALUE = "zoom"; //放大倍数
|
||||
static QString VERSION = "version";//当前版本
|
||||
static QString FINDRESULTPOS = "findpos";//查找窗口悬浮的位置
|
||||
static QString FILELISTPOS = "filepos";//文件列表悬浮框的位置
|
||||
static QString FILELISTSHOW = "showfilelist"; //文件列表框是否显示
|
||||
static QString TOOLBARSHOW = "showbar"; //是否显示工具栏
|
||||
static QString FINDWINSIZE = "findwinsize";//保存查找框的大小。150%放大时界面永久。保留避免每次手动调整
|
||||
static QString SHOWWEBADDR = "showweb";//高亮web地址,双击网页打开
|
||||
static QString FIND_RESULT_FONT_SIZE = "frfs";//查找结果的默认字体大小,默认为14
|
||||
|
||||
|
||||
//下面这个是winpos.ini中的key,避免单个文件太大,拖慢启动速度
|
||||
static QString BATCH_FIND_REPLACE_POS = "bfpos";//批量查找替换窗口的大小
|
||||
//下面这个是winpos.ini中的key,避免单个文件太大,拖慢启动速度
|
||||
static QString BATCH_FIND_REPLACE_POS = "bfpos";//批量查找替换窗口的大小
|
||||
|
||||
class NddSetting
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "ndstyleditemdelegate.h"
|
||||
#include "ndstyleditemdelegate.h"
|
||||
#include <QTextDocument>
|
||||
#include <QApplication>
|
||||
#include <QAbstractTextDocumentLayout>
|
||||
|
@ -21,7 +21,7 @@ void NdStyledItemDelegate::setFontSize(int size)
|
|||
|
||||
}
|
||||
|
||||
//重载使可以支持富文本格式的文字
|
||||
//重载使可以支持富文本格式的文字
|
||||
void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
|
||||
{
|
||||
QStyleOptionViewItem viewOption(option);
|
||||
|
@ -29,13 +29,13 @@ void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
|||
if (option.state.testFlag(QStyle::State_HasFocus))
|
||||
viewOption.state = viewOption.state ^ QStyle::State_HasFocus;
|
||||
|
||||
// ... 省略
|
||||
// 设置显示文本为空,使用默认样式
|
||||
// ... 省略
|
||||
// 设置显示文本为空,使用默认样式
|
||||
QStyle *pStyle = viewOption.widget ? viewOption.widget->style() : QApplication::style();
|
||||
|
||||
QTextDocument doc;
|
||||
|
||||
//外部修改了字体大小后,内部进行富文本的修改绘制。
|
||||
//外部修改了字体大小后,内部进行富文本的修改绘制。
|
||||
if (m_defaultFontSize != 14)
|
||||
{
|
||||
viewOption.text.replace("font-size:14px",QString("font-size:%1px").arg(m_defaultFontSize));
|
||||
|
@ -51,9 +51,9 @@ void NdStyledItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem
|
|||
|
||||
QRect textRect = pStyle->subElementRect(QStyle::SE_ItemViewItemText, &viewOption);
|
||||
painter->save();
|
||||
// 坐标变换,将左上角设置为原点
|
||||
// 坐标变换,将左上角设置为原点
|
||||
painter->translate(textRect.topLeft());
|
||||
// 设置HTML绘制区域
|
||||
// 设置HTML绘制区域
|
||||
painter->setClipRect(textRect.translated(-textRect.topLeft()));
|
||||
|
||||
doc.documentLayout()->draw(painter, paintContext);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "plugin.h"
|
||||
#include "plugin.h"
|
||||
#include <QLibrary>
|
||||
#include <QDir>
|
||||
#include <QMenu>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include "pluginGl.h"
|
||||
#include <functional>
|
||||
class QMenu;
|
||||
class QsciScintilla;
|
||||
class QWidget;
|
||||
|
||||
typedef int (*NDD_PROC_MAIN_CALLBACK)(QWidget* parent, const QString& strFileName, std::function<QsciScintilla*()>getCurEdit);
|
||||
typedef int (*NDD_PROC_MAIN_CALLBACK)(QWidget* parent, const QString& strFileName, std::function<QsciScintilla*()>getCurEdit, NDD_PROC_DATA* procData);
|
||||
|
||||
int loadProc(const QString& strDirOut, std::function<void(NDD_PROC_DATA&, QMenu*)> funcallback, QMenu* pUserData);
|
||||
|
|
|
@ -1,182 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{06EED29A-D357-39F4-B1B8-25129EBC2852}</ProjectGuid>
|
||||
<RootNamespace>helloworld</RootNamespace>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.19041.0</WindowsTargetPlatformMinVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' or !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild></PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<OutputDirectory>..\..\x64\Debug\plugin\</OutputDirectory>
|
||||
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<IntermediateDirectory>release\</IntermediateDirectory>
|
||||
<PrimaryOutput>helloworld</PrimaryOutput>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<OutputDirectory>..\..\x64\Debug\plugin\</OutputDirectory>
|
||||
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<IntermediateDirectory>debug\</IntermediateDirectory>
|
||||
<PrimaryOutput>helloworld</PrimaryOutput>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /><Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')"><Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." /></Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" /><ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')"><Import Project="$(QtMsBuild)\qt_defaults.props" /></ImportGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><OutDir>..\..\x64\Debug\plugin\</OutDir><IntDir>debug\</IntDir><TargetName>helloworld</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><OutDir>..\..\x64\Debug\plugin\</OutDir><IntDir>release\</IntDir><TargetName>helloworld</TargetName><IgnoreImportLibrary>true</IgnoreImportLibrary><LinkIncremental>false</LinkIncremental></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"><QtInstall>5.12.10_msvc2017_64</QtInstall><QtModules>core;gui;widgets</QtModules></PropertyGroup><PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"><QtInstall>5.12.10_msvc2017_64</QtInstall><QtModules>core;gui;widgets</QtModules></PropertyGroup><ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"><Import Project="$(QtMsBuild)\qt.props" /></ImportGroup>
|
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;..\..\include;..\..\qscint\src;..\..\qscint\src\Qsci;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>release\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<ObjectFileName>release\</ObjectFileName>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<ProgramDataBaseFileName></ProgramDataBaseFileName>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>qmyedit_qt5d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutputFile>$(OutDir)\helloworld.dll</OutputFile>
|
||||
<RandomizedBaseAddress>true</RandomizedBaseAddress>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DefaultCharType>Unsigned</DefaultCharType>
|
||||
<EnableErrorChecks>None</EnableErrorChecks>
|
||||
<WarningLevel>0</WarningLevel>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;..\..\include;..\..\qscint\src;..\..\qscint\src\Qsci;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>debug\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4577;4467;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<ObjectFileName>debug\</ObjectFileName>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>qmyedit_qt5d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkDLL>true</LinkDLL>
|
||||
<OutputFile>$(OutDir)\helloworld.dll</OutputFile>
|
||||
<RandomizedBaseAddress>true</RandomizedBaseAddress>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DefaultCharType>Unsigned</DefaultCharType>
|
||||
<EnableErrorChecks>None</EnableErrorChecks>
|
||||
<WarningLevel>0</WarningLevel>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="helloworldexport.cpp" />
|
||||
<ClCompile Include="qttestclass.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="qttestclass.h">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</QtMoc>
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">debug\moc_predefs.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="release\moc_predefs.h.cbt">
|
||||
<FileType>Document</FileType>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">release\moc_predefs.h;%(Outputs)</Outputs>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</CustomBuild>
|
||||
|
||||
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="qttestclass.ui">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /><ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')"><Import Project="$(QtMsBuild)\qt.targets" /></ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
</Project>
|
|
@ -1,69 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
<ParseFiles>false</ParseFiles>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files">
|
||||
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="helloworldexport.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="qttestclass.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="qttestclass.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||
<Filter>Generated Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="release\moc_predefs.h.cbt">
|
||||
<Filter>Generated Files</Filter>
|
||||
</CustomBuild>
|
||||
|
||||
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="qttestclass.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtLastBackgroundBuild>2023-01-06T12:23:11.3148927Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtLastBackgroundBuild>2023-01-06T12:23:11.4036545Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,4 +1,4 @@
|
|||
#include <qobject.h>
|
||||
#include <qobject.h>
|
||||
#include <qstring.h>
|
||||
#include <pluginGl.h>
|
||||
#include <functional>
|
||||
|
@ -22,13 +22,17 @@
|
|||
#endif
|
||||
|
||||
NDD_EXPORT bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData);
|
||||
NDD_EXPORT int NDD_PROC_MAIN(QWidget* pNotepad, const QString& strFileName, std::function<QsciScintilla* ()>getCurEdit);
|
||||
NDD_EXPORT int NDD_PROC_MAIN(QWidget* pNotepad, const QString& strFileName, std::function<QsciScintilla* ()>getCurEdit, NDD_PROC_DATA* procData);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
static NDD_PROC_DATA s_procData;
|
||||
static QWidget* s_pMainNotepad = nullptr;
|
||||
std::function<QsciScintilla* ()> s_getCurEdit;
|
||||
|
||||
bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData)
|
||||
{
|
||||
if(pProcData == NULL)
|
||||
|
@ -40,13 +44,38 @@ bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData)
|
|||
|
||||
pProcData->m_version = QString("v1.0");
|
||||
pProcData->m_auther = QString("zuowei.yin");
|
||||
|
||||
pProcData->m_menuType = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//插件的入口点函数
|
||||
int NDD_PROC_MAIN(QWidget* pNotepad, const QString &strFileName, std::function<QsciScintilla*()>getCurEdit)
|
||||
//则点击菜单栏按钮时,会自动调用到该插件的入口点函数。
|
||||
//pNotepad:就是CCNotepad的主界面指针
|
||||
//strFileName:当前插件DLL的全路径,如果不关心,则可以不使用
|
||||
//getCurEdit:从NDD主程序传递过来的仿函数,通过该函数获取当前编辑框操作对象QsciScintilla
|
||||
//pProcData:如果pProcData->m_menuType = 0 ,则该指针为空;如果pProcData->m_menuType = 1,则该指针有值。目前需要关心s_procData.m_rootMenu
|
||||
//开发者可以在该菜单下面,自行创建二级菜单
|
||||
int NDD_PROC_MAIN(QWidget* pNotepad, const QString &strFileName, std::function<QsciScintilla*()>getCurEdit, NDD_PROC_DATA* pProcData)
|
||||
{
|
||||
QsciScintilla* pEdit = getCurEdit();
|
||||
if (pEdit == nullptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
//务必拷贝一份pProcData,在外面会释放。
|
||||
if (pProcData != nullptr)
|
||||
{
|
||||
s_procData = *pProcData;
|
||||
}
|
||||
|
||||
s_pMainNotepad = pNotepad;
|
||||
s_getCurEdit = getCurEdit;
|
||||
|
||||
//如果pProcData->m_menuType = 1;是自己要创建二级菜单的场景。则通过s_procData.m_rootMenu 获取该插件的菜单根节点。
|
||||
//插件开发者自行在s_procData.m_rootMenu下添加新的二级菜单项目
|
||||
|
||||
|
||||
//做一个简单的转大写的操作
|
||||
QtTestClass* p = new QtTestClass(pNotepad,pEdit);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "qttestclass.h"
|
||||
#include "qttestclass.h"
|
||||
#include <qsciscintilla.h>
|
||||
|
||||
QtTestClass::QtTestClass(QWidget *parent, QsciScintilla* pEdit)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_qttestclass.h"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#include <qobject.h>
|
||||
#include <qobject.h>
|
||||
#include <qstring.h>
|
||||
#include <pluginGl.h>
|
||||
#include <functional>
|
||||
#include <qsciscintilla.h>
|
||||
#include <QAction>
|
||||
|
||||
#define NDD_EXPORTDLL
|
||||
|
||||
|
@ -21,13 +22,16 @@
|
|||
#endif
|
||||
|
||||
NDD_EXPORT bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData);
|
||||
NDD_EXPORT int NDD_PROC_MAIN(QWidget* parent, const QString& strFileName, std::function<QsciScintilla* ()>getCurEdit);
|
||||
|
||||
NDD_EXPORT int NDD_PROC_MAIN(QWidget* pNotepad, const QString& strFileName, std::function<QsciScintilla* ()>getCurEdit, NDD_PROC_DATA* procData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
static NDD_PROC_DATA s_procData;
|
||||
static QWidget* s_pMainNotepad = nullptr;
|
||||
std::function<QsciScintilla* ()> s_getCurEdit;
|
||||
|
||||
bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData)
|
||||
{
|
||||
if(pProcData == NULL)
|
||||
|
@ -39,21 +43,39 @@ bool NDD_PROC_IDENTIFY(NDD_PROC_DATA* pProcData)
|
|||
|
||||
pProcData->m_version = QString("v1.0");
|
||||
pProcData->m_auther = QString("zuowei.yin");
|
||||
|
||||
pProcData->m_menuType = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
//插件的入口点函数
|
||||
int NDD_PROC_MAIN(QWidget* parent, const QString &strFileName, std::function<QsciScintilla*()>getCurEdit)
|
||||
//则点击菜单栏按钮时,会自动调用到该插件的入口点函数。
|
||||
//pNotepad:就是CCNotepad的主界面指针
|
||||
//strFileName:当前插件DLL的全路径,如果不关心,则可以不使用
|
||||
//getCurEdit:从NDD主程序传递过来的仿函数,通过该函数获取当前编辑框操作对象QsciScintilla
|
||||
//pProcData:如果pProcData->m_menuType = 0 ,则该指针为空;如果pProcData->m_menuType = 1,则该指针有值。目前需要关心s_procData.m_rootMenu
|
||||
//开发者可以在该菜单下面,自行创建二级菜单
|
||||
int NDD_PROC_MAIN(QWidget* pNotepad, const QString& strFileName, std::function<QsciScintilla* ()>getCurEdit, NDD_PROC_DATA* pProcData)
|
||||
{
|
||||
QsciScintilla* pEidt = getCurEdit();
|
||||
|
||||
QString text = pEidt->text();
|
||||
//务必拷贝一份pProcData,在外面会释放。
|
||||
if (pProcData != nullptr)
|
||||
{
|
||||
s_procData = *pProcData;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
//做一个简单的转大写的操作
|
||||
s_pMainNotepad = pNotepad;
|
||||
s_getCurEdit = getCurEdit;
|
||||
|
||||
text = text.toLower();
|
||||
//如果pProcData->m_menuType = 1;是自己要创建二级菜单的场景。则通过s_procData.m_rootMenu 获取该插件的菜单根节点。
|
||||
//插件开发者自行在s_procData.m_rootMenu下添加新的二级菜单项目
|
||||
|
||||
pEidt->setText(text);
|
||||
QAction* pAction = new QAction(s_procData.m_strPlugName, s_procData.m_rootMenu);
|
||||
s_procData.m_rootMenu->addAction(pAction);
|
||||
pAction->setText("Secondary Menu Example");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QString>
|
||||
#include <QMenu>
|
||||
|
||||
struct ndd_proc_data
|
||||
{
|
||||
QString m_strPlugName; //插件名称 必选
|
||||
QString m_strFilePath; //lib 插件的全局路径。必选
|
||||
QString m_strComment; //插件说明
|
||||
QString m_version; //版本号码。可选
|
||||
QString m_auther;//作者名称。可选
|
||||
QString m_strPlugName; //插件名称 必选。插件里面需填写
|
||||
QString m_strFilePath; //lib 插件的全局路径。必选。插件内部不用填写,主程序传递下来
|
||||
QString m_strComment; //插件说明;插件里面需填写
|
||||
QString m_version; //版本号码。可选;插件里面需填写
|
||||
QString m_auther;//作者名称。可选;插件里面需填写
|
||||
int m_menuType;//菜单类型。0:不使用二级菜单 1:创建二级菜单;插件里面需填写
|
||||
QMenu* m_rootMenu;//如果m_menuType = 1,给出二级根菜单的地址。其他值nullptr 插件内部不用填写,主程序传递下来
|
||||
|
||||
ndd_proc_data(): m_rootMenu(nullptr), m_menuType(0)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
//#define NDD_PROC_IDENTIFY ("nddProc")
|
||||
|
@ -15,4 +23,4 @@ struct ndd_proc_data
|
|||
typedef struct ndd_proc_data NDD_PROC_DATA;
|
||||
|
||||
typedef bool (*NDD_PROC_IDENTIFY_CALLBACK)(NDD_PROC_DATA* pProcData);
|
||||
typedef void (*NDD_PROC_FOUND_CALLBACK)(NDD_PROC_DATA* pProcData, void* pUserData);
|
||||
typedef void (*NDD_PROC_FOUND_CALLBACK)(NDD_PROC_DATA* pProcData, void* pUserData);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "pluginmgr.h"
|
||||
#include "pluginmgr.h"
|
||||
#include "rcglobal.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "ui_pluginmgr.h"
|
||||
|
|
|
@ -37,7 +37,7 @@ ${PROJECT_SOURCE_DIR}/scintilla/include)
|
|||
|
||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent Qt5::Network Qt5::PrintSupport)
|
||||
|
||||
if(($ENV{CMAKE_BUILD_TYPE}) STREQUAL "Release")
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "qmyedit_qt5")
|
||||
else()
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "qmyedit_qt5d")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <QCoreApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Scintilla source code edit control */
|
||||
/* Scintilla source code edit control */
|
||||
/** @file Scintilla.h
|
||||
** Interface to the edit control.
|
||||
**/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Scintilla source code edit control
|
||||
// Scintilla source code edit control
|
||||
/** @file LexAVS.cxx
|
||||
** Lexer for AviSynth.
|
||||
**/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Scintilla source code edit control
|
||||
// Scintilla source code edit control
|
||||
/** @file Catalogue.cxx
|
||||
** Lexer infrastructure.
|
||||
** Contains a list of LexerModules which can be searched to find a module appropriate for a
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
// Define QSCINTILLA_MAKE_DLL to create a QScintilla shared library, or
|
||||
// define QSCINTILLA_DLL to link against a QScintilla shared library, or define
|
||||
// neither to either build or link against a static QScintilla library.
|
||||
#define QSCINTILLA_DLL
|
||||
|
||||
#if defined(QSCINTILLA_DLL)
|
||||
#define QSCINTILLA_EXPORT Q_DECL_IMPORT
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
// This defines the interface to the QsciLexerAsm class.
|
||||
//
|
||||
// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include <Qsci/qsciglobal.h>
|
||||
#include <Qsci/qscilexer.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#pragma once
|
||||
// This defines the interface to the QsciLexerR class.
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// This module implements the QsciLexerAsm class.
|
||||
// This module implements the QsciLexerAsm class.
|
||||
//
|
||||
// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "Qsci/qscilexerglobal.h"
|
||||
#include "Qsci/qscilexerglobal.h"
|
||||
#include "Qsci/qsciscintilla.h"
|
||||
#include "Scintilla.h"
|
||||
#include "SciLexer.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
#include "Qsci/qsciLexerr.h"
|
||||
|
||||
#include <qcolor.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "Qsci/qscilexervb.h"
|
||||
#include "Qsci/qscilexervb.h"
|
||||
|
||||
QsciLexerVB::QsciLexerVB(QObject *parent)
|
||||
: QsciLexer(parent)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QListWidgetItem>
|
||||
|
|
|
@ -15,7 +15,7 @@ static const char* VersionStr = "v1.22.2";
|
|||
#endif // TEST_PRE
|
||||
|
||||
|
||||
//#define NO_PLUGIN 1
|
||||
#define NO_PLUGIN 1
|
||||
|
||||
#define CMP_CODE_NOEQUAL
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "renamewin.h"
|
||||
#include "renamewin.h"
|
||||
#include "progresswin.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_renamewin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// This file is part of Notepad-- project
|
||||
// This file is part of Notepad-- project
|
||||
// Copyright (C)2023 zuowei.yin <cxasm@qq.com>
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "scintillaeditview.h"
|
||||
#include "scintillaeditview.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "rgba_icons.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <qsciscintilla.h>
|
||||
#include <Scintilla.h>
|
||||
#include <SciLexer.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "scintillahexeditview.h"
|
||||
#include "scintillahexeditview.h"
|
||||
#include "styleset.h"
|
||||
|
||||
#include "ccnotepad.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <qsciscintilla.h>
|
||||
#include <Scintilla.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "shortcutkeyeditwin.h"
|
||||
#include "shortcutkeyeditwin.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
|
@ -27,7 +27,7 @@ QKeySequence ShortcutKeyEditWin::getNewKeySeq()
|
|||
return m_newKeys;
|
||||
}
|
||||
|
||||
//确认修改,先检查一下。最多四个键
|
||||
//确认修改,先检查一下。最多四个键
|
||||
void ShortcutKeyEditWin::slot_ok()
|
||||
{
|
||||
QKeySequence keys = ui.keySequenceEdit->keySequence();
|
||||
|
@ -41,7 +41,7 @@ void ShortcutKeyEditWin::slot_ok()
|
|||
done(1);
|
||||
}
|
||||
|
||||
//删除为空
|
||||
//删除为空
|
||||
void ShortcutKeyEditWin::on_delete()
|
||||
{
|
||||
done(2);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_shortcutkeyeditwin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "shortcutkeymgr.h"
|
||||
#include "shortcutkeymgr.h"
|
||||
#include "shortcutkeyeditwin.h"
|
||||
#include "ccnotepad.h"
|
||||
|
||||
|
@ -13,12 +13,12 @@ QMap<QString, int>* ShortcutKeyMgr::s_shortcutKeysMap = nullptr;
|
|||
//QMap<QString, int> * qScintShortcutKeyValueMap = nullptr;
|
||||
|
||||
struct ShortcutKeySt {
|
||||
QString iniTag;//保存在Ini文件中的名称
|
||||
QString name;//显示在表格中的名称
|
||||
//QString keyDesc;//qkeysequence的描述
|
||||
QString iniTag;//保存在Ini文件中的名称
|
||||
QString name;//显示在表格中的名称
|
||||
//QString keyDesc;//qkeysequence的描述
|
||||
QKeySequence key;
|
||||
|
||||
bool canModify;//能否修改
|
||||
bool canModify;//能否修改
|
||||
|
||||
ShortcutKeySt() = default;
|
||||
ShortcutKeySt(QString name_, QString iniTag_, bool canMofidy=true) :name(name_), iniTag(iniTag_), canModify(canMofidy)
|
||||
|
@ -119,12 +119,12 @@ void ShortcutKeyMgr::initShortcutKeysMap()
|
|||
s_shortcutKeysMap->insert(shortCutTable.at(i).iniTag, i);
|
||||
}
|
||||
|
||||
//从文件中读取用户修改过的配置表。
|
||||
//从文件中读取用户修改过的配置表。
|
||||
loadUserDefSet();
|
||||
}
|
||||
}
|
||||
|
||||
//务必先调用initShortcutKeysMap()
|
||||
//务必先调用initShortcutKeysMap()
|
||||
QKeySequence ShortcutKeyMgr::getUserDefShortcutKey(QString iniTag)
|
||||
{
|
||||
if (s_shortcutKeysMap->contains(iniTag))
|
||||
|
@ -134,7 +134,7 @@ QKeySequence ShortcutKeyMgr::getUserDefShortcutKey(QString iniTag)
|
|||
return QKeySequence();
|
||||
}
|
||||
|
||||
//从用户ini配置中加载快捷键配置
|
||||
//从用户ini配置中加载快捷键配置
|
||||
void ShortcutKeyMgr::loadUserDefSet()
|
||||
{
|
||||
QString userDefFile = QString("notepad/shortcuttab");
|
||||
|
@ -159,7 +159,7 @@ void ShortcutKeyMgr::loadUserDefSet()
|
|||
}
|
||||
}
|
||||
|
||||
//修改配置文件中的快捷键定义。inittag ini的key, keySeqStr ini的value。内存也修改了
|
||||
//修改配置文件中的快捷键定义。inittag ini的key, keySeqStr ini的value。内存也修改了
|
||||
bool ShortcutKeyMgr::ModifyShortCutKey(QString initTag, QString keySeqStr)
|
||||
{
|
||||
QString userDefFile = QString("notepad/shortcuttab");
|
||||
|
@ -210,7 +210,7 @@ void ShortcutKeyMgr::initNddShortcutTable()
|
|||
}
|
||||
}
|
||||
|
||||
//初始化qscint内部的快捷键。目前这部分不能修改。
|
||||
//初始化qscint内部的快捷键。目前这部分不能修改。
|
||||
void ShortcutKeyMgr::initQscintShortcutTable()
|
||||
{
|
||||
QsciScintilla* pNote = new QsciScintilla(nullptr);
|
||||
|
@ -273,7 +273,7 @@ int ShortcutKeyMgr::isKeySeqExist(int row, QString keySeq, int &type)
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
//双击修改槽函数
|
||||
//双击修改槽函数
|
||||
void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item)
|
||||
{
|
||||
int row = item->row();
|
||||
|
@ -289,14 +289,14 @@ void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item)
|
|||
pWin->setCurKeyDesc(shortCutTable.at(row).key.toString());
|
||||
|
||||
int ret = pWin->exec();
|
||||
if (1 == ret) //确定
|
||||
if (1 == ret) //确定
|
||||
{
|
||||
QKeySequence newKeySeq = pWin->getNewKeySeq();
|
||||
|
||||
QTableWidgetItem* item = ui.tableWidget->item(row, 1);
|
||||
if (item != nullptr)
|
||||
{
|
||||
//检查是否冲突,如果冲突,则不设置。先预留
|
||||
//检查是否冲突,如果冲突,则不设置。先预留
|
||||
int conflictType = 0;
|
||||
int existId = isKeySeqExist(row, newKeySeq.toString(), conflictType);
|
||||
if (-1 == existId)
|
||||
|
@ -329,7 +329,7 @@ void ShortcutKeyMgr::slot_edit(QTableWidgetItem* item)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (2 == ret)//删除
|
||||
else if (2 == ret)//删除
|
||||
{
|
||||
QKeySequence newKeySeq(QKeySequence::UnknownKey);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "ui_shortcutkeymgr.h"
|
||||
|
@ -38,7 +38,7 @@ enum Shortcut_Key_ID {
|
|||
Format_Json_ID,
|
||||
|
||||
|
||||
Shortcut_End_ID,//总是在最底下
|
||||
Shortcut_End_ID,//总是在最底下
|
||||
};
|
||||
|
||||
static const char* New_File = "newfile";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "styleset.h"
|
||||
#include "styleset.h"
|
||||
#include "ccnotepad.h"
|
||||
#include <QFile>
|
||||
#include <QPalette>
|
||||
|
@ -70,7 +70,7 @@ void StyleSet::setCommonStyle(QColor foldfgColor_, QColor foldbgColor_, QColor m
|
|||
foldbgColor = foldbgColor_;
|
||||
marginsBackgroundColor = marginsBackgroundColor_;
|
||||
|
||||
QFile file(":/qss/lightbluestyle.qss"); //qss文件路径:/lightblue.qss
|
||||
QFile file(":/qss/lightbluestyle.qss"); //qss文件路径:/lightblue.qss
|
||||
QString styleSheet;
|
||||
if (file.open(QIODevice::Text | QIODevice::ReadOnly))
|
||||
{
|
||||
|
@ -128,7 +128,7 @@ void StyleSet::setSkin(int id)
|
|||
}
|
||||
}
|
||||
|
||||
//重新加载Global全局风格
|
||||
//重新加载Global全局风格
|
||||
void StyleSet::reloadGolbalStyleFromSetFile()
|
||||
{
|
||||
loadGolbalStyle();
|
||||
|
@ -140,7 +140,7 @@ void StyleSet::loadGolbalStyle()
|
|||
QsciLexerGlobal* pGlobalLexer = dynamic_cast<QsciLexerGlobal*>(pLexer);
|
||||
if (pGlobalLexer != nullptr)
|
||||
{
|
||||
//获取其属性颜色,然后填入。后续在ScintillaEditView中直接设置这些One_Stype_Info的属性值
|
||||
//获取其属性颜色,然后填入。后续在ScintillaEditView中直接设置这些One_Stype_Info的属性值
|
||||
One_Stype_Info* pAddr = &s_global_style->global_style;
|
||||
|
||||
for (int i = 0; i <= URL_HOVERRED; ++i)
|
||||
|
@ -158,7 +158,7 @@ QString StyleSet::getCurrentStyle()
|
|||
return getStyleName(m_curStyleId);
|
||||
}
|
||||
|
||||
//是否深色风格系列
|
||||
//是否深色风格系列
|
||||
bool StyleSet::isCurrentDeepStyle()
|
||||
{
|
||||
switch (m_curStyleId)
|
||||
|
@ -217,7 +217,7 @@ void StyleSet::setDefaultStyle()
|
|||
marginsBackgroundColor = QColor(0xf0f0f0);
|
||||
bookmarkBkColor = QColor(0xececec);
|
||||
|
||||
QFile file(":/qss/mystyle.qss"); //qss文件路径:/lightblue.qss
|
||||
QFile file(":/qss/mystyle.qss"); //qss文件路径:/lightblue.qss
|
||||
QString styleSheet;
|
||||
if (file.open(QIODevice::Text | QIODevice::ReadOnly))
|
||||
{
|
||||
|
@ -246,7 +246,7 @@ void StyleSet::setThinBlueStyle()
|
|||
setCommonStyle(QColor(0xd7, 0xe3, 0xf4, 100), QColor(0xd7e3f4), QColor(0xd5e1f1), "#D7E3F4");
|
||||
}
|
||||
|
||||
//纸黄
|
||||
//纸黄
|
||||
void StyleSet::setThinYellowStyle()
|
||||
{
|
||||
//m_curStyleId = THIN_YELLOW_SE;
|
||||
|
@ -254,7 +254,7 @@ void StyleSet::setThinYellowStyle()
|
|||
setCommonStyle(QColor(0xf9, 0xf0, 0xe1, 100), QColor(0xf9f0e1), QColor(0xf7f0e0), "#F9F0E1");
|
||||
}
|
||||
|
||||
//宣纸黄
|
||||
//宣纸黄
|
||||
void StyleSet::setRiceYellowStyle()
|
||||
{
|
||||
//m_curStyleId = RICE_YELLOW_SE;
|
||||
|
@ -262,7 +262,7 @@ void StyleSet::setRiceYellowStyle()
|
|||
setCommonStyle(QColor(0xf6, 0xf3, 0xea, 100), QColor(0xf6f3ea), QColor(0xf4f1e9), "#F6F3EA");
|
||||
}
|
||||
|
||||
//银色
|
||||
//银色
|
||||
void StyleSet::setSilverStyle()
|
||||
{
|
||||
//m_curStyleId = SILVER_SE;
|
||||
|
@ -270,7 +270,7 @@ void StyleSet::setSilverStyle()
|
|||
setCommonStyle(QColor(0xe9, 0xe8, 0xe4, 100), QColor(0xe9e8e4), QColor(0xe7e6e2), "#E9E8E4");
|
||||
}
|
||||
|
||||
//谈紫色#FFF0F5
|
||||
//谈紫色#FFF0F5
|
||||
void StyleSet::setLavenderBlushStyle()
|
||||
{
|
||||
//m_curStyleId = LAVENDER_SE;
|
||||
|
@ -293,14 +293,14 @@ void StyleSet::setBlackStyle()
|
|||
foldfgColor = QColor(0,0, 0);
|
||||
foldbgColor = QColor(32, 32, 40);
|
||||
|
||||
//注意暗黑模式是单独的窗口背景颜色。上面的foldbgColor决定了编辑器的背景颜色。
|
||||
//暗黑模式窗体背景不完全是黑色,而是686868
|
||||
//注意暗黑模式是单独的窗口背景颜色。上面的foldbgColor决定了编辑器的背景颜色。
|
||||
//暗黑模式窗体背景不完全是黑色,而是686868
|
||||
QColor blackPaletteColor(68,68,68);
|
||||
|
||||
marginsBackgroundColor = QColor(57, 58, 60);
|
||||
bookmarkBkColor = QColor(53,54,56);
|
||||
|
||||
QFile file(":/qss/black.qss"); //qss文件路径:/lightblue.qss
|
||||
QFile file(":/qss/black.qss"); //qss文件路径:/lightblue.qss
|
||||
QString styleSheet;
|
||||
if (file.open(QIODevice::Text | QIODevice::ReadOnly))
|
||||
{
|
||||
|
@ -325,7 +325,7 @@ void StyleSet::setBlackStyle()
|
|||
marginsBackgroundColor = QColor(57, 58, 60);
|
||||
bookmarkBkColor = QColor(53, 54, 56);
|
||||
|
||||
QFile file(":/qss/myblack.qss"); //qss文件路径:/lightblue.qss
|
||||
QFile file(":/qss/myblack.qss"); //qss文件路径:/lightblue.qss
|
||||
QString styleSheet;
|
||||
if (file.open(QIODevice::Text | QIODevice::ReadOnly))
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include <QColor>
|
||||
#include <QFont>
|
||||
|
||||
|
@ -30,7 +30,7 @@ struct One_Stype_Info {
|
|||
int styleId;
|
||||
QColor fgColor;
|
||||
QColor bgColor;
|
||||
QFont font; //这个font代表两个含有,1是字体,而是字体大小。有些属性,比如括号大小,他们没有字体,但是有大小,则使用字体大小来表示
|
||||
QFont font; //这个font代表两个含有,1是字体,而是字体大小。有些属性,比如括号大小,他们没有字体,但是有大小,则使用字体大小来表示
|
||||
One_Stype_Info() :styleId(-1)
|
||||
{
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ struct One_Stype_Info {
|
|||
};
|
||||
|
||||
|
||||
//当前的全局风格属性,所有的样式修改,都是先修改这个结构体,然后其余地方再根据这个修改后的结构体,来进行同步更新
|
||||
//当前的全局风格属性,所有的样式修改,都是先修改这个结构体,然后其余地方再根据这个修改后的结构体,来进行同步更新
|
||||
struct GLOBAL_STYLE_OPS {
|
||||
One_Stype_Info global_style;
|
||||
One_Stype_Info default_style;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include "ui_texteditsetwin.h"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "userlexdef.h"
|
||||
#include "userlexdef.h"
|
||||
#include "rcglobal.h"
|
||||
#include <QSettings>
|
||||
|
||||
|
@ -12,14 +12,14 @@ UserLexDef::~UserLexDef()
|
|||
}
|
||||
|
||||
|
||||
//自己定义一套读取和保存配置的接口
|
||||
//自己定义一套读取和保存配置的接口
|
||||
|
||||
bool UserLexDef::readUserSettings(QString langTagName)
|
||||
{
|
||||
//自定义语言格式。
|
||||
//自定义语言格式。
|
||||
//mz:ndd
|
||||
//name:xxx
|
||||
//mother:xxx none/cpp/html 就三种
|
||||
//mother:xxx none/cpp/html 就三种
|
||||
//keword:xxx
|
||||
|
||||
QString userLangFile = QString("notepad/userlang/%1").arg(langTagName);
|
||||
|
@ -28,7 +28,7 @@ bool UserLexDef::readUserSettings(QString langTagName)
|
|||
|
||||
if (!qs.contains(QString("mz")))
|
||||
{
|
||||
//必须包含Mz为Ndd的键,否则错误
|
||||
//必须包含Mz为Ndd的键,否则错误
|
||||
return false;
|
||||
}
|
||||
if (qs.value("mz").toString() != QString("ndd"))
|
||||
|
@ -84,11 +84,11 @@ void UserLexDef::setMotherLang(UserLangMother words)
|
|||
|
||||
bool UserLexDef::writeUserSettings(QString langTagName)
|
||||
{
|
||||
//自定义语言格式。
|
||||
//自定义语言格式。
|
||||
//mz:ndd
|
||||
//name:xxx
|
||||
//mother:xxx none/cpp/html 就三种
|
||||
//ext:xx xx xx 文件关联后缀名
|
||||
//mother:xxx none/cpp/html 就三种
|
||||
//ext:xx xx xx 文件关联后缀名
|
||||
//keyword:xxx
|
||||
|
||||
QString userLangFile = QString("notepad/userlang/%1").arg(langTagName);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include "rcglobal.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue