refactor: fix typos

This commit is contained in:
Roy Qu 2023-07-25 09:41:20 +08:00
parent 21b4494f3c
commit 9076fb6ab9
11 changed files with 46 additions and 46 deletions

View File

@ -182,7 +182,7 @@ SOURCES += \
settingsdialog/editorgeneralwidget.cpp \
settingsdialog/editorsymbolcompletionwidget.cpp \
settingsdialog/editorsyntaxcheckwidget.cpp \
settingsdialog/environmentappearencewidget.cpp \
settingsdialog/environmentappearancewidget.cpp \
settingsdialog/executorgeneralwidget.cpp \
settingsdialog/settingsdialog.cpp \
settingsdialog/settingswidget.cpp \
@ -317,7 +317,7 @@ HEADERS += \
settingsdialog/editorgeneralwidget.h \
settingsdialog/editorsymbolcompletionwidget.h \
settingsdialog/editorsyntaxcheckwidget.h \
settingsdialog/environmentappearencewidget.h \
settingsdialog/environmentappearancewidget.h \
settingsdialog/executorgeneralwidget.h \
settingsdialog/settingsdialog.h \
settingsdialog/settingswidget.h \
@ -406,7 +406,7 @@ FORMS += \
settingsdialog/editorgeneralwidget.ui \
settingsdialog/editorsymbolcompletionwidget.ui \
settingsdialog/editorsyntaxcheckwidget.ui \
settingsdialog/environmentappearencewidget.ui \
settingsdialog/environmentappearancewidget.ui \
settingsdialog/executorgeneralwidget.ui \
settingsdialog/settingsdialog.ui \
widgets/custommakefileinfodialog.ui \

View File

