2014-04-28 21:09:25 +04:00
|
|
|
#pragma once
|
2010-01-15 04:00:41 +03:00
|
|
|
|
|
|
|
#include <QMainWindow>
|
2010-01-25 23:52:43 +03:00
|
|
|
#include <QSettings>
|
2014-12-30 04:37:16 +03:00
|
|
|
|
|
|
|
#include "qtgettext.h"
|
2010-01-15 04:00:41 +03:00
|
|
|
#include "ui_Preferences.h"
|
2014-12-30 04:37:16 +03:00
|
|
|
#include "settings.h"
|
2010-01-15 04:00:41 +03:00
|
|
|
|
|
|
|
class Preferences : public QMainWindow, public Ui::Preferences
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
|
|
|
|
|
|
|
public:
|
|
|
|
~Preferences();
|
2014-11-01 01:30:52 +03:00
|
|
|
|
2014-11-16 21:35:16 +03:00
|
|
|
static void create(QStringList colorSchemes);
|
2014-11-01 01:30:52 +03:00
|
|
|
static Preferences *inst();
|
2010-01-15 04:00:41 +03:00
|
|
|
|
2010-01-25 23:52:43 +03:00
|
|
|
QVariant getValue(const QString &key) const;
|
2014-11-01 01:30:52 +03:00
|
|
|
void init();
|
2010-01-25 23:52:43 +03:00
|
|
|
void apply() const;
|
2014-12-30 15:03:51 +03:00
|
|
|
void fireEditorConfigChanged() const;
|
2010-01-15 04:00:41 +03:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void actionTriggered(class QAction *);
|
2014-01-03 11:08:50 +04:00
|
|
|
void featuresCheckBoxToggled(bool);
|
2012-01-10 03:55:46 +04:00
|
|
|
void on_colorSchemeChooser_itemSelectionChanged();
|
|
|
|
void on_fontChooser_activated(const QString &);
|
2015-02-25 19:31:30 +03:00
|
|
|
void on_fontSize_currentIndexChanged(const QString &);
|
2014-11-01 01:30:52 +03:00
|
|
|
void on_syntaxHighlight_activated(const QString &);
|
2012-01-10 03:55:46 +04:00
|
|
|
void on_openCSGWarningBox_toggled(bool);
|
|
|
|
void on_enableOpenCSGBox_toggled(bool);
|
|
|
|
void on_cgalCacheSizeEdit_textChanged(const QString &);
|
|
|
|
void on_polysetCacheSizeEdit_textChanged(const QString &);
|
|
|
|
void on_opencsgLimitEdit_textChanged(const QString &);
|
2012-01-14 04:22:46 +04:00
|
|
|
void on_forceGoldfeatherBox_toggled(bool);
|
2014-03-19 03:59:47 +04:00
|
|
|
void on_mouseWheelZoomBox_toggled(bool);
|
2014-10-18 21:37:31 +04:00
|
|
|
void on_localizationCheckBox_toggled(bool);
|
2013-02-05 09:36:25 +04:00
|
|
|
void on_updateCheckBox_toggled(bool);
|
|
|
|
void on_snapshotCheckBox_toggled(bool);
|
2014-05-13 00:47:42 +04:00
|
|
|
void on_mdiCheckBox_toggled(bool);
|
2014-11-01 20:55:48 +03:00
|
|
|
void on_reorderCheckBox_toggled(bool);
|
2014-05-13 00:47:42 +04:00
|
|
|
void on_undockCheckBox_toggled(bool);
|
2013-02-05 09:36:25 +04:00
|
|
|
void on_checkNowButton_clicked();
|
2014-09-14 01:52:21 +04:00
|
|
|
void on_launcherBox_toggled(bool);
|
2015-02-25 19:31:30 +03:00
|
|
|
void on_editorType_currentIndexChanged(const QString &);
|
2010-01-21 22:18:21 +03:00
|
|
|
|
2015-01-10 02:54:52 +03:00
|
|
|
void on_checkBoxShowWarningsIn3dView_toggled(bool);
|
2014-12-30 10:49:47 +03:00
|
|
|
//
|
|
|
|
// editor settings
|
|
|
|
//
|
|
|
|
|
|
|
|
// Indentation
|
|
|
|
void on_checkBoxAutoIndent_toggled(bool);
|
|
|
|
void on_comboBoxIndentUsing_activated(int);
|
|
|
|
void on_spinBoxIndentationWidth_valueChanged(int);
|
|
|
|
void on_spinBoxTabWidth_valueChanged(int);
|
|
|
|
void on_comboBoxTabKeyFunction_activated(int);
|
|
|
|
void on_comboBoxShowWhitespace_activated(int);
|
|
|
|
void on_spinBoxShowWhitespaceSize_valueChanged(int);
|
|
|
|
|
|
|
|
// Line wrap
|
|
|
|
void on_comboBoxLineWrap_activated(int);
|
|
|
|
void on_comboBoxLineWrapIndentationStyle_activated(int);
|
|
|
|
void on_spinBoxLineWrapIndentationIndent_valueChanged(int);
|
|
|
|
void on_comboBoxLineWrapVisualizationStart_activated(int);
|
|
|
|
void on_comboBoxLineWrapVisualizationEnd_activated(int);
|
|
|
|
|
|
|
|
// Display
|
|
|
|
void on_checkBoxHighlightCurrentLine_toggled(bool);
|
|
|
|
void on_checkBoxEnableBraceMatching_toggled(bool);
|
2014-12-27 04:17:15 +03:00
|
|
|
|
2010-01-21 22:18:21 +03:00
|
|
|
signals:
|
2010-01-25 23:52:43 +03:00
|
|
|
void requestRedraw() const;
|
2014-05-13 00:47:42 +04:00
|
|
|
void updateMdiMode(bool mdi) const;
|
2014-11-01 20:55:48 +03:00
|
|
|
void updateUndockMode(bool undockMode) const;
|
|
|
|
void updateReorderMode(bool undockMode) const;
|
2010-01-25 23:52:43 +03:00
|
|
|
void fontChanged(const QString &family, uint size) const;
|
2014-08-15 01:16:24 +04:00
|
|
|
void colorSchemeChanged(const QString &scheme) const;
|
2012-01-14 04:22:46 +04:00
|
|
|
void openCSGSettingsChanged() const;
|
2014-11-01 01:30:52 +03:00
|
|
|
void syntaxHighlightChanged(const QString &s) const;
|
2014-07-11 18:11:16 +04:00
|
|
|
void editorTypeChanged(const QString &type);
|
2014-12-27 04:17:15 +03:00
|
|
|
void editorConfigChanged() const;
|
2010-01-15 04:00:41 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
Preferences(QWidget *parent = NULL);
|
2010-01-22 16:17:41 +03:00
|
|
|
void keyPressEvent(QKeyEvent *e);
|
2010-01-25 23:52:43 +03:00
|
|
|
void updateGUI();
|
|
|
|
void removeDefaultSettings();
|
2014-01-03 11:08:50 +04:00
|
|
|
void setupFeaturesPage();
|
2014-12-30 15:03:51 +03:00
|
|
|
void writeSettings();
|
2014-01-03 11:08:50 +04:00
|
|
|
void addPrefPage(QActionGroup *group, QAction *action, QWidget *widget);
|
2010-01-22 16:17:41 +03:00
|
|
|
|
2014-12-30 04:37:16 +03:00
|
|
|
/** Initialize combobox list values from the settings range values */
|
|
|
|
void initComboBox(QComboBox *comboBox, const Settings::SettingsEntry& entry);
|
|
|
|
/** Initialize spinbox min/max values from the settings range values */
|
|
|
|
void initSpinBox(QSpinBox *spinBox, const Settings::SettingsEntry& entry);
|
|
|
|
/** Update combobox from current settings */
|
|
|
|
void updateComboBox(QComboBox *comboBox, const Settings::SettingsEntry& entry);
|
|
|
|
/** Set value from combobox to settings */
|
|
|
|
void applyComboBox(QComboBox *comboBox, int val, Settings::SettingsEntry& entry);
|
|
|
|
|
2010-01-25 23:52:43 +03:00
|
|
|
QSettings::SettingsMap defaultmap;
|
2014-01-03 11:08:50 +04:00
|
|
|
QHash<const QAction *, QWidget *> prefPages;
|
2010-01-15 04:00:41 +03:00
|
|
|
|
|
|
|
static Preferences *instance;
|
2014-01-03 11:08:50 +04:00
|
|
|
static const char *featurePropertyName;
|
2010-01-15 04:00:41 +03:00
|
|
|
};
|