- fix: editor's modified state not correctly initiated
- fix: project's modified state not correctly initiated
This commit is contained in:
parent
88ac399b4e
commit
deabf1e847
Binary file not shown.
|
@ -2791,12 +2791,12 @@ Are you really want to continue?</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="1703"/>
|
<location filename="mainwindow.ui" line="1703"/>
|
||||||
<source>Open Folder in Explorer</source>
|
<source>Open Folder in Explorer</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>在浏览器中打开</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="1712"/>
|
<location filename="mainwindow.ui" line="1712"/>
|
||||||
<source>Open In Terminal</source>
|
<source>Open In Terminal</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>在终端中打开</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="98"/>
|
<location filename="mainwindow.cpp" line="98"/>
|
||||||
|
@ -2975,33 +2975,33 @@ Are you really want to continue?</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1479"/>
|
<location filename="mainwindow.cpp" line="1479"/>
|
||||||
<source>Rename File</source>
|
<source>Rename File</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>重命名文件</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1487"/>
|
<location filename="mainwindow.cpp" line="1487"/>
|
||||||
<location filename="mainwindow.cpp" line="1506"/>
|
<location filename="mainwindow.cpp" line="1506"/>
|
||||||
<source>Add Folder</source>
|
<source>Add Folder</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>添加文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1503"/>
|
<location filename="mainwindow.cpp" line="1503"/>
|
||||||
<source>New folder</source>
|
<source>New folder</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>新文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1507"/>
|
<location filename="mainwindow.cpp" line="1507"/>
|
||||||
<source>Folder name:</source>
|
<source>Folder name:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>文件夹:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1521"/>
|
<location filename="mainwindow.cpp" line="1521"/>
|
||||||
<source>Rename Folder</source>
|
<source>Rename Folder</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>重命名</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1529"/>
|
<location filename="mainwindow.cpp" line="1529"/>
|
||||||
<source>Remove Folder</source>
|
<source>Remove Folder</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>删除文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1612"/>
|
<location filename="mainwindow.cpp" line="1612"/>
|
||||||
|
@ -3647,24 +3647,24 @@ Are you really want to continue?</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="project.cpp" line="1848"/>
|
<location filename="project.cpp" line="1848"/>
|
||||||
<source>File exists</source>
|
<source>File exists</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>文件已存在</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="project.cpp" line="1849"/>
|
<location filename="project.cpp" line="1849"/>
|
||||||
<source>File '%1' already exists. Delete it now?</source>
|
<source>File '%1' already exists. Delete it now?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>文件'%1'已存在。是否删除?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="project.cpp" line="1867"/>
|
<location filename="project.cpp" line="1867"/>
|
||||||
<location filename="project.cpp" line="1887"/>
|
<location filename="project.cpp" line="1887"/>
|
||||||
<source>Remove failed</source>
|
<source>Remove failed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>删除失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="project.cpp" line="1868"/>
|
<location filename="project.cpp" line="1868"/>
|
||||||
<location filename="project.cpp" line="1888"/>
|
<location filename="project.cpp" line="1888"/>
|
||||||
<source>Failed to remove file '%1'</source>
|
<source>Failed to remove file '%1'</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>无法删除文件'%1'</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
|
|
|
@ -2003,7 +2003,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mProject) {
|
if (mProject) {
|
||||||
mProject = nullptr;
|
closeProject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete mEditorList;
|
delete mEditorList;
|
||||||
|
@ -2991,7 +2991,9 @@ void MainWindow::on_actionOpen_Containing_Folder_triggered()
|
||||||
if (editor) {
|
if (editor) {
|
||||||
QFileInfo info(editor->filename());
|
QFileInfo info(editor->filename());
|
||||||
if (!info.path().isEmpty()) {
|
if (!info.path().isEmpty()) {
|
||||||
QDesktopServices::openUrl(info.path());
|
QDesktopServices::openUrl(
|
||||||
|
QUrl("file:///"+
|
||||||
|
includeTrailingPathDelimiter(info.path()),QUrl::TolerantMode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3293,7 +3295,8 @@ void MainWindow::on_actionProject_Open_Folder_In_Explorer_triggered()
|
||||||
{
|
{
|
||||||
if (!mProject)
|
if (!mProject)
|
||||||
return;
|
return;
|
||||||
QDesktopServices::openUrl(mProject->directory());
|
QDesktopServices::openUrl(
|
||||||
|
QUrl("file:///"+includeTrailingPathDelimiter(mProject->directory()),QUrl::TolerantMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,10 @@ Project::Project(const QString &filename, const QString &name, QObject *parent)
|
||||||
&EditorList::getContentFromOpenedEditor,pMainWindow->editorList(),
|
&EditorList::getContentFromOpenedEditor,pMainWindow->editorList(),
|
||||||
std::placeholders::_1, std::placeholders::_2));
|
std::placeholders::_1, std::placeholders::_2));
|
||||||
resetCppParser(mParser);
|
resetCppParser(mParser);
|
||||||
if (name == DEV_INTERNAL_OPEN)
|
if (name == DEV_INTERNAL_OPEN) {
|
||||||
open();
|
open();
|
||||||
else {
|
mModified = false;
|
||||||
|
} else {
|
||||||
mName = name;
|
mName = name;
|
||||||
SimpleIni ini;
|
SimpleIni ini;
|
||||||
ini.SetValue("Project","filename", toByteArray(extractRelativePath(directory(),mFilename)));
|
ini.SetValue("Project","filename", toByteArray(extractRelativePath(directory(),mFilename)));
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent)
|
SynEdit::SynEdit(QWidget *parent) : QAbstractScrollArea(parent)
|
||||||
{
|
{
|
||||||
|
mModified = false;
|
||||||
mPaintLock = 0;
|
mPaintLock = 0;
|
||||||
mPainterLock = 0;
|
mPainterLock = 0;
|
||||||
mPainting = false;
|
mPainting = false;
|
||||||
|
|
Loading…
Reference in New Issue