-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy pathconfigdialog.h
177 lines (143 loc) · 5.58 KB
/
configdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/***************************************************************************
* copyright : (C) 2003-2007 by Pascal Brachet *
* http://www.xm1math.net/texmaker/ *
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef Header_Config_Dialog
#define Header_Config_Dialog
#include "mostQtHeaders.h"
#include "ui_configdialog.h"
#include "qformat.h"
#include "buildmanager.h"
#include <QNetworkReply>
//TODO: perhaps move each class in its own file?
class ShortcutComboBox: public QComboBox
{
Q_OBJECT
public:
ShortcutComboBox(QWidget *parent = nullptr);
protected:
virtual void keyPressEvent(QKeyEvent *e);
virtual void focusInEvent(QFocusEvent *e);
};
class ShortcutDelegate : public QItemDelegate
{
Q_OBJECT
public:
ShortcutDelegate(QObject *parent = nullptr);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &index) const;
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const;
bool isBasicEditorKey(const QModelIndex &index) const;
QTreeWidget *treeWidget; //tree widget to remove duplicates from, not necessary
static const QString deleteRowButton;
static const QString addRowButton;
public slots:
void treeWidgetItemClicked(QTreeWidgetItem *item, int column);
};
class ComboBoxDelegate : public QItemDelegate
{
public:
ComboBoxDelegate(QObject *parent = nullptr);
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setEditorData(QWidget *editor, const QModelIndex &index) const;
void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &index) const;
QStringList defaultItems;
int activeColumn;
};
class QFormatConfig;
class ConfigDialog : public QDialog
{
Q_OBJECT
public:
ConfigDialog(QWidget *parent = nullptr);
~ConfigDialog();
Ui::ConfigDialog ui;
QRadioButton *checkboxInternalPDFViewer;
QMap<QString, QFormat> editorFormats;
QFormatConfig *fmConfig;
QMap<QString, QVariant> *replacedIconsOnMenus;
QObject *menuParent;
QList<QStringList> customizableToolbars;
QList<QMenu *> allMenus;
QList<QMenu *> standardToolbarMenus;
void setBuildManger(BuildManager *buildManager) { mBuildManager = buildManager; }
void showAndLimitSize();
bool riddled;
public slots:
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
private slots:
void comboBoxWithPathEdited(const QString &newText);
void comboBoxWithPathHighlighted(const QString &newText);
void browseThesaurus();
void browseGrammarLTPath();
void browseGrammarLTJavaPath();
void browseGrammarWordListsDir();
void resetLTURL();
void resetLTArgs();
void browseDictDir();
void updateDefaultDictSelection(const QString &dictPaths, const QString &newDefault = QString());
void browsePathLog();
void browsePathBib();
void browsePathImages();
void browsePathPdf();
void browsePathCommands();
void advancedOptionsToggled(bool on);
void advancedOptionsClicked(bool on);
void metaFilterChanged(const QString &filter);
void toolbarChanged(int toolbar);
void actionsChanged(int actionClass);
void toToolbarClicked();
void fromToolbarClicked();
void checkToolbarMoved();
void customContextMenu(const QPoint &p);
void loadOtherIcon();
void insertSeparator();
void populatePossibleActions(QTreeWidgetItem *parent, const QMenu *menu, bool keepHierarchy);
void importDictionary();
void updateCheckNow();
void refreshLastUpdateTime();
void filterCompletionList(const QString &text);
void revertClicked();
void aiProviderChanged(int provider);
void retrieveModels();
void resetAIURL();
void modelsRetrieved(QNetworkReply *reply);
void aiFillInKnownModels();
void populateComboBoxFont(bool onlyMonospaced);
private:
#ifdef INTERNAL_TERMINAL
void populateTerminalColorSchemes();
void populateTerminalComboBoxFont(bool onlyMonospaced);
#endif
protected:
bool eventFilter(QObject *obj,QEvent *event);
private:
enum ContentsType {CONTENTS_BASIC, CONTENTS_ADVANCED, CONTENTS_DISABLED};
QListWidgetItem *createIcon(const QString &caption, const QIcon &icon, ContentsType contentsType = CONTENTS_BASIC);
bool askRiddle();
void hideShowAdvancedOptions(QWidget *w, bool on);
void tweakFocusSettings(QObjectList objList);
static bool metaFilterRecurseWidget(const QString &filter, QWidget *widget);
static bool metaFilterRecurseLayout(const QString &filter, QLayout *layout);
static int lastUsedPage;
static QPoint lastSize;
int oldToolbarIndex;
BuildManager *mBuildManager;
};
Q_DECLARE_METATYPE(QAction *)
#endif