KTextEditor
Go to the documentation of this file.
20 #include <editorchooser.moc>
22 #include <QtGui/QComboBox>
23 #include <QtCore/QStringList>
24 #include <QtGui/QLabel>
25 #include <QtGui/QLayout>
32 #include "ui_editorchooser_ui.h"
35 using namespace KTextEditor;
39 class PrivateEditorChooser
42 PrivateEditorChooser()
45 ~PrivateEditorChooser(){}
47 Ui::EditorChooser *chooser;
59 d->chooser->setupUi(
this);
65 if (editor.isEmpty()) editor =
"katepart";
68 for (KService::List::Iterator it = offers.begin(); it != offers.end(); ++it)
70 if ((*it)->desktopEntryName().contains(editor))
72 d->chooser->editorCombo->addItem(
i18n(
"System Default (currently: %1)", (*it)->name()));
78 for (KService::List::Iterator it = offers.begin(); it != offers.end(); ++it)
80 d->chooser->editorCombo->addItem((*it)->name());
81 d->elements.append((*it)->desktopEntryName());
83 d->chooser->editorCombo->setCurrentIndex(0);
85 connect(d->chooser->editorCombo,SIGNAL(activated(
int)),
this,SIGNAL(
changed()));
87 setMinimumSize(sizeHint());
100 if (editor.isEmpty())
101 d->chooser->editorCombo->setCurrentIndex(0);
105 int idx = d->elements.indexOf(editor) + 1;
106 d->chooser->editorCombo->setCurrentIndex(idx);
113 cg.
writeEntry(
"DEVELOPER_INFO",
"NEVER TRY TO USE VALUES FROM THAT GROUP, THEY ARE SUBJECT TO CHANGES");
114 cg.
writePathEntry(
"editor", (d->chooser->editorCombo->currentIndex()<=0) ?
115 QString() :
QString(d->elements.at(d->chooser->editorCombo->currentIndex()-1)));
119 bool fallBackToKatePart)
124 if (editor.isEmpty())
136 if (tmpEd)
return tmpEd;
138 if (fallBackToKatePart)
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 22:05:49 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.