@ -3304,7 +3304,7 @@ Settings::Environment::Environment(Settings *settings):_Base(settings, SETTING_E
void Settings::Environment::doLoad()
{
//Appearence
//Appearance
mTheme = stringValue("theme","dark");
QString defaultFontName = "Segoe UI";
QString defaultLocaleName = QLocale::system().name();
@ -3563,7 +3563,7 @@ void Settings::Environment::setIconZoomFactor(double newIconZoomFactor)
void Settings::Environment::doSave()
{
//Appearence
//Appearance
saveValue("theme", mTheme);
saveValue("interface_font", mInterfaceFont);
saveValue("interface_font_size", mInterfaceFontSize);
@ -4318,7 +4318,7 @@ void Settings::CodeCompletion::doSave()
void Settings::CodeCompletion::doLoad()
{
//Appearence
//Appearance
mWidth = intValue("width",700);
mHeight = intValue("height",400);
mEnabled = boolValue("enabled",true);

View File

@ -592,7 +592,7 @@ public:
private:
//Appearence
//Appearance
QString mTheme;
QString mInterfaceFont;
int mInterfaceFontSize;

View File

@ -14,8 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "environmentappearencewidget.h"
#include "ui_environmentappearencewidget.h"
#include "environmentappearancewidget.h"
#include "ui_environmentappearancewidget.h"
#include <QApplication>
#include <QStyleFactory>
@ -24,19 +24,19 @@
#include "../thememanager.h"
#include "../iconsmanager.h"
EnvironmentAppearenceWidget::EnvironmentAppearenceWidget(const QString& name, const QString& group, QWidget *parent) :
EnvironmentAppearanceWidget::EnvironmentAppearanceWidget(const QString& name, const QString& group, QWidget *parent) :
SettingsWidget(name,group,parent),
ui(new Ui::EnvironmentAppearenceWidget)
ui(new Ui::EnvironmentAppearanceWidget)
{
ui->setupUi(this);
}
EnvironmentAppearenceWidget::~EnvironmentAppearenceWidget()
EnvironmentAppearanceWidget::~EnvironmentAppearanceWidget()
{
delete ui;
}
void EnvironmentAppearenceWidget::doLoad()
void EnvironmentAppearanceWidget::doLoad()
{
for (int i=0; i<ui->cbTheme->count();i++) {
if (ui->cbTheme->itemData(i) == pSettings->environment().theme()) {
@ -64,7 +64,7 @@ void EnvironmentAppearenceWidget::doLoad()
}
}
void EnvironmentAppearenceWidget::doSave()
void EnvironmentAppearanceWidget::doSave()
{
if (pSettings->environment().theme()!=ui->cbTheme->currentData().toString()) {
ThemeManager themeManager;
@ -90,7 +90,7 @@ void EnvironmentAppearenceWidget::doSave()
pMainWindow->applySettings();
}
void EnvironmentAppearenceWidget::init()
void EnvironmentAppearanceWidget::init()
{
ThemeManager themeManager;
QList<PAppTheme> appThemes = themeManager.getThemes();
@ -108,7 +108,7 @@ void EnvironmentAppearenceWidget::init()
SettingsWidget::init();
}
void EnvironmentAppearenceWidget::on_cbTheme_currentIndexChanged(int /* index */)
void EnvironmentAppearanceWidget::on_cbTheme_currentIndexChanged(int /* index */)
{
ThemeManager themeManager;
PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString());

View File

@ -14,26 +14,26 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef ENVIRONMENTAPPEARENCEWIDGET_H
#define ENVIRONMENTAPPEARENCEWIDGET_H
#ifndef ENVIRONMENTAPPEARANCEWIDGET_H
#define ENVIRONMENTAPPEARANCEWIDGET_H
#include <QWidget>
#include "settingswidget.h"
namespace Ui {
class EnvironmentAppearenceWidget;
class EnvironmentAppearanceWidget;
}
class EnvironmentAppearenceWidget : public SettingsWidget
class EnvironmentAppearanceWidget : public SettingsWidget
{
Q_OBJECT
public:
explicit EnvironmentAppearenceWidget(const QString& name, const QString& group, QWidget *parent = nullptr);
~EnvironmentAppearenceWidget();
explicit EnvironmentAppearanceWidget(const QString& name, const QString& group, QWidget *parent = nullptr);
~EnvironmentAppearanceWidget();
private:
Ui::EnvironmentAppearenceWidget *ui;
Ui::EnvironmentAppearanceWidget *ui;
// SettingsWidget interface
protected:
@ -47,4 +47,4 @@ private slots:
void on_cbTheme_currentIndexChanged(int index);
};
#endif // ENVIRONMENTAPPEARENCEWIDGET_H
#endif // ENVIRONMENTAPPEARANCEWIDGET_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EnvironmentAppearenceWidget</class>
<widget class="QWidget" name="EnvironmentAppearenceWidget">
<class>EnvironmentAppearanceWidget</class>
<widget class="QWidget" name="EnvironmentAppearanceWidget">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -31,7 +31,7 @@
#include "editorsnippetwidget.h"
#include "editorcustomctypekeywords.h"
#include "editormiscwidget.h"
#include "environmentappearencewidget.h"
#include "environmentappearancewidget.h"
#include "environmentshortcutwidget.h"
#include "environmentfolderswidget.h"
#include "environmentperformancewidget.h"
@ -140,7 +140,7 @@ PSettingsDialog SettingsDialog::optionDialog()
dialog->setWindowTitle(tr("Options"));
SettingsWidget* widget;
widget = new EnvironmentAppearenceWidget(tr("Appearance"),tr("Environment"));
widget = new EnvironmentAppearanceWidget(tr("Appearance"),tr("Environment"));
dialog->addWidget(widget);
#ifdef Q_OS_WIN

View File

@ -75,7 +75,7 @@ private:
// EditorFontWidget *pEditorFontWidget;
// EditorClipboardWidget *pEditorClipboardWidget;
// EditorColorSchemeWidget *pEditorColorSchemeWidget;
// EnvironmentAppearenceWidget *pEnvironmentAppearenceWidget;
// EnvironmentAppearanceWidget *pEnvironmentAppearanceWidget;
// EditorSymbolCompletionWidget *pEditorSymbolCompletionWidget;
// EditorCodeCompletionWidget *pEditorCodeCompletionWidget;
// EditorSyntaxCheckWidget *pEditorSyntaxCheckWidget;

View File

@ -1749,7 +1749,7 @@
</message>
</context>
<context>
<name>EnvironmentAppearenceWidget</name>
<name>EnvironmentAppearanceWidget</name>
<message>
<source>Form</source>
<translation>Configuração</translation>

View File

@ -2434,74 +2434,74 @@ Are you really want to continue?</oldsource>
</message>
</context>
<context>
<name>EnvironmentAppearenceWidget</name>
<name>EnvironmentAppearanceWidget</name>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="14"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="14"/>
<source>Form</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="160"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="160"/>
<source>Theme:</source>
<translation>:</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="137"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="137"/>
<source>Use custom theme</source>
<translation>使</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="20"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="20"/>
<source>Icon Set:</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="192"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="192"/>
<source>Use custom icon set</source>
<translation>使</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="263"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="263"/>
<source>Icon Zoom:</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="65"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="65"/>
<source>Font:</source>
<translation>:</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="215"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="215"/>
<source>Language:</source>
<translation>:</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="240"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="240"/>
<source>*Needs restart</source>
<translation>*</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.ui" line="167"/>
<location filename="../settingsdialog/environmentappearancewidget.ui" line="167"/>
<source>Font Size:</source>
<translation>:</translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.cpp" line="100"/>
<location filename="../settingsdialog/environmentappearancewidget.cpp" line="100"/>
<source>English</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.cpp" line="101"/>
<location filename="../settingsdialog/environmentappearancewidget.cpp" line="101"/>
<source>Portuguese</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.cpp" line="102"/>
<location filename="../settingsdialog/environmentappearancewidget.cpp" line="102"/>
<source>Simplified Chinese</source>
<translation></translation>
</message>
<message>
<location filename="../settingsdialog/environmentappearencewidget.cpp" line="103"/>
<location filename="../settingsdialog/environmentappearancewidget.cpp" line="103"/>
<source>Traditional Chinese</source>
<translation></translation>
</message>

View File

@ -1582,7 +1582,7 @@
</message>
</context>
<context>
<name>EnvironmentAppearenceWidget</name>
<name>EnvironmentAppearanceWidget</name>
<message>
<source>Form</source>
<translation type="unfinished"></translation>