2021-12-26 23:18:28 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2021-04-08 10:29:21 +08:00
|
|
|
#ifndef SETTINGS_H
|
|
|
|
#define SETTINGS_H
|
|
|
|
|
|
|
|
#include <QSettings>
|
2021-04-13 22:17:18 +08:00
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
2021-06-07 11:02:03 +08:00
|
|
|
#include <QColor>
|
2021-10-22 07:42:51 +08:00
|
|
|
#include <QString>
|
2022-05-12 15:28:08 +08:00
|
|
|
#include <QPair>
|
2021-06-07 11:02:03 +08:00
|
|
|
#include "qsynedit/SynEdit.h"
|
2022-05-13 20:22:16 +08:00
|
|
|
#include "compiler/compilerinfo.h"
|
2021-04-08 10:29:21 +08:00
|
|
|
|
2021-04-15 11:18:14 +08:00
|
|
|
/**
|
|
|
|
* use the following command to get gcc's default bin/library folders:
|
|
|
|
* gcc -print-search-dirs
|
|
|
|
*/
|
|
|
|
|
2021-04-15 21:32:45 +08:00
|
|
|
#define SETTING_DIRS "Dirs"
|
|
|
|
#define SETTING_EDITOR "Editor"
|
2021-06-18 21:48:40 +08:00
|
|
|
#define SETTING_ENVIRONMENT "Environment"
|
2021-07-01 19:44:38 +08:00
|
|
|
#define SETTING_EXECUTOR "Executor"
|
2021-07-26 11:47:54 +08:00
|
|
|
#define SETTING_DEBUGGER "Debugger"
|
2021-08-30 13:30:42 +08:00
|
|
|
#define SETTING_HISTORY "History"
|
2021-09-02 16:35:28 +08:00
|
|
|
#define SETTING_UI "UI"
|
2022-02-08 23:38:29 +08:00
|
|
|
#define SETTING_VCS "VCS"
|
2021-08-30 13:30:42 +08:00
|
|
|
#define SETTING_CODE_COMPLETION "CodeCompletion"
|
2021-08-31 19:15:11 +08:00
|
|
|
#define SETTING_CODE_FORMATTER "CodeFormatter"
|
2021-04-15 21:32:45 +08:00
|
|
|
#define SETTING_COMPILTER_SETS "CompilerSets"
|
|
|
|
#define SETTING_COMPILTER_SETS_DEFAULT_INDEX "defaultIndex"
|
|
|
|
#define SETTING_COMPILTER_SETS_COUNT "count"
|
|
|
|
#define SETTING_COMPILTER_SET "CompilerSet_%1"
|
2021-04-13 11:23:37 +08:00
|
|
|
#define SETTING_EDITOR_DEFAULT_ENCODING "default_encoding"
|
|
|
|
#define SETTING_EDITOR_AUTO_INDENT "default_auto_indent"
|
2021-04-09 17:48:25 +08:00
|
|
|
|
2021-04-15 11:18:14 +08:00
|
|
|
extern const char ValueToChar[28];
|
|
|
|
|
2021-04-13 22:17:18 +08:00
|
|
|
class Settings;
|
|
|
|
|
2021-10-25 21:36:23 +08:00
|
|
|
enum CompilerSetType {
|
|
|
|
CST_RELEASE,
|
|
|
|
CST_DEBUG,
|
|
|
|
CST_PROFILING
|
|
|
|
};
|
|
|
|
|
2021-04-08 10:29:21 +08:00
|
|
|
class Settings
|
|
|
|
{
|
2021-04-13 11:23:37 +08:00
|
|
|
private:
|
2021-04-15 11:18:14 +08:00
|
|
|
|
2021-04-13 11:23:37 +08:00
|
|
|
class _Base {
|
|
|
|
public:
|
|
|
|
explicit _Base(Settings* settings, const QString& groupName);
|
2021-06-07 11:02:03 +08:00
|
|
|
void beginGroup();
|
|
|
|
void endGroup();
|
2022-05-21 10:44:39 +08:00
|
|
|
void remove(const QString &key);
|
2021-06-07 11:02:03 +08:00
|
|
|
void saveValue(const QString &key, const QVariant &value);
|
|
|
|
QVariant value(const QString &key, const QVariant& defaultValue);
|
|
|
|
bool boolValue(const QString &key, bool defaultValue);
|
2022-05-22 14:31:13 +08:00
|
|
|
QSize sizeValue(const QString &key);
|
2021-06-07 11:02:03 +08:00
|
|
|
int intValue(const QString &key, int defaultValue);
|
2021-08-01 23:24:37 +08:00
|
|
|
QStringList stringListValue(const QString &key, const QStringList& defaultValue=QStringList());
|
2021-06-07 11:02:03 +08:00
|
|
|
QColor colorValue(const QString &key, const QColor& defaultValue);
|
|
|
|
QString stringValue(const QString &key, const QString& defaultValue);
|
|
|
|
void save();
|
|
|
|
void load();
|
|
|
|
protected:
|
|
|
|
virtual void doSave() = 0;
|
|
|
|
virtual void doLoad() = 0;
|
2021-04-13 11:23:37 +08:00
|
|
|
protected:
|
|
|
|
Settings* mSettings;
|
|
|
|
QString mGroup;
|
|
|
|
};
|
2021-04-08 10:29:21 +08:00
|
|
|
|
2021-04-13 11:23:37 +08:00
|
|
|
public:
|
|
|
|
class Dirs: public _Base {
|
|
|
|
public:
|
2021-06-17 10:39:46 +08:00
|
|
|
enum class DataType {
|
|
|
|
None,
|
2022-01-28 16:13:20 +08:00
|
|
|
ColorScheme,
|
|
|
|
IconSet,
|
|
|
|
Theme
|
2021-06-17 10:39:46 +08:00
|
|
|
};
|
2021-04-13 11:23:37 +08:00
|
|
|
explicit Dirs(Settings * settings);
|
2021-12-26 15:08:54 +08:00
|
|
|
QString appDir() const;
|
2022-01-05 09:08:44 +08:00
|
|
|
QString appResourceDir() const;
|
|
|
|
QString appLibexecDir() const;
|
2021-09-16 12:03:10 +08:00
|
|
|
QString templateDir() const;
|
|
|
|
QString projectDir() const;
|
2021-06-17 10:39:46 +08:00
|
|
|
QString data(DataType dataType = DataType::None) const;
|
|
|
|
QString config(DataType dataType = DataType::None) const;
|
2021-10-04 19:23:52 +08:00
|
|
|
QString executable() const;
|
2021-06-07 11:02:03 +08:00
|
|
|
|
2021-11-18 21:25:28 +08:00
|
|
|
void setProjectDir(const QString &newProjectDir);
|
|
|
|
|
2021-06-07 11:02:03 +08:00
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
2021-11-18 21:25:28 +08:00
|
|
|
private:
|
|
|
|
QString mProjectDir;
|
2021-04-13 11:23:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Editor: public _Base {
|
|
|
|
public:
|
|
|
|
explicit Editor(Settings * settings);
|
|
|
|
QByteArray defaultEncoding();
|
2021-06-07 11:02:03 +08:00
|
|
|
void setDefaultEncoding(const QByteArray& value);
|
2021-04-13 11:23:37 +08:00
|
|
|
bool autoIndent();
|
2021-06-07 11:02:03 +08:00
|
|
|
void setAutoIndent(bool value);
|
|
|
|
bool addIndent() const;
|
|
|
|
void setAddIndent(bool addIndent);
|
|
|
|
|
|
|
|
bool tabToSpaces() const;
|
|
|
|
void setTabToSpaces(bool tabToSpaces);
|
|
|
|
|
|
|
|
int tabWidth() const;
|
|
|
|
void setTabWidth(int tabWidth);
|
|
|
|
|
|
|
|
bool showIndentLines() const;
|
|
|
|
void setShowIndentLines(bool showIndentLines);
|
|
|
|
|
|
|
|
QColor indentLineColor() const;
|
|
|
|
void setIndentLineColor(const QColor &indentLineColor);
|
|
|
|
|
|
|
|
bool enhanceHomeKey() const;
|
|
|
|
void setEnhanceHomeKey(bool enhanceHomeKey);
|
|
|
|
|
|
|
|
bool enhanceEndKey() const;
|
|
|
|
void setEnhanceEndKey(bool enhanceEndKey);
|
|
|
|
|
|
|
|
SynEditCaretType caretForInsert() const;
|
|
|
|
void setCaretForInsert(const SynEditCaretType &caretForInsert);
|
|
|
|
|
|
|
|
SynEditCaretType caretForOverwrite() const;
|
|
|
|
void setCaretForOverwrite(const SynEditCaretType &caretForOverwrite);
|
|
|
|
|
|
|
|
QColor caretColor() const;
|
|
|
|
void setCaretColor(const QColor &caretColor);
|
|
|
|
|
|
|
|
bool keepCaretX() const;
|
|
|
|
void setKeepCaretX(bool keepCaretX);
|
|
|
|
|
2021-06-08 21:41:42 +08:00
|
|
|
bool autoHideScrollbar() const;
|
|
|
|
void setAutoHideScrollbar(bool autoHideScrollbar);
|
|
|
|
|
|
|
|
bool scrollPastEof() const;
|
|
|
|
void setScrollPastEof(bool scrollPastEof);
|
|
|
|
|
|
|
|
bool scrollPastEol() const;
|
|
|
|
void setScrollPastEol(bool scrollPastEol);
|
|
|
|
|
|
|
|
bool scrollByOneLess() const;
|
|
|
|
void setScrollByOneLess(bool scrollByOneLess);
|
|
|
|
|
|
|
|
bool halfPageScroll() const;
|
|
|
|
void setHalfPageScroll(bool halfPageScroll);
|
|
|
|
|
2021-06-09 17:12:23 +08:00
|
|
|
QString fontName() const;
|
|
|
|
void setFontName(const QString &fontName);
|
|
|
|
|
|
|
|
int fontSize() const;
|
|
|
|
void setFontSize(int fontSize);
|
|
|
|
|
|
|
|
bool fontOnlyMonospaced() const;
|
|
|
|
void setFontOnlyMonospaced(bool fontOnlyMonospaced);
|
|
|
|
|
|
|
|
bool gutterVisible() const;
|
|
|
|
void setGutterVisible(bool gutterVisible);
|
|
|
|
|
|
|
|
bool gutterAutoSize() const;
|
|
|
|
void setGutterAutoSize(bool gutterAutoSize);
|
|
|
|
|
|
|
|
int gutterDigitsCount() const;
|
|
|
|
void setGutterDigitsCount(int gutterDigitsCount);
|
|
|
|
|
|
|
|
bool gutterShowLineNumbers() const;
|
|
|
|
void setGutterShowLineNumbers(bool gutterShowLineNumbers);
|
|
|
|
|
|
|
|
bool gutterAddLeadingZero() const;
|
|
|
|
void setGutterAddLeadingZero(bool gutterAddLeadingZero);
|
|
|
|
|
|
|
|
bool gutterLineNumbersStartZero() const;
|
|
|
|
void setGutterLineNumbersStartZero(bool gutterLineNumbersStartZero);
|
|
|
|
|
|
|
|
bool gutterUseCustomFont() const;
|
|
|
|
void setGutterUseCustomFont(bool gutterUseCustomFont);
|
|
|
|
|
|
|
|
QString gutterFontName() const;
|
|
|
|
void setGutterFontName(const QString &gutterFontName);
|
|
|
|
|
|
|
|
int gutterFontSize() const;
|
|
|
|
void setGutterFontSize(int gutterFontSize);
|
|
|
|
|
|
|
|
bool gutterFontOnlyMonospaced() const;
|
|
|
|
void setGutterFontOnlyMonospaced(bool gutterFontOnlyMonospaced);
|
|
|
|
|
|
|
|
int gutterLeftOffset() const;
|
|
|
|
void setGutterLeftOffset(int gutterLeftOffset);
|
|
|
|
|
|
|
|
int gutterRightOffset() const;
|
|
|
|
void setGutterRightOffset(int gutterRightOffset);
|
|
|
|
|
2021-06-12 22:36:23 +08:00
|
|
|
bool copySizeLimit() const;
|
|
|
|
void setCopySizeLimit(bool copyLimit);
|
|
|
|
|
|
|
|
int copyCharLimits() const;
|
|
|
|
void setCopyCharLimits(int copyCharLimits);
|
|
|
|
|
|
|
|
int copyLineLimits() const;
|
|
|
|
void setCopyLineLimits(int copyLineLimits);
|
|
|
|
|
|
|
|
bool copyRTFUseBackground() const;
|
|
|
|
void setCopyRTFUseBackground(bool copyRTFUseBackground);
|
|
|
|
|
|
|
|
bool copyRTFUseEditorColor() const;
|
|
|
|
void setCopyRTFUseEditorColor(bool copyRTFUseEditorColor);
|
|
|
|
|
2021-06-20 14:30:47 +08:00
|
|
|
QString copyRTFColorScheme() const;
|
|
|
|
void setCopyRTFColorScheme(const QString ©RTFColorScheme);
|
2021-06-12 22:36:23 +08:00
|
|
|
|
|
|
|
bool copyHTMLUseBackground() const;
|
|
|
|
void setCopyHTMLUseBackground(bool copyHTMLUseBackground);
|
|
|
|
|
|
|
|
bool copyHTMLUseEditorColor() const;
|
|
|
|
void setCopyHTMLUseEditorColor(bool copyHTMLUseEditorColor);
|
|
|
|
|
2021-06-20 14:30:47 +08:00
|
|
|
QString copyHTMLColorScheme() const;
|
|
|
|
void setCopyHTMLColorScheme(const QString ©HTMLColorScheme);
|
2021-06-12 22:36:23 +08:00
|
|
|
|
|
|
|
int copyWithFormatAs() const;
|
|
|
|
void setCopyWithFormatAs(int copyWithFormatAs);
|
|
|
|
|
2021-06-20 14:30:47 +08:00
|
|
|
QString colorScheme() const;
|
|
|
|
void setColorScheme(const QString &colorScheme);
|
|
|
|
|
2021-06-21 16:25:21 +08:00
|
|
|
bool completeSymbols() const;
|
|
|
|
void setCompleteSymbols(bool completeSymbols);
|
|
|
|
|
|
|
|
bool completeParenthese() const;
|
|
|
|
void setCompleteParenthese(bool completeParenthese);
|
|
|
|
|
|
|
|
bool completeBracket() const;
|
|
|
|
void setCompleteBracket(bool completeBracket);
|
|
|
|
|
|
|
|
bool completeBrace() const;
|
|
|
|
void setCompleteBrace(bool completeBrace);
|
|
|
|
|
|
|
|
bool completeComment() const;
|
|
|
|
void setCompleteComment(bool completeComment);
|
|
|
|
|
|
|
|
bool completeSingleQuote() const;
|
|
|
|
void setCompleteSingleQuote(bool completeSingleQuote);
|
|
|
|
|
|
|
|
bool completeDoubleQuote() const;
|
|
|
|
void setCompleteDoubleQuote(bool completeDoubleQuote);
|
|
|
|
|
|
|
|
bool completeGlobalInclude() const;
|
|
|
|
void setCompleteGlobalInclude(bool completeGlobalInclude);
|
|
|
|
|
|
|
|
bool overwriteSymbols() const;
|
|
|
|
void setOverwriteSymbols(bool overwriteSymbols);
|
|
|
|
|
2021-06-23 08:55:56 +08:00
|
|
|
bool removeSymbolPairs() const;
|
|
|
|
void setRemoveSymbolPairs(bool value);
|
2021-06-21 16:25:21 +08:00
|
|
|
|
2021-06-25 12:40:11 +08:00
|
|
|
bool syntaxCheck() const;
|
|
|
|
void setSyntaxCheck(bool syntaxCheck);
|
|
|
|
|
|
|
|
bool syntaxCheckWhenSave() const;
|
|
|
|
void setSyntaxCheckWhenSave(bool syntaxCheckWhenSave);
|
|
|
|
|
|
|
|
bool syntaxCheckWhenLineChanged() const;
|
|
|
|
void setSyntaxCheckWhenLineChanged(bool syntaxCheckWhenLineChanged);
|
|
|
|
|
2021-08-30 13:30:42 +08:00
|
|
|
bool readOnlySytemHeader() const;
|
|
|
|
void setReadOnlySytemHeader(bool newReadOnlySytemHeader);
|
|
|
|
|
2021-08-30 18:36:44 +08:00
|
|
|
bool autoLoadLastFiles() const;
|
|
|
|
void setAutoLoadLastFiles(bool newAutoLoadLastFiles);
|
|
|
|
|
|
|
|
bool defaultFileCpp() const;
|
|
|
|
void setDefaultFileCpp(bool newDefaultFileCpp);
|
|
|
|
|
2021-08-30 22:05:45 +08:00
|
|
|
bool enableAutoSave() const;
|
|
|
|
void setEnableAutoSave(bool newEnableAutoSave);
|
|
|
|
|
|
|
|
int autoSaveInterval() const;
|
|
|
|
void setAutoSaveInterval(int newInterval);
|
|
|
|
|
|
|
|
AutoSaveTarget autoSaveTarget() const;
|
|
|
|
void setAutoSaveTarget(AutoSaveTarget newAutoSaveTarget);
|
|
|
|
|
|
|
|
AutoSaveStrategy autoSaveStrategy() const;
|
|
|
|
void setAutoSaveStrategy(AutoSaveStrategy newAutoSaveStrategy);
|
|
|
|
|
2021-09-04 16:34:14 +08:00
|
|
|
bool enableAutolink() const;
|
|
|
|
void setEnableAutolink(bool newEnableAutolink);
|
|
|
|
|
2021-09-04 19:27:44 +08:00
|
|
|
bool showRightEdgeLine() const;
|
|
|
|
void setShowRightEdgeLine(bool newShowRightMarginLine);
|
|
|
|
|
|
|
|
int rightEdgeWidth() const;
|
|
|
|
void setRightEdgeWidth(int newRightMarginWidth);
|
|
|
|
|
|
|
|
const QColor &rightEdgeLineColor() const;
|
|
|
|
void setRightEdgeLineColor(const QColor &newRightMarginLineColor);
|
|
|
|
|
|
|
|
bool caretUseTextColor() const;
|
|
|
|
void setCaretUseTextColor(bool newUseIdentifierColor);
|
|
|
|
|
2021-09-19 17:59:03 +08:00
|
|
|
bool rainbowParenthesis() const;
|
|
|
|
void setRainbowParenthesis(bool newRainbowParenthesis);
|
|
|
|
|
2021-09-21 20:36:43 +08:00
|
|
|
bool enableTooltips() const;
|
|
|
|
void setEnableTooltips(bool newEnableTooltips);
|
|
|
|
bool enableDebugTooltips() const;
|
|
|
|
void setEnableDebugTooltips(bool newEnableDebugTooltips);
|
|
|
|
bool enableIdentifierToolTips() const;
|
|
|
|
void setEnableIdentifierToolTips(bool newEnableIdentifierToolTips);
|
|
|
|
bool enableHeaderToolTips() const;
|
|
|
|
void setEnableHeaderToolTips(bool newEnableHeaderToolTips);
|
|
|
|
bool enableIssueToolTips() const;
|
|
|
|
void setEnableIssueToolTips(bool newEnableIssueToolTips);
|
|
|
|
|
|
|
|
bool showFunctionTips() const;
|
|
|
|
void setShowFunctionTips(bool newShowFunctionTips);
|
|
|
|
|
2021-10-20 11:14:49 +08:00
|
|
|
bool fillIndents() const;
|
|
|
|
void setFillIndents(bool newFillIndents);
|
|
|
|
|
2021-10-20 12:27:44 +08:00
|
|
|
int mouseWheelScrollSpeed() const;
|
|
|
|
void setMouseWheelScrollSpeed(int newMouseWheelScrollSpeed);
|
|
|
|
|
2021-11-18 21:25:28 +08:00
|
|
|
bool highlightCurrentWord() const;
|
|
|
|
void setHighlightCurrentWord(bool newHighlightCurrentWord);
|
|
|
|
|
|
|
|
bool highlightMathingBraces() const;
|
|
|
|
void setHighlightMathingBraces(bool newHighlightMathingBraces);
|
|
|
|
|
2022-01-10 20:16:26 +08:00
|
|
|
bool enableLigaturesSupport() const;
|
|
|
|
void setEnableLigaturesSupport(bool newEnableLigaturesSupport);
|
|
|
|
|
2022-01-26 14:31:26 +08:00
|
|
|
const QString &nonAsciiFontName() const;
|
|
|
|
void setNonAsciiFontName(const QString &newNonAsciiFontName);
|
|
|
|
|
2022-03-04 19:04:45 +08:00
|
|
|
int mouseSelectionScrollSpeed() const;
|
|
|
|
void setMouseSelectionScrollSpeed(int newMouseSelectionScrollSpeed);
|
|
|
|
|
2022-03-12 17:37:53 +08:00
|
|
|
bool autoDetectFileEncoding() const;
|
|
|
|
void setAutoDetectFileEncoding(bool newAutoDetectFileEncoding);
|
|
|
|
|
2022-03-20 18:10:53 +08:00
|
|
|
int undoLimit() const;
|
|
|
|
void setUndoLimit(int newUndoLimit);
|
|
|
|
|
2021-06-07 11:02:03 +08:00
|
|
|
private:
|
2021-06-09 17:12:23 +08:00
|
|
|
//General
|
2021-06-07 11:02:03 +08:00
|
|
|
// indents
|
|
|
|
bool mAutoIndent;
|
|
|
|
bool mTabToSpaces;
|
|
|
|
int mTabWidth;
|
|
|
|
bool mShowIndentLines;
|
|
|
|
QColor mIndentLineColor;
|
2021-10-20 11:14:49 +08:00
|
|
|
bool mfillIndents;
|
2021-06-07 11:02:03 +08:00
|
|
|
// caret
|
|
|
|
bool mEnhanceHomeKey;
|
|
|
|
bool mEnhanceEndKey;
|
|
|
|
bool mKeepCaretX;
|
|
|
|
SynEditCaretType mCaretForInsert;
|
|
|
|
SynEditCaretType mCaretForOverwrite;
|
2021-09-04 19:27:44 +08:00
|
|
|
bool mCaretUseTextColor;
|
2021-06-07 11:02:03 +08:00
|
|
|
QColor mCaretColor;
|
2021-09-04 19:27:44 +08:00
|
|
|
|
2021-11-18 21:25:28 +08:00
|
|
|
//highlights
|
|
|
|
bool mHighlightCurrentWord;
|
|
|
|
bool mHighlightMathingBraces;
|
|
|
|
|
2021-06-08 21:41:42 +08:00
|
|
|
//scroll
|
|
|
|
bool mAutoHideScrollbar;
|
|
|
|
bool mScrollPastEof;
|
|
|
|
bool mScrollPastEol;
|
|
|
|
bool mScrollByOneLess;
|
|
|
|
bool mHalfPageScroll;
|
2021-10-20 12:27:44 +08:00
|
|
|
int mMouseWheelScrollSpeed;
|
2022-03-04 19:04:45 +08:00
|
|
|
int mMouseSelectionScrollSpeed;
|
2021-06-07 11:02:03 +08:00
|
|
|
|
2021-09-04 19:27:44 +08:00
|
|
|
//right margin
|
|
|
|
bool mShowRightEdgeLine;
|
|
|
|
int mRightEdgeWidth;
|
|
|
|
QColor mRightEdgeLineColor;
|
2022-01-10 20:16:26 +08:00
|
|
|
bool mEnableLigaturesSupport;
|
2021-09-04 19:27:44 +08:00
|
|
|
|
2021-06-09 17:12:23 +08:00
|
|
|
//Font
|
|
|
|
//font
|
|
|
|
QString mFontName;
|
2022-01-26 14:31:26 +08:00
|
|
|
QString mNonAsciiFontName;
|
2021-06-09 17:12:23 +08:00
|
|
|
int mFontSize;
|
|
|
|
bool mFontOnlyMonospaced;
|
|
|
|
|
|
|
|
//gutter
|
|
|
|
bool mGutterVisible;
|
|
|
|
bool mGutterAutoSize;
|
|
|
|
int mGutterLeftOffset;
|
|
|
|
int mGutterRightOffset;
|
|
|
|
int mGutterDigitsCount;
|
|
|
|
bool mGutterShowLineNumbers;
|
|
|
|
bool mGutterAddLeadingZero;
|
|
|
|
bool mGutterLineNumbersStartZero;
|
|
|
|
bool mGutterUseCustomFont;
|
|
|
|
QString mGutterFontName;
|
|
|
|
int mGutterFontSize;
|
|
|
|
bool mGutterFontOnlyMonospaced;
|
|
|
|
|
2021-06-12 22:36:23 +08:00
|
|
|
//copy
|
|
|
|
bool mCopySizeLimit;
|
|
|
|
int mCopyCharLimits;
|
|
|
|
int mCopyLineLimits;
|
|
|
|
int mCopyWithFormatAs;
|
|
|
|
bool mCopyRTFUseBackground;
|
|
|
|
bool mCopyRTFUseEditorColor;
|
2021-06-20 14:30:47 +08:00
|
|
|
QString mCopyRTFColorScheme;
|
2021-06-12 22:36:23 +08:00
|
|
|
bool mCopyHTMLUseBackground;
|
|
|
|
bool mCopyHTMLUseEditorColor;
|
2021-06-20 14:30:47 +08:00
|
|
|
QString mCopyHTMLColorScheme;
|
|
|
|
|
|
|
|
//Color
|
|
|
|
QString mColorScheme;
|
2021-09-19 17:59:03 +08:00
|
|
|
bool mRainbowParenthesis;
|
2021-06-12 22:36:23 +08:00
|
|
|
|
2021-06-21 16:25:21 +08:00
|
|
|
//Symbol Completion
|
|
|
|
bool mCompleteSymbols;
|
|
|
|
bool mCompleteParenthese;
|
|
|
|
bool mCompleteBracket;
|
|
|
|
bool mCompleteBrace;
|
|
|
|
bool mCompleteComment;
|
|
|
|
bool mCompleteSingleQuote;
|
|
|
|
bool mCompleteDoubleQuote;
|
|
|
|
bool mCompleteGlobalInclude;
|
|
|
|
bool mOverwriteSymbols;
|
2021-06-23 08:55:56 +08:00
|
|
|
bool mRemoveSymbolPairs;
|
2021-06-21 16:25:21 +08:00
|
|
|
|
2021-06-25 12:40:11 +08:00
|
|
|
//Auto Syntax Check
|
|
|
|
bool mSyntaxCheck;
|
|
|
|
bool mSyntaxCheckWhenSave;
|
|
|
|
bool mSyntaxCheckWhenLineChanged;
|
|
|
|
|
2021-08-30 22:05:45 +08:00
|
|
|
//auto save
|
|
|
|
bool mEnableAutoSave;
|
|
|
|
int mAutoSaveInterval;
|
|
|
|
enum AutoSaveTarget mAutoSaveTarget;
|
|
|
|
enum AutoSaveStrategy mAutoSaveStrategy;
|
|
|
|
|
2021-09-04 16:34:14 +08:00
|
|
|
//auto link
|
|
|
|
bool mEnableAutolink;
|
|
|
|
|
2021-08-30 18:36:44 +08:00
|
|
|
//Misc
|
|
|
|
QByteArray mDefaultEncoding;
|
2022-03-12 17:37:53 +08:00
|
|
|
bool mAutoDetectFileEncoding;
|
2021-08-30 18:36:44 +08:00
|
|
|
bool mReadOnlySytemHeader;
|
|
|
|
bool mAutoLoadLastFiles;
|
|
|
|
bool mDefaultFileCpp;
|
2022-03-20 18:10:53 +08:00
|
|
|
int mUndoLimit;
|
|
|
|
|
2021-08-30 18:36:44 +08:00
|
|
|
|
2021-09-21 20:36:43 +08:00
|
|
|
//hints tooltip
|
|
|
|
bool mEnableTooltips;
|
|
|
|
bool mEnableDebugTooltips;
|
|
|
|
bool mEnableIdentifierToolTips;
|
|
|
|
bool mEnableHeaderToolTips;
|
|
|
|
bool mEnableIssueToolTips;
|
|
|
|
bool mShowFunctionTips;
|
|
|
|
|
2021-06-07 11:02:03 +08:00
|
|
|
// _Base interface
|
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
2021-04-13 11:23:37 +08:00
|
|
|
};
|
2021-04-08 10:29:21 +08:00
|
|
|
|
2021-06-18 21:48:40 +08:00
|
|
|
class Environment: public _Base {
|
|
|
|
public:
|
|
|
|
explicit Environment(Settings * settings);
|
|
|
|
QString theme() const;
|
|
|
|
void setTheme(const QString &theme);
|
|
|
|
|
|
|
|
QString interfaceFont() const;
|
|
|
|
void setInterfaceFont(const QString &interfaceFont);
|
|
|
|
|
|
|
|
int interfaceFontSize() const;
|
|
|
|
void setInterfaceFontSize(int interfaceFontSize);
|
|
|
|
|
2021-06-20 09:27:37 +08:00
|
|
|
QString language() const;
|
|
|
|
void setLanguage(const QString &language);
|
|
|
|
|
2021-10-22 07:42:51 +08:00
|
|
|
const QString ¤tFolder() const;
|
|
|
|
void setCurrentFolder(const QString &newCurrentFolder);
|
|
|
|
|
2021-11-10 10:42:33 +08:00
|
|
|
const QString &defaultOpenFolder() const;
|
|
|
|
void setDefaultOpenFolder(const QString &newDefaultOpenFolder);
|
|
|
|
|
2021-12-24 09:17:28 +08:00
|
|
|
const QString &iconSet() const;
|
|
|
|
void setIconSet(const QString &newIconSet);
|
|
|
|
|
2021-12-25 23:38:53 +08:00
|
|
|
QString terminalPath() const;
|
|
|
|
void setTerminalPath(const QString &terminalPath);
|
|
|
|
|
2021-12-27 22:46:54 +08:00
|
|
|
QString AStylePath() const;
|
|
|
|
void setAStylePath(const QString &aStylePath);
|
|
|
|
|
2022-01-27 12:08:57 +08:00
|
|
|
bool useCustomIconSet() const;
|
|
|
|
void setUseCustomIconSet(bool newUseCustomIconSet);
|
|
|
|
|
2022-01-28 16:13:20 +08:00
|
|
|
bool useCustomTheme() const;
|
|
|
|
void setUseCustomTheme(bool newUseCustomTheme);
|
|
|
|
|
2022-02-28 22:40:09 +08:00
|
|
|
bool hideNonSupportFilesInFileView() const;
|
|
|
|
void setHideNonSupportFilesInFileView(bool newHideNonSupportFilesInFileView);
|
|
|
|
|
|
|
|
bool openFilesInSingleInstance() const;
|
|
|
|
void setOpenFilesInSingleInstance(bool newOpenFilesInSingleInstance);
|
|
|
|
|
2021-06-18 21:48:40 +08:00
|
|
|
private:
|
|
|
|
|
|
|
|
//Appearence
|
|
|
|
QString mTheme;
|
|
|
|
QString mInterfaceFont;
|
|
|
|
int mInterfaceFontSize;
|
2021-06-20 09:27:37 +08:00
|
|
|
QString mLanguage;
|
2021-10-22 07:42:51 +08:00
|
|
|
QString mCurrentFolder;
|
2021-12-24 09:17:28 +08:00
|
|
|
QString mIconSet;
|
2022-01-27 12:08:57 +08:00
|
|
|
bool mUseCustomIconSet;
|
2022-01-28 16:13:20 +08:00
|
|
|
bool mUseCustomTheme;
|
2021-11-10 10:42:33 +08:00
|
|
|
|
|
|
|
QString mDefaultOpenFolder;
|
2021-12-25 23:38:53 +08:00
|
|
|
QString mTerminalPath;
|
2021-12-27 22:46:54 +08:00
|
|
|
QString mAStylePath;
|
2022-02-28 22:40:09 +08:00
|
|
|
bool mHideNonSupportFilesInFileView;
|
|
|
|
bool mOpenFilesInSingleInstance;
|
2021-06-18 21:48:40 +08:00
|
|
|
// _Base interface
|
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
};
|
|
|
|
|
2021-08-30 13:30:42 +08:00
|
|
|
class CodeCompletion: public _Base {
|
|
|
|
public:
|
|
|
|
explicit CodeCompletion(Settings *settings);
|
|
|
|
int width() const;
|
|
|
|
void setWidth(int newWidth);
|
|
|
|
|
|
|
|
int height() const;
|
|
|
|
void setHeight(int newHeight);
|
|
|
|
|
|
|
|
bool enabled() const;
|
|
|
|
void setEnabled(bool newEnabled);
|
|
|
|
|
|
|
|
bool parseLocalHeaders() const;
|
|
|
|
void setParseLocalHeaders(bool newParseLocalHeaders);
|
|
|
|
|
|
|
|
bool parseGlobalHeaders() const;
|
|
|
|
void setParseGlobalHeaders(bool newParseGlobalHeaders);
|
|
|
|
|
|
|
|
bool showCompletionWhileInput() const;
|
|
|
|
void setShowCompletionWhileInput(bool newShowCompletionWhileInput);
|
|
|
|
|
|
|
|
bool recordUsage() const;
|
|
|
|
void setRecordUsage(bool newRecordUsage);
|
|
|
|
|
|
|
|
bool sortByScope() const;
|
|
|
|
void setSortByScope(bool newSortByScope);
|
|
|
|
|
|
|
|
bool showKeywords() const;
|
|
|
|
void setShowKeywords(bool newShowKeywords);
|
|
|
|
|
|
|
|
bool ignoreCase() const;
|
|
|
|
void setIgnoreCase(bool newIgnoreCase);
|
|
|
|
|
|
|
|
bool appendFunc() const;
|
|
|
|
void setAppendFunc(bool newAppendFunc);
|
|
|
|
|
|
|
|
bool showCodeIns() const;
|
|
|
|
void setShowCodeIns(bool newShowCodeIns);
|
|
|
|
|
2021-11-08 09:19:50 +08:00
|
|
|
bool clearWhenEditorHidden() const;
|
|
|
|
void setClearWhenEditorHidden(bool newClearWhenEditorHidden);
|
|
|
|
|
2022-01-10 21:46:03 +08:00
|
|
|
int minCharRequired() const;
|
|
|
|
void setMinCharRequired(int newMinCharRequired);
|
|
|
|
|
2022-03-01 22:03:54 +08:00
|
|
|
bool hideSymbolsStartsWithUnderLine() const;
|
|
|
|
void setHideSymbolsStartsWithUnderLine(bool newHideSymbolsStartsWithOneUnderLine);
|
|
|
|
|
|
|
|
bool hideSymbolsStartsWithTwoUnderLine() const;
|
|
|
|
void setHideSymbolsStartsWithTwoUnderLine(bool newHideSymbolsStartsWithTwoUnderLine);
|
|
|
|
|
2021-08-30 13:30:42 +08:00
|
|
|
private:
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
bool mEnabled;
|
|
|
|
bool mParseLocalHeaders;
|
|
|
|
bool mParseGlobalHeaders;
|
|
|
|
bool mShowCompletionWhileInput;
|
|
|
|
bool mRecordUsage;
|
|
|
|
bool mSortByScope;
|
|
|
|
bool mShowKeywords;
|
|
|
|
bool mIgnoreCase;
|
|
|
|
bool mAppendFunc;
|
|
|
|
bool mShowCodeIns;
|
2021-11-08 09:19:50 +08:00
|
|
|
bool mClearWhenEditorHidden;
|
2022-01-10 21:46:03 +08:00
|
|
|
int mMinCharRequired;
|
2022-03-01 22:03:54 +08:00
|
|
|
bool mHideSymbolsStartsWithTwoUnderLine;
|
|
|
|
bool mHideSymbolsStartsWithUnderLine;
|
2021-08-30 13:30:42 +08:00
|
|
|
|
|
|
|
// _Base interface
|
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-08-31 19:15:11 +08:00
|
|
|
class CodeFormatter: public _Base {
|
|
|
|
public:
|
|
|
|
explicit CodeFormatter(Settings* settings);
|
2021-09-01 22:40:58 +08:00
|
|
|
QStringList getArguments();
|
2021-09-01 00:05:46 +08:00
|
|
|
int braceStyle() const;
|
|
|
|
void setBraceStyle(int newBraceStyle);
|
|
|
|
|
|
|
|
int indentStyle() const;
|
|
|
|
void setIndentStyle(int newIndentStyle);
|
|
|
|
int tabWidth() const;
|
|
|
|
void setTabWidth(int newTabWidth);
|
|
|
|
bool attachNamespaces() const;
|
|
|
|
void setAttachNamespaces(bool newAttachNamespaces);
|
|
|
|
bool attachClasses() const;
|
|
|
|
void setAttachClasses(bool newAttachClasses);
|
|
|
|
bool attachInlines() const;
|
|
|
|
void setAttachInlines(bool newAttachInlines);
|
|
|
|
bool attachExternC() const;
|
|
|
|
void setAttachExternC(bool newAttachExternC);
|
|
|
|
bool attachClosingWhile() const;
|
|
|
|
void setAttachClosingWhile(bool newAttachClosingWhile);
|
|
|
|
bool indentClasses() const;
|
|
|
|
void setIndentClasses(bool newIndentClasses);
|
|
|
|
bool indentModifiers() const;
|
|
|
|
void setIndentModifiers(bool newIndentModifiers);
|
|
|
|
bool indentCases() const;
|
|
|
|
void setIndentCases(bool newIndentCases);
|
|
|
|
bool indentNamespaces() const;
|
|
|
|
void setIndentNamespaces(bool newIndentNamespaces);
|
2021-09-01 15:14:40 +08:00
|
|
|
int indentContinuation() const;
|
|
|
|
void setIndentContinuation(int newIndentContinuation);
|
2021-09-01 00:05:46 +08:00
|
|
|
bool indentLabels() const;
|
|
|
|
void setIndentLabels(bool newIndentLabels);
|
|
|
|
bool indentPreprocBlock() const;
|
|
|
|
void setIndentPreprocBlock(bool newIndentPreprocBlock);
|
|
|
|
bool indentPreprocCond() const;
|
|
|
|
void setIndentPreprocCond(bool newIndentPreprocCond);
|
|
|
|
bool indentPreprocDefine() const;
|
|
|
|
void setIndentPreprocDefine(bool newIndentPreprocDefine);
|
|
|
|
bool indentCol1Comments() const;
|
|
|
|
void setIndentCol1Comments(bool newIndentCol1Comments);
|
|
|
|
int minConditionalIndent() const;
|
|
|
|
void setMinConditionalIndent(int newMinConditionalIndent);
|
|
|
|
int maxContinuationIndent() const;
|
|
|
|
void setMaxContinuationIndent(int newMaxContinuationIndent);
|
|
|
|
bool breakBlocks() const;
|
|
|
|
void setBreakBlocks(bool newBreakBlocks);
|
|
|
|
bool breakBlocksAll() const;
|
|
|
|
void setBreakBlocksAll(bool newBreakBlocksAll);
|
|
|
|
bool padOper() const;
|
|
|
|
void setPadOper(bool newPadOper);
|
|
|
|
bool padComma() const;
|
|
|
|
void setPadComma(bool newPadComma);
|
|
|
|
bool padParen() const;
|
|
|
|
void setPadParen(bool newPadParen);
|
|
|
|
bool padParenOut() const;
|
|
|
|
void setPadParenOut(bool newPadParenOut);
|
|
|
|
bool padFirstParenOut() const;
|
|
|
|
void setPadFirstParenOut(bool newPadFirstParenOut);
|
|
|
|
bool padParenIn() const;
|
|
|
|
void setPadParenIn(bool newPadParenIn);
|
|
|
|
bool padHeader() const;
|
|
|
|
void setPadHeader(bool newPadHeader);
|
|
|
|
bool unpadParen() const;
|
|
|
|
void setUnpadParen(bool newUnpadParen);
|
|
|
|
bool deleteEmptyLines() const;
|
|
|
|
void setDeleteEmptyLines(bool newDeleteEmptyLines);
|
|
|
|
bool deleteMultipleEmptyLines() const;
|
|
|
|
void setDeleteMultipleEmptyLines(bool newDeleteMultipleEmptyLines);
|
|
|
|
bool fillEmptyLines() const;
|
|
|
|
void setFillEmptyLines(bool newFillEmptyLines);
|
|
|
|
int alignPointerStyle() const;
|
|
|
|
void setAlignPointerStyle(int newAlignPointerStyle);
|
|
|
|
int alignReferenceStyle() const;
|
|
|
|
void setAlignReferenceStyle(int newAlignReferenceStyle);
|
|
|
|
bool breakClosingBraces() const;
|
|
|
|
void setBreakClosingBraces(bool newBreakClosingBraces);
|
|
|
|
bool breakElseIf() const;
|
|
|
|
void setBreakElseIf(bool newBreakElseIf);
|
|
|
|
bool breakOneLineHeaders() const;
|
|
|
|
void setBreakOneLineHeaders(bool newBreakOneLineHeaders);
|
|
|
|
bool addBraces() const;
|
|
|
|
void setAddBraces(bool newAddBraces);
|
|
|
|
bool addOneLineBraces() const;
|
|
|
|
void setAddOneLineBraces(bool newAddOneLineBraces);
|
|
|
|
bool removeBraces() const;
|
|
|
|
void setRemoveBraces(bool newRemoveBraces);
|
|
|
|
bool breakReturnTypeDecl() const;
|
|
|
|
void setBreakReturnTypeDecl(bool newBreakReturnTypeDecl);
|
|
|
|
bool attachReturnType() const;
|
|
|
|
void setAttachReturnType(bool newAttachReturnType);
|
|
|
|
bool attachReturnTypeDecl() const;
|
|
|
|
void setAttachReturnTypeDecl(bool newAttachReturnTypeDecl);
|
|
|
|
bool keepOneLineBlocks() const;
|
|
|
|
void setKeepOneLineBlocks(bool newKeepOneLineBlocks);
|
|
|
|
bool keepOneLineStatements() const;
|
|
|
|
void setKeepOneLineStatements(bool newKeepOneLineStatements);
|
|
|
|
bool convertTabs() const;
|
|
|
|
void setConvertTabs(bool newConvertTabs);
|
|
|
|
bool closeTemplates() const;
|
|
|
|
void setCloseTemplates(bool newCloseTemplates);
|
|
|
|
bool removeCommentPrefix() const;
|
|
|
|
void setRemoveCommentPrefix(bool newRemoveCommentPrefix);
|
2021-09-01 15:14:40 +08:00
|
|
|
int maxCodeLength() const;
|
2021-09-01 00:05:46 +08:00
|
|
|
void setMaxCodeLength(int newMaxCodeLength);
|
|
|
|
bool breakAfterLogical() const;
|
|
|
|
void setBreakAfterLogical(bool newBreakAfterLogical);
|
|
|
|
|
|
|
|
bool breakReturnType() const;
|
|
|
|
void setBreakReturnType(bool newBreakReturnType);
|
|
|
|
|
|
|
|
bool breakMaxCodeLength() const;
|
|
|
|
void setBreakMaxCodeLength(bool newBreakMaxCodeLength);
|
|
|
|
|
2021-09-01 15:14:40 +08:00
|
|
|
bool indentSwitches() const;
|
|
|
|
void setIndentSwitches(bool newIndentSwitches);
|
|
|
|
|
|
|
|
bool indentAfterParens() const;
|
|
|
|
void setIndentAfterParens(bool newIndentAfterParens);
|
|
|
|
|
2021-08-31 19:15:11 +08:00
|
|
|
private:
|
|
|
|
int mBraceStyle;
|
|
|
|
int mIndentStyle;
|
|
|
|
int mTabWidth;
|
|
|
|
bool mAttachNamespaces;
|
|
|
|
bool mAttachClasses;
|
|
|
|
bool mAttachInlines;
|
|
|
|
bool mAttachExternC;
|
|
|
|
bool mAttachClosingWhile;
|
|
|
|
bool mIndentClasses;
|
|
|
|
bool mIndentModifiers;
|
2021-09-01 15:14:40 +08:00
|
|
|
bool mIndentSwitches;
|
2021-08-31 19:15:11 +08:00
|
|
|
bool mIndentCases;
|
|
|
|
bool mIndentNamespaces;
|
2021-09-01 15:14:40 +08:00
|
|
|
bool mIndentAfterParens;
|
|
|
|
int mIndentContinuation;
|
2021-08-31 19:15:11 +08:00
|
|
|
bool mIndentLabels;
|
|
|
|
bool mIndentPreprocBlock;
|
|
|
|
bool mIndentPreprocCond;
|
|
|
|
bool mIndentPreprocDefine;
|
2021-09-01 00:05:46 +08:00
|
|
|
bool mIndentCol1Comments;
|
2021-08-31 19:15:11 +08:00
|
|
|
int mMinConditionalIndent;
|
|
|
|
int mMaxContinuationIndent;
|
|
|
|
bool mBreakBlocks;
|
|
|
|
bool mBreakBlocksAll;
|
|
|
|
bool mPadOper;
|
|
|
|
bool mPadComma;
|
|
|
|
bool mPadParen;
|
|
|
|
bool mPadParenOut;
|
|
|
|
bool mPadFirstParenOut;
|
|
|
|
bool mPadParenIn;
|
|
|
|
bool mPadHeader;
|
|
|
|
bool mUnpadParen;
|
|
|
|
bool mDeleteEmptyLines;
|
|
|
|
bool mDeleteMultipleEmptyLines;
|
|
|
|
bool mFillEmptyLines;
|
|
|
|
int mAlignPointerStyle;
|
|
|
|
int mAlignReferenceStyle;
|
|
|
|
bool mBreakClosingBraces;
|
|
|
|
bool mBreakElseIf;
|
|
|
|
bool mBreakOneLineHeaders;
|
|
|
|
bool mAddBraces;
|
|
|
|
bool mAddOneLineBraces;
|
|
|
|
bool mRemoveBraces;
|
2021-09-01 00:05:46 +08:00
|
|
|
bool mBreakReturnType;
|
2021-08-31 19:15:11 +08:00
|
|
|
bool mBreakReturnTypeDecl;
|
|
|
|
bool mAttachReturnType;
|
|
|
|
bool mAttachReturnTypeDecl;
|
|
|
|
bool mKeepOneLineBlocks;
|
|
|
|
bool mKeepOneLineStatements;
|
|
|
|
bool mConvertTabs;
|
|
|
|
bool mCloseTemplates;
|
|
|
|
bool mRemoveCommentPrefix;
|
2021-09-01 00:05:46 +08:00
|
|
|
bool mBreakMaxCodeLength;
|
2021-09-01 15:14:40 +08:00
|
|
|
int mMaxCodeLength;
|
2021-08-31 19:15:11 +08:00
|
|
|
bool mBreakAfterLogical;
|
2021-09-01 00:05:46 +08:00
|
|
|
// _Base interface
|
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
2021-08-31 19:15:11 +08:00
|
|
|
};
|
|
|
|
|
2021-08-01 23:24:37 +08:00
|
|
|
class History: public _Base {
|
|
|
|
public:
|
|
|
|
explicit History(Settings *settings);
|
|
|
|
|
2022-02-23 13:17:57 +08:00
|
|
|
const QStringList& opennedFiles() const;
|
|
|
|
const QStringList& opennedProjects() const;
|
|
|
|
void clearOpennedFiles();
|
|
|
|
void clearOpennedProjects();
|
2021-08-01 23:24:37 +08:00
|
|
|
bool addToOpenedFiles(const QString& filename);
|
2021-09-11 11:42:20 +08:00
|
|
|
void removeFile(const QString& filename);
|
2021-09-11 18:42:49 +08:00
|
|
|
bool addToOpenedProjects(const QString& filename);
|
|
|
|
void removeProject(const QString& filename);
|
2021-08-01 23:24:37 +08:00
|
|
|
private:
|
|
|
|
QStringList mOpenedFiles;
|
|
|
|
QStringList mOpenedProjects;
|
|
|
|
|
|
|
|
// _Base interface
|
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
};
|
|
|
|
|
2021-07-01 19:44:38 +08:00
|
|
|
class Executor: public _Base {
|
|
|
|
public:
|
|
|
|
explicit Executor(Settings * settings);
|
|
|
|
|
|
|
|
bool pauseConsole() const;
|
|
|
|
void setPauseConsole(bool pauseConsole);
|
|
|
|
|
|
|
|
bool minimizeOnRun() const;
|
|
|
|
void setMinimizeOnRun(bool minimizeOnRun);
|
|
|
|
|
2021-09-19 17:59:03 +08:00
|
|
|
bool useParams() const;
|
|
|
|
void setUseParams(bool newUseParams);
|
|
|
|
const QString ¶ms() const;
|
|
|
|
void setParams(const QString &newParams);
|
|
|
|
bool redirectInput() const;
|
|
|
|
void setRedirectInput(bool newRedirectInput);
|
|
|
|
const QString &inputFilename() const;
|
|
|
|
void setInputFilename(const QString &newInputFilename);
|
|
|
|
|
2021-11-02 13:12:36 +08:00
|
|
|
bool enableProblemSet() const;
|
|
|
|
void setEnableProblemSet(bool newEnableProblemSet);
|
|
|
|
|
|
|
|
bool enableCompetitiveCompanion() const;
|
|
|
|
void setEnableCompetitiveCompanion(bool newEnableCompetitiveCompanion);
|
|
|
|
|
|
|
|
int competivieCompanionPort() const;
|
|
|
|
void setCompetivieCompanionPort(int newCompetivieCompanionPort);
|
|
|
|
|
2021-11-27 15:43:47 +08:00
|
|
|
bool ignoreSpacesWhenValidatingCases() const;
|
|
|
|
void setIgnoreSpacesWhenValidatingCases(bool newIgnoreSpacesWhenValidatingCases);
|
|
|
|
|
2021-12-15 19:12:16 +08:00
|
|
|
const QString &caseEditorFontName() const;
|
|
|
|
void setCaseEditorFontName(const QString &newCaseEditorFontName);
|
|
|
|
|
|
|
|
int caseEditorFontSize() const;
|
|
|
|
void setCaseEditorFontSize(int newCaseEditorFontSize);
|
|
|
|
|
|
|
|
bool caseEditorFontOnlyMonospaced() const;
|
|
|
|
void setCaseEditorFontOnlyMonospaced(bool newCaseEditorFontOnlyMonospaced);
|
|
|
|
|
2022-03-27 11:44:52 +08:00
|
|
|
bool enableCaseTimeout() const;
|
|
|
|
void setEnableCaseTimeout(bool newEnableCaseTimeout);
|
|
|
|
|
|
|
|
int caseTimeout() const;
|
|
|
|
void setCaseTimeout(int newCaseTimeout);
|
|
|
|
|
2021-07-01 19:44:38 +08:00
|
|
|
private:
|
|
|
|
// general
|
|
|
|
bool mPauseConsole;
|
|
|
|
bool mMinimizeOnRun;
|
2021-09-19 17:59:03 +08:00
|
|
|
bool mUseParams;
|
|
|
|
QString mParams;
|
|
|
|
bool mRedirectInput;
|
|
|
|
QString mInputFilename;
|
2021-07-01 19:44:38 +08:00
|
|
|
|
2021-11-02 13:12:36 +08:00
|
|
|
//Problem Set
|
|
|
|
bool mEnableProblemSet;
|
|
|
|
bool mEnableCompetitiveCompanion;
|
|
|
|
int mCompetivieCompanionPort;
|
2021-11-27 15:43:47 +08:00
|
|
|
bool mIgnoreSpacesWhenValidatingCases;
|
2021-12-15 19:12:16 +08:00
|
|
|
QString mCaseEditorFontName;
|
|
|
|
int mCaseEditorFontSize;
|
|
|
|
bool mCaseEditorFontOnlyMonospaced;
|
2022-03-27 11:44:52 +08:00
|
|
|
bool mEnableCaseTimeout;
|
|
|
|
int mCaseTimeout;
|
2021-11-02 13:12:36 +08:00
|
|
|
|
2021-07-01 19:44:38 +08:00
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
};
|
|
|
|
|
2022-02-08 23:38:29 +08:00
|
|
|
class VCS: public _Base {
|
|
|
|
public:
|
|
|
|
explicit VCS(Settings *settings);
|
|
|
|
const QString &gitPath() const;
|
|
|
|
void setGitPath(const QString &newGitPath);
|
2022-02-15 00:01:50 +08:00
|
|
|
bool gitOk() const;
|
|
|
|
void detectGitInPath();
|
|
|
|
private:
|
|
|
|
void validateGit();
|
2022-02-08 23:38:29 +08:00
|
|
|
private:
|
|
|
|
QString mGitPath;
|
2022-02-15 00:01:50 +08:00
|
|
|
bool mGitOk;
|
2022-02-08 23:38:29 +08:00
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
};
|
|
|
|
|
2021-09-02 16:35:28 +08:00
|
|
|
class UI: public _Base {
|
|
|
|
public:
|
|
|
|
explicit UI(Settings *settings);
|
|
|
|
|
|
|
|
const QByteArray &mainWindowState() const;
|
|
|
|
void setMainWindowState(const QByteArray &newMainWindowState);
|
|
|
|
|
|
|
|
const QByteArray &mainWindowGeometry() const;
|
|
|
|
void setMainWindowGeometry(const QByteArray &newMainWindowGeometry);
|
|
|
|
|
2021-09-02 16:46:53 +08:00
|
|
|
int bottomPanelIndex() const;
|
|
|
|
void setBottomPanelIndex(int newBottomPanelIndex);
|
|
|
|
int leftPanelIndex() const;
|
|
|
|
void setLeftPanelIndex(int newLeftPanelIndex);
|
|
|
|
|
2021-09-26 16:25:17 +08:00
|
|
|
bool classBrowserSortAlpha() const;
|
|
|
|
void setClassBrowserSortAlpha(bool newClassBrowserSortAlpha);
|
|
|
|
|
|
|
|
bool classBrowserSortType() const;
|
|
|
|
void setClassBrowserSortType(bool newClassBrowserSortType);
|
|
|
|
|
|
|
|
bool classBrowserShowInherited() const;
|
|
|
|
void setClassBrowserShowInherited(bool newClassBrowserShowInherited);
|
|
|
|
|
2021-11-09 12:31:37 +08:00
|
|
|
bool showToolbar() const;
|
|
|
|
void setShowToolbar(bool newShowToolbar);
|
|
|
|
|
|
|
|
bool showStatusBar() const;
|
|
|
|
void setShowStatusBar(bool newShowStatusBar);
|
|
|
|
|
|
|
|
bool showToolWindowBars() const;
|
|
|
|
void setShowToolWindowBars(bool newShowToolWindowBars);
|
|
|
|
|
|
|
|
bool showProject() const;
|
|
|
|
void setShowProject(bool newShowProject);
|
|
|
|
|
|
|
|
bool showWatch() const;
|
|
|
|
void setShowWatch(bool newShowWatch);
|
|
|
|
|
|
|
|
bool showStructure() const;
|
|
|
|
void setShowStructure(bool newShowStructure);
|
|
|
|
|
|
|
|
bool showFiles() const;
|
|
|
|
void setShowFiles(bool newShowFiles);
|
|
|
|
|
|
|
|
bool showProblemSet() const;
|
|
|
|
void setShowProblemSet(bool newShowProblemSet);
|
|
|
|
|
|
|
|
bool showIssues() const;
|
|
|
|
void setShowIssues(bool newShowIssues);
|
|
|
|
|
|
|
|
bool showCompileLog() const;
|
|
|
|
void setShowCompileLog(bool newShowCompileLog);
|
|
|
|
|
|
|
|
bool showDebug() const;
|
|
|
|
void setShowDebug(bool newShowDebug);
|
|
|
|
|
|
|
|
bool showSearch() const;
|
|
|
|
void setShowSearch(bool newShowSearch);
|
|
|
|
|
|
|
|
bool showTODO() const;
|
|
|
|
void setShowTODO(bool newShowTODO);
|
|
|
|
|
|
|
|
bool showBookmark() const;
|
|
|
|
void setShowBookmark(bool newShowBookmark);
|
|
|
|
|
|
|
|
bool showProblem() const;
|
|
|
|
void setShowProblem(bool newShowProblem);
|
|
|
|
|
2021-12-23 09:11:58 +08:00
|
|
|
int CPUDialogWidth() const;
|
|
|
|
void setCPUDialogWidth(int newCPUDialogWidth);
|
|
|
|
|
|
|
|
int CPUDialogHeight() const;
|
|
|
|
void setCPUDialogHeight(int newCPUDialogHeight);
|
|
|
|
|
|
|
|
int CPUDialogSplitterPos() const;
|
|
|
|
void setCPUDialogSplitterPos(int newCPUDialogSplitterPos);
|
|
|
|
|
|
|
|
int settingsDialogWidth() const;
|
|
|
|
void setSettingsDialogWidth(int newSettingsDialogWidth);
|
|
|
|
|
|
|
|
int settingsDialogHeight() const;
|
|
|
|
void setSettingsDialogHeight(int newSettingsDialogHeight);
|
|
|
|
|
|
|
|
int settingsDialogSplitterPos() const;
|
|
|
|
void setSettingsDialogSplitterPos(int newSettingsDialogSplitterPos);
|
|
|
|
|
2022-01-08 21:23:20 +08:00
|
|
|
int newProjectDialogWidth() const;
|
|
|
|
void setNewProjectDialogWidth(int newNewProjectDialogWidth);
|
|
|
|
|
|
|
|
int newProjectDialogHeight() const;
|
|
|
|
void setNewProjectDialogHeight(int newNewProjectDialogHeight);
|
|
|
|
|
2022-01-27 18:46:37 +08:00
|
|
|
int newClassDialogWidth() const;
|
|
|
|
void setNewClassDialogWidth(int newNewClassDialogWidth);
|
|
|
|
|
2022-01-27 20:31:44 +08:00
|
|
|
int newClassDialogHeight() const;
|
|
|
|
void setNewClassDialogHeight(int newNewClassDialogHeight);
|
|
|
|
|
2022-02-01 16:17:28 +08:00
|
|
|
int newHeaderDialogWidth() const;
|
|
|
|
void setNewHeaderDialogWidth(int newNewFileDialogWidth);
|
|
|
|
|
|
|
|
int newHeaderDialogHeight() const;
|
|
|
|
void setNewHeaderDialogHeight(int newNewFileDialogHeight);
|
|
|
|
|
2022-05-22 14:31:13 +08:00
|
|
|
bool shrinkExplorerTabs() const;
|
|
|
|
void setShrinkExplorerTabs(bool newShrinkExplorerTabs);
|
|
|
|
|
|
|
|
bool shrinkMessagesTabs() const;
|
|
|
|
void setShrinkMessagesTabs(bool newShrinkMessagesTabs);
|
|
|
|
|
|
|
|
const QSize &explorerTabsSize() const;
|
|
|
|
void setExplorerTabsSize(const QSize &newExplorerTabsSize);
|
|
|
|
|
|
|
|
const QSize &messagesTabsSize() const;
|
|
|
|
void setMessagesTabsSize(const QSize &newMessagesTabsSize);
|
|
|
|
|
2021-09-02 16:35:28 +08:00
|
|
|
private:
|
|
|
|
QByteArray mMainWindowState;
|
|
|
|
QByteArray mMainWindowGeometry;
|
2021-09-02 16:46:53 +08:00
|
|
|
int mBottomPanelIndex;
|
|
|
|
int mLeftPanelIndex;
|
2021-09-26 16:25:17 +08:00
|
|
|
bool mClassBrowserSortAlpha;
|
|
|
|
bool mClassBrowserSortType;
|
|
|
|
bool mClassBrowserShowInherited;
|
2021-09-02 16:35:28 +08:00
|
|
|
|
2022-05-22 14:31:13 +08:00
|
|
|
bool mShrinkExplorerTabs;
|
|
|
|
bool mShrinkMessagesTabs;
|
|
|
|
QSize mExplorerTabsSize;
|
|
|
|
QSize mMessagesTabsSize;
|
2021-11-09 12:31:37 +08:00
|
|
|
//view
|
|
|
|
bool mShowToolbar;
|
|
|
|
bool mShowStatusBar;
|
|
|
|
bool mShowToolWindowBars;
|
|
|
|
|
|
|
|
bool mShowProject;
|
|
|
|
bool mShowWatch;
|
|
|
|
bool mShowStructure;
|
|
|
|
bool mShowFiles;
|
|
|
|
bool mShowProblemSet;
|
|
|
|
|
|
|
|
bool mShowIssues;
|
|
|
|
bool mShowCompileLog;
|
|
|
|
bool mShowDebug;
|
|
|
|
bool mShowSearch;
|
|
|
|
bool mShowTODO;
|
|
|
|
bool mShowBookmark;
|
|
|
|
bool mShowProblem;
|
|
|
|
|
2021-12-23 09:11:58 +08:00
|
|
|
//dialogs
|
|
|
|
int mCPUDialogWidth;
|
|
|
|
int mCPUDialogHeight;
|
|
|
|
int mCPUDialogSplitterPos;
|
|
|
|
int mSettingsDialogWidth;
|
|
|
|
int mSettingsDialogHeight;
|
|
|
|
int mSettingsDialogSplitterPos;
|
2022-01-08 21:23:20 +08:00
|
|
|
int mNewProjectDialogWidth;
|
|
|
|
int mNewProjectDialogHeight;
|
2022-01-27 18:46:37 +08:00
|
|
|
int mNewClassDialogWidth;
|
|
|
|
int mNewClassDialogHeight;
|
2022-02-01 16:17:28 +08:00
|
|
|
int mNewHeaderDialogWidth;
|
|
|
|
int mNewHeaderDialogHeight;
|
2021-12-23 09:11:58 +08:00
|
|
|
|
2021-09-02 16:35:28 +08:00
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
};
|
|
|
|
|
2021-07-26 11:47:54 +08:00
|
|
|
class Debugger: public _Base {
|
|
|
|
public:
|
|
|
|
explicit Debugger(Settings* settings);
|
2021-11-25 10:18:21 +08:00
|
|
|
bool enableDebugConsole() const;
|
|
|
|
void setEnableDebugConsole(bool showCommandLog);
|
2021-07-26 11:47:54 +08:00
|
|
|
|
2021-11-25 10:18:21 +08:00
|
|
|
bool showDetailLog() const;
|
|
|
|
void setShowDetailLog(bool showAnnotations);
|
2021-07-26 11:47:54 +08:00
|
|
|
|
2021-08-01 23:24:37 +08:00
|
|
|
bool onlyShowMono() const;
|
|
|
|
void setOnlyShowMono(bool onlyShowMono);
|
|
|
|
|
|
|
|
int fontSize() const;
|
|
|
|
void setFontSize(int fontSize);
|
|
|
|
|
|
|
|
bool useIntelStyle() const;
|
|
|
|
void setUseIntelStyle(bool useIntelStyle);
|
|
|
|
|
|
|
|
QString fontName() const;
|
|
|
|
void setFontName(const QString &fontName);
|
|
|
|
|
2021-08-13 11:18:42 +08:00
|
|
|
bool blendMode() const;
|
|
|
|
void setBlendMode(bool blendMode);
|
|
|
|
|
2021-09-28 14:18:51 +08:00
|
|
|
bool skipSystemLibraries() const;
|
|
|
|
void setSkipSystemLibraries(bool newSkipSystemLibraries);
|
|
|
|
bool skipProjectLibraries() const;
|
|
|
|
void setSkipProjectLibraries(bool newSkipProjectLibraries);
|
|
|
|
bool skipCustomLibraries() const;
|
|
|
|
void setSkipCustomLibraries(bool newSkipCustomLibraries);
|
|
|
|
|
2021-10-21 19:33:11 +08:00
|
|
|
bool autosaveBreakpoints() const;
|
|
|
|
void setAutosaveBreakpoints(bool newAutosaveBreakpoints);
|
|
|
|
|
|
|
|
bool autosaveWatches() const;
|
|
|
|
void setAutosaveWatches(bool newAutosaveWatches);
|
|
|
|
|
2021-11-25 10:18:21 +08:00
|
|
|
bool openCPUInfoWhenSignaled() const;
|
|
|
|
void setOpenCPUInfoWhenSignaled(bool newOpenCPUInfoWhenSignaled);
|
|
|
|
|
2021-12-25 18:09:50 +08:00
|
|
|
bool useGDBServer() const;
|
|
|
|
void setUseGDBServer(bool newUseGDBServer);
|
|
|
|
int GDBServerPort() const;
|
|
|
|
void setGDBServerPort(int newGDBServerPort);
|
|
|
|
|
2022-07-21 15:28:07 +08:00
|
|
|
int memoryViewRows() const;
|
|
|
|
void setMemoryViewRows(int newMemoryViewRows);
|
|
|
|
|
|
|
|
int memoryViewColumns() const;
|
|
|
|
void setMemoryViewColumns(int newMemoryViewColumns);
|
|
|
|
|
2021-07-26 11:47:54 +08:00
|
|
|
private:
|
2021-11-25 10:18:21 +08:00
|
|
|
bool mEnableDebugConsole;
|
|
|
|
bool mShowDetailLog;
|
2021-08-01 23:24:37 +08:00
|
|
|
QString mFontName;
|
|
|
|
bool mOnlyShowMono;
|
|
|
|
int mFontSize;
|
|
|
|
bool mUseIntelStyle;
|
2021-08-13 11:18:42 +08:00
|
|
|
bool mBlendMode;
|
2021-09-28 14:18:51 +08:00
|
|
|
bool mSkipSystemLibraries;
|
|
|
|
bool mSkipProjectLibraries;
|
|
|
|
bool mSkipCustomLibraries;
|
2021-10-21 19:33:11 +08:00
|
|
|
bool mAutosaveBreakpoints;
|
|
|
|
bool mAutosaveWatches;
|
2021-11-25 10:18:21 +08:00
|
|
|
bool mOpenCPUInfoWhenSignaled;
|
2021-12-25 18:09:50 +08:00
|
|
|
bool mUseGDBServer;
|
|
|
|
int mGDBServerPort;
|
2022-07-21 15:28:07 +08:00
|
|
|
int mMemoryViewRows;
|
|
|
|
int mMemoryViewColumns;
|
2021-07-26 11:47:54 +08:00
|
|
|
|
|
|
|
// _Base interface
|
|
|
|
protected:
|
|
|
|
void doSave() override;
|
|
|
|
void doLoad() override;
|
|
|
|
};
|
|
|
|
|
2021-07-01 19:44:38 +08:00
|
|
|
|
2021-04-15 11:18:14 +08:00
|
|
|
class CompilerSet {
|
2021-04-13 22:17:18 +08:00
|
|
|
public:
|
2022-07-24 18:24:21 +08:00
|
|
|
explicit CompilerSet();
|
|
|
|
explicit CompilerSet(const QString& compilerFolder, const QString& cc_prog);
|
2021-04-15 11:18:14 +08:00
|
|
|
explicit CompilerSet(const CompilerSet& set);
|
|
|
|
|
|
|
|
CompilerSet& operator= (const CompilerSet& ) = delete;
|
|
|
|
CompilerSet& operator= (const CompilerSet&& ) = delete;
|
|
|
|
|
2022-07-24 19:08:09 +08:00
|
|
|
// Initialization
|
|
|
|
void setProperties(const QString& binDir, const QString& cc_prog);
|
|
|
|
|
|
|
|
void resetCompileOptionts();
|
2022-05-12 15:28:08 +08:00
|
|
|
bool setCompileOption(const QString& key, int valIndex);
|
|
|
|
bool setCompileOption(const QString& key, const QString& value);
|
|
|
|
void unsetCompileOption(const QString& key);
|
2022-05-14 11:21:59 +08:00
|
|
|
void setCompileOptions(const QMap<QString, QString> options);
|
2022-05-12 15:28:08 +08:00
|
|
|
|
|
|
|
QString getCompileOptionValue(const QString& key);
|
2021-04-16 22:04:48 +08:00
|
|
|
|
2021-10-12 19:39:24 +08:00
|
|
|
int mainVersion();
|
2021-04-15 11:18:14 +08:00
|
|
|
|
2021-04-16 22:04:48 +08:00
|
|
|
bool dirsValid(QString& msg);
|
2021-06-24 16:05:19 +08:00
|
|
|
bool validateExes(QString& msg);
|
2021-04-16 22:04:48 +08:00
|
|
|
//properties
|
2021-04-17 14:52:47 +08:00
|
|
|
const QString& CCompiler() const;
|
|
|
|
void setCCompiler(const QString& name);
|
|
|
|
const QString& cppCompiler() const;
|
|
|
|
void setCppCompiler(const QString& name);
|
|
|
|
const QString& make() const;
|
|
|
|
void setMake(const QString& name);
|
|
|
|
const QString& debugger() const;
|
|
|
|
void setDebugger(const QString& name);
|
|
|
|
const QString& profiler() const;
|
|
|
|
void setProfiler(const QString& name);
|
|
|
|
const QString& resourceCompiler() const;
|
|
|
|
void setResourceCompiler(const QString& name);
|
2021-12-25 18:09:50 +08:00
|
|
|
const QString &debugServer() const;
|
|
|
|
void setDebugServer(const QString &newDebugServer);
|
2021-04-15 11:18:14 +08:00
|
|
|
|
|
|
|
QStringList& binDirs();
|
|
|
|
QStringList& CIncludeDirs();
|
|
|
|
QStringList& CppIncludeDirs();
|
2021-04-17 22:38:46 +08:00
|
|
|
QStringList& libDirs();
|
2021-09-04 20:49:44 +08:00
|
|
|
QStringList& defaultCIncludeDirs();
|
|
|
|
QStringList& defaultCppIncludeDirs();
|
|
|
|
QStringList& defaultLibDirs();
|
2021-04-15 11:18:14 +08:00
|
|
|
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& dumpMachine() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setDumpMachine(const QString& value);
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& version() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setVersion(const QString& value);
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& type() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setType(const QString& value);
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& name() const;
|
2021-04-15 21:32:45 +08:00
|
|
|
void setName(const QString& value);
|
2022-03-11 20:51:33 +08:00
|
|
|
const QStringList& defines();
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& target() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setTarget(const QString& value);
|
|
|
|
|
2021-08-29 10:14:07 +08:00
|
|
|
bool useCustomCompileParams() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setUseCustomCompileParams(bool value);
|
2021-08-29 10:14:07 +08:00
|
|
|
bool useCustomLinkParams() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setUseCustomLinkParams(bool value);
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& customCompileParams() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setCustomCompileParams(const QString& value);
|
2021-08-29 10:14:07 +08:00
|
|
|
const QString& customLinkParams() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setCustomLinkParams(const QString& value);
|
2021-08-29 10:14:07 +08:00
|
|
|
bool autoAddCharsetParams() const;
|
2021-04-15 11:18:14 +08:00
|
|
|
void setAutoAddCharsetParams(bool value);
|
|
|
|
|
2022-05-14 11:21:59 +08:00
|
|
|
//Converts options to and from memory format ( for old settings compatibility)
|
2021-04-15 21:32:45 +08:00
|
|
|
void setIniOptions(const QByteArray& value);
|
|
|
|
|
2021-09-02 21:01:23 +08:00
|
|
|
bool staticLink() const;
|
|
|
|
void setStaticLink(bool newStaticLink);
|
|
|
|
|
2021-04-15 11:18:14 +08:00
|
|
|
|
2021-09-13 10:48:44 +08:00
|
|
|
static int charToValue(char valueChar);
|
2021-09-15 11:23:42 +08:00
|
|
|
static char valueToChar(int val);
|
2021-10-03 23:46:40 +08:00
|
|
|
const QString &compilerType() const;
|
|
|
|
|
|
|
|
void setCompilerType(const QString &newCompilerType);
|
|
|
|
|
2021-10-25 21:36:23 +08:00
|
|
|
int compilerSetType() const;
|
|
|
|
void setCompilerSetType(int newCompilerSetType);
|
|
|
|
|
2022-01-24 11:23:30 +08:00
|
|
|
const QString &execCharset() const;
|
|
|
|
void setExecCharset(const QString &newExecCharset);
|
2022-01-24 01:08:47 +08:00
|
|
|
|
2022-05-12 15:28:08 +08:00
|
|
|
const QMap<QString, QString> &compileOptions() const;
|
|
|
|
|
2021-09-13 10:48:44 +08:00
|
|
|
private:
|
2022-07-24 19:08:09 +08:00
|
|
|
void setDirectories(const QString& binDir, const QString& mCompilerType);
|
|
|
|
//load hard defines
|
|
|
|
void setDefines();
|
2021-04-15 11:18:14 +08:00
|
|
|
void setExecutables();
|
|
|
|
void setUserInput();
|
|
|
|
|
2021-04-17 14:52:47 +08:00
|
|
|
QString findProgramInBinDirs(const QString name);
|
|
|
|
|
2021-04-15 11:18:14 +08:00
|
|
|
QByteArray getCompilerOutput(const QString& binDir, const QString& binFile,
|
|
|
|
const QStringList& arguments);
|
2021-04-13 22:17:18 +08:00
|
|
|
private:
|
2022-03-11 20:51:33 +08:00
|
|
|
bool mFullLoaded;
|
2021-04-13 22:17:18 +08:00
|
|
|
// Executables, most are hardcoded
|
2021-04-17 14:52:47 +08:00
|
|
|
QString mCCompiler;
|
|
|
|
QString mCppCompiler;
|
|
|
|
QString mMake;
|
|
|
|
QString mDebugger;
|
|
|
|
QString mProfiler;
|
|
|
|
QString mResourceCompiler;
|
2021-12-25 18:09:50 +08:00
|
|
|
QString mDebugServer;
|
2021-04-13 22:17:18 +08:00
|
|
|
|
|
|
|
// Directories, mostly hardcoded too
|
|
|
|
QStringList mBinDirs;
|
|
|
|
QStringList mCIncludeDirs;
|
2021-04-15 11:18:14 +08:00
|
|
|
QStringList mCppIncludeDirs;
|
2021-04-13 22:17:18 +08:00
|
|
|
QStringList mLibDirs;
|
2021-09-04 20:49:44 +08:00
|
|
|
QStringList mDefaultLibDirs;
|
|
|
|
QStringList mDefaultCIncludeDirs;
|
|
|
|
QStringList mDefaultCppIncludeDirs;
|
2021-04-13 22:17:18 +08:00
|
|
|
|
|
|
|
// Misc. properties
|
|
|
|
QString mDumpMachine; // "x86_64-w64-mingw32", "mingw32" etc
|
|
|
|
QString mVersion; // "4.7.1"
|
|
|
|
QString mType; // "TDM-GCC", "MinGW"
|
|
|
|
QString mName; // "TDM-GCC 4.7.1 Release"
|
2021-04-15 11:18:14 +08:00
|
|
|
QStringList mDefines; // list of predefined constants
|
2021-04-13 22:17:18 +08:00
|
|
|
QString mTarget; // 'X86_64' / 'i686'
|
2021-10-25 21:36:23 +08:00
|
|
|
QString mCompilerType; // 'Clang' / 'GCC'
|
|
|
|
int mCompilerSetType; // RELEASE/ DEBUG/ Profile
|
2021-04-13 22:17:18 +08:00
|
|
|
|
|
|
|
// User settings
|
2021-04-15 11:18:14 +08:00
|
|
|
bool mUseCustomCompileParams;
|
|
|
|
bool mUseCustomLinkParams;
|
2021-04-13 22:17:18 +08:00
|
|
|
QString mCustomCompileParams;
|
|
|
|
QString mCustomLinkParams;
|
2021-04-15 11:18:14 +08:00
|
|
|
bool mAutoAddCharsetParams;
|
2022-01-24 11:23:30 +08:00
|
|
|
QString mExecCharset;
|
2021-09-02 21:01:23 +08:00
|
|
|
bool mStaticLink;
|
2021-04-13 22:17:18 +08:00
|
|
|
|
|
|
|
// Options
|
2022-05-12 15:28:08 +08:00
|
|
|
QMap<QString,QString> mCompileOptions;
|
2021-04-13 22:17:18 +08:00
|
|
|
};
|
|
|
|
|
2021-04-15 21:32:45 +08:00
|
|
|
typedef std::shared_ptr<CompilerSet> PCompilerSet;
|
|
|
|
typedef std::vector<PCompilerSet> CompilerSetList;
|
|
|
|
|
|
|
|
class CompilerSets {
|
|
|
|
public:
|
|
|
|
explicit CompilerSets(Settings* settings);
|
2022-07-24 18:24:21 +08:00
|
|
|
PCompilerSet addSet();
|
2021-12-25 18:09:50 +08:00
|
|
|
bool addSets(const QString& folder);
|
2021-04-15 21:32:45 +08:00
|
|
|
void clearSets();
|
|
|
|
void findSets();
|
|
|
|
void saveSets();
|
|
|
|
void loadSets();
|
2021-04-18 11:41:41 +08:00
|
|
|
void saveDefaultIndex();
|
2021-04-16 22:04:48 +08:00
|
|
|
void deleteSet(int index);
|
2021-07-23 13:22:05 +08:00
|
|
|
void saveSet(int index);
|
2022-04-14 22:25:49 +08:00
|
|
|
size_t size() const;
|
2021-04-15 21:32:45 +08:00
|
|
|
int defaultIndex() const;
|
|
|
|
void setDefaultIndex(int value);
|
2021-04-16 22:04:48 +08:00
|
|
|
PCompilerSet defaultSet();
|
2021-09-09 11:47:04 +08:00
|
|
|
PCompilerSet getSet(int index);
|
2022-05-12 15:28:08 +08:00
|
|
|
|
|
|
|
QString getKeyFromCompilerCompatibleIndex(int idx) const;
|
|
|
|
|
2021-04-15 21:32:45 +08:00
|
|
|
private:
|
2022-07-24 18:24:21 +08:00
|
|
|
PCompilerSet addSet(const QString& folder, const QString& cc_prog);
|
2022-07-24 19:08:09 +08:00
|
|
|
PCompilerSet addSet(const PCompilerSet &pSet);
|
2022-07-24 18:24:21 +08:00
|
|
|
bool addSets(const QString& folder, const QString& cc_prog);
|
2021-04-17 14:52:47 +08:00
|
|
|
void savePath(const QString& name, const QString& path);
|
|
|
|
void savePathList(const QString& name, const QStringList& pathList);
|
2021-07-23 13:22:05 +08:00
|
|
|
|
2021-04-17 14:52:47 +08:00
|
|
|
QString loadPath(const QString& name);
|
|
|
|
void loadPathList(const QString& name, QStringList& list);
|
2021-04-15 21:32:45 +08:00
|
|
|
PCompilerSet loadSet(int index);
|
2022-05-13 20:22:16 +08:00
|
|
|
void prepareCompatibleIndex();
|
2022-05-12 15:28:08 +08:00
|
|
|
private:
|
2021-04-15 21:32:45 +08:00
|
|
|
CompilerSetList mList;
|
|
|
|
int mDefaultIndex;
|
|
|
|
Settings* mSettings;
|
2022-05-12 15:28:08 +08:00
|
|
|
QStringList mCompilerCompatibleIndex; // index for old settings compatibility
|
2021-04-15 21:32:45 +08:00
|
|
|
};
|
|
|
|
|
2021-04-08 10:29:21 +08:00
|
|
|
public:
|
2021-04-13 22:17:18 +08:00
|
|
|
explicit Settings(const QString& filename);
|
|
|
|
explicit Settings(Settings&& settings) = delete;
|
|
|
|
explicit Settings(const Settings& settings) = delete;
|
2021-06-12 22:36:23 +08:00
|
|
|
~Settings();
|
2021-04-08 10:29:21 +08:00
|
|
|
|
2021-04-13 22:17:18 +08:00
|
|
|
Settings& operator= (const Settings& settings) = delete;
|
|
|
|
Settings& operator= (const Settings&& settings) = delete;
|
2021-06-07 11:02:03 +08:00
|
|
|
void beginGroup(const QString& group);
|
|
|
|
void endGroup();
|
2022-05-21 10:44:39 +08:00
|
|
|
void remove(const QString &key);
|
2021-06-07 11:02:03 +08:00
|
|
|
void saveValue(const QString& group, const QString &key, const QVariant &value);
|
|
|
|
void saveValue(const QString &key, const QVariant &value);
|
|
|
|
QVariant value(const QString& group, const QString &key, const QVariant& defaultValue);
|
|
|
|
QVariant value(const QString &key, const QVariant& defaultValue);
|
2021-08-07 18:02:57 +08:00
|
|
|
void load();
|
2021-04-13 11:23:37 +08:00
|
|
|
|
|
|
|
Dirs& dirs();
|
|
|
|
Editor& editor();
|
2021-04-15 21:32:45 +08:00
|
|
|
CompilerSets& compilerSets();
|
2021-06-18 21:48:40 +08:00
|
|
|
Environment& environment();
|
2021-07-01 19:44:38 +08:00
|
|
|
Executor& executor();
|
2021-07-26 18:22:09 +08:00
|
|
|
Debugger& debugger();
|
2021-08-01 23:24:37 +08:00
|
|
|
History& history();
|
2021-08-30 16:59:08 +08:00
|
|
|
CodeCompletion &codeCompletion();
|
2021-09-01 00:05:46 +08:00
|
|
|
CodeFormatter &codeFormatter();
|
2021-09-02 16:35:28 +08:00
|
|
|
UI &ui();
|
2022-02-08 23:38:29 +08:00
|
|
|
VCS &vcs();
|
2021-06-17 10:39:46 +08:00
|
|
|
QString filename() const;
|
|
|
|
|
2021-04-08 10:29:21 +08:00
|
|
|
private:
|
2021-06-17 10:39:46 +08:00
|
|
|
QString mFilename;
|
2021-04-08 10:29:21 +08:00
|
|
|
QSettings mSettings;
|
2021-04-13 11:23:37 +08:00
|
|
|
Dirs mDirs;
|
|
|
|
Editor mEditor;
|
2021-06-18 21:48:40 +08:00
|
|
|
Environment mEnvironment;
|
2021-04-15 21:32:45 +08:00
|
|
|
CompilerSets mCompilerSets;
|
2021-07-01 19:44:38 +08:00
|
|
|
Executor mExecutor;
|
2021-07-26 11:47:54 +08:00
|
|
|
Debugger mDebugger;
|
2021-08-30 16:59:08 +08:00
|
|
|
CodeCompletion mCodeCompletion;
|
2021-09-01 00:05:46 +08:00
|
|
|
CodeFormatter mCodeFormatter;
|
2021-08-01 23:24:37 +08:00
|
|
|
History mHistory;
|
2021-09-02 16:35:28 +08:00
|
|
|
UI mUI;
|
2022-02-08 23:38:29 +08:00
|
|
|
VCS mVCS;
|
2021-04-08 10:29:21 +08:00
|
|
|
};
|
|
|
|
|
2021-04-13 11:23:37 +08:00
|
|
|
|
2021-04-08 10:29:21 +08:00
|
|
|
extern Settings* pSettings;
|
|
|
|
|
|
|
|
#endif // SETTINGS_H
|