diff options
| author | 2023-04-30 18:30:36 -0400 | |
|---|---|---|
| committer | 2023-04-30 18:30:36 -0400 | |
| commit | 3565aad630864ecdbe53fdaa501ea708555b3c7c (patch) | |
| tree | c743e4ad0bad39ebdb2f514c7cc52d34a257ebbe /SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h | |
| parent | 1fdc150116cad39aae5c5da407c3312b47a59e3a (diff) | |
New upstream version 3.4.4+dfsg.upstream/3.4.4+dfsg
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h b/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h index f0ab1de..7f5abb3 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/configdialog.h @@ -26,6 +26,13 @@ class ConfigMapper; class MultiEditorWidgetPlugin;
class ConfigNotifiablePlugin;
class UiConfiguredPlugin;
+class SyntaxHighlighterPlugin;
+class QPlainTextEdit;
+class QSyntaxHighlighter;
+class SqlEditor;
+
+#define CFG_UI_NAME "Ui"
+#define CFG_COLORS_NAME "Colors"
class GUI_API_EXPORT ConfigDialog : public QDialog
{
@@ -43,6 +50,9 @@ class GUI_API_EXPORT ConfigDialog : public QDialog static QString getFilterString(QListWidget* widget);
static QString getFilterString(QTableWidget* widget);
+ protected:
+ void showEvent(QShowEvent* event);
+
private:
void init();
void load();
@@ -57,6 +67,10 @@ class GUI_API_EXPORT ConfigDialog : public QDialog void initShortcuts();
void initShortcuts(CfgCategory* cfgCategory);
void initLangs();
+ void initTooltips();
+ void initColors();
+ void updateColorsAfterLoad();
+ void toggleColorButtonState(CfgEntry* colorCheckEntry);
void applyStyle(QWidget* widget, QStyle* style);
QTreeWidgetItem* getPluginsCategoryItem() const;
QTreeWidgetItem* getPluginsCategoryItem(PluginType* type) const;
@@ -83,13 +97,23 @@ class GUI_API_EXPORT ConfigDialog : public QDialog void setPluginNamesForDataTypeItem(QListWidgetItem* typeItem, const QStringList& pluginNames);
void addDataType(const QString& typeStr);
void rollbackPluginConfigs();
+ void rollbackColorsConfig();
void commitPluginConfigs();
+ void commitColorsConfig();
void connectMapperSignals(ConfigMapper* mapper);
+ QList<CfgMain*> getShortcutsCfgMains() const;
+ QList<CfgCategory*> getShortcutsCfgCategories() const;
+ void refreshColorsInSyntaxHighlighters();
+ void colorChanged();
+ QList<QWidget*> prepareCodeSyntaxColorsForStyle();
+ void adjustSyntaxColorsForStyle(QList<QWidget*>& unmodifiedColors);
+ void highlighterPluginLoaded(SyntaxHighlighterPlugin* plugin);
+ void highlighterPluginUnloaded(SyntaxHighlighterPlugin* plugin);
Ui::ConfigDialog *ui = nullptr;
QStyle* previewStyle = nullptr;
QHash<QString,QWidget*> nameToPage;
- BiHash<QTreeWidgetItem*,QString> itemToPluginNameMap;
+ BiHash<QTreeWidgetItem*,QString> pluginListItemToPluginNameMap;
QHash<PluginType*,QTreeWidgetItem*> pluginTypeToItemMap;
QHash<Plugin*,QTreeWidgetItem*> pluginToItemMap;
QHash<QString,QComboBox*> formatterLangToPluginComboMap;
@@ -102,6 +126,11 @@ class GUI_API_EXPORT ConfigDialog : public QDialog bool modifiedFlag = false;
QList<ConfigNotifiablePlugin*> notifiablePlugins;
bool requiresSchemasRefresh = false;
+ QList<QPlainTextEdit*> colorPreviewEditors;
+ SqlEditor* codePreviewSqlEditor = nullptr;
+ QList<QSyntaxHighlighter*> colorPreviewHighlighters;
+ BiHash<QPlainTextEdit*, SyntaxHighlighterPlugin*> highlightingPluginForPreviewEditor;
+ bool resettingColors = false;
private slots:
void refreshFormattersPage();
@@ -138,6 +167,7 @@ class GUI_API_EXPORT ConfigDialog : public QDialog void applyShortcutsFilter(const QString& filter);
void markRequiresSchemasRefresh();
void notifyPluginsAboutModification(QWidget*, CfgEntry* key, const QVariant& value);
+ void resetCodeSyntaxColors();
public slots:
void accept();
|
