- enhancement: "Toggle readonly" in the Edit menu.
- fix: Error When save project units' encoding settings.
This commit is contained in:
parent
96f9a898d0
commit
9296877b86
2
NEWS.md
2
NEWS.md
|
@ -8,6 +8,8 @@ Red Panda C++ Version 2.8
|
||||||
- fix: Resource compilation items is missing in the auto generated makefile, if the project's icon is removed and re-added.
|
- fix: Resource compilation items is missing in the auto generated makefile, if the project's icon is removed and re-added.
|
||||||
- fix: Action "Run all problem cases" is triggered twice by one clicked.
|
- fix: Action "Run all problem cases" is triggered twice by one clicked.
|
||||||
- enhancement: "Switch Header/Source" in editor title bar context menu.
|
- enhancement: "Switch Header/Source" in editor title bar context menu.
|
||||||
|
- enhancement: "Toggle readonly" in the Edit menu.
|
||||||
|
- fix: Error When save project units' encoding settings.
|
||||||
|
|
||||||
Red Panda C++ Version 2.7
|
Red Panda C++ Version 2.7
|
||||||
|
|
||||||
|
|
|
@ -571,6 +571,7 @@ void MainWindow::updateEditorActions(const Editor *e)
|
||||||
|
|
||||||
ui->actionGo_to_Line->setEnabled(false);
|
ui->actionGo_to_Line->setEnabled(false);
|
||||||
ui->actionLocate_in_Files_View->setEnabled(false);
|
ui->actionLocate_in_Files_View->setEnabled(false);
|
||||||
|
ui->actionToggle_Readonly->setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
ui->actionAuto_Detect->setEnabled(true);
|
ui->actionAuto_Detect->setEnabled(true);
|
||||||
ui->actionEncode_in_ANSI->setEnabled(true);
|
ui->actionEncode_in_ANSI->setEnabled(true);
|
||||||
|
@ -624,8 +625,9 @@ void MainWindow::updateEditorActions(const Editor *e)
|
||||||
ui->actionRemove_Bookmark->setEnabled(e->hasBookmark(line));
|
ui->actionRemove_Bookmark->setEnabled(e->hasBookmark(line));
|
||||||
ui->actionModify_Bookmark_Description->setEnabled(e->hasBookmark(line));
|
ui->actionModify_Bookmark_Description->setEnabled(e->hasBookmark(line));
|
||||||
|
|
||||||
ui->actionGo_to_Line->setEnabled(true);
|
ui->actionGo_to_Line->setEnabled(true);
|
||||||
ui->actionLocate_in_Files_View->setEnabled(!e->isNew());
|
ui->actionLocate_in_Files_View->setEnabled(!e->isNew());
|
||||||
|
ui->actionToggle_Readonly->setEnabled(!e->modified());
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCompileActions(e);
|
updateCompileActions(e);
|
||||||
|
@ -4820,6 +4822,8 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos
|
||||||
menu.addAction(ui->actionClose);
|
menu.addAction(ui->actionClose);
|
||||||
menu.addAction(ui->actionClose_All);
|
menu.addAction(ui->actionClose_All);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
menu.addAction(ui->actionToggle_Readonly);
|
||||||
|
menu.addSeparator();
|
||||||
menu.addAction(ui->actionOpen_Containing_Folder);
|
menu.addAction(ui->actionOpen_Containing_Folder);
|
||||||
menu.addAction(ui->actionOpen_Terminal);
|
menu.addAction(ui->actionOpen_Terminal);
|
||||||
menu.addAction(ui->actionLocate_in_Files_View);
|
menu.addAction(ui->actionLocate_in_Files_View);
|
||||||
|
@ -9218,3 +9222,14 @@ void MainWindow::onExportFPSProblemSet()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionToggle_Readonly_triggered()
|
||||||
|
{
|
||||||
|
Editor * editor = mEditorList->getEditor();
|
||||||
|
if (editor && !editor->modified()) {
|
||||||
|
editor->setReadOnly(!editor->readOnly());
|
||||||
|
editor->updateCaption();
|
||||||
|
updateEditorActions(editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -767,6 +767,8 @@ private slots:
|
||||||
|
|
||||||
void onExportFPSProblemSet();
|
void onExportFPSProblemSet();
|
||||||
|
|
||||||
|
void on_actionToggle_Readonly_triggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
EditorList *mEditorList;
|
EditorList *mEditorList;
|
||||||
|
|
|
@ -200,6 +200,8 @@
|
||||||
<addaction name="actionDelete_to_Word_End"/>
|
<addaction name="actionDelete_to_Word_End"/>
|
||||||
<addaction name="actionDelete_to_BOL"/>
|
<addaction name="actionDelete_to_BOL"/>
|
||||||
<addaction name="actionDelete_to_EOL"/>
|
<addaction name="actionDelete_to_EOL"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionToggle_Readonly"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuSearch">
|
<widget class="QMenu" name="menuSearch">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -3300,6 +3302,11 @@
|
||||||
<string>Trim trailing spaces</string>
|
<string>Trim trailing spaces</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionToggle_Readonly">
|
||||||
|
<property name="text">
|
||||||
|
<string>Toggle Readonly</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -237,9 +237,11 @@ void Project::open()
|
||||||
newUnit->setOverrideBuildCmd(ini.GetBoolValue(groupName,"OverrideBuildCmd", false));
|
newUnit->setOverrideBuildCmd(ini.GetBoolValue(groupName,"OverrideBuildCmd", false));
|
||||||
newUnit->setBuildCmd(fromByteArray(ini.GetValue(groupName,"BuildCmd", "")));
|
newUnit->setBuildCmd(fromByteArray(ini.GetValue(groupName,"BuildCmd", "")));
|
||||||
QByteArray defaultEncoding = toByteArray(mOptions.encoding);
|
QByteArray defaultEncoding = toByteArray(mOptions.encoding);
|
||||||
|
//Compatibility
|
||||||
if (ini.GetBoolValue(groupName,"DetectEncoding",true)){
|
if (ini.GetBoolValue(groupName,"DetectEncoding",true)){
|
||||||
defaultEncoding = ENCODING_AUTO_DETECT;
|
defaultEncoding = ENCODING_AUTO_DETECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
newUnit->setEncoding(ini.GetValue(groupName, "FileEncoding",defaultEncoding));
|
newUnit->setEncoding(ini.GetValue(groupName, "FileEncoding",defaultEncoding));
|
||||||
if (QTextCodec::codecForName(newUnit->encoding())==nullptr) {
|
if (QTextCodec::codecForName(newUnit->encoding())==nullptr) {
|
||||||
newUnit->setEncoding(ENCODING_AUTO_DETECT);
|
newUnit->setEncoding(ENCODING_AUTO_DETECT);
|
||||||
|
@ -758,9 +760,14 @@ bool Project::saveUnits()
|
||||||
ini.SetLongValue(groupName,"Priority", unit->priority());
|
ini.SetLongValue(groupName,"Priority", unit->priority());
|
||||||
ini.SetLongValue(groupName,"OverrideBuildCmd", unit->overrideBuildCmd());
|
ini.SetLongValue(groupName,"OverrideBuildCmd", unit->overrideBuildCmd());
|
||||||
ini.SetValue(groupName,"BuildCmd", toByteArray(unit->buildCmd()));
|
ini.SetValue(groupName,"BuildCmd", toByteArray(unit->buildCmd()));
|
||||||
ini.SetLongValue(groupName,"DetectEncoding", unit->encoding()==ENCODING_AUTO_DETECT);
|
//ini.SetLongValue(groupName,"DetectEncoding", unit->encoding()==ENCODING_AUTO_DETECT);
|
||||||
if (unit->encoding() != options().encoding)
|
ini.Delete(groupName,"DetectEncoding");
|
||||||
|
if (unit->encoding() != options().encoding
|
||||||
|
&& unit->encoding()!=ENCODING_AUTO_DETECT)
|
||||||
ini.SetValue(groupName,"FileEncoding", toByteArray(unit->encoding()));
|
ini.SetValue(groupName,"FileEncoding", toByteArray(unit->encoding()));
|
||||||
|
else
|
||||||
|
ini.Delete(groupName,"FileEncoding");
|
||||||
|
|
||||||
}
|
}
|
||||||
ini.SetLongValue("Project","UnitCount",count);
|
ini.SetLongValue("Project","UnitCount",count);
|
||||||
ini.SaveFile(mFilename.toLocal8Bit());
|
ini.SaveFile(mFilename.toLocal8Bit());
|
||||||
|
|
|
@ -4920,6 +4920,10 @@
|
||||||
<source>Choose Expected Output File</source>
|
<source>Choose Expected Output File</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Toggle Readonly</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NewClassDialog</name>
|
<name>NewClassDialog</name>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4737,6 +4737,10 @@
|
||||||
<source>Add Problem Case</source>
|
<source>Add Problem Case</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Toggle Readonly</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>NewClassDialog</name>
|
<name>NewClassDialog</name>
|
||||||
|
|
Loading…
Reference in New Issue