diff --git a/interfaces/isourceformatter.h b/interfaces/isourceformatter.h index 08dbe71ad8..5546f3dcfb 100644 --- a/interfaces/isourceformatter.h +++ b/interfaces/isourceformatter.h @@ -1,187 +1,193 @@ /* This file is part of KDevelop Copyright (C) 2008 Cédric Pasteur This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ISOURCEFORMATTER_H #define ISOURCEFORMATTER_H #include #include #include #include "interfacesexport.h" namespace KDevelop { class KDEVPLATFORMINTERFACES_EXPORT SourceFormatterStyle { public: - SourceFormatterStyle() {}; + SourceFormatterStyle() : m_usePreview(false) {}; SourceFormatterStyle( const QString& name ) : m_name(name) {} void setContent( const QString& content ) { m_content = content; } void setCaption( const QString& caption ) { m_caption = caption; } QString content() const { return m_content; } QString caption() const { return m_caption; } QString name() const { return m_name; } + QString description() const { return m_description; } + void setDescription( const QString& desc ) { m_description = desc; } + bool usePreview() const { return m_usePreview; } + void setUsePreview(bool use) { m_usePreview = use; } private: + bool m_usePreview; QString m_name; QString m_caption; QString m_content; + QString m_description; }; /** * @short A widget to edit a style * A plugin should inherit this widget to create a widget to * edit a style. * @author Cédric Pasteur */ class KDEVPLATFORMINTERFACES_EXPORT SettingsWidget : public QWidget { Q_OBJECT public: SettingsWidget(QWidget *parent = 0); virtual ~SettingsWidget(); /** This function is called after the creation of the dialog. * it should initialise the widgets with the values corresponding to * the predefined style \arg name if it's not empty, or * to the string \arg content. */ virtual void load(const SourceFormatterStyle&) = 0; /** \return A string representing the state of the config. */ virtual QString save() = 0; Q_SIGNALS: /** Emits this signal when a setting was changed and the preview * needs to be updated. \arg text is the text that will be shown in the * editor. One might want to show different text * according to the different pages shown in the widget. * Text should already be formatted. */ void previewTextChanged(const QString &text); }; /** * @short An interface for a source beautifier * An example of a plugin using an external executable to do * the formatting can be found in kdevelop/plugins/formatters/indent_plugin.cpp. * @author Cédric Pasteur */ class KDEVPLATFORMINTERFACES_EXPORT ISourceFormatter { public: virtual ~ISourceFormatter(); /** \return The name of the plugin. This should contain only * ASCII chars and no spaces. This will be used internally to identify * the plugin. */ virtual QString name() = 0; /** \return A caption describing the plugin. */ virtual QString caption() = 0; /** \return A more complete description of the plugin. * The string should be written in Rich text. It can eg contain * a link to the project homepage. */ virtual QString description() = 0; /** \return The highlighting mode for Kate corresponding to this mime. */ virtual QString highlightModeForMime(const KMimeType::Ptr &mime) = 0; /** Formats using the current style. * @param text The text to format * @param url The URL to which the text belongs (its contents must not be changed). * @param leftContext The context at the left side of the text. If it is in another line, it must end with a newline. * @param rightContext The context at the right side of the text. If it is in the next line, it must start with a newline. * * If the source-formatter cannot work correctly with the context, it will just return the input text. */ virtual QString formatSource(const QString &text, const KUrl& url, const KMimeType::Ptr &mime, const QString& leftContext = QString(), const QString& rightContext = QString()) = 0; /** * Format with the given style, this is mostly for the kcm to format the preview text * Its a bit of a hassle that this needs to be public API, but I can't find a better way * to do this. */ virtual QString formatSourceWithStyle( SourceFormatterStyle, const QString& text, const KUrl& url, const KMimeType::Ptr &mime, const QString& leftContext = QString(), const QString& rightContext = QString() ) = 0; /** \return A map of predefined styles (a key and a caption for each type) */ virtual QList predefinedStyles() = 0; /** \return The widget to edit a style. */ virtual SettingsWidget* editStyleWidget(const KMimeType::Ptr &mime) = 0; /** \return The text used in the config dialog to preview the current style. */ virtual QString previewText(const KMimeType::Ptr &mime) = 0; struct Indentation { Indentation() : indentationTabWidth(0), indentWidth(0) { } // If this indentation is really valid bool isValid() const { return indentationTabWidth != 0 || indentWidth != 0; } // The length of one tab used for indentation. // Zero if unknown, -1 if tabs should not be used for indentation int indentationTabWidth; // The number of columns that equal one indentation level. // If this is zero, the default should be used. int indentWidth; }; /** \return The indentation of the style applicable for the given url. */ virtual Indentation indentation(const KUrl& url) = 0; /** \return A string representing the map. Values are written in the form * key=value and separated with ','. */ static QString optionMapToString(const QMap &map); /** \return A map corresponding to the string, that was created with * \ref optionMapToString. */ static QMap stringToOptionMap(const QString &option); /** \return A message to display when an executable needed by a * plugin is missing. This should be returned as description * if a needed executable is not found. */ static QString missingExecutableMessage(const QString &name); }; } Q_DECLARE_INTERFACE(KDevelop::ISourceFormatter, "org.kdevelop.ISourceFormatter") #endif // ISOURCEFORMATTER_H // kate: indent-mode cstyle; space-indent off; tab-width 4; diff --git a/shell/settings/sourceformattersettings.cpp b/shell/settings/sourceformattersettings.cpp index 9d4cd630db..7b4d83ff84 100644 --- a/shell/settings/sourceformattersettings.cpp +++ b/shell/settings/sourceformattersettings.cpp @@ -1,498 +1,513 @@ /* This file is part of KDevelop * Copyright (C) 2008 Cédric Pasteur This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sourceformattersettings.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "editstyledialog.h" #define STYLE_ROLE (Qt::UserRole+1) K_PLUGIN_FACTORY(SourceFormatterSettingsFactory, registerPlugin();) K_EXPORT_PLUGIN(SourceFormatterSettingsFactory("kcm_kdevsourceformattersettings")) using KDevelop::Core; using KDevelop::ISourceFormatter; using KDevelop::SourceFormatterStyle; using KDevelop::SourceFormatterController; const QString SourceFormatterSettings::userStylePrefix( "User" ); SourceFormatter::~SourceFormatter() { qDeleteAll(styles); } LanguageSettings::LanguageSettings() : selectedFormatter(0), selectedStyle(0) { } SourceFormatterSettings::SourceFormatterSettings(QWidget *parent, const QVariantList &args) : KCModule(SourceFormatterSettingsFactory::componentData(), parent, args) { setupUi(this); connect( cbLanguages, SIGNAL(currentIndexChanged(int)), SLOT(selectLanguage(int)) ); connect( cbFormatters, SIGNAL(currentIndexChanged(int)), SLOT(selectFormatter(int)) ); connect( chkKateModelines, SIGNAL(toggled(bool)), SLOT(somethingChanged()) ); connect( chkKateOverrideIndentation, SIGNAL(toggled(bool)), SLOT(somethingChanged()) ); connect( styleList, SIGNAL(currentRowChanged(int)), SLOT(selectStyle(int)) ); connect( btnDelStyle, SIGNAL(clicked()), SLOT(deleteStyle()) ); connect( btnNewStyle, SIGNAL(clicked()), SLOT(newStyle()) ); connect( btnEditStyle, SIGNAL(clicked()), SLOT(editStyle()) ); connect( styleList, SIGNAL(itemChanged(QListWidgetItem*)), SLOT(styleNameChanged(QListWidgetItem*)) ); KTextEditor::Editor *editor = KTextEditor::EditorChooser::editor(); if (!editor) KMessageBox::error(this, i18n("A KDE text-editor component could not be found.\n" "Please check your KDE installation.")); m_document = editor->createDocument(this); m_document->setReadWrite(false); KTextEditor::View* view = qobject_cast(m_document->createView(textEditor)); QVBoxLayout *layout2 = new QVBoxLayout(textEditor); layout2->addWidget(view); textEditor->setLayout(layout2); view->show(); KTextEditor::ConfigInterface *iface = qobject_cast(view); if (iface) { iface->setConfigValue("dynamic-word-wrap", false); iface->setConfigValue("icon-bar", false); } } SourceFormatterSettings::~SourceFormatterSettings() { qDeleteAll(formatters); } void selectAvailableStyle(LanguageSettings& lang) { Q_ASSERT(!lang.selectedFormatter->styles.empty()); lang.selectedStyle = *lang.selectedFormatter->styles.begin(); } void SourceFormatterSettings::load() { SourceFormatterController* fmtctrl = Core::self()->sourceFormatterControllerInternal(); foreach( KDevelop::IPlugin* plugin, KDevelop::ICore::self()->pluginController()->allPluginsForExtension( "org.kdevelop.ISourceFormatter" ) ) { KDevelop::ISourceFormatter* ifmt = plugin->extension(); KPluginInfo info = KDevelop::Core::self()->pluginControllerInternal()->pluginInfo( plugin ); SourceFormatter* formatter; FormatterMap::const_iterator iter = formatters.constFind(ifmt->name()); if (iter == formatters.constEnd()) { formatter = new SourceFormatter(); formatter->formatter = ifmt; formatters[ifmt->name()] = formatter; // Inserted a new formatter. Now fill it with styles foreach( const KDevelop::SourceFormatterStyle& style, ifmt->predefinedStyles() ) { formatter->styles[ style.name() ] = new SourceFormatterStyle(style); } KConfigGroup grp = fmtctrl->configuration(); if( grp.hasGroup( ifmt->name() ) ) { KConfigGroup fmtgrp = grp.group( ifmt->name() ); foreach( const QString& subgroup, fmtgrp.groupList() ) { SourceFormatterStyle* s = new SourceFormatterStyle( subgroup ); KConfigGroup stylegrp = fmtgrp.group( subgroup ); s->setCaption( stylegrp.readEntry( SourceFormatterController::styleCaptionKey, "" ) ); s->setContent( stylegrp.readEntry( SourceFormatterController::styleContentKey, "" ) ); formatter->styles[ s->name() ] = s; } } } else { formatter = iter.value(); } foreach( const QString& mime, info.property( SourceFormatterController::supportedMimeTypesKey ).toStringList() ) { KMimeType::Ptr mimePtr = KMimeType::mimeType(mime); if (!mimePtr) { kWarning() << "plugin" << info.name() << "supports unknown mimetype entry" << mime; continue; } QString languageName = formatter->formatter->highlightModeForMime(mimePtr); LanguageSettings& l = languages[languageName]; l.mimetypes.append( mimePtr ); l.formatters.insert( formatter ); } } // Sort the languages, preferring firstly active, then loaded languages QList sortedLanguages; foreach( KDevelop::ILanguage* language, KDevelop::ICore::self()->languageController()->activeLanguages() + KDevelop::ICore::self()->languageController()->loadedLanguages() ) if( languages.contains( language->name() ) && !sortedLanguages.contains(language->name()) ) sortedLanguages.push_back( language->name() ); foreach( const QString& name, languages.keys() ) if( !sortedLanguages.contains( name ) ) sortedLanguages.push_back( name ); foreach( const QString& name, sortedLanguages ) { // Pick the first appropriate mimetype for this language KConfigGroup grp = fmtctrl->configuration(); LanguageSettings& l = languages[name]; foreach (const KMimeType::Ptr& mimetype, l.mimetypes) { QStringList formatterAndStyleName = grp.readEntry( mimetype->name(), "" ).split( "||", QString::KeepEmptyParts ); FormatterMap::const_iterator formatterIter = formatters.constFind(formatterAndStyleName.first()); if (formatterIter == formatters.constEnd()) { kDebug() << "Reference to unknown formatter" << formatterAndStyleName.first(); Q_ASSERT(!l.formatters.empty()); // otherwise there should be no entry for 'name' l.selectedFormatter = *l.formatters.begin(); selectAvailableStyle(l); } else { l.selectedFormatter = formatterIter.value(); SourceFormatter::StyleMap::const_iterator styleIter = l.selectedFormatter->styles.constFind(formatterAndStyleName.at( 1 )); if (styleIter == l.selectedFormatter->styles.constEnd()) { kDebug() << "No style" << formatterAndStyleName.at( 1 ) << "found for formatter" << formatterAndStyleName.first(); selectAvailableStyle(l); } else { l.selectedStyle = styleIter.value(); } } break; } if (!l.selectedFormatter) { Q_ASSERT(!l.formatters.empty()); l.selectedFormatter = *l.formatters.begin(); } if (!l.selectedStyle) { selectAvailableStyle(l); } } bool b = blockSignals( true ); cbLanguages->blockSignals( !b ); cbFormatters->blockSignals( !b ); styleList->blockSignals( !b ); chkKateModelines->blockSignals( !b ); chkKateOverrideIndentation->blockSignals( !b ); cbLanguages->clear(); cbFormatters->clear(); styleList->clear(); chkKateModelines->setChecked( fmtctrl->configuration().readEntry( SourceFormatterController::kateModeLineConfigKey, false ) ); chkKateOverrideIndentation->setChecked( fmtctrl->configuration().readEntry( SourceFormatterController::kateOverrideIndentationConfigKey, false ) ); foreach( const QString& name, sortedLanguages ) { cbLanguages->addItem( name ); } if( cbLanguages->count() == 0 ) { cbLanguages->setEnabled( false ); selectLanguage( -1 ); } else { cbLanguages->setCurrentIndex( 0 ); selectLanguage( 0 ); } updatePreview(); blockSignals( b ); cbLanguages->blockSignals( b ); cbFormatters->blockSignals( b ); styleList->blockSignals( b ); chkKateModelines->blockSignals( b ); chkKateOverrideIndentation->blockSignals( b ); } void SourceFormatterSettings::save() { KConfigGroup grp = Core::self()->sourceFormatterControllerInternal()->configuration(); for ( LanguageMap::const_iterator iter = languages.constBegin(); iter != languages.constEnd(); ++iter ) { foreach( const KMimeType::Ptr& mime, iter.value().mimetypes ) { grp.writeEntry( mime->name(), QString("%1||%2").arg(iter.value().selectedFormatter->formatter->name()).arg( iter.value().selectedStyle->name() ) ); } } foreach( SourceFormatter* fmt, formatters ) { KConfigGroup fmtgrp = grp.group( fmt->formatter->name() ); // delete all styles so we don't leave any behind when all user styles are deleted foreach( const QString& subgrp, fmtgrp.groupList() ) { if( subgrp.startsWith( userStylePrefix ) ) { fmtgrp.deleteGroup( subgrp ); } } foreach( const SourceFormatterStyle* style, fmt->styles ) { if( style->name().startsWith( userStylePrefix ) ) { KConfigGroup stylegrp = fmtgrp.group( style->name() ); stylegrp.writeEntry( SourceFormatterController::styleCaptionKey, style->caption() ); stylegrp.writeEntry( SourceFormatterController::styleContentKey, style->content() ); } } } grp.writeEntry( SourceFormatterController::kateModeLineConfigKey, chkKateModelines->isChecked() ); grp.writeEntry( SourceFormatterController::kateOverrideIndentationConfigKey, chkKateOverrideIndentation->isChecked() ); grp.sync(); Core::self()->sourceFormatterControllerInternal()->settingsChanged(); } void SourceFormatterSettings::enableStyleButtons() { bool userEntry = styleList->currentItem() && styleList->currentItem()->data( STYLE_ROLE ).toString().startsWith( userStylePrefix ); QString languageName = cbLanguages->currentText(); LanguageSettings& l = languages[languageName]; ISourceFormatter* fmt = l.selectedFormatter->formatter; bool hasEditWidget = ( fmt && fmt->editStyleWidget( l.mimetypes.first() ) ); btnDelStyle->setEnabled( userEntry ); btnEditStyle->setEnabled( userEntry && hasEditWidget ); btnNewStyle->setEnabled( cbFormatters->currentIndex() >= 0 && hasEditWidget ); } void SourceFormatterSettings::selectLanguage( int idx ) { cbFormatters->clear(); if( idx < 0 ) { cbFormatters->setEnabled( false ); selectFormatter( -1 ); return; } cbFormatters->setEnabled( true ); bool b = cbFormatters->blockSignals( true ); LanguageSettings& l = languages[cbLanguages->itemText( idx )]; foreach( const SourceFormatter* fmt, l.formatters ) { cbFormatters->addItem( fmt->formatter->caption(), fmt->formatter->name() ); } cbFormatters->setCurrentIndex(cbFormatters->findData(l.selectedFormatter->formatter->name())); cbFormatters->blockSignals(b); selectFormatter( cbFormatters->currentIndex() ); emit changed( true ); } void SourceFormatterSettings::selectFormatter( int idx ) { styleList->clear(); if( idx < 0 ) { styleList->setEnabled( false ); enableStyleButtons(); return; } styleList->setEnabled( true ); LanguageSettings& l = languages[ cbLanguages->currentText() ]; Q_ASSERT( idx < l.formatters.size() ); FormatterMap::const_iterator formatterIter = formatters.constFind(cbFormatters->itemData( idx ).toString()); Q_ASSERT( formatterIter != formatters.constEnd() ); Q_ASSERT( l.formatters.contains(formatterIter.value()) ); if (l.selectedFormatter != formatterIter.value()) { l.selectedFormatter = formatterIter.value(); l.selectedStyle = 0; // will hold 0 until a style is picked } foreach( const SourceFormatterStyle* style, formatterIter.value()->styles ) { QListWidgetItem* item = addStyle( *style ); if (style == l.selectedStyle) { styleList->setCurrentItem(item); } } if (l.selectedStyle == 0) { styleList->setCurrentRow(0); } enableStyleButtons(); emit changed( true ); } void SourceFormatterSettings::selectStyle( int row ) { if( row < 0 ) { enableStyleButtons(); return; } styleList->setCurrentRow( row ); LanguageSettings& l = languages[ cbLanguages->currentText() ]; l.selectedStyle = l.selectedFormatter->styles[styleList->item( row )->data( STYLE_ROLE ).toString()]; enableStyleButtons(); updatePreview(); emit changed( true ); } void SourceFormatterSettings::deleteStyle() { Q_ASSERT( styleList->currentRow() >= 0 ); QListWidgetItem* item = styleList->currentItem(); LanguageSettings& l = languages[ cbLanguages->currentText() ]; SourceFormatter* fmt = l.selectedFormatter; SourceFormatter::StyleMap::iterator styleIter = fmt->styles.find(item->data( STYLE_ROLE ).toString()); QStringList otherLanguageNames; QList otherlanguages; for ( LanguageMap::iterator languageIter = languages.begin(); languageIter != languages.end(); ++languageIter ) { if ( &languageIter.value() != &l && languageIter.value().selectedStyle == styleIter.value() ) { otherLanguageNames.append(languageIter.key()); otherlanguages.append(&languageIter.value()); } } if (!otherLanguageNames.empty() && KMessageBox::warningContinueCancel(this, i18n("The style %1 is also used for the following languages:\n%2.\nAre you sure you want to delete it?") .arg(styleIter.value()->caption()).arg(otherLanguageNames.join("\n")), i18n("Style being deleted")) != KMessageBox::Continue) { return; } styleList->takeItem( styleList->currentRow() ); fmt->styles.erase(styleIter); delete item; selectStyle( styleList->count() > 0 ? 0 : -1 ); foreach (LanguageSettings* lang, otherlanguages) { selectAvailableStyle(*lang); } updatePreview(); emit changed( true ); } void SourceFormatterSettings::editStyle() { QString language = cbLanguages->currentText(); Q_ASSERT( languages.contains( language ) ); LanguageSettings& l = languages[ language ]; SourceFormatter* fmt = l.selectedFormatter; KMimeType::Ptr mimetype = l.mimetypes.first(); if( fmt->formatter->editStyleWidget( mimetype ) != 0 ) { EditStyleDialog dlg( fmt->formatter, mimetype, *l.selectedStyle, this ); if( dlg.exec() == QDialog::Accepted ) { l.selectedStyle->setContent(dlg.content()); } updatePreview(); emit changed( true ); } } void SourceFormatterSettings::newStyle() { QListWidgetItem* item = styleList->currentItem(); LanguageSettings& l = languages[ cbLanguages->currentText() ]; SourceFormatter* fmt = l.selectedFormatter; int idx = 0; for( int i = 0; i < styleList->count(); i++ ) { QString name = styleList->item( i )->data( STYLE_ROLE ).toString(); if( name.startsWith( userStylePrefix ) && name.mid( userStylePrefix.length() ).toInt() >= idx ) { idx = name.mid( userStylePrefix.length() ).toInt(); } } // Increase number for next style idx++; SourceFormatterStyle* s = new SourceFormatterStyle( QString( "%1%2" ).arg( userStylePrefix ).arg( idx ) ); if( item ) { SourceFormatterStyle* existstyle = fmt->styles[ item->data( STYLE_ROLE ).toString() ]; s->setCaption( i18n( "New %1", existstyle->caption() ) ); s->setContent( existstyle->content() ); } else { s->setCaption( i18n( "New Style" ) ); } fmt->styles[ s->name() ] = s; QListWidgetItem* newitem = addStyle( *s ); selectStyle( styleList->row( newitem ) ); styleList->editItem( newitem ); emit changed( true ); } void SourceFormatterSettings::styleNameChanged( QListWidgetItem* item ) { if ( !item->isSelected() ) { return; } LanguageSettings& l = languages[ cbLanguages->currentText() ]; l.selectedStyle->setCaption( item->text() ); emit changed( true ); } QListWidgetItem* SourceFormatterSettings::addStyle( const SourceFormatterStyle& s ) { QListWidgetItem* item = new QListWidgetItem( styleList ); item->setText( s.caption() ); item->setData( STYLE_ROLE, s.name() ); if( s.name().startsWith( userStylePrefix ) ) { item->setFlags( item->flags() | Qt::ItemIsEditable ); } styleList->addItem( item ); return item; } void SourceFormatterSettings::updatePreview() { m_document->setReadWrite( true ); QString langName = cbLanguages->itemText( cbLanguages->currentIndex() ); if( !langName.isEmpty() ) { LanguageSettings& l = languages[ langName ]; SourceFormatter* fmt = l.selectedFormatter; SourceFormatterStyle* style = l.selectedStyle; - ISourceFormatter* ifmt = fmt->formatter; - KMimeType::Ptr mime = l.mimetypes.first(); - m_document->setHighlightingMode( ifmt->highlightModeForMime( mime ) ); - m_document->setText( ifmt->formatSourceWithStyle( *style, ifmt->previewText( mime ), KUrl(), mime ) ); + + descriptionLabel->setText( style->description() ); + if( style->description().isEmpty() ) + descriptionLabel->hide(); + else + descriptionLabel->show(); + + if( style->usePreview() ) + { + ISourceFormatter* ifmt = fmt->formatter; + KMimeType::Ptr mime = l.mimetypes.first(); + m_document->setHighlightingMode( ifmt->highlightModeForMime( mime ) ); + m_document->setText( ifmt->formatSourceWithStyle( *style, ifmt->previewText( mime ), KUrl(), mime ) ); + previewLabel->show(); + textEditor->show(); + }else{ + previewLabel->hide(); + textEditor->hide(); + } } else { m_document->setText( i18n( "No Language selected" ) ); } m_document->activeView()->setCursorPosition( KTextEditor::Cursor( 0, 0 ) ); m_document->setReadWrite( false ); } void SourceFormatterSettings::somethingChanged() { // Widgets are managed manually, so we have to explicitly tell KCModule // that we have some changes, otherwise it won't call "save" and/or will not activate // "Appy" unmanagedWidgetChangeState(true); } #include "sourceformattersettings.moc" diff --git a/shell/settings/sourceformattersettings.ui b/shell/settings/sourceformattersettings.ui index 9583ed04dc..458de683f8 100644 --- a/shell/settings/sourceformattersettings.ui +++ b/shell/settings/sourceformattersettings.ui @@ -1,203 +1,235 @@ SourceFormatterSettingsUI 0 0 636 632 General Override the editor indentation mode according to the formatting style for documents without Kate modeline. Override Kate Indentation Mode Add a Kate modeline according to the formatting style to formatted documents. Add Kate Modeline 200 129 0 66 Formatting Styles Language: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 4 - + - + + + + 0 + 0 + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + Qt::Vertical + + + + 20 + 10 + + + + + + Preview: 0 0 0 0 Formatter: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 4 Style: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 4 -1 New Edit... Delete QAbstractItemView::SelectRows false KComboBox QComboBox
kcombobox.h
KPushButton QPushButton
kpushbutton.h
KListWidget QListWidget
klistwidget.h