auto save new class dialog widht/height

This commit is contained in:
Roy Qu 2022-01-27 18:46:37 +08:00
parent 620bdc8266
commit 656ab3eaed
10 changed files with 504 additions and 419 deletions

View File

@ -1,7 +1,7 @@
Red Panda C++ Version 0.14.0
- enhancement: custom icon set ( in the configuration folder)
- enhancement: show custom icon set folder in options -> enviroment -> folders
- enhancement: add class ( to project) wizard
- enhancement: new class ( to project) wizard
- enhancement: greatly speed up code completion
- fix: code folding calcuation not correct when some codes are folded and editing after them

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -471,7 +471,7 @@ void MainWindow::updateProjectActions()
ui->actionMakeClean->setEnabled(hasProject);
ui->actionProject_options->setEnabled(hasProject);
ui->actionClose_Project->setEnabled(hasProject);
ui->actionAdd_Class->setEnabled(hasProject);
ui->actionNew_Class->setEnabled(hasProject);
ui->actionProject_Open_Folder_In_Explorer->setEnabled(hasProject);
ui->actionProject_Open_In_Terminal->setEnabled(hasProject);
updateCompileActions();
@ -6150,7 +6150,7 @@ void MainWindow::on_actionDelete_to_Word_End_triggered()
}
void MainWindow::on_actionAdd_Class_triggered()
void MainWindow::on_actionNew_Class_triggered()
{
if (!mProject)
return;
@ -6201,5 +6201,7 @@ void MainWindow::on_actionAdd_Class_triggered()
parseFileList(mProject->cppParser());
updateProjectView();
}
pSettings->ui().setNewClassDialogWidth(dialog.width());
pSettings->ui().setNewClassDialogHeight(dialog.height());
}

View File

@ -560,7 +560,7 @@ private slots:
void on_actionDelete_to_Word_End_triggered();
void on_actionAdd_Class_triggered();
void on_actionNew_Class_triggered();
private:
Ui::MainWindow *ui;

View File

@ -1493,7 +1493,7 @@
<addaction name="actionBack"/>
<addaction name="actionForward"/>
<addaction name="separator"/>
<addaction name="actionAdd_Class"/>
<addaction name="actionNew_Class"/>
<addaction name="separator"/>
<addaction name="actionAdd_bookmark"/>
<addaction name="actionRemove_Bookmark"/>
@ -2697,9 +2697,9 @@
<string>Ctrl+Shift+E</string>
</property>
</action>
<action name="actionAdd_Class">
<action name="actionNew_Class">
<property name="text">
<string>Add Class...</string>
<string>New Class...</string>
</property>
</action>
</widget>

View File

@ -4700,6 +4700,16 @@ void Settings::UI::setNewProjectDialogHeight(int newNewProjectDialogHeight)
mNewProjectDialogHeight = newNewProjectDialogHeight;
}
int Settings::UI::newClassDialogWidth() const
{
return mNewClassDialogWidth;
}
void Settings::UI::setNewClassDialogWidth(int newNewClassDialogWidth)
{
mNewClassDialogWidth = newNewClassDialogWidth;
}
int Settings::UI::settingsDialogHeight() const
{
return mSettingsDialogHeight;
@ -4962,6 +4972,8 @@ void Settings::UI::doSave()
saveValue("settings_dialog_splitter", mSettingsDialogSplitterPos);
saveValue("new_project_dialog_width", mNewProjectDialogWidth);
saveValue("new_project_dialog_height", mNewProjectDialogHeight);
saveValue("new_class_dialog_width", mNewClassDialogWidth);
saveValue("new_class_dialog_height", mNewClassDialogHeight);
}
void Settings::UI::doLoad()
@ -5007,4 +5019,6 @@ void Settings::UI::doLoad()
mNewProjectDialogWidth = intValue("new_project_dialog_width", 900*qApp->desktop()->width()/1920);
mNewProjectDialogHeight = intValue("new_project_dialog_height", 600*qApp->desktop()->height()/1080);
mNewClassDialogWidth = intValue("new_class_dialog_width", 642*qApp->desktop()->width()/1920);
mNewClassDialogHeight = intValue("new_class_dialog_height", 300*qApp->desktop()->height()/1080);
}

View File

@ -977,6 +977,9 @@ public:
int newProjectDialogHeight() const;
void setNewProjectDialogHeight(int newNewProjectDialogHeight);
int newClassDialogWidth() const;
void setNewClassDialogWidth(int newNewClassDialogWidth);
private:
QByteArray mMainWindowState;
QByteArray mMainWindowGeometry;
@ -1018,6 +1021,8 @@ public:
int mSettingsDialogSplitterPos;
int mNewProjectDialogWidth;
int mNewProjectDialogHeight;
int mNewClassDialogWidth;
int mNewClassDialogHeight;
protected:
void doSave() override;

View File

@ -1,7 +1,7 @@
#include "newclassdialog.h"
#include "ui_newclassdialog.h"
#include "../iconsmanager.h"
#include "../settings.h"
#include <QFileDialog>
NewClassDialog::NewClassDialog(QWidget *parent) :
@ -9,6 +9,7 @@ NewClassDialog::NewClassDialog(QWidget *parent) :
ui(new Ui::NewClassDialog)
{
ui->setupUi(this);
resize(pSettings->ui().newClassDialogWidth(),pSettings->ui().newClassDialogHeight());
updateIcons();
}
@ -72,7 +73,7 @@ void NewClassDialog::on_btnBrowsePath_clicked()
{
QString fileName = QFileDialog::getExistingDirectory(
this,
tr("Location"),
tr("Path"),
ui->txtPath->text());
ui->txtPath->setText(fileName);
}

View File

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>New Class</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="7" column="0">