[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
klfsettings.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2011 by Philippe Faist
5  * philippe.faist@bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id: klfsettings.h 603 2011-02-26 23:14:55Z phfaist $ */
23 
24 #ifndef KLFSETTINGS_H
25 #define KLFSETTINGS_H
26 
27 #include <QDialog>
28 #include <QTextCharFormat>
29 #include <QCheckBox>
30 #include <QPushButton>
31 
32 #include <klfbackend.h>
33 
34 class QTreeWidgetItem;
35 class KLFColorChooser;
36 class KLFPathChooser;
38 class KLFMainWin;
39 
40 namespace Ui { class KLFSettings; }
41 
46 class KLF_EXPORT KLFSettings : public QDialog
47 {
48  Q_OBJECT
49 
50 public:
52  AppLanguage = 1,
63  PluginsConfig
64  };
65 
66  KLFSettings(KLFMainWin* parent = 0);
67  ~KLFSettings();
68 
69  bool eventFilter(QObject *object, QEvent *event);
70 
71 public slots:
72 
73  void reset();
74  void show();
75 
77  void showControl(int controlNum);
80  void showControl(const QString& controlName);
81 
82  void apply();
83 
84  void help();
85 
86  void setDefaultPaths();
87  void importAddOn();
88  void importAddOn(const QString& fileName, bool uiSuggestRestart = true);
89  void removeAddOn();
90  void removePlugin();
92  void removePlugin(const QString& fname);
93 
94  void retranslateUi(bool alsoBaseUi = true);
95 
96 protected:
97 
98 protected slots:
99 
100  void populateLocaleCombo();
101  void populateExportProfilesCombos();
102 
103  void initPluginControls();
104  void resetPluginControls();
105  void refreshPluginSelected();
106  void refreshAddOnList();
107  void refreshAddOnSelected();
108 
109  virtual void accept();
110 
111  void slotChangeFontPresetSender();
112  void slotChangeFontSender();
113  void slotChangeFont(QPushButton *btn, const QFont& f);
114 
115 private:
116  Ui::KLFSettings *u;
117 
118  KLFMainWin *_mainwin;
119 
120  bool pUserSetDefaultAppFont;
121 
122  QMap<QString,QPushButton*> pFontButtons;
123  QMap<QString,QAction*> pFontBasePresetActions;
124  QList<QAction*> pFontSetActions;
125 
126  struct TextFormatEnsemble {
127  TextFormatEnsemble(QTextCharFormat *format,
128  KLFColorChooser *foreground, KLFColorChooser *background,
129  QCheckBox *chkBold, QCheckBox *chkItalic)
130  : fmt(format), fg(foreground), bg(background), chkB(chkBold), chkI(chkItalic) { }
131  QTextCharFormat *fmt;
132  KLFColorChooser *fg;
133  KLFColorChooser *bg;
134  QCheckBox *chkB;
135  QCheckBox *chkI;
136  };
137  QList<TextFormatEnsemble> _textformats;
138 
139  bool _pluginstuffloaded;
140  QMap<QString,QWidget*> mPluginConfigWidgets;
141  QMap<QString,QTreeWidgetItem*> mPluginListItems;
142 
143  bool setDefaultFor(const QString& progname, const QString& guessprog, bool required,
144  KLFPathChooser *destination);
145 };
146 
147 #endif
148 
A settings dialog.
Definition: klfsettings.h:46

Generated by doxygen 1.8.5