Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KLFSETTINGS_H
00025 #define KLFSETTINGS_H
00026
00027 #include <QDialog>
00028 #include <QTextCharFormat>
00029 #include <QCheckBox>
00030 #include <QPushButton>
00031
00032 #include <klfbackend.h>
00033
00034 class QTreeWidgetItem;
00035 class KLFColorChooser;
00036 class KLFPathChooser;
00037 class KLFLatexSyntaxHighlighter;
00038 class KLFMainWin;
00039
00040 namespace Ui { class KLFSettings; }
00041
00046 class KLF_EXPORT KLFSettings : public QDialog
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 enum SettingsControl {
00052 AppLanguage = 1,
00053 AppFonts,
00054 Preview,
00055 TooltipPreview,
00056 SyntaxHighlighting,
00057 ExecutablePaths,
00058 ExpandEPSBBox,
00059 ExportProfiles,
00060 LibrarySettings,
00061 ManageAddOns,
00062 ManagePlugins,
00063 PluginsConfig
00064 };
00065
00066 KLFSettings(KLFMainWin* parent = 0);
00067 ~KLFSettings();
00068
00069 bool eventFilter(QObject *object, QEvent *event);
00070
00071 public slots:
00072
00073 void reset();
00074 void show();
00075
00077 void showControl(int controlNum);
00080 void showControl(const QString& controlName);
00081
00082 void apply();
00083
00084 void help();
00085
00086 void setDefaultPaths();
00087 void importAddOn();
00088 void importAddOn(const QString& fileName, bool uiSuggestRestart = true);
00089 void removeAddOn();
00090 void removePlugin();
00092 void removePlugin(const QString& fname);
00093
00094 void retranslateUi(bool alsoBaseUi = true);
00095
00096 protected:
00097
00098 protected slots:
00099
00100 void populateLocaleCombo();
00101 void populateExportProfilesCombos();
00102
00103 void initPluginControls();
00104 void resetPluginControls();
00105 void refreshPluginSelected();
00106 void refreshAddOnList();
00107 void refreshAddOnSelected();
00108
00109 virtual void accept();
00110
00111 void slotChangeFontPresetSender();
00112 void slotChangeFontSender();
00113 void slotChangeFont(QPushButton *btn, const QFont& f);
00114
00115 private:
00116 Ui::KLFSettings *u;
00117
00118 KLFMainWin *_mainwin;
00119
00120 bool pUserSetDefaultAppFont;
00121
00122 QMap<QString,QPushButton*> pFontButtons;
00123 QMap<QString,QAction*> pFontBasePresetActions;
00124 QList<QAction*> pFontSetActions;
00125
00126 struct TextFormatEnsemble {
00127 TextFormatEnsemble(QTextCharFormat *format,
00128 KLFColorChooser *foreground, KLFColorChooser *background,
00129 QCheckBox *chkBold, QCheckBox *chkItalic)
00130 : fmt(format), fg(foreground), bg(background), chkB(chkBold), chkI(chkItalic) { }
00131 QTextCharFormat *fmt;
00132 KLFColorChooser *fg;
00133 KLFColorChooser *bg;
00134 QCheckBox *chkB;
00135 QCheckBox *chkI;
00136 };
00137 QList<TextFormatEnsemble> _textformats;
00138
00139 bool _pluginstuffloaded;
00140 QMap<QString,QWidget*> mPluginConfigWidgets;
00141 QMap<QString,QTreeWidgetItem*> mPluginListItems;
00142
00143 bool setDefaultFor(const QString& progname, const QString& guessprog, bool required,
00144 KLFPathChooser *destination);
00145 };
00146
00147 #endif
00148