30 #include <QFontDatabase>
31 #include <QFontDialog>
33 #include <QMessageBox>
36 #include <QFileDialog>
41 #include <QMouseEvent>
42 #include <QDesktopServices>
49 #include <ui_klfsettings.h>
60 #define KLFSETTINGS_ROLE_PLUGNAME (Qt::UserRole + 5300)
61 #define KLFSETTINGS_ROLE_PLUGINDEX (KLFSETTINGS_ROLE_PLUGNAME + 1)
63 #define KLFSETTINGS_ROLE_ADDONINDEX (Qt::UserRole + 5400)
66 #define REG_SH_TEXTFORMATENSEMBLE(x) \
67 _textformats.append( TextFormatEnsemble( & klfconfig.SyntaxHighlighter.fmt##x , \
68 u->colSH##x, u->colSH##x##Bg , u->chkSH##x##B , u->chkSH##x##I ) );
76 u =
new Ui::KLFSettings;
78 setObjectName(
"KLFSettings");
82 pUserSetDefaultAppFont =
false;
84 u->cbxLibIconViewFlow->setEnumValues(
QList<int>()<<QListView::TopToBottom<<QListView::LeftToRight,
85 QStringList()<<tr(
"Top to Bottom")<<tr(
"Left to Right"));
102 b = u->btns->addButton(QDialogButtonBox::Cancel);
103 b->setIcon(
QIcon(
":/pics/closehide.png"));
104 connect(b, SIGNAL(clicked()),
this, SLOT(
reject()));
105 b = u->btns->addButton(QDialogButtonBox::Apply);
106 b->setIcon(
QIcon(
":/pics/apply.png"));
107 connect(b, SIGNAL(clicked()),
this, SLOT(
apply()));
108 b = u->btns->addButton(QDialogButtonBox::Ok);
109 b->setIcon(
QIcon(
":/pics/ok.png"));
110 connect(b, SIGNAL(clicked()),
this, SLOT(
accept()));
116 QFont f = this->font();
118 u->lblSHForeground->setFont(f);
119 u->lblSHBackground->setFont(f);
121 connect(u->btnPathsReset, SIGNAL(clicked()),
this, SLOT(
setDefaultPaths()));
125 connect(u->btnImportAddOn, SIGNAL(clicked()),
this, SLOT(
importAddOn()));
126 connect(u->btnRemoveAddOn, SIGNAL(clicked()),
this, SLOT(
removeAddOn()));
129 u->lstPlugins->installEventFilter(
this);
130 u->lstPlugins->viewport()->installEventFilter(
this);
131 u->lstAddOns->installEventFilter(
this);
132 u->lstAddOns->viewport()->installEventFilter(
this);
140 u->aFontCMU->setEnabled( fdb.
families().contains(
"CMU Sans Serif") );
141 pFontBasePresetActions[
"CMU"] = u->aFontCMU;
142 pFontBasePresetActions[
"TT"] = u->aFontTT;
143 pFontBasePresetActions[
"Std"] = u->aFontStd;
144 pFontButtons[
"AppFont"] = u->btnAppFont;
145 pFontButtons[
"EditorFont"] = u->btnEditorFont;
146 pFontButtons[
"PreambleFont"] = u->btnPreambleFont;
148 QMenu *fontPresetMenu = NULL;
152 fontPresetMenu =
new QMenu(
this);
154 vmap[
"Action"] =
"CMU";
156 vmap[
"Button"] =
QVariant(
"AppFont");
158 a->setEnabled(u->aFontCMU->isEnabled());
161 pFontSetActions << a;
163 vmap[
"Action"] =
"Std";
165 vmap[
"Button"] =
QVariant(
"AppFont");
166 vmap[
"isSystemDefaultAppFont"] =
QVariant(
true);
169 pFontSetActions << a;
171 u->btnAppFontChoose->setMenu(fontPresetMenu);
173 fontPresetMenu =
new QMenu(
this);
175 vmap[
"Action"] =
"TT";
177 vmap[
"Button"] =
QVariant(
"EditorFont");
180 pFontSetActions << a;
183 vmap[
"Action"] =
"CMU";
185 vmap[
"Button"] =
QVariant(
"EditorFont");
187 a->setEnabled(u->aFontCMU->isEnabled());
189 pFontSetActions << a;
192 vmap[
"Action"] =
"Std";
194 vmap[
"Button"] =
QVariant(
"EditorFont");
197 pFontSetActions << a;
199 u->btnEditorFontChoose->setMenu(fontPresetMenu);
201 fontPresetMenu =
new QMenu(
this);
203 vmap[
"Action"] =
"TT";
205 vmap[
"Button"] =
QVariant(
"PreambleFont");
208 pFontSetActions << a;
211 vmap[
"Action"] =
"CMU";
213 vmap[
"Button"] =
QVariant(
"PreambleFont");
215 a->setEnabled(u->aFontCMU->isEnabled());
217 pFontSetActions << a;
220 vmap[
"Action"] =
"Std";
222 vmap[
"Button"] =
QVariant(
"PreambleFont");
225 pFontSetActions << a;
227 u->btnPreambleFontChoose->setMenu(fontPresetMenu);
245 QWidget * w = u->tbxPluginsConfig->widget(u->tbxPluginsConfig->currentIndex());
246 u->tbxPluginsConfig->removeItem(u->tbxPluginsConfig->currentIndex());
249 u->lstPlugins->setColumnWidth(0, 185);
252 _pluginstuffloaded =
false;
260 u->retranslateUi(
this);
264 for (k = 0; k < pFontSetActions.
size(); ++k) {
265 QAction *a = pFontSetActions[k];
266 QVariantMap vmap = a->
data().toMap();
267 QString refAKey = vmap[
"Action"].toString();
269 "Base Reference Preset Action not found: "<<refAKey<<
" ?!?",
271 QAction *refA = pFontBasePresetActions[refAKey];
272 a->setText(refA->text());
273 a->setIcon(refA->icon());
274 a->setToolTip(refA->toolTip());
290 u->cbxLocale->clear();
292 u->cbxLocale->addItem(
QLatin1String(
"English Default"), QVariant::fromValue<QString>(
"en_US") );
306 u->cbxLocale->setCurrentIndex(k);
313 u->cbxCopyExportProfile->clear();
314 u->cbxDragExportProfile->clear();
316 for (k = 0; k < eplist.
size(); ++k) {
317 u->cbxCopyExportProfile->addItem(eplist[k].description(),
QVariant(eplist[k].profileName()));
318 u->cbxDragExportProfile->addItem(eplist[k].description(),
QVariant(eplist[k].profileName()));
330 if (!_pluginstuffloaded)
340 #define __KLF_SHOW_SETTINGS_CONTROL( tab , focuswidget ) \
341 u->tabs->setCurrentWidget( u->tab ); \
342 u->focuswidget->setFocus(Qt::OtherFocusReason);
384 qWarning()<<
KLF_FUNC_NAME<<
": unknown control number requested : "<<control;
389 #define __KLF_SETTINGS_TEST_STR_CONTROL( controlName, controlNum ) \
390 if (controlName == QLatin1String(#controlNum)) { \
391 showControl(controlNum); \
414 if (event->
type() != QEvent::MouseButtonPress)
417 if (e->button() != Qt::LeftButton)
427 for (k = 0; k < selitems.
size(); ++k) {
428 selitems[k]->setSelected(
false);
437 if (
object == u->lstPlugins ||
object == u->lstPlugins->viewport())
438 tree = u->lstPlugins;
439 if (
object == u->lstAddOns ||
object == u->lstAddOns->viewport())
445 return QDialog::eventFilter(
object, event);
457 u->cbxLocale->setCurrentIndex(k);
462 u->pathGs->setPath(s.
gsexec);
480 for (k = 0; k < _textformats.
size(); ++k) {
481 if (_textformats[k].fmt->hasProperty(QTextFormat::ForegroundBrush))
482 _textformats[k].fg->setColor(_textformats[k].fmt->foreground().color());
484 _textformats[k].fg->setColor(
QColor());
485 if (_textformats[k].fmt->hasProperty(QTextFormat::BackgroundBrush))
486 _textformats[k].bg->setColor(_textformats[k].fmt->background().color());
488 _textformats[k].bg->setColor(
QColor());
489 if (_textformats[k].fmt->hasProperty(QTextFormat::FontWeight))
490 _textformats[k].chkB->setChecked(_textformats[k].fmt->fontWeight() > 60);
492 _textformats[k].chkB->setCheckState(Qt::PartiallyChecked);
493 if (_textformats[k].fmt->hasProperty(QTextFormat::FontItalic))
494 _textformats[k].chkI->setChecked(_textformats[k].fmt->fontItalic());
496 _textformats[k].chkI->setCheckState(Qt::PartiallyChecked);
520 u->cbxCopyExportProfile->setCurrentIndex(copyi);
522 u->cbxDragExportProfile->setCurrentIndex(dragi);
537 if (_pluginstuffloaded)
539 _pluginstuffloaded =
true;
542 int n_pluginconfigpages = 0;
553 Qt::Checked : Qt::Unchecked);
559 mPluginListItems[name] = litem;
561 if ( instance != NULL ) {
563 u->tbxPluginsConfig->addItem( mPluginConfigWidgets[name] ,
QIcon(
":/pics/bullet22.png"), title );
566 n_pluginconfigpages++;
569 if (n_pluginconfigpages == 0) {
571 lbl =
new QLabel(tr(
"No Plugins have been loaded. Please install and enable individual plugins "
572 "first, then come back to this page to configure them."), u->tbxPluginsConfig);
574 lbl->setWordWrap(
true);
576 u->tbxPluginsConfig->addItem(lbl, tr(
"No Plugins Loaded"));
590 "Plugin "<<name<<
" does not have its corresponding check item!",
593 mPluginListItems[name]->setCheckState(0,
595 Qt::Checked : Qt::Unchecked);
597 if (instance != NULL) {
598 if (!mPluginConfigWidgets.
contains(name)) {
599 qWarning()<<
KLF_FUNC_NAME<<
": Plugin "<<name<<
" does not have its config widget !?!?!";
602 QWidget *widget = mPluginConfigWidgets[name];
613 if (sel.
size() != 1) {
615 u->lblPluginInfo->setText(
"");
621 u->lblPluginInfo->setText(
"");
627 u->lblPluginInfo->setText(tr(
"<p style=\"-qt-block-indent: 0; text-indent: 0px; margin-bottom: 0px;\">\n"
628 "<tt>Name:</tt> <span style=\"font-weight:600;\">%1</span><br />\n"
629 "<tt>Author:</tt> <span style=\"font-weight:600;\">%2</span><br />\n"
630 "<tt>Description:</tt></p>\n"
631 "<p style=\"font-weight: 600; margin-top: 2px; margin-left: 25px;"
632 " margin-bottom: 0px;\">%3</p>\n"
633 "<p style=\"-qt-block-indent: 0; text-indent: 0px; margin-top: 2px;\">\n"
634 "<tt>File Location:</tt> <span style=\"font-size: %4pt;\">%5</span>\n")
639 .canonicalFilePath())))
649 if (sel.
size() != 1) {
650 qWarning(
"KLFSettings::removePlugin: No Selection or many selection");
656 qWarning(
"KLFSettings::removePlugin: Error: What's going on?? k=%d > klf_plugins.size=%d", k,
klf_plugins.size());
661 confirmdlg.setIcon(QMessageBox::Warning);
663 confirmdlg.setText(tr(
"<qt>Are you sure you want to remove Plugin <i>%1</i>?</qt>").arg(
klf_plugins[k].title));
664 confirmdlg.setDetailedText(tr(
"The Plugin File %1 will be removed from disk.").arg(
klf_plugins[k].fpath));
665 confirmdlg.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
669 int confirmation = confirmdlg.
exec();
670 if (confirmation != QMessageBox::Yes) {
679 tr(
"<p style=\"-qt-block-indent: 0; text-indent: 0px;\">Please note the following:<br />\n"
680 "<ul><li>You need to restart KLatexFormula for changes to take effect\n"
681 "<li>If this plugin was privided in an add-on, you need to remove the corresponding "
682 "add-on too or the plugin will be automatically re-installed."
687 qWarning(
"Failed to remove plugin '%s'", qPrintable(
klf_plugins[k].fpath));
698 klfDbg(
"removing plugin "<<fname<<
" from plugins. Dumping plugin list: ");
706 qWarning(
"KLFSettings::removePlugin: internal error: didn't find plugin name %s", qPrintable(fname));
724 qWarning(
"Failed to remove plugin '%s'", qPrintable(
klf_plugins[k].fpath));
730 bool KLFSettings::setDefaultFor(
const QString& progname,
const QString& guessedprog,
bool required,
733 QString progpath = guessedprog;
741 QMessageBox msgbox(QMessageBox::Critical, tr(
"Error"), tr(
"Could not find %1 executable !")
742 .arg(progname), QMessageBox::Ok);
743 msgbox.setInformativeText(tr(
"Please check your installation and specify the path"
744 " to %1 executable manually if it is not installed"
745 " in $PATH.").arg(progname));
746 msgbox.setDefaultButton(QMessageBox::Ok);
747 msgbox.setEscapeButton(QMessageBox::Ok);
752 destination->
setPath(progpath);
760 if ( !
QFileInfo(u->pathTempDir->path()).isDir() )
762 setDefaultFor(
"latex", defaultsettings.
latexexec,
true, u->pathLatex);
763 setDefaultFor(
"dvips", defaultsettings.
dvipsexec,
true, u->pathDvips);
764 setDefaultFor(
"gs", defaultsettings.
gsexec,
true, u->pathGs);
765 bool r = setDefaultFor(
"epstopdf", defaultsettings.
epstopdfexec,
false, u->pathEpstopdf);
766 u->chkEpstopdf->setChecked(r);
772 u->lstAddOns->clear();
773 u->lstAddOns->setColumnWidth(0, 160);
800 if (sel.
size() != 1) {
801 u->lblAddOnInfo->setText(
"");
802 u->btnRemoveAddOn->setEnabled(
false);
807 u->lblAddOnInfo->setText(
"");
808 u->btnRemoveAddOn->setEnabled(
false);
813 u->btnRemoveAddOn->setEnabled(
klf_addons[k].islocal());
816 u->lblAddOnInfo->setText(tr(
"<p style=\"-qt-block-indent: 0; text-indent: 0px; margin-bottom: 0px\">\n"
817 "<tt>Name:</tt> <span style=\"font-weight:600;\">%1</span><br />\n"
818 "<tt>Author:</tt> <span style=\"font-weight:600;\">%2</span><br />\n"
819 "<tt>Description:</tt></p>\n"
820 "<p style=\"font-weight: 600; margin-top: 2px; margin-left: 25px;"
821 " margin-bottom: 0px;\">%3</p>\n"
822 "<p style=\"-qt-block-indent: 0; text-indent: 0px; margin-top: 2px;\">\n"
823 "<tt>File Name:</tt> <span style=\"font-size: %5pt;\">%4</span><br />\n"
824 "<tt>File Location:</tt> <span style=\"font-size: %5pt;\">%6</span><br />\n"
825 "<tt><i>%7</i></tt>").arg(Qt::escape(
klf_addons[k].title()))
832 tr(
"Add-On installed locally") :
833 tr(
"Add-On installed globally on system") )
843 QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation),
844 "Qt Resource Files (*.rcc)");
846 for (i = 0; i < efnames.size(); ++i) {
858 klfDbg(
"fileName="<<fileName<<
", suggestRestart="<<suggestRestart) ;
869 tr(
"An Add-On with the same file name has already been imported."));
884 tr(
"This add-on requires a more recent version of KLatexFormula.\n"
885 "Required version: %1\n"
886 "This version: %2").arg(addoninfo.
klfminversion(), KLF_VERSION_STRING));
894 for (k = 0; k < trlist.size(); ++k) {
896 if ( u->cbxLocale->findData(i18nfile.locale) == -1 ) {
897 klfDbg(
"found translation: "<<i18nfile.locale) ;
899 if (detectedI18nFile == NULL)
903 if (detectedI18nFile != NULL) {
904 klfDbg(
"translation(s) found. first one found was: "<<detectedI18nFile->
locale) ;
912 int cbxindex = u->cbxLocale->findData(detectedI18nFile->
locale);
914 if (
QMessageBox::question(
this, tr(
"Change Language"), tr(
"Change application language to <b>%1</b>?")
916 QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes)
917 == QMessageBox::Yes) {
918 u->cbxLocale->setCurrentIndex(cbxindex);
921 suggestRestart =
false;
924 delete detectedI18nFile;
925 detectedI18nFile = NULL;
930 if (suggestRestart) {
938 if (sel.
size() != 1) {
939 qWarning(
"Expected single add-on selection for removal !");
950 confirmdlg.setIcon(QMessageBox::Warning);
952 confirmdlg.setText(tr(
"<qt>Are you sure you want to remove Add-On <i>%1</i>?</qt>")
956 if (ourplugins.size()) {
957 msg = tr(
"The Add-On File %1 will be removed from disk, along with plugin(s) %2.")
960 msg = tr(
"The Add-On File %1 will be removed from disk.").
arg(
klf_addons[k].fpath());
962 confirmdlg.setDetailedText(msg);
963 confirmdlg.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
967 int confirmation = confirmdlg.
exec();
968 if (confirmation != QMessageBox::Yes) {
978 tr(
"Please restart KLatexFormula for changes to take effect."));
980 qWarning(
"Failed to remove add-on '%s'", qPrintable(
klf_addons[k].fpath()));
987 for (j = 0; j < lplugins.size(); ++j)
1001 const QVariantMap vmap = a->
data().toMap();
1002 klfDbg(
"Set font from action with data "<<vmap) ;
1003 QString btnkey = vmap[
"Button"].toString();
1007 if (vmap.contains(
"isSystemDefaultAppFont") && vmap[
"isSystemDefaultAppFont"].toBool()) {
1008 klfDbg(
"Set default application font.") ;
1009 pUserSetDefaultAppFont =
true;
1025 w->setProperty(
"selectedFont",
QVariant(fnt));
1026 if (w == u->btnAppFont)
1027 pUserSetDefaultAppFont =
false;
1041 s.
gsexec = u->pathGs->path();
1043 if (u->chkEpstopdf->isChecked()) {
1058 if (u->chkSHEnable->isChecked())
1062 if (u->chkSHHighlightParensOnly->isChecked())
1066 if (u->chkSHHighlightLonelyParen->isChecked())
1071 for (k = 0; k < _textformats.
size(); ++k) {
1072 QColor c = _textformats[k].fg->color();
1074 _textformats[k].fmt->setForeground(c);
1076 _textformats[k].fmt->clearForeground();
1077 c = _textformats[k].bg->color();
1079 _textformats[k].fmt->setBackground(c);
1081 _textformats[k].fmt->clearBackground();
1082 Qt::CheckState b = _textformats[k].chkB->checkState();
1083 if (b == Qt::PartiallyChecked)
1084 _textformats[k].fmt->clearProperty(QTextFormat::FontWeight);
1085 else if (b == Qt::Checked)
1086 _textformats[k].fmt->setFontWeight(QFont::Bold);
1088 _textformats[k].fmt->setFontWeight(QFont::Normal);
1089 Qt::CheckState it = _textformats[k].chkI->checkState();
1090 if (it == Qt::PartiallyChecked)
1091 _textformats[k].fmt->clearProperty(QTextFormat::FontItalic);
1093 _textformats[k].fmt->setFontItalic( it == Qt::Checked );
1097 QString localename = u->cbxLocale->itemData(u->cbxLocale->currentIndex()).toString();
1098 klfDbg(
"New locale name: "<<localename);
1099 bool localechanged =
false;
1102 (!localename.
isEmpty() && localename !=
"C" && localename !=
"en_US"))
1103 localechanged =
true;
1108 if (localechanged) {
1110 tr(
"You may need to restart KLatexFormula for your new language "
1111 "settings to fully take effect."));
1124 QFont newAppFont = u->btnAppFont->property(
"selectedFont").value<
QFont>();
1130 qApp->setFont(
QFont());
1135 qApp->setStyleSheet(qApp->styleSheet());
1154 u->cbxCopyExportProfile->itemData(u->cbxCopyExportProfile->currentIndex()).toString();
1156 u->cbxDragExportProfile->itemData(u->cbxDragExportProfile->currentIndex()).toString();
1168 bool warnneedrestart =
false;
1173 bool loadenable = ( (*it)->checkState(0) == Qt::Checked ) ;
1175 warnneedrestart =
true;
1180 klf_plugins[j].instance->saveToConfig(mPluginConfigWidgets[name], &pconfa);
1185 if (warnneedrestart) {
1187 tr(
"You need to restart KLatexFormula for your changes to take effect."));
QStringList translations()
bool menuExportProfileAffectsDrag
toNativeSeparators(const QString &pathName)
setPointSize(int pointSize)
QString locale
When setting this, don't forget to call QLocale::setDefault().
fromNativeSeparators(const QString &pathName)
bool KLF_EXPORT klf_detect_execenv(KLFBackend::klfSettings *settings)
QString homeConfigDirRCCResources
bool menuExportProfileAffectsCopy
QMap< QString, QMap< QString, QVariant > > pluginConfig
QString locale
Locale Name (e.g. "fr" or "fr_CH")
void refreshShowCorrectClearButton()
#define __KLF_SHOW_SETTINGS_CONTROL(tab, focuswidget)
void populateLocaleCombo()
arg(const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char( ' ')
void slotChangeFontPresetSender()
#define klfDbg(streamableItems)
#define KLF_DEBUG_BLOCK(msg)
KLFSettings(KLFMainWin *parent=0)
join(const QString &separator)
void setTxtLatexFont(const QFont &f)
Utility class for plugins to access their configuration space in KLFConfig.
virtual void loadFromConfig(QWidget *configWidget, KLFPluginConfigAccess *config)=0
void refreshAllWindowStyleSheets()
copy(const QString &newName)
#define __KLF_SETTINGS_TEST_STR_CONTROL(controlName, controlNum)
static QList< KLFMimeExportProfile > exportProfileList()
KLF_EXPORT bool klfVersionCompareLessThan(const QString &v1, const QString &v2)
bool historyTagCopyToArchive
#define REG_SH_TEXTFORMATENSEMBLE(x)
#define KLFSETTINGS_ROLE_ADDONINDEX
void populateExportProfilesCombos()
question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
setWindowTitle(const QString &title)
setDefault(const QLocale &locale)
QSize previewTooltipMaxSize
QString dragExportProfile
void setTxtPreambleFont(const QFont &f)
void klf_add_avail_translation(KLFI18nFile i18nfile)
void slotChangeFont(QPushButton *btn, const QFont &f)
void showControl(int controlNum)
void applySettings(const KLFBackend::klfSettings &s)
Small minimalist structure to store basic information about available translations.
setData(const QVariant &userData)
struct KLFConfig::@2 SyntaxHighlighter
KLF_EXPORT QList< KLFTranslationInfo > klf_avail_translations
QList< KLFPluginInfo > klf_plugins
void refreshAddOnSelected()
KLFBackend::klfSettings currentSettings() const
Small structure to store information for a translation file (.qm)
void initPluginControls()
void refreshWindowSizes()
static bool treeMaybeUnselect(QTreeWidget *tree, QEvent *event)
virtual QWidget * createConfigWidget(QWidget *parent)=0
void resetPluginControls()
families(WritingSystem writingSystem=Any)
QString copyExportProfile
QList< KLFAddOnInfo > klf_addons
void retranslateUi(bool alsoBaseUi=true)
setText(int column, const QString &text)
critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
KLFPluginConfigAccess getPluginConfigAccess(const QString &name)
void slotChangeFontSender()
QSize labelOutputFixedSize
bool klf_addons_canimport
#define KLF_ASSERT_CONDITION(expr, msg, failaction)
void setApplicationLocale(const QString &locale)
static bool detectSettings(klfSettings *settings, const QString &extraPath=QString())
struct KLFConfig::@4 LibraryBrowser
bool eventFilter(QObject *object, QEvent *event)
virtual void setPath(const QString &path)
bool enableRealTimePreview
struct KLFConfig::@5 Plugins
QString rccmountroot()
where in the resource tree this rcc resource data is mounted
bool enableToolTipPreview
getOpenFileNames(QWidget *parent=0, const QString &caption=QString()
getFont(bool *ok, const QFont &initial, QWidget *parent, const QString &caption)
#define KLFSETTINGS_ROLE_PLUGINDEX
#define KLFSETTINGS_ROLE_PLUGNAME
void refreshPluginSelected()