Kate
Go to the documentation of this file.
21 #include "katehighlightmenu.moc"
30 #include "ui_filetypeconfigwidget.h"
41 #include <QtCore/QRegExp>
42 #include <QtGui/QCheckBox>
43 #include <QtGui/QComboBox>
44 #include <QtGui/QGroupBox>
46 #include <QtGui/QLabel>
47 #include <QtGui/QLayout>
48 #include <QtGui/QPushButton>
49 #include <QtGui/QToolButton>
55 qDeleteAll (subMenus);
58 void KateHighlightingMenu::init()
63 m_actionGroup =
new QActionGroup(
menu());
80 if ( !hlSection.isEmpty() && !names.contains(hlName) )
82 if (!subMenusName.contains(hlSection))
84 subMenusName << hlSection;
86 subMenus.append(qmenu);
87 menu()->addMenu( qmenu );
90 int m = subMenusName.indexOf (hlSection);
92 QAction *a=subMenus.at(m)->addAction(
'&' + hlName,
this, SLOT(setHl()));
93 m_actionGroup->addAction(a);
95 a->setCheckable(
true);
98 else if (!names.contains(hlName))
101 QAction *a=
menu()->addAction (
'&' + hlName,
this, SLOT(setHl()));
102 m_actionGroup->addAction(a);
104 a->setCheckable(
true);
105 subActions.append(a);
111 QString mode=m_doc->highlightingMode();
112 for (
int i=0;i<subActions.count();i++) {
113 subActions[i]->setChecked(subActions[i]->data().toString()==mode);
117 void KateHighlightingMenu::setHl ()
119 if (!m_doc || !sender())
return;
122 QString mode=action->data().toString();
123 m_doc->setHighlightingMode(mode);
126 m_doc->setDontChangeHlOnSave();
QString hlNameTranslated(int n)
static KateHlManager * self()
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:52 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.