fix: crash while delete headers created by new header dialog
This commit is contained in:
parent
5eb5c4d58b
commit
425b4a4e96
1
NEWS.md
1
NEWS.md
|
@ -6,6 +6,7 @@ Red Panda C++ Version 0.14.1
|
||||||
- enhancement: display localzed icon set name in the option dialog
|
- enhancement: display localzed icon set name in the option dialog
|
||||||
- enhancement: new sky blue icon set, contributed by Alan-CRL
|
- enhancement: new sky blue icon set, contributed by Alan-CRL
|
||||||
- enhancement: show caret at once, when edition finished
|
- enhancement: show caret at once, when edition finished
|
||||||
|
- enhancement: new header dialog for project
|
||||||
|
|
||||||
Red Panda C++ Version 0.14.0
|
Red Panda C++ Version 0.14.0
|
||||||
- enhancement: custom icon set ( in the configuration folder)
|
- enhancement: custom icon set ( in the configuration folder)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -54,7 +54,7 @@ void ProjectCompiler::createStandardMakeFile()
|
||||||
newMakeFile(file);
|
newMakeFile(file);
|
||||||
file.write("$(BIN): $(OBJ)\n");
|
file.write("$(BIN): $(OBJ)\n");
|
||||||
if (!mOnlyCheckSyntax) {
|
if (!mOnlyCheckSyntax) {
|
||||||
if (mProject->options().useGPP) {
|
if (mProject->options().isCpp) {
|
||||||
writeln(file,"\t$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)");
|
writeln(file,"\t$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)");
|
||||||
} else
|
} else
|
||||||
writeln(file,"\t$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)");
|
writeln(file,"\t$(CC) $(LINKOBJ) -o $(BIN) $(LIBS)");
|
||||||
|
@ -80,7 +80,7 @@ void ProjectCompiler::createDynamicMakeFile()
|
||||||
newMakeFile(file);
|
newMakeFile(file);
|
||||||
writeln(file,"$(BIN): $(LINKOBJ)");
|
writeln(file,"$(BIN): $(LINKOBJ)");
|
||||||
if (!mOnlyCheckSyntax) {
|
if (!mOnlyCheckSyntax) {
|
||||||
if (mProject->options().useGPP) {
|
if (mProject->options().isCpp) {
|
||||||
file.write("\t$(CPP) -mdll $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
file.write("\t$(CPP) -mdll $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
||||||
} else {
|
} else {
|
||||||
file.write("\t$(CC) -mdll $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
file.write("\t$(CC) -mdll $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC)");
|
||||||
|
|
|
@ -55,6 +55,13 @@ Editor* EditorList::newEditor(const QString& filename, const QByteArray& encodin
|
||||||
Editor * e = new Editor(parentPageControl,filename,encoding,inProject,newFile,parentPageControl);
|
Editor * e = new Editor(parentPageControl,filename,encoding,inProject,newFile,parentPageControl);
|
||||||
connect(e, &Editor::renamed, this, &EditorList::onEditorRenamed);
|
connect(e, &Editor::renamed, this, &EditorList::onEditorRenamed);
|
||||||
updateLayout();
|
updateLayout();
|
||||||
|
if (pMainWindow->project()){
|
||||||
|
PProjectUnit unit = pMainWindow->project()->findUnitByFilename(filename);
|
||||||
|
if (unit) {
|
||||||
|
pMainWindow->project()->associateEditorToUnit(e,unit);
|
||||||
|
e->setInProject(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "widgets/ojproblempropertywidget.h"
|
#include "widgets/ojproblempropertywidget.h"
|
||||||
#include "iconsmanager.h"
|
#include "iconsmanager.h"
|
||||||
#include "widgets/newclassdialog.h"
|
#include "widgets/newclassdialog.h"
|
||||||
|
#include "widgets/newheaderdialog.h"
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
@ -166,6 +167,10 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
mMenuNew->setTitle(tr("New"));
|
mMenuNew->setTitle(tr("New"));
|
||||||
mMenuNew->addAction(ui->actionNew);
|
mMenuNew->addAction(ui->actionNew);
|
||||||
mMenuNew->addAction(ui->actionNew_Project);
|
mMenuNew->addAction(ui->actionNew_Project);
|
||||||
|
mMenuNew->addSeparator();
|
||||||
|
mMenuNew->addAction(ui->actionNew_Class);
|
||||||
|
mMenuNew->addAction(ui->actionNew_Header);
|
||||||
|
|
||||||
ui->menuFile->insertMenu(ui->actionOpen,mMenuNew);
|
ui->menuFile->insertMenu(ui->actionOpen,mMenuNew);
|
||||||
|
|
||||||
|
|
||||||
|
@ -474,6 +479,7 @@ void MainWindow::updateProjectActions()
|
||||||
ui->actionProject_options->setEnabled(hasProject);
|
ui->actionProject_options->setEnabled(hasProject);
|
||||||
ui->actionClose_Project->setEnabled(hasProject);
|
ui->actionClose_Project->setEnabled(hasProject);
|
||||||
ui->actionNew_Class->setEnabled(hasProject);
|
ui->actionNew_Class->setEnabled(hasProject);
|
||||||
|
ui->actionNew_Header->setEnabled(hasProject);
|
||||||
ui->actionProject_Open_Folder_In_Explorer->setEnabled(hasProject);
|
ui->actionProject_Open_Folder_In_Explorer->setEnabled(hasProject);
|
||||||
ui->actionProject_Open_In_Terminal->setEnabled(hasProject);
|
ui->actionProject_Open_In_Terminal->setEnabled(hasProject);
|
||||||
updateCompileActions();
|
updateCompileActions();
|
||||||
|
@ -1010,9 +1016,9 @@ void MainWindow::openFile(const QString &filename, QTabWidget* page)
|
||||||
QByteArray encoding = unit ? unit->encoding() : ENCODING_AUTO_DETECT;
|
QByteArray encoding = unit ? unit->encoding() : ENCODING_AUTO_DETECT;
|
||||||
editor = mEditorList->newEditor(filename,encoding,
|
editor = mEditorList->newEditor(filename,encoding,
|
||||||
inProject, false, page);
|
inProject, false, page);
|
||||||
if (mProject) {
|
// if (mProject) {
|
||||||
mProject->associateEditorToUnit(editor,unit);
|
// mProject->associateEditorToUnit(editor,unit);
|
||||||
}
|
// }
|
||||||
editor->activate();
|
editor->activate();
|
||||||
this->updateForEncodingInfo();
|
this->updateForEncodingInfo();
|
||||||
} catch (FileError e) {
|
} catch (FileError e) {
|
||||||
|
@ -2042,14 +2048,11 @@ void MainWindow::loadLastOpens()
|
||||||
bool inProject = (mProject && unit);
|
bool inProject = (mProject && unit);
|
||||||
QByteArray encoding = unit ? unit->encoding() : ENCODING_AUTO_DETECT;
|
QByteArray encoding = unit ? unit->encoding() : ENCODING_AUTO_DETECT;
|
||||||
Editor * editor = mEditorList->newEditor(editorFilename, encoding, inProject,false,page);
|
Editor * editor = mEditorList->newEditor(editorFilename, encoding, inProject,false,page);
|
||||||
if (mProject) {
|
// if (mProject) {
|
||||||
mProject->associateEditorToUnit(editor,unit);
|
// mProject->associateEditorToUnit(editor,unit);
|
||||||
}
|
// }
|
||||||
if (!editor)
|
if (!editor)
|
||||||
continue;
|
continue;
|
||||||
// if (mProject) {
|
|
||||||
// mProject->associateEditor(editor);
|
|
||||||
// }
|
|
||||||
BufferCoord pos;
|
BufferCoord pos;
|
||||||
pos.Char = lastOpenIni.GetLongValue(sectionName,"CursorCol", 1);
|
pos.Char = lastOpenIni.GetLongValue(sectionName,"CursorCol", 1);
|
||||||
pos.Line = lastOpenIni.GetLongValue(sectionName,"CursorRow", 1);
|
pos.Line = lastOpenIni.GetLongValue(sectionName,"CursorRow", 1);
|
||||||
|
@ -2915,6 +2918,8 @@ void MainWindow::onProjectViewContextMenu(const QPoint &pos)
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
updateProjectActions();
|
updateProjectActions();
|
||||||
menu.addAction(ui->actionProject_New_File);
|
menu.addAction(ui->actionProject_New_File);
|
||||||
|
menu.addAction(ui->actionNew_Class);
|
||||||
|
menu.addAction(ui->actionNew_Header);
|
||||||
menu.addAction(ui->actionAdd_to_project);
|
menu.addAction(ui->actionAdd_to_project);
|
||||||
if (!onFolder) {
|
if (!onFolder) {
|
||||||
menu.addAction(ui->actionRemove_from_project);
|
menu.addAction(ui->actionRemove_from_project);
|
||||||
|
@ -5327,7 +5332,7 @@ void MainWindow::newProjectUnitFile()
|
||||||
QString newFileName;
|
QString newFileName;
|
||||||
do {
|
do {
|
||||||
newFileName = tr("untitled")+QString("%1").arg(getNewFileNumber());
|
newFileName = tr("untitled")+QString("%1").arg(getNewFileNumber());
|
||||||
if (mProject->options().useGPP) {
|
if (mProject->options().isCpp) {
|
||||||
newFileName+=".cpp";
|
newFileName+=".cpp";
|
||||||
} else {
|
} else {
|
||||||
newFileName+=".c";
|
newFileName+=".c";
|
||||||
|
@ -6148,6 +6153,55 @@ void MainWindow::on_actionDelete_to_Word_End_triggered()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionNew_Header_triggered()
|
||||||
|
{
|
||||||
|
if (!mProject)
|
||||||
|
return;
|
||||||
|
NewHeaderDialog dialog;
|
||||||
|
dialog.setPath(mProject->folder());
|
||||||
|
if (dialog.exec()==QDialog::Accepted) {
|
||||||
|
QDir dir(dialog.path());
|
||||||
|
if (dialog.headerName().isEmpty()
|
||||||
|
|| !dir.exists())
|
||||||
|
return;
|
||||||
|
QString headerFilename = includeTrailingPathDelimiter(dialog.path())+dialog.headerName();
|
||||||
|
if (fileExists(headerFilename)){
|
||||||
|
QMessageBox::critical(this,
|
||||||
|
tr("Header Exists"),
|
||||||
|
tr("Header file \"%1\" already exists!").arg(headerFilename));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QString header_macro = QFileInfo(dialog.headerName()).baseName().toUpper()+"_H";
|
||||||
|
QStringList header;
|
||||||
|
QString indents;
|
||||||
|
if (pSettings->editor().tabToSpaces()) {
|
||||||
|
indents = QString(pSettings->editor().tabWidth(),' ');
|
||||||
|
} else {
|
||||||
|
indents = "\t";
|
||||||
|
}
|
||||||
|
header.append(QString("#ifndef %1").arg(header_macro));
|
||||||
|
header.append(QString("#define %1").arg(header_macro));
|
||||||
|
header.append("");
|
||||||
|
header.append("#endif");
|
||||||
|
stringsToFile(header, headerFilename);
|
||||||
|
|
||||||
|
mProject->addUnit(headerFilename,mProject->rootNode(),false);
|
||||||
|
mProject->cppParser()->addFileToScan(headerFilename);
|
||||||
|
mProject->rebuildNodes();
|
||||||
|
mProject->saveUnits();
|
||||||
|
parseFileList(mProject->cppParser());
|
||||||
|
updateProjectView();
|
||||||
|
|
||||||
|
Editor * editor = mEditorList->getEditorByFilename(headerFilename);
|
||||||
|
if (editor){
|
||||||
|
editor->activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pSettings->ui().setNewClassDialogWidth(dialog.width());
|
||||||
|
pSettings->ui().setNewClassDialogHeight(dialog.height());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionNew_Class_triggered()
|
void MainWindow::on_actionNew_Class_triggered()
|
||||||
{
|
{
|
||||||
if (!mProject)
|
if (!mProject)
|
||||||
|
@ -6161,6 +6215,20 @@ void MainWindow::on_actionNew_Class_triggered()
|
||||||
|| dialog.headerName().isEmpty()
|
|| dialog.headerName().isEmpty()
|
||||||
|| !dir.exists())
|
|| !dir.exists())
|
||||||
return;
|
return;
|
||||||
|
QString headerFilename = includeTrailingPathDelimiter(dialog.path())+dialog.headerName();
|
||||||
|
QString sourceFilename = includeTrailingPathDelimiter(dialog.path())+dialog.sourceName();
|
||||||
|
if (fileExists(headerFilename)){
|
||||||
|
QMessageBox::critical(this,
|
||||||
|
tr("Header Exists"),
|
||||||
|
tr("Header file \"%1\" already exists!").arg(headerFilename));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (fileExists(sourceFilename)){
|
||||||
|
QMessageBox::critical(this,
|
||||||
|
tr("Source Exists"),
|
||||||
|
tr("Source file \"%1\" already exists!").arg(sourceFilename));
|
||||||
|
return;
|
||||||
|
}
|
||||||
QString header_macro = dialog.className().toUpper()+"_H";
|
QString header_macro = dialog.className().toUpper()+"_H";
|
||||||
QStringList header;
|
QStringList header;
|
||||||
QString indents;
|
QString indents;
|
||||||
|
@ -6180,13 +6248,11 @@ void MainWindow::on_actionNew_Class_triggered()
|
||||||
header.append("};");
|
header.append("};");
|
||||||
header.append("");
|
header.append("");
|
||||||
header.append("#endif");
|
header.append("#endif");
|
||||||
QString headerFilename = includeTrailingPathDelimiter(dialog.path())+dialog.headerName();
|
|
||||||
stringsToFile(header, headerFilename);
|
stringsToFile(header, headerFilename);
|
||||||
QStringList source;
|
QStringList source;
|
||||||
source.append(QString("#include \"%1\"").arg(dialog.headerName()));
|
source.append(QString("#include \"%1\"").arg(dialog.headerName()));
|
||||||
source.append("");
|
source.append("");
|
||||||
source.append("");
|
source.append("");
|
||||||
QString sourceFilename = includeTrailingPathDelimiter(dialog.path())+dialog.sourceName();
|
|
||||||
stringsToFile(source, sourceFilename);
|
stringsToFile(source, sourceFilename);
|
||||||
|
|
||||||
mProject->addUnit(headerFilename,mProject->rootNode(),false);
|
mProject->addUnit(headerFilename,mProject->rootNode(),false);
|
||||||
|
@ -6197,8 +6263,14 @@ void MainWindow::on_actionNew_Class_triggered()
|
||||||
mProject->saveUnits();
|
mProject->saveUnits();
|
||||||
parseFileList(mProject->cppParser());
|
parseFileList(mProject->cppParser());
|
||||||
updateProjectView();
|
updateProjectView();
|
||||||
|
|
||||||
|
Editor * editor = mEditorList->getEditorByFilename(headerFilename);
|
||||||
|
if (editor){
|
||||||
|
editor->activate();
|
||||||
|
}
|
||||||
|
editor = mEditorList->getEditorByFilename(sourceFilename);
|
||||||
}
|
}
|
||||||
pSettings->ui().setNewClassDialogWidth(dialog.width());
|
pSettings->ui().setNewHeaderDialogWidth(dialog.width());
|
||||||
pSettings->ui().setNewClassDialogHeight(dialog.height());
|
pSettings->ui().setNewHeaderDialogHeight(dialog.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -561,6 +561,8 @@ private slots:
|
||||||
|
|
||||||
void on_actionNew_Class_triggered();
|
void on_actionNew_Class_triggered();
|
||||||
|
|
||||||
|
void on_actionNew_Header_triggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
EditorList *mEditorList;
|
EditorList *mEditorList;
|
||||||
|
|
|
@ -543,7 +543,6 @@
|
||||||
<widget class="IssuesTable" name="tableIssues">
|
<widget class="IssuesTable" name="tableIssues">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
<bold>false</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1389,7 +1388,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1114</width>
|
<width>1114</width>
|
||||||
<height>26</height>
|
<height>25</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
@ -1487,8 +1486,6 @@
|
||||||
<addaction name="actionBack"/>
|
<addaction name="actionBack"/>
|
||||||
<addaction name="actionForward"/>
|
<addaction name="actionForward"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionNew_Class"/>
|
|
||||||
<addaction name="separator"/>
|
|
||||||
<addaction name="actionAdd_bookmark"/>
|
<addaction name="actionAdd_bookmark"/>
|
||||||
<addaction name="actionRemove_Bookmark"/>
|
<addaction name="actionRemove_Bookmark"/>
|
||||||
<addaction name="actionModify_Bookmark_Description"/>
|
<addaction name="actionModify_Bookmark_Description"/>
|
||||||
|
@ -1510,6 +1507,8 @@
|
||||||
<string>Project</string>
|
<string>Project</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionProject_New_File"/>
|
<addaction name="actionProject_New_File"/>
|
||||||
|
<addaction name="actionNew_Class"/>
|
||||||
|
<addaction name="actionNew_Header"/>
|
||||||
<addaction name="actionAdd_to_project"/>
|
<addaction name="actionAdd_to_project"/>
|
||||||
<addaction name="actionRemove_from_project"/>
|
<addaction name="actionRemove_from_project"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
@ -2702,6 +2701,14 @@
|
||||||
<string>New Class...</string>
|
<string>New Class...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionNew_Header">
|
||||||
|
<property name="text">
|
||||||
|
<string>New Header...</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>New Header...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
|
|
@ -164,7 +164,7 @@ void Project::open()
|
||||||
newUnit->setFolder(fromByteArray(ini.GetValue(groupName,"Folder","")));
|
newUnit->setFolder(fromByteArray(ini.GetValue(groupName,"Folder","")));
|
||||||
newUnit->setCompile(ini.GetBoolValue(groupName,"Compile", true));
|
newUnit->setCompile(ini.GetBoolValue(groupName,"Compile", true));
|
||||||
newUnit->setCompileCpp(
|
newUnit->setCompileCpp(
|
||||||
ini.GetBoolValue(groupName,"CompileCpp",mOptions.useGPP));
|
ini.GetBoolValue(groupName,"CompileCpp",mOptions.isCpp));
|
||||||
|
|
||||||
newUnit->setLink(ini.GetBoolValue(groupName,"Link", true));
|
newUnit->setLink(ini.GetBoolValue(groupName,"Link", true));
|
||||||
newUnit->setPriority(ini.GetLongValue(groupName,"Priority", 1000));
|
newUnit->setPriority(ini.GetLongValue(groupName,"Priority", 1000));
|
||||||
|
@ -268,7 +268,7 @@ PProjectUnit Project::newUnit(PFolderNode parentNode, const QString& customFileN
|
||||||
newUnit->node()->unitIndex = count;
|
newUnit->node()->unitIndex = count;
|
||||||
//parentNode.Expand(True);
|
//parentNode.Expand(True);
|
||||||
newUnit->setCompile(true);
|
newUnit->setCompile(true);
|
||||||
newUnit->setCompileCpp(mOptions.useGPP);
|
newUnit->setCompileCpp(mOptions.isCpp);
|
||||||
newUnit->setLink(true);
|
newUnit->setLink(true);
|
||||||
newUnit->setPriority(1000);
|
newUnit->setPriority(1000);
|
||||||
newUnit->setOverrideBuildCmd(false);
|
newUnit->setOverrideBuildCmd(false);
|
||||||
|
@ -348,6 +348,7 @@ bool Project::removeUnit(int index, bool doClose , bool removeFile)
|
||||||
// qDebug()<<(qint64)unit->editor();
|
// qDebug()<<(qint64)unit->editor();
|
||||||
// Attempt to close it
|
// Attempt to close it
|
||||||
if (doClose && (unit->editor())) {
|
if (doClose && (unit->editor())) {
|
||||||
|
unit->editor()->setInProject(false);
|
||||||
if (!pMainWindow->editorList()->closeEditor(unit->editor()))
|
if (!pMainWindow->editorList()->closeEditor(unit->editor()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -658,7 +659,7 @@ bool Project::assignTemplate(const std::shared_ptr<ProjectTemplate> aTemplate, b
|
||||||
}
|
}
|
||||||
mOptions = aTemplate->options();
|
mOptions = aTemplate->options();
|
||||||
mOptions.compilerSet = pSettings->compilerSets().defaultIndex();
|
mOptions.compilerSet = pSettings->compilerSets().defaultIndex();
|
||||||
mOptions.useGPP = useCpp;
|
mOptions.isCpp = useCpp;
|
||||||
updateCompilerSetType();
|
updateCompilerSetType();
|
||||||
mOptions.icon = aTemplate->icon();
|
mOptions.icon = aTemplate->icon();
|
||||||
|
|
||||||
|
@ -690,7 +691,7 @@ bool Project::assignTemplate(const std::shared_ptr<ProjectTemplate> aTemplate, b
|
||||||
} else {
|
} else {
|
||||||
QString s;
|
QString s;
|
||||||
PProjectUnit unit;
|
PProjectUnit unit;
|
||||||
if (mOptions.useGPP) {
|
if (mOptions.isCpp) {
|
||||||
s = templateUnit->CppText;
|
s = templateUnit->CppText;
|
||||||
unit = newUnit(mNode, templateUnit->CppName);
|
unit = newUnit(mNode, templateUnit->CppName);
|
||||||
} else {
|
} else {
|
||||||
|
@ -743,7 +744,7 @@ void Project::saveOptions()
|
||||||
ini.SetValue("Project","Compiler", toByteArray(mOptions.compilerCmd));
|
ini.SetValue("Project","Compiler", toByteArray(mOptions.compilerCmd));
|
||||||
ini.SetValue("Project","CppCompiler", toByteArray(mOptions.cppCompilerCmd));
|
ini.SetValue("Project","CppCompiler", toByteArray(mOptions.cppCompilerCmd));
|
||||||
ini.SetValue("Project","Linker", toByteArray(mOptions.linkerCmd));
|
ini.SetValue("Project","Linker", toByteArray(mOptions.linkerCmd));
|
||||||
ini.SetLongValue("Project","IsCpp", mOptions.useGPP);
|
ini.SetLongValue("Project","IsCpp", mOptions.isCpp);
|
||||||
ini.SetValue("Project","Icon", toByteArray(extractRelativePath(directory(), mOptions.icon)));
|
ini.SetValue("Project","Icon", toByteArray(extractRelativePath(directory(), mOptions.icon)));
|
||||||
ini.SetValue("Project","ExeOutput", toByteArray(mOptions.exeOutput));
|
ini.SetValue("Project","ExeOutput", toByteArray(mOptions.exeOutput));
|
||||||
ini.SetValue("Project","ObjectOutput", toByteArray(mOptions.objectOutput));
|
ini.SetValue("Project","ObjectOutput", toByteArray(mOptions.objectOutput));
|
||||||
|
@ -848,7 +849,7 @@ PProjectUnit Project::addUnit(const QString &inFileName, PFolderNode parentNode,
|
||||||
switch(getFileType(inFileName)) {
|
switch(getFileType(inFileName)) {
|
||||||
case FileType::CSource:
|
case FileType::CSource:
|
||||||
newUnit->setCompile(true);
|
newUnit->setCompile(true);
|
||||||
newUnit->setCompileCpp(mOptions.useGPP);
|
newUnit->setCompileCpp(mOptions.isCpp);
|
||||||
newUnit->setLink(true);
|
newUnit->setLink(true);
|
||||||
break;
|
break;
|
||||||
case FileType::CppSource:
|
case FileType::CppSource:
|
||||||
|
@ -858,7 +859,7 @@ PProjectUnit Project::addUnit(const QString &inFileName, PFolderNode parentNode,
|
||||||
break;
|
break;
|
||||||
case FileType::WindowsResourceSource:
|
case FileType::WindowsResourceSource:
|
||||||
newUnit->setCompile(true);
|
newUnit->setCompile(true);
|
||||||
newUnit->setCompileCpp(mOptions.useGPP);
|
newUnit->setCompileCpp(mOptions.isCpp);
|
||||||
newUnit->setLink(false);
|
newUnit->setLink(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1212,6 +1213,7 @@ void Project::closeUnit(int index)
|
||||||
PProjectUnit unit = mUnits[index];
|
PProjectUnit unit = mUnits[index];
|
||||||
if (unit->editor()) {
|
if (unit->editor()) {
|
||||||
saveUnitLayout(unit->editor(),index);
|
saveUnitLayout(unit->editor(),index);
|
||||||
|
unit->editor()->setInProject(false);
|
||||||
pMainWindow->editorList()->forceCloseEditor(unit->editor());
|
pMainWindow->editorList()->forceCloseEditor(unit->editor());
|
||||||
unit->setEditor(nullptr);
|
unit->setEditor(nullptr);
|
||||||
}
|
}
|
||||||
|
@ -1381,7 +1383,7 @@ void Project::loadOptions(SimpleIni& ini)
|
||||||
mOptions.privateResource = fromByteArray(ini.GetValue("Project", "PrivateResource", ""));
|
mOptions.privateResource = fromByteArray(ini.GetValue("Project", "PrivateResource", ""));
|
||||||
mOptions.resourceIncludes = fromByteArray(ini.GetValue("Project", "ResourceIncludes", "")).split(";",QString::SkipEmptyParts);
|
mOptions.resourceIncludes = fromByteArray(ini.GetValue("Project", "ResourceIncludes", "")).split(";",QString::SkipEmptyParts);
|
||||||
mOptions.makeIncludes = fromByteArray(ini.GetValue("Project", "MakeIncludes", "")).split(";",QString::SkipEmptyParts);
|
mOptions.makeIncludes = fromByteArray(ini.GetValue("Project", "MakeIncludes", "")).split(";",QString::SkipEmptyParts);
|
||||||
mOptions.useGPP = ini.GetBoolValue("Project", "IsCpp", false);
|
mOptions.isCpp = ini.GetBoolValue("Project", "IsCpp", false);
|
||||||
mOptions.exeOutput = fromByteArray(ini.GetValue("Project", "ExeOutput", ""));
|
mOptions.exeOutput = fromByteArray(ini.GetValue("Project", "ExeOutput", ""));
|
||||||
mOptions.objectOutput = fromByteArray(ini.GetValue("Project", "ObjectOutput", ""));
|
mOptions.objectOutput = fromByteArray(ini.GetValue("Project", "ObjectOutput", ""));
|
||||||
mOptions.logOutput = fromByteArray(ini.GetValue("Project", "LogOutput", ""));
|
mOptions.logOutput = fromByteArray(ini.GetValue("Project", "LogOutput", ""));
|
||||||
|
@ -1470,7 +1472,7 @@ void Project::loadOptions(SimpleIni& ini)
|
||||||
mOptions.objFiles = fromByteArray(ini.GetValue("Project", "ObjFiles", "")).split(";",QString::SkipEmptyParts);
|
mOptions.objFiles = fromByteArray(ini.GetValue("Project", "ObjFiles", "")).split(";",QString::SkipEmptyParts);
|
||||||
mOptions.includes = fromByteArray(ini.GetValue("Project", "IncludeDirs", "")).split(";",QString::SkipEmptyParts);
|
mOptions.includes = fromByteArray(ini.GetValue("Project", "IncludeDirs", "")).split(";",QString::SkipEmptyParts);
|
||||||
mOptions.compilerCmd = fromByteArray(ini.GetValue("Project", "CompilerOptions", ""));
|
mOptions.compilerCmd = fromByteArray(ini.GetValue("Project", "CompilerOptions", ""));
|
||||||
mOptions.useGPP = ini.GetBoolValue("Project", "Use_GPP", false);
|
mOptions.isCpp = ini.GetBoolValue("Project", "Use_GPP", false);
|
||||||
mOptions.exeOutput = fromByteArray(ini.GetValue("Project", "ExeOutput", ""));
|
mOptions.exeOutput = fromByteArray(ini.GetValue("Project", "ExeOutput", ""));
|
||||||
mOptions.objectOutput = fromByteArray(ini.GetValue("Project", "ObjectOutput", ""));
|
mOptions.objectOutput = fromByteArray(ini.GetValue("Project", "ObjectOutput", ""));
|
||||||
mOptions.overrideOutput = ini.GetBoolValue("Project", "OverrideOutput", false);
|
mOptions.overrideOutput = ini.GetBoolValue("Project", "OverrideOutput", false);
|
||||||
|
|
|
@ -41,7 +41,7 @@ ProjectOptions::ProjectOptions()
|
||||||
{
|
{
|
||||||
type = ProjectType::GUI;
|
type = ProjectType::GUI;
|
||||||
version = 2;
|
version = 2;
|
||||||
useGPP = false;
|
isCpp = false;
|
||||||
logOutputEnabled = false;
|
logOutputEnabled = false;
|
||||||
useCustomMakefile = false;
|
useCustomMakefile = false;
|
||||||
usePrecompiledHeader = false;
|
usePrecompiledHeader = false;
|
||||||
|
|
|
@ -60,7 +60,7 @@ struct ProjectOptions{
|
||||||
QString privateResource;
|
QString privateResource;
|
||||||
QStringList resourceIncludes;
|
QStringList resourceIncludes;
|
||||||
QStringList makeIncludes;
|
QStringList makeIncludes;
|
||||||
bool useGPP;
|
bool isCpp;
|
||||||
QString icon;
|
QString icon;
|
||||||
QString exeOutput;
|
QString exeOutput;
|
||||||
QString objectOutput;
|
QString objectOutput;
|
||||||
|
|
|
@ -134,7 +134,7 @@ void ProjectTemplate::readTemplateFile(const QString &fileName)
|
||||||
mOptions.compilerCmd = fromByteArray(mIni->GetValue("Project", "Compiler", ""));
|
mOptions.compilerCmd = fromByteArray(mIni->GetValue("Project", "Compiler", ""));
|
||||||
mOptions.cppCompilerCmd = fromByteArray(mIni->GetValue("Project", "CppCompiler", ""));
|
mOptions.cppCompilerCmd = fromByteArray(mIni->GetValue("Project", "CppCompiler", ""));
|
||||||
mOptions.linkerCmd = fromByteArray(mIni->GetValue("Project", "Linker",""));
|
mOptions.linkerCmd = fromByteArray(mIni->GetValue("Project", "Linker",""));
|
||||||
mOptions.useGPP = mIni->GetBoolValue("Project", "IsCpp", false);
|
mOptions.isCpp = mIni->GetBoolValue("Project", "IsCpp", false);
|
||||||
mOptions.includeVersionInfo = mIni->GetBoolValue("Project", "IncludeVersionInfo", false);
|
mOptions.includeVersionInfo = mIni->GetBoolValue("Project", "IncludeVersionInfo", false);
|
||||||
mOptions.supportXPThemes = mIni->GetBoolValue("Project", "SupportXPThemes", false);
|
mOptions.supportXPThemes = mIni->GetBoolValue("Project", "SupportXPThemes", false);
|
||||||
mOptions.exeOutput = fromByteArray(mIni->GetValue("Project", "ExeOutput", ""));
|
mOptions.exeOutput = fromByteArray(mIni->GetValue("Project", "ExeOutput", ""));
|
||||||
|
|
|
@ -4738,6 +4738,26 @@ void Settings::UI::setNewClassDialogHeight(int newNewClassDialogHeight)
|
||||||
mNewClassDialogHeight = newNewClassDialogHeight;
|
mNewClassDialogHeight = newNewClassDialogHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Settings::UI::newHeaderDialogHeight() const
|
||||||
|
{
|
||||||
|
return mNewHeaderDialogHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::UI::setNewHeaderDialogHeight(int newNewFileDialogHeight)
|
||||||
|
{
|
||||||
|
mNewHeaderDialogHeight = newNewFileDialogHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
int Settings::UI::newHeaderDialogWidth() const
|
||||||
|
{
|
||||||
|
return mNewHeaderDialogWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::UI::setNewHeaderDialogWidth(int newNewFileDialogWidth)
|
||||||
|
{
|
||||||
|
mNewHeaderDialogWidth = newNewFileDialogWidth;
|
||||||
|
}
|
||||||
|
|
||||||
int Settings::UI::settingsDialogHeight() const
|
int Settings::UI::settingsDialogHeight() const
|
||||||
{
|
{
|
||||||
return mSettingsDialogHeight;
|
return mSettingsDialogHeight;
|
||||||
|
@ -5002,6 +5022,8 @@ void Settings::UI::doSave()
|
||||||
saveValue("new_project_dialog_height", mNewProjectDialogHeight);
|
saveValue("new_project_dialog_height", mNewProjectDialogHeight);
|
||||||
saveValue("new_class_dialog_width", mNewClassDialogWidth);
|
saveValue("new_class_dialog_width", mNewClassDialogWidth);
|
||||||
saveValue("new_class_dialog_height", mNewClassDialogHeight);
|
saveValue("new_class_dialog_height", mNewClassDialogHeight);
|
||||||
|
saveValue("new_header_dialog_width", mNewHeaderDialogWidth);
|
||||||
|
saveValue("new_header_dialog_height", mNewHeaderDialogHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::UI::doLoad()
|
void Settings::UI::doLoad()
|
||||||
|
@ -5049,4 +5071,6 @@ void Settings::UI::doLoad()
|
||||||
mNewProjectDialogHeight = intValue("new_project_dialog_height", 600*qApp->desktop()->height()/1080);
|
mNewProjectDialogHeight = intValue("new_project_dialog_height", 600*qApp->desktop()->height()/1080);
|
||||||
mNewClassDialogWidth = intValue("new_class_dialog_width", 642*qApp->desktop()->width()/1920);
|
mNewClassDialogWidth = intValue("new_class_dialog_width", 642*qApp->desktop()->width()/1920);
|
||||||
mNewClassDialogHeight = intValue("new_class_dialog_height", 300*qApp->desktop()->height()/1080);
|
mNewClassDialogHeight = intValue("new_class_dialog_height", 300*qApp->desktop()->height()/1080);
|
||||||
|
mNewHeaderDialogWidth = intValue("new_header_dialog_width", 642*qApp->desktop()->width()/1920);
|
||||||
|
mNewHeaderDialogHeight = intValue("new_header_dialog_height", 300*qApp->desktop()->height()/1080);
|
||||||
}
|
}
|
||||||
|
|
|
@ -988,6 +988,12 @@ public:
|
||||||
int newClassDialogHeight() const;
|
int newClassDialogHeight() const;
|
||||||
void setNewClassDialogHeight(int newNewClassDialogHeight);
|
void setNewClassDialogHeight(int newNewClassDialogHeight);
|
||||||
|
|
||||||
|
int newHeaderDialogWidth() const;
|
||||||
|
void setNewHeaderDialogWidth(int newNewFileDialogWidth);
|
||||||
|
|
||||||
|
int newHeaderDialogHeight() const;
|
||||||
|
void setNewHeaderDialogHeight(int newNewFileDialogHeight);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QByteArray mMainWindowState;
|
QByteArray mMainWindowState;
|
||||||
QByteArray mMainWindowGeometry;
|
QByteArray mMainWindowGeometry;
|
||||||
|
@ -1031,6 +1037,8 @@ public:
|
||||||
int mNewProjectDialogHeight;
|
int mNewProjectDialogHeight;
|
||||||
int mNewClassDialogWidth;
|
int mNewClassDialogWidth;
|
||||||
int mNewClassDialogHeight;
|
int mNewClassDialogHeight;
|
||||||
|
int mNewHeaderDialogWidth;
|
||||||
|
int mNewHeaderDialogHeight;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void doSave() override;
|
void doSave() override;
|
||||||
|
|
|
@ -81,7 +81,7 @@ void ProjectGeneralWidget::doLoad()
|
||||||
|
|
||||||
ui->lstType->setCurrentRow( static_cast<int>(project->options().type));
|
ui->lstType->setCurrentRow( static_cast<int>(project->options().type));
|
||||||
|
|
||||||
ui->cbDefaultCpp->setChecked(project->options().useGPP);
|
ui->cbDefaultCpp->setChecked(project->options().isCpp);
|
||||||
ui->cbSupportXPTheme->setChecked(project->options().supportXPThemes);
|
ui->cbSupportXPTheme->setChecked(project->options().supportXPThemes);
|
||||||
mIconPath = project->options().icon;
|
mIconPath = project->options().icon;
|
||||||
QPixmap icon(mIconPath);
|
QPixmap icon(mIconPath);
|
||||||
|
@ -100,7 +100,7 @@ void ProjectGeneralWidget::doSave()
|
||||||
int row = std::max(0,ui->lstType->currentRow());
|
int row = std::max(0,ui->lstType->currentRow());
|
||||||
project->options().type = static_cast<ProjectType>(row);
|
project->options().type = static_cast<ProjectType>(row);
|
||||||
|
|
||||||
project->options().useGPP = ui->cbDefaultCpp->isChecked();
|
project->options().isCpp = ui->cbDefaultCpp->isChecked();
|
||||||
project->options().supportXPThemes = ui->cbSupportXPTheme->isChecked();
|
project->options().supportXPThemes = ui->cbSupportXPTheme->isChecked();
|
||||||
if (mIconPath.isEmpty()
|
if (mIconPath.isEmpty()
|
||||||
|| !ui->lbIcon->pixmap() || ui->lbIcon->pixmap()->isNull()) {
|
|| !ui->lbIcon->pixmap() || ui->lbIcon->pixmap()->isNull()) {
|
||||||
|
|
|
@ -11,6 +11,7 @@ NewClassDialog::NewClassDialog(QWidget *parent) :
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
resize(pSettings->ui().newClassDialogWidth(),pSettings->ui().newClassDialogHeight());
|
resize(pSettings->ui().newClassDialogWidth(),pSettings->ui().newClassDialogHeight());
|
||||||
updateIcons();
|
updateIcons();
|
||||||
|
ui->txtClassName->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
NewClassDialog::~NewClassDialog()
|
NewClassDialog::~NewClassDialog()
|
||||||
|
|
|
@ -1,14 +1,68 @@
|
||||||
#include "newheaderdialog.h"
|
#include "newheaderdialog.h"
|
||||||
#include "ui_newheaderdialog.h"
|
#include "ui_newheaderdialog.h"
|
||||||
|
#include "../iconsmanager.h"
|
||||||
|
#include "../settings.h"
|
||||||
|
|
||||||
|
#include <QFileDialog>
|
||||||
|
|
||||||
NewHeaderDialog::NewHeaderDialog(QWidget *parent) :
|
NewHeaderDialog::NewHeaderDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::NewHeaderDialog)
|
ui(new Ui::NewHeaderDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
resize(pSettings->ui().newHeaderDialogWidth(),pSettings->ui().newHeaderDialogHeight());
|
||||||
|
updateIcons();
|
||||||
|
ui->txtHeader->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
NewHeaderDialog::~NewHeaderDialog()
|
NewHeaderDialog::~NewHeaderDialog()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString NewHeaderDialog::headerName() const
|
||||||
|
{
|
||||||
|
return ui->txtHeader->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString NewHeaderDialog::path() const
|
||||||
|
{
|
||||||
|
return ui->txtPath->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewHeaderDialog::setPath(const QString &location)
|
||||||
|
{
|
||||||
|
ui->txtPath->setText(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewHeaderDialog::updateIcons()
|
||||||
|
{
|
||||||
|
pIconsManager->setIcon(ui->btnBrowse, IconsManager::ACTION_FILE_OPEN_FOLDER);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewHeaderDialog::closeEvent(QCloseEvent */*event*/)
|
||||||
|
{
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewHeaderDialog::on_btnCreate_clicked()
|
||||||
|
{
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NewHeaderDialog::on_btnCancel_clicked()
|
||||||
|
{
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NewHeaderDialog::on_btnBrowse_clicked()
|
||||||
|
{
|
||||||
|
QString fileName = QFileDialog::getExistingDirectory(
|
||||||
|
this,
|
||||||
|
tr("Path"),
|
||||||
|
ui->txtPath->text());
|
||||||
|
ui->txtPath->setText(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,23 @@ class NewHeaderDialog : public QDialog
|
||||||
public:
|
public:
|
||||||
explicit NewHeaderDialog(QWidget *parent = nullptr);
|
explicit NewHeaderDialog(QWidget *parent = nullptr);
|
||||||
~NewHeaderDialog();
|
~NewHeaderDialog();
|
||||||
|
QString headerName() const;
|
||||||
|
QString path() const;
|
||||||
|
void setPath(const QString& location);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::NewHeaderDialog *ui;
|
Ui::NewHeaderDialog *ui;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateIcons();
|
||||||
|
|
||||||
|
// QWidget interface
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
private slots:
|
||||||
|
void on_btnCreate_clicked();
|
||||||
|
void on_btnCancel_clicked();
|
||||||
|
void on_btnBrowse_clicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NEWHEADERDIALOG_H
|
#endif // NEWHEADERDIALOG_H
|
||||||
|
|
|
@ -11,68 +11,93 @@
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>New Header</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QLabel" name="label">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="geometry">
|
<item row="1" column="1">
|
||||||
<rect>
|
<widget class="QLineEdit" name="txtPath"/>
|
||||||
<x>30</x>
|
</item>
|
||||||
<y>40</y>
|
<item row="0" column="0">
|
||||||
<width>69</width>
|
<widget class="QLabel" name="label">
|
||||||
<height>20</height>
|
<property name="text">
|
||||||
</rect>
|
<string>Header:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>Header:</string>
|
</item>
|
||||||
</property>
|
<item row="1" column="2">
|
||||||
</widget>
|
<widget class="QToolButton" name="btnBrowse">
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
<property name="toolTip">
|
||||||
<property name="geometry">
|
<string>Browse</string>
|
||||||
<rect>
|
</property>
|
||||||
<x>150</x>
|
<property name="text">
|
||||||
<y>40</y>
|
<string>Browse</string>
|
||||||
<width>113</width>
|
</property>
|
||||||
<height>27</height>
|
<property name="icon">
|
||||||
</rect>
|
<iconset resource="../icons.qrc">
|
||||||
</property>
|
<normaloff>:/icons/images/newlook24/053-open.png</normaloff>:/icons/images/newlook24/053-open.png</iconset>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QLabel" name="label_2">
|
</widget>
|
||||||
<property name="geometry">
|
</item>
|
||||||
<rect>
|
<item row="1" column="0">
|
||||||
<x>40</x>
|
<widget class="QLabel" name="label_2">
|
||||||
<y>90</y>
|
<property name="text">
|
||||||
<width>69</width>
|
<string>Path:</string>
|
||||||
<height>20</height>
|
</property>
|
||||||
</rect>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
<property name="text">
|
<item row="3" column="0" colspan="3">
|
||||||
<string>Path:</string>
|
<widget class="QWidget" name="widget" native="true">
|
||||||
</property>
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
</widget>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit_2">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="geometry">
|
<property name="orientation">
|
||||||
<rect>
|
<enum>Qt::Horizontal</enum>
|
||||||
<x>150</x>
|
</property>
|
||||||
<y>80</y>
|
<property name="sizeHint" stdset="0">
|
||||||
<width>113</width>
|
<size>
|
||||||
<height>27</height>
|
<width>179</width>
|
||||||
</rect>
|
<height>20</height>
|
||||||
</property>
|
</size>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QToolButton" name="btnBrowse">
|
</spacer>
|
||||||
<property name="geometry">
|
</item>
|
||||||
<rect>
|
<item>
|
||||||
<x>350</x>
|
<widget class="QPushButton" name="btnCreate">
|
||||||
<y>80</y>
|
<property name="text">
|
||||||
<width>28</width>
|
<string>Create</string>
|
||||||
<height>27</height>
|
</property>
|
||||||
</rect>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
<property name="text">
|
<item>
|
||||||
<string>...</string>
|
<widget class="QPushButton" name="btnCancel">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>Cancel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="txtHeader"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../icons.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
|
@ -208,7 +208,7 @@ void NewProjectDialog::on_lstTemplates_currentItemChanged(QListWidgetItem *curre
|
||||||
int index = current->data(Qt::UserRole).toInt();
|
int index = current->data(Qt::UserRole).toInt();
|
||||||
PProjectTemplate t = mTemplates[index];
|
PProjectTemplate t = mTemplates[index];
|
||||||
ui->lblDescription->setText(t->description());
|
ui->lblDescription->setText(t->description());
|
||||||
if (t->options().useGPP) {
|
if (t->options().isCpp) {
|
||||||
ui->rdCProject->setEnabled(false);
|
ui->rdCProject->setEnabled(false);
|
||||||
ui->rdCppProject->setChecked(true);
|
ui->rdCppProject->setChecked(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